Updated to 1.9.4

This commit is contained in:
Adubbz 2016-05-21 09:23:08 +10:00
parent 9a57f08ca3
commit 27b8dfb7d8
77 changed files with 898 additions and 516 deletions

View File

@ -7,7 +7,7 @@ buildscript {
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT'
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
}
}

View File

@ -1,4 +1,4 @@
minecraft_version=1.9
forge_version=12.16.0.1863-1.9
mod_version=4.0.2
mappings_version=snapshot_nodoc_20160412
minecraft_version=1.9.4
forge_version=12.17.0.1909-1.9.4
mod_version=4.1.2
mappings_version=snapshot_nodoc_20160519

View File

@ -15,7 +15,7 @@ import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
import net.minecraft.world.WorldType;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.Biome;
public class BOPBiomes
{
@ -25,71 +25,71 @@ public class BOPBiomes
public static List<WorldType> excludedDecoratedWorldTypes = Lists.newArrayList();
// normal biomes which have weights
public static Optional<BiomeGenBase> alps = Optional.absent();
public static Optional<BiomeGenBase> bamboo_forest = Optional.absent();
public static Optional<BiomeGenBase> bayou = Optional.absent();
public static Optional<BiomeGenBase> bog = Optional.absent();
public static Optional<BiomeGenBase> boreal_forest = Optional.absent();
public static Optional<BiomeGenBase> brushland = Optional.absent();
public static Optional<BiomeGenBase> chaparral = Optional.absent();
public static Optional<BiomeGenBase> cherry_blossom_grove = Optional.absent();
public static Optional<BiomeGenBase> cold_desert = Optional.absent();
public static Optional<BiomeGenBase> coniferous_forest = Optional.absent();
public static Optional<BiomeGenBase> crag = Optional.absent();
public static Optional<BiomeGenBase> dead_forest = Optional.absent();
public static Optional<BiomeGenBase> dead_swamp = Optional.absent();
public static Optional<BiomeGenBase> eucalyptus_forest = Optional.absent();
public static Optional<BiomeGenBase> fen = Optional.absent();
public static Optional<BiomeGenBase> flower_field = Optional.absent();
public static Optional<BiomeGenBase> grassland = Optional.absent();
public static Optional<BiomeGenBase> grove = Optional.absent();
public static Optional<BiomeGenBase> heathland = Optional.absent();
public static Optional<BiomeGenBase> highland = Optional.absent();
public static Optional<BiomeGenBase> land_of_lakes = Optional.absent();
public static Optional<BiomeGenBase> lavender_fields = Optional.absent();
public static Optional<BiomeGenBase> lush_desert = Optional.absent();
public static Optional<BiomeGenBase> lush_swamp = Optional.absent();
public static Optional<BiomeGenBase> maple_woods = Optional.absent();
public static Optional<BiomeGenBase> marsh = Optional.absent();
public static Optional<BiomeGenBase> meadow = Optional.absent();
public static Optional<BiomeGenBase> moor = Optional.absent();
public static Optional<BiomeGenBase> mountain = Optional.absent();
public static Optional<BiomeGenBase> mystic_grove = Optional.absent();
public static Optional<BiomeGenBase> ominous_woods = Optional.absent();
public static Optional<BiomeGenBase> orchard = Optional.absent();
public static Optional<BiomeGenBase> outback = Optional.absent();
public static Optional<BiomeGenBase> overgrown_cliffs = Optional.absent();
public static Optional<BiomeGenBase> prairie = Optional.absent();
public static Optional<BiomeGenBase> quagmire = Optional.absent();
public static Optional<BiomeGenBase> rainforest = Optional.absent();
public static Optional<BiomeGenBase> redwood_forest = Optional.absent();
public static Optional<BiomeGenBase> sacred_springs = Optional.absent();
public static Optional<BiomeGenBase> seasonal_forest = Optional.absent();
public static Optional<BiomeGenBase> shield = Optional.absent();
public static Optional<BiomeGenBase> shrubland = Optional.absent();
public static Optional<BiomeGenBase> snowy_coniferous_forest = Optional.absent();
public static Optional<BiomeGenBase> snowy_forest = Optional.absent();
public static Optional<BiomeGenBase> steppe = Optional.absent();
public static Optional<BiomeGenBase> temperate_rainforest = Optional.absent();
public static Optional<BiomeGenBase> tropical_rainforest = Optional.absent();
public static Optional<BiomeGenBase> tundra = Optional.absent();
public static Optional<BiomeGenBase> wasteland = Optional.absent();
public static Optional<BiomeGenBase> wetland = Optional.absent();
public static Optional<BiomeGenBase> woodland = Optional.absent();
public static Optional<BiomeGenBase> xeric_shrubland = Optional.absent();
public static Optional<Biome> alps = Optional.absent();
public static Optional<Biome> bamboo_forest = Optional.absent();
public static Optional<Biome> bayou = Optional.absent();
public static Optional<Biome> bog = Optional.absent();
public static Optional<Biome> boreal_forest = Optional.absent();
public static Optional<Biome> brushland = Optional.absent();
public static Optional<Biome> chaparral = Optional.absent();
public static Optional<Biome> cherry_blossom_grove = Optional.absent();
public static Optional<Biome> cold_desert = Optional.absent();
public static Optional<Biome> coniferous_forest = Optional.absent();
public static Optional<Biome> crag = Optional.absent();
public static Optional<Biome> dead_forest = Optional.absent();
public static Optional<Biome> dead_swamp = Optional.absent();
public static Optional<Biome> eucalyptus_forest = Optional.absent();
public static Optional<Biome> fen = Optional.absent();
public static Optional<Biome> flower_field = Optional.absent();
public static Optional<Biome> grassland = Optional.absent();
public static Optional<Biome> grove = Optional.absent();
public static Optional<Biome> heathland = Optional.absent();
public static Optional<Biome> highland = Optional.absent();
public static Optional<Biome> land_of_lakes = Optional.absent();
public static Optional<Biome> lavender_fields = Optional.absent();
public static Optional<Biome> lush_desert = Optional.absent();
public static Optional<Biome> lush_swamp = Optional.absent();
public static Optional<Biome> maple_woods = Optional.absent();
public static Optional<Biome> marsh = Optional.absent();
public static Optional<Biome> meadow = Optional.absent();
public static Optional<Biome> moor = Optional.absent();
public static Optional<Biome> mountain = Optional.absent();
public static Optional<Biome> mystic_grove = Optional.absent();
public static Optional<Biome> ominous_woods = Optional.absent();
public static Optional<Biome> orchard = Optional.absent();
public static Optional<Biome> outback = Optional.absent();
public static Optional<Biome> overgrown_cliffs = Optional.absent();
public static Optional<Biome> prairie = Optional.absent();
public static Optional<Biome> quagmire = Optional.absent();
public static Optional<Biome> rainforest = Optional.absent();
public static Optional<Biome> redwood_forest = Optional.absent();
public static Optional<Biome> sacred_springs = Optional.absent();
public static Optional<Biome> seasonal_forest = Optional.absent();
public static Optional<Biome> shield = Optional.absent();
public static Optional<Biome> shrubland = Optional.absent();
public static Optional<Biome> snowy_coniferous_forest = Optional.absent();
public static Optional<Biome> snowy_forest = Optional.absent();
public static Optional<Biome> steppe = Optional.absent();
public static Optional<Biome> temperate_rainforest = Optional.absent();
public static Optional<Biome> tropical_rainforest = Optional.absent();
public static Optional<Biome> tundra = Optional.absent();
public static Optional<Biome> wasteland = Optional.absent();
public static Optional<Biome> wetland = Optional.absent();
public static Optional<Biome> woodland = Optional.absent();
public static Optional<Biome> xeric_shrubland = Optional.absent();
// edge-biomes, sub-biomes and mutated-biomes
public static Optional<BiomeGenBase> mountain_foothills = Optional.absent();
public static Optional<BiomeGenBase> glacier = Optional.absent();
public static Optional<BiomeGenBase> oasis = Optional.absent();
public static Optional<BiomeGenBase> coral_reef = Optional.absent();
public static Optional<BiomeGenBase> kelp_forest = Optional.absent();
public static Optional<BiomeGenBase> mangrove = Optional.absent();
public static Optional<BiomeGenBase> origin_island = Optional.absent();
public static Optional<BiomeGenBase> tropical_island = Optional.absent();
public static Optional<BiomeGenBase> volcanic_island = Optional.absent();
public static Optional<BiomeGenBase> flower_island = Optional.absent();
public static Optional<BiomeGenBase> gravel_beach = Optional.absent();
public static Optional<Biome> mountain_foothills = Optional.absent();
public static Optional<Biome> glacier = Optional.absent();
public static Optional<Biome> oasis = Optional.absent();
public static Optional<Biome> coral_reef = Optional.absent();
public static Optional<Biome> kelp_forest = Optional.absent();
public static Optional<Biome> mangrove = Optional.absent();
public static Optional<Biome> origin_island = Optional.absent();
public static Optional<Biome> tropical_island = Optional.absent();
public static Optional<Biome> volcanic_island = Optional.absent();
public static Optional<Biome> flower_island = Optional.absent();
public static Optional<Biome> gravel_beach = Optional.absent();
//Biome extensions
public static IExtendedBiome end_extension;
@ -140,7 +140,7 @@ public class BOPBiomes
public static interface IBiomeRegistry
{
public IExtendedBiome registerBiome(IExtendedBiome biome, String idName);
public IExtendedBiome getExtendedBiome(BiomeGenBase biome);
public ImmutableSet<BiomeGenBase> getPresentBiomes();
public IExtendedBiome getExtendedBiome(Biome biome);
public ImmutableSet<Biome> getPresentBiomes();
}
}

View File

@ -17,7 +17,7 @@ import biomesoplenty.api.generation.GeneratorStage;
import biomesoplenty.api.generation.IGenerationManager;
import biomesoplenty.api.generation.IGenerator;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.Biome;
public interface IExtendedBiome
{
@ -34,6 +34,6 @@ public interface IExtendedBiome
public ResourceLocation getBeachLocation();
/**Get the base biome associated with this extension**/
public BiomeGenBase getBaseBiome();
public Biome getBaseBiome();
public ResourceLocation getResourceLocation();
}

View File

@ -5,7 +5,7 @@ import java.util.Iterator;
import biomesoplenty.api.generation.BOPGenLayer;
import net.minecraft.init.Biomes;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.Biome;
import net.minecraftforge.common.BiomeManager.BiomeType;
public enum BOPClimates {
@ -34,7 +34,7 @@ public enum BOPClimates {
this.biomeType = biomeType;
}
public BOPClimates addLandBiome(int weight, BiomeGenBase biome)
public BOPClimates addLandBiome(int weight, Biome biome)
{
return this.addLandBiome(new WeightedBiomeEntry(weight, biome));
}
@ -46,7 +46,7 @@ public enum BOPClimates {
return this;
}
public BiomeGenBase getRandomLandBiome(BOPGenLayer layer)
public Biome getRandomLandBiome(BOPGenLayer layer)
{
int weight = layer.nextInt(this.totalLandBiomesWeight);
Iterator<WeightedBiomeEntry> iterator = this.landBiomes.iterator();
@ -60,7 +60,7 @@ public enum BOPClimates {
return item.biome;
}
public BiomeGenBase getRandomOceanBiome(BOPGenLayer layer, boolean deep)
public Biome getRandomOceanBiome(BOPGenLayer layer, boolean deep)
{
switch (this)
{
@ -131,9 +131,9 @@ public enum BOPClimates {
public static class WeightedBiomeEntry
{
public final int weight;
public final BiomeGenBase biome;
public final Biome biome;
public WeightedBiomeEntry(int weight, BiomeGenBase biome)
public WeightedBiomeEntry(int weight, Biome biome)
{
this.weight = weight;
this.biome = biome;

View File

@ -1,13 +1,22 @@
package biomesoplenty.client.gui;
import java.io.IOException;
import com.google.common.base.Predicate;
import com.google.common.primitives.Floats;
import biomesoplenty.common.world.BOPWorldSettings;
import biomesoplenty.common.world.BOPWorldSettings.BiomeSize;
import biomesoplenty.common.world.BOPWorldSettings.LandMassScheme;
import biomesoplenty.common.world.BOPWorldSettings.RainfallVariationScheme;
import biomesoplenty.common.world.BOPWorldSettings.TemperatureVariationScheme;
import com.google.common.base.Predicate;
import com.google.common.primitives.Floats;
import net.minecraft.client.gui.*;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiCreateWorld;
import net.minecraft.client.gui.GuiListButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.GuiSlider;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.VertexBuffer;
@ -16,8 +25,6 @@ import net.minecraft.client.resources.I18n;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import java.io.IOException;
@SideOnly(Side.CLIENT)
public class GuiBOPConfigureWorld extends GuiScreen implements GuiSlider.FormatHelper, GuiBOPPageList.GuiResponder
{
@ -448,11 +455,11 @@ public class GuiBOPConfigureWorld extends GuiScreen implements GuiSlider.FormatH
// These 3 are the original functions required by GuiPageButtonList.GuiResponder - just pass off to the better named functions
@Override
public void func_175319_a(int fieldId, String value) {this.handleStringSelection(fieldId, value);}
public void setEntryValue(int fieldId, String value) {this.handleStringSelection(fieldId, value);}
@Override
public void onTick(int fieldId, float value) {this.handleFloatSelection(fieldId, value);}
public void setEntryValue(int fieldId, float value) {this.handleFloatSelection(fieldId, value);}
@Override
public void func_175321_a(int fieldId, boolean value) {this.handleBooleanSelection(fieldId, value);}
public void setEntryValue(int fieldId, boolean value) {this.handleBooleanSelection(fieldId, value);}
@ -605,7 +612,7 @@ public class GuiBOPConfigureWorld extends GuiScreen implements GuiSlider.FormatH
int i = guitextfield.getId();
String s = this.stringFormatFloat(guitextfield.getId(), f2.floatValue());
guitextfield.setText(s);
this.func_175319_a(i, s);
this.setEntryValue(i, s);
}
}
}

View File

@ -49,7 +49,7 @@ public abstract class GuiBOPPageList extends GuiBOPPageDelegate
}
@Override
protected void func_178040_a(int p_178040_1_, int p_178040_2_, int p_178040_3_)
protected void updateItemPos(int p_178040_1_, int p_178040_2_, int p_178040_3_)
{
this.getListEntry(p_178040_1_).setSelected(p_178040_1_, p_178040_2_, p_178040_3_);
}
@ -257,7 +257,7 @@ public abstract class GuiBOPPageList extends GuiBOPPageDelegate
private void drawGuiLabel(GuiLabel guiLabel, int y, int mouseX, int mouseY, boolean isVisible)
{
guiLabel.field_146174_h = y;
guiLabel.y = y;
if (!isVisible)
{

View File

@ -227,7 +227,7 @@ public class GuiBOPPageTable extends GuiBOPPageList
}
guilabel.visible = field.isVisible();
guilabel.func_175202_a(field.getLabelText()); // setText
guilabel.addLine(field.getLabelText());
guilabel.setCentered();
return guilabel;
}

View File

@ -8,15 +8,15 @@
package biomesoplenty.client.model;
import biomesoplenty.client.util.ModelUtils;
import com.google.common.collect.ImmutableList;
import biomesoplenty.client.util.ModelUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.client.renderer.block.model.IBakedModel;
import net.minecraft.client.renderer.block.model.ItemOverride;
import net.minecraft.client.renderer.block.model.ItemOverrideList;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;

View File

@ -8,12 +8,12 @@
package biomesoplenty.client.model;
import biomesoplenty.common.inventory.InventoryFlowerBasket;
import com.google.common.collect.ImmutableList;
import biomesoplenty.common.inventory.InventoryFlowerBasket;
import net.minecraft.client.renderer.block.model.IBakedModel;
import net.minecraft.client.renderer.block.model.ItemOverride;
import net.minecraft.client.renderer.block.model.ItemOverrideList;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;

View File

@ -9,7 +9,7 @@
package biomesoplenty.client.particle;
import biomesoplenty.core.ClientProxy;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.particle.Particle;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.VertexBuffer;
import net.minecraft.entity.Entity;
@ -17,15 +17,15 @@ import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.fml.client.FMLClientHandler;
public class EntityPixieTrailFX extends EntityFX
public class EntityPixieTrailFX extends Particle
{
public EntityPixieTrailFX(World world, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn)
public EntityPixieTrailFX(World world, double xCoordIn, double yCoordIn, double zCoordIn, double motionXIn, double motionYIn, double motionZIn)
{
this(world, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn, 1.0F);
this(world, xCoordIn, yCoordIn, zCoordIn, motionXIn, motionYIn, motionZIn, 1.0F);
}
public EntityPixieTrailFX(World world, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, float par14)
public EntityPixieTrailFX(World world, double xCoordIn, double yCoordIn, double zCoordIn, double motionXIn, double motionYIn, double motionZIn, float par14)
{
super(world, xCoordIn, yCoordIn, zCoordIn, 0.0D, 0.0D, 0.0D);
@ -33,12 +33,12 @@ public class EntityPixieTrailFX extends EntityFX
this.particleTextureIndexX = 7;
this.particleTextureIndexY = 1;
this.xSpeed *= 0.10000000149011612D;
this.ySpeed *= 0.10000000149011612D;
this.zSpeed *= 0.10000000149011612D;
this.xSpeed += xSpeedIn;
this.ySpeed += ySpeedIn;
this.zSpeed += zSpeedIn;
this.motionX *= 0.10000000149011612D;
this.motionY *= 0.10000000149011612D;
this.motionZ *= 0.10000000149011612D;
this.motionX += motionXIn;
this.motionY += motionYIn;
this.motionZ += motionZIn;
this.particleScale *= 0.75F;
this.particleScale *= par14;
this.particleMaxAge = (int)((8.0D / (Math.random() * 0.8D + 0.2D)) * 8);
@ -88,22 +88,22 @@ public class EntityPixieTrailFX extends EntityFX
}
this.particleTextureIndexX = 7 - particleAge * 8 / particleMaxAge;
this.moveEntity(xSpeed, ySpeed, zSpeed);
this.moveEntity(motionX, motionY, motionZ);
if (posY == prevPosY)
{
xSpeed *= 1.1D;
zSpeed *= 1.1D;
motionX *= 1.1D;
motionZ *= 1.1D;
}
xSpeed *= 0.9599999785423279D;
ySpeed *= 0.9599999785423279D;
zSpeed *= 0.9599999785423279D;
motionX *= 0.9599999785423279D;
motionY *= 0.9599999785423279D;
motionZ *= 0.9599999785423279D;
if (isCollided)
{
xSpeed *= 0.699999988079071D;
zSpeed *= 0.699999988079071D;
motionX *= 0.699999988079071D;
motionZ *= 0.699999988079071D;
}
}

View File

@ -8,14 +8,14 @@
package biomesoplenty.client.particle;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.particle.Particle;
import net.minecraft.client.renderer.VertexBuffer;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.fml.client.FMLClientHandler;
public class EntityTrailFX extends EntityFX
public class EntityTrailFX extends Particle
{
private ResourceLocation trailResource;
/**The index of the flower to be spawned, values are 0-3*/
@ -27,7 +27,7 @@ public class EntityTrailFX extends EntityFX
super(world, x, y, z);
this.trailResource = new ResourceLocation("biomesoplenty:textures/particles/" + trailName + ".png");
this.xSpeed = this.ySpeed = this.zSpeed = 0.0D; //Trail particles should not move
this.motionX = this.motionY = this.motionZ = 0.0D; //Trail particles should not move
this.particleMaxAge = 550;
this.particleIndex = this.rand.nextInt(4); //Choose a random index on creation
this.startY = y; //Where y coordinate where this particle has started (before it moves downwards with time)

View File

@ -8,10 +8,7 @@
package biomesoplenty.client.util;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class TextureUtils
{

View File

@ -48,10 +48,10 @@ import net.minecraft.init.Biomes;
import net.minecraft.init.Blocks;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.chunk.ChunkPrimer;
public class BOPBiome extends BiomeGenBase implements IExtendedBiome
public class BOPBiome extends Biome implements IExtendedBiome
{
private GenerationManager generationManager = new GenerationManager();
private Map<BOPClimates, Integer> weightMap = new HashMap<BOPClimates, Integer>();
@ -406,7 +406,7 @@ public class BOPBiome extends BiomeGenBase implements IExtendedBiome
}
@Override
public BiomeGenBase getBaseBiome()
public Biome getBaseBiome()
{
return this;
}
@ -450,7 +450,7 @@ public class BOPBiome extends BiomeGenBase implements IExtendedBiome
}
}
private static class BiomeProps extends BiomeGenBase.BiomeProperties
private static class BiomeProps extends Biome.BiomeProperties
{
/**The colour of this biome as seen in guis**/
private int guiColour = 0xffffff;

View File

@ -136,14 +136,14 @@ public class BiomeGenBambooForest extends BOPBiome
@Override
public int getGrassColorAtPos(BlockPos pos)
{
double noise = GRASS_COLOR_NOISE.func_151601_a((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D);
double noise = GRASS_COLOR_NOISE.getValue((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D);
return noise < -0.7D ? 0xD4DB55 : (noise < -0.3D ? 0xBBDD54 : 0xA3E053);
}
@Override
public int getFoliageColorAtPos(BlockPos pos)
{
double noise = GRASS_COLOR_NOISE.func_151601_a((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D);
double noise = GRASS_COLOR_NOISE.getValue((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D);
return noise < -0.7D ? 0xD4DB55 : (noise < -0.3D ? 0xBBDD54 : 0xA3E053);
}

View File

@ -118,14 +118,14 @@ public class BiomeGenGrove extends BOPBiome
@Override
public int getGrassColorAtPos(BlockPos pos)
{
double noise = GRASS_COLOR_NOISE.func_151601_a((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D);
double noise = GRASS_COLOR_NOISE.getValue((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D);
return noise < -0.1D ? 0x517F51 : 0x609E58;
}
@Override
public int getFoliageColorAtPos(BlockPos pos)
{
double noise = GRASS_COLOR_NOISE.func_151601_a((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D);
double noise = GRASS_COLOR_NOISE.getValue((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D);
return noise < -0.1D ? 0x619961 : 0x75B569;
}

View File

@ -137,14 +137,14 @@ public class BiomeGenHeathland extends BOPBiome
@Override
public int getGrassColorAtPos(BlockPos pos)
{
double noise = GRASS_COLOR_NOISE.func_151601_a((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D);
double noise = GRASS_COLOR_NOISE.getValue((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D);
return noise < -0.1D ? 0xAD9D68 : 0xADAE68;
}
@Override
public int getFoliageColorAtPos(BlockPos pos)
{
double noise = GRASS_COLOR_NOISE.func_151601_a((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D);
double noise = GRASS_COLOR_NOISE.getValue((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D);
return noise < -0.1D ? 0xB6A763 : 0xB6C663;
}

View File

@ -128,14 +128,14 @@ public class BiomeGenLandOfLakes extends BOPBiome
@Override
public int getGrassColorAtPos(BlockPos pos)
{
double noise = GRASS_COLOR_NOISE.func_151601_a((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D);
double noise = GRASS_COLOR_NOISE.getValue((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D);
return noise < -0.1D ? 13414508 : 13419628;
}
@Override
public int getFoliageColorAtPos(BlockPos pos)
{
double noise = GRASS_COLOR_NOISE.func_151601_a((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D);
double noise = GRASS_COLOR_NOISE.getValue((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D);
return noise < -0.1D ? 12766316 : 10730594;
}

View File

@ -86,7 +86,7 @@ public class BiomeGenMangrove extends BOPBiome
@Override
public void genTerrainBlocks(World world, Random rand, ChunkPrimer primer, int x, int z, double noise)
{
double d0 = GRASS_COLOR_NOISE.func_151601_a((double)x * 0.25D, (double)z * 0.25D);
double d0 = GRASS_COLOR_NOISE.getValue((double)x * 0.25D, (double)z * 0.25D);
if (d0 > 0.0D)
{

View File

@ -43,7 +43,7 @@ import net.minecraft.entity.passive.EntitySheep;
import net.minecraft.entity.passive.EntityWolf;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.chunk.ChunkPrimer;
public class BiomeGenMountain extends BOPBiome
@ -92,8 +92,8 @@ public class BiomeGenMountain extends BOPBiome
// only sheep and wolves on the peaks
this.spawnableCreatureList.clear();
this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySheep.class, 12, 4, 6));
this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityWolf.class, 4, 4, 4));
this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntitySheep.class, 12, 4, 6));
this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityWolf.class, 4, 4, 4));
}
this.topBlock = Blocks.GRASS.getDefaultState();

View File

@ -28,7 +28,7 @@ import net.minecraft.entity.passive.EntityCow;
import net.minecraft.entity.passive.EntityPig;
import net.minecraft.entity.passive.EntitySheep;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.Biome;
public class BiomeGenOriginIsland extends BOPBiome
{
@ -54,14 +54,14 @@ public class BiomeGenOriginIsland extends BOPBiome
this.spawnableCaveCreatureList.clear();
this.spawnableMonsterList.clear();
this.spawnableCreatureList.clear();
this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySheep.class, 12, 4, 4));
this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityPig.class, 10, 4, 4));
this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 10, 4, 4));
this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityCow.class, 8, 4, 4));
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySpider.class, 100, 4, 4));
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 100, 4, 4));
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySkeleton.class, 100, 4, 4));
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityCreeper.class, 100, 4, 4));
this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntitySheep.class, 12, 4, 4));
this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityPig.class, 10, 4, 4));
this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityChicken.class, 10, 4, 4));
this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityCow.class, 8, 4, 4));
this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntitySpider.class, 100, 4, 4));
this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntityZombie.class, 100, 4, 4));
this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntitySkeleton.class, 100, 4, 4));
this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntityCreeper.class, 100, 4, 4));
this.topBlock = BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BOPGrassType.ORIGIN);

View File

@ -117,14 +117,14 @@ public class BiomeGenSacredSprings extends BOPBiome
@Override
public int getGrassColorAtPos(BlockPos pos)
{
double noise = GRASS_COLOR_NOISE.func_151601_a((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D);
double noise = GRASS_COLOR_NOISE.getValue((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D);
return noise < -0.1D ? 39285 : 39259;
}
@Override
public int getFoliageColorAtPos(BlockPos pos)
{
double noise = GRASS_COLOR_NOISE.func_151601_a((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D);
double noise = GRASS_COLOR_NOISE.getValue((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D);
return noise < -0.1D ? 39285 : 39259;
}
}

View File

@ -119,14 +119,14 @@ public class BiomeGenSteppe extends BOPBiome
@Override
public int getGrassColorAtPos(BlockPos pos)
{
double noise = GRASS_COLOR_NOISE.func_151601_a((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D);
double noise = GRASS_COLOR_NOISE.getValue((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D);
return noise < -0.1D ? 13741418 : 13018487;
}
@Override
public int getFoliageColorAtPos(BlockPos pos)
{
double noise = GRASS_COLOR_NOISE.func_151601_a((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D);
double noise = GRASS_COLOR_NOISE.getValue((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D);
return noise < -0.1D ? 13741418 : 13018487;
}
}

View File

@ -133,14 +133,14 @@ public class BiomeGenTropicalRainforest extends BOPBiome
@Override
public int getGrassColorAtPos(BlockPos pos)
{
double noise = GRASS_COLOR_NOISE.func_151601_a((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D);
double noise = GRASS_COLOR_NOISE.getValue((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D);
return noise < -0.1D ? 11002176 : 12836929;
}
@Override
public int getFoliageColorAtPos(BlockPos pos)
{
double noise = GRASS_COLOR_NOISE.func_151601_a((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D);
double noise = GRASS_COLOR_NOISE.getValue((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D);
return noise < -0.1D ? 8970560 : 10870849;
}

View File

@ -16,17 +16,17 @@ import biomesoplenty.common.world.GenerationManager;
import biomesoplenty.common.world.generator.GeneratorFlora;
import net.minecraft.init.Biomes;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.Biome;
public class ExtendedBiomeWrapper implements IExtendedBiome
{
public final BiomeGenBase biome;
public final Biome biome;
private GenerationManager generationManager = new GenerationManager();
private Map<BOPClimates, Integer> weightMap = new HashMap<BOPClimates, Integer>();
public ResourceLocation beachBiomeLocation = BiomeUtils.getLocForBiome(Biomes.BEACH);
public ExtendedBiomeWrapper(BiomeGenBase biome)
public ExtendedBiomeWrapper(Biome biome)
{
this.biome = biome;
@ -112,7 +112,7 @@ public class ExtendedBiomeWrapper implements IExtendedBiome
}
@Override
public BiomeGenBase getBaseBiome()
public Biome getBaseBiome()
{
return this.biome;
}

View File

@ -25,7 +25,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.Biome;
public class BlockBOPBiomeBlock extends BlockBOPGeneric
{
@ -37,17 +37,17 @@ public class BlockBOPBiomeBlock extends BlockBOPGeneric
}
// list of biomes which have an associated essence (possible drops when this block is broken)
private static List<BiomeGenBase> biomesWithEssence;
private static List<Biome> biomesWithEssence;
// generate the list of biomes which have an associated essence
public List<BiomeGenBase> getBiomesWithEssence()
public List<Biome> getBiomesWithEssence()
{
if (biomesWithEssence != null) {return biomesWithEssence;}
biomesWithEssence = new ArrayList<BiomeGenBase>();
biomesWithEssence = new ArrayList<Biome>();
List<BiomeGenBase> vanillaBiomesToExclude = Arrays.asList(
new BiomeGenBase[] {
List<Biome> vanillaBiomesToExclude = Arrays.asList(
new Biome[] {
Biomes.SKY,
Biomes.HELL,
Biomes.BEACH,
@ -61,7 +61,7 @@ public class BlockBOPBiomeBlock extends BlockBOPGeneric
}
);
for (BiomeGenBase biome : BiomeUtils.getRegisteredBiomes())
for (Biome biome : BiomeUtils.getRegisteredBiomes())
{
if (biome == null) {continue;}
if (biome instanceof BOPBiome)
@ -84,17 +84,17 @@ public class BlockBOPBiomeBlock extends BlockBOPGeneric
List<ItemStack> ret = new ArrayList<ItemStack>();
Random rand = world instanceof World ? ((World)world).rand : RANDOM;
List<BiomeGenBase> biomes = this.getBiomesWithEssence();
List<Biome> biomes = this.getBiomesWithEssence();
int numToDrop = rand.nextInt(fortune + 2) + 1;
int numChoices = biomes.size();
BiomeGenBase biome;
Biome biome;
for (int i = 0; i < numToDrop; i++)
{
biome = biomes.get(rand.nextInt(numChoices));
ItemStack biome_essence = new ItemStack(BOPItems.biome_essence);
biome_essence.setTagCompound(new NBTTagCompound());
biome_essence.getTagCompound().setInteger("biomeID", BiomeGenBase.getIdForBiome(biome));
biome_essence.getTagCompound().setInteger("biomeID", Biome.getIdForBiome(biome));
ret.add(biome_essence);
}

View File

@ -108,10 +108,9 @@ public class BlockBOPDecoration extends Block implements IBOPBlock
// check this block is still able to remain after neighbor change
@Override
public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock)
public void neighborChanged(IBlockState state, World world, BlockPos pos, Block neighborBlock)
{
super.onNeighborBlockChange(worldIn, pos, state, neighborBlock);
this.checkAndDropBlock(worldIn, pos, state);
this.checkAndDropBlock(world, pos, state);
}
// check this block is still able to remain on update ticks

View File

@ -150,7 +150,7 @@ public class BlockBOPFarmland extends BlockFarmland implements IBOPBlock
}
@Override
public void onNeighborBlockChange(World world, BlockPos pos, IBlockState state, Block neighborBlock)
public void neighborChanged(IBlockState state, World world, BlockPos pos, Block neighborBlock)
{
if (world.getBlockState(pos.up()).getMaterial().isSolid())
{

View File

@ -22,7 +22,7 @@ import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.particle.EffectRenderer;
import net.minecraft.client.particle.ParticleManager;
import net.minecraft.client.renderer.color.IBlockColor;
import net.minecraft.client.renderer.color.IItemColor;
import net.minecraft.entity.Entity;
@ -416,7 +416,7 @@ public class BlockBOPGrass extends BlockGrass implements IBOPBlock, ISustainsPla
@SideOnly(Side.CLIENT)
@Override
public boolean addDestroyEffects(World world, BlockPos pos, EffectRenderer effectRenderer)
public boolean addDestroyEffects(World world, BlockPos pos, ParticleManager effectRenderer)
{
IBlockState state = world.getBlockState(pos);

View File

@ -20,6 +20,7 @@ import net.minecraft.block.Block;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.particle.ParticleManager;
import net.minecraft.client.renderer.color.IBlockColor;
import net.minecraft.client.renderer.color.IItemColor;
import net.minecraft.entity.Entity;
@ -294,7 +295,7 @@ public class BlockBOPPlant extends BlockBOPDecoration implements IShearable
@Override
@SideOnly(Side.CLIENT)
public boolean addDestroyEffects(World world, BlockPos pos, net.minecraft.client.particle.EffectRenderer effectRenderer)
public boolean addDestroyEffects(World world, BlockPos pos, ParticleManager effectRenderer)
{
IBlockState state = world.getBlockState(pos);
Block block = state.getBlock();

View File

@ -8,11 +8,18 @@
package biomesoplenty.common.command;
import biomesoplenty.common.util.biome.BiomeUtils;
import java.util.List;
import com.google.common.collect.Lists;
import biomesoplenty.common.util.biome.BiomeUtils;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.command.*;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.command.NumberInvalidException;
import net.minecraft.command.WrongUsageException;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Blocks;
import net.minecraft.server.MinecraftServer;
@ -21,12 +28,10 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
import java.util.List;
public class BOPCommand extends CommandBase
{
public static int blockCount = 0;
@ -91,7 +96,7 @@ public class BOPCommand extends CommandBase
}
int biomeId = parseInt(args[1], 0, 255);
BiomeGenBase biome = BiomeGenBase.getBiome(biomeId);
Biome biome = Biome.getBiome(biomeId);
sender.addChatMessage(new TextComponentTranslation("commands.biomesoplenty.biomename.success", biomeId, biome == null ? "Undefined" : biome.getBiomeName()));
}
@ -104,12 +109,12 @@ public class BOPCommand extends CommandBase
}
// Parse args[1] to find the biome to search for - search for a string matching the biome identifier, or an integer matching the biome id
BiomeGenBase biomeToFind = null;
Biome biomeToFind = null;
if (biomeToFind == null)
{
try {
int biomeId = parseInt(args[1], 0, 255);
biomeToFind = BiomeGenBase.getBiome(biomeId);
biomeToFind = Biome.getBiome(biomeId);
} catch (NumberInvalidException e) {
biomeToFind = BiomeUtils.getBiomeForLoc(new ResourceLocation(args[1]));
}
@ -125,7 +130,7 @@ public class BOPCommand extends CommandBase
double y = (double)world.getTopSolidOrLiquidBlock(closestBiomePos).getY();
double z = (double)closestBiomePos.getZ();
player.playerNetServerHandler.setPlayerLocation(x, y, z, player.rotationYaw, player.rotationPitch);
player.connection.setPlayerLocation(x, y, z, player.rotationYaw, player.rotationPitch);
sender.addChatMessage(new TextComponentTranslation("commands.biomesoplenty.tpbiome.success", player.getName(), biomeToFind.getBiomeName(), x, y, z));
}
else

View File

@ -8,6 +8,11 @@
package biomesoplenty.common.entities;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import net.minecraft.entity.EntityFlying;
import net.minecraft.entity.IEntityLivingData;
import net.minecraft.entity.SharedMonsterAttributes;
@ -25,11 +30,6 @@ import net.minecraft.util.math.MathHelper;
import net.minecraft.world.DifficultyInstance;
import net.minecraft.world.World;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Random;
public class EntityButterfly extends EntityFlying implements IMob {
private static final DataParameter<Byte> TYPE = EntityDataManager.<Byte>createKey(EntityButterfly.class, DataSerializers.BYTE);

View File

@ -8,6 +8,11 @@
package biomesoplenty.common.entities;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import biomesoplenty.api.item.BOPItems;
import biomesoplenty.api.particle.BOPParticleTypes;
import biomesoplenty.core.BiomesOPlenty;
@ -23,11 +28,6 @@ import net.minecraft.util.math.MathHelper;
import net.minecraft.world.EnumSkyBlock;
import net.minecraft.world.World;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Random;
public class EntityPixie extends EntityFlying implements IMob {
public EntityPixie(World worldIn) {

View File

@ -12,7 +12,6 @@ import biomesoplenty.api.block.BOPBlocks;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.monster.IMob;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;

View File

@ -8,6 +8,11 @@
package biomesoplenty.common.entities;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import biomesoplenty.api.sound.BOPSounds;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityFlying;
@ -24,11 +29,6 @@ import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Random;
public class EntityWasp extends EntityFlying implements IMob {
public EntityWasp(World worldIn) {

View File

@ -8,6 +8,8 @@
package biomesoplenty.common.entities.projectiles;
import java.util.List;
import biomesoplenty.api.item.BOPItems;
import biomesoplenty.api.potion.BOPPotions;
import biomesoplenty.common.item.ItemDart;
@ -32,8 +34,6 @@ import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
import java.util.List;
public class EntityDart extends EntityArrow
{
private static final DataParameter<Byte> TYPE = EntityDataManager.<Byte>createKey(EntityDart.class, DataSerializers.BYTE);
@ -122,7 +122,7 @@ public class EntityDart extends EntityArrow
// TODO: what is all this? Something about informing the other player in a multiplayer game that he got hit or something?
if (this.shootingEntity != null && entityHit != this.shootingEntity && entityHit instanceof EntityPlayer && this.shootingEntity instanceof EntityPlayerMP)
{
((EntityPlayerMP)this.shootingEntity).playerNetServerHandler.sendPacket(new SPacketChangeGameState(6, 0.0F));
((EntityPlayerMP)this.shootingEntity).connection.sendPacket(new SPacketChangeGameState(6, 0.0F));
}
}

View File

@ -8,12 +8,12 @@
package biomesoplenty.common.entities.projectiles;
import net.minecraft.client.renderer.VertexBuffer;
import org.lwjgl.opengl.GL11;
import biomesoplenty.common.item.ItemDart;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.VertexBuffer;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;

View File

@ -8,6 +8,8 @@
package biomesoplenty.common.fluids.blocks;
import java.util.Random;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
@ -24,8 +26,6 @@ import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import java.util.Random;
public class BlockHotSpringWaterFluid extends BlockFluidClassic
{
public BlockHotSpringWaterFluid(Fluid fluid)

View File

@ -7,6 +7,11 @@
******************************************************************************/
package biomesoplenty.common.handler;
import java.util.Iterator;
import java.util.Set;
import com.google.common.collect.Sets;
import biomesoplenty.api.achievement.BOPAchievements;
import biomesoplenty.api.biome.BOPBiomes;
import biomesoplenty.api.block.BOPBlocks;
@ -19,7 +24,6 @@ import biomesoplenty.common.enums.BOPFlowers;
import biomesoplenty.common.enums.BOPPlants;
import biomesoplenty.common.enums.BOPTrees;
import biomesoplenty.common.item.ItemJarFilled;
import com.google.common.collect.Sets;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
@ -31,7 +35,7 @@ import net.minecraft.stats.AchievementList;
import net.minecraft.util.JsonSerializableSet;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.Biome;
import net.minecraftforge.event.entity.living.LivingEntityUseItemEvent;
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
@ -40,12 +44,9 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.PlayerEvent;
import net.minecraftforge.fml.common.gameevent.PlayerEvent.ItemCraftedEvent;
import java.util.Iterator;
import java.util.Set;
public class AchievementEventHandler
{
private static final Set<BiomeGenBase> BOP_BIOMES_TO_EXPLORE = Sets.union(BOPBiomes.REG_INSTANCE.getPresentBiomes(), BiomeGenBase.EXPLORATION_BIOMES_LIST);
private static final Set<Biome> BOP_BIOMES_TO_EXPLORE = Sets.union(BOPBiomes.REG_INSTANCE.getPresentBiomes(), Biome.EXPLORATION_BIOMES_LIST);
@SubscribeEvent
public void onItemPickup(PlayerEvent.ItemPickupEvent event)
@ -269,7 +270,7 @@ public class AchievementEventHandler
private void updateBiomeRadarExplore(EntityPlayerMP player)
{
BiomeGenBase currentBiome = player.worldObj.getBiomeGenForCoords(new BlockPos(MathHelper.floor_double(player.posX), 0, MathHelper.floor_double(player.posZ)));
Biome currentBiome = player.worldObj.getBiomeGenForCoords(new BlockPos(MathHelper.floor_double(player.posX), 0, MathHelper.floor_double(player.posZ)));
//Search every item in the player's main inventory for a biome radar
for (ItemStack stack : player.inventory.mainInventory)
@ -283,7 +284,7 @@ public class AchievementEventHandler
int biomeIdToFind = stack.getTagCompound().getInteger("biomeIDToFind");
//If the current biome id is the id on the radar, award the achievement and stop searching
if (biomeIdToFind == BiomeGenBase.getIdForBiome(currentBiome))
if (biomeIdToFind == Biome.getIdForBiome(currentBiome))
{
player.addStat(BOPAchievements.use_biome_finder);
return;
@ -294,15 +295,15 @@ public class AchievementEventHandler
private void updateBiomesExplored(EntityPlayerMP player)
{
BiomeGenBase currentBiome = player.worldObj.getBiomeGenForCoords(new BlockPos(MathHelper.floor_double(player.posX), 0, MathHelper.floor_double(player.posZ)));
Biome currentBiome = player.worldObj.getBiomeGenForCoords(new BlockPos(MathHelper.floor_double(player.posX), 0, MathHelper.floor_double(player.posZ)));
String biomeName = currentBiome.getBiomeName();
//Get a list of the current explored biomes
JsonSerializableSet exploredBiomeNames = (JsonSerializableSet)player.getStatFile().func_150870_b(BOPAchievements.explore_all_biomes);
JsonSerializableSet exploredBiomeNames = (JsonSerializableSet)player.getStatFile().getProgress(BOPAchievements.explore_all_biomes);
if (exploredBiomeNames == null)
{
//Set the stat data
exploredBiomeNames = (JsonSerializableSet)player.getStatFile().func_150872_a(BOPAchievements.explore_all_biomes, new JsonSerializableSet());
exploredBiomeNames = (JsonSerializableSet)player.getStatFile().setProgress(BOPAchievements.explore_all_biomes, new JsonSerializableSet());
}
//Add the current biome to the set of biomes that the player has explored
@ -311,17 +312,17 @@ public class AchievementEventHandler
if (player.getStatFile().canUnlockAchievement(BOPAchievements.explore_all_biomes) && exploredBiomeNames.size() >= BOP_BIOMES_TO_EXPLORE.size())
{
//Create a copy of the set of biomes that need to be explored to fulfil the achievement
Set<BiomeGenBase> set = Sets.newHashSet(BOP_BIOMES_TO_EXPLORE);
Set<Biome> set = Sets.newHashSet(BOP_BIOMES_TO_EXPLORE);
//Iterate over the names of all the biomes the player has explored
for (String exploredBiomeName : exploredBiomeNames)
{
Iterator<BiomeGenBase> iterator = set.iterator();
Iterator<Biome> iterator = set.iterator();
//Iterate over the set of biomes required to be explored and remove those that already have been explored
while (iterator.hasNext())
{
BiomeGenBase biome = (BiomeGenBase)iterator.next();
Biome biome = (Biome)iterator.next();
if (biome.getBiomeName().equals(exploredBiomeName))
{

View File

@ -55,7 +55,7 @@ public class ItemEventHandler
InventoryFlowerBasket inventory = new InventoryFlowerBasket(basketStack, player);
//Add the stack to the basket's inventory, if successful, don't add it to the player's regular inventory
if (inventory.func_174894_a(stack) == null)
if (inventory.addItem(stack) == null)
{
//Set stack size to 0 to cause it to be removed
stack.stackSize = 0;

View File

@ -15,10 +15,9 @@ import biomesoplenty.api.biome.IExtendedBiome;
import biomesoplenty.api.generation.GeneratorStage;
import biomesoplenty.api.generation.IGenerationManager;
import biomesoplenty.api.generation.IGenerator;
import biomesoplenty.common.world.GenerationManager;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.Biome;
import net.minecraftforge.event.terraingen.DecorateBiomeEvent;
import net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate;
import net.minecraftforge.event.terraingen.OreGenEvent;
@ -79,7 +78,7 @@ public class DecorateBiomeEventHandler
private static boolean runGeneratorStage(World world, Random random, BlockPos pos, GeneratorStage stage)
{
BiomeGenBase biome = world.getBiomeGenForCoords(pos.add(16, 0, 16));
Biome biome = world.getBiomeGenForCoords(pos.add(16, 0, 16));
IExtendedBiome extendedBiome = BOPBiomes.REG_INSTANCE.getExtendedBiome(biome);
if (extendedBiome != null)

View File

@ -8,33 +8,219 @@
package biomesoplenty.common.init;
import static biomesoplenty.api.biome.BOPBiomes.alps;
import static biomesoplenty.api.biome.BOPBiomes.bamboo_forest;
import static biomesoplenty.api.biome.BOPBiomes.bayou;
import static biomesoplenty.api.biome.BOPBiomes.birch_forest_extension;
import static biomesoplenty.api.biome.BOPBiomes.birch_forest_hills_extension;
import static biomesoplenty.api.biome.BOPBiomes.bog;
import static biomesoplenty.api.biome.BOPBiomes.boreal_forest;
import static biomesoplenty.api.biome.BOPBiomes.brushland;
import static biomesoplenty.api.biome.BOPBiomes.chaparral;
import static biomesoplenty.api.biome.BOPBiomes.cherry_blossom_grove;
import static biomesoplenty.api.biome.BOPBiomes.cold_desert;
import static biomesoplenty.api.biome.BOPBiomes.cold_taiga_extension;
import static biomesoplenty.api.biome.BOPBiomes.cold_taiga_hills_extension;
import static biomesoplenty.api.biome.BOPBiomes.coniferous_forest;
import static biomesoplenty.api.biome.BOPBiomes.coral_reef;
import static biomesoplenty.api.biome.BOPBiomes.crag;
import static biomesoplenty.api.biome.BOPBiomes.dead_forest;
import static biomesoplenty.api.biome.BOPBiomes.dead_swamp;
import static biomesoplenty.api.biome.BOPBiomes.desert_extension;
import static biomesoplenty.api.biome.BOPBiomes.desert_hills_extension;
import static biomesoplenty.api.biome.BOPBiomes.end_extension;
import static biomesoplenty.api.biome.BOPBiomes.eucalyptus_forest;
import static biomesoplenty.api.biome.BOPBiomes.excludedDecoratedWorldTypes;
import static biomesoplenty.api.biome.BOPBiomes.extreme_hills_extension;
import static biomesoplenty.api.biome.BOPBiomes.extreme_hills_plus_extension;
import static biomesoplenty.api.biome.BOPBiomes.fen;
import static biomesoplenty.api.biome.BOPBiomes.flower_field;
import static biomesoplenty.api.biome.BOPBiomes.flower_island;
import static biomesoplenty.api.biome.BOPBiomes.forest_extension;
import static biomesoplenty.api.biome.BOPBiomes.forest_hills_extension;
import static biomesoplenty.api.biome.BOPBiomes.glacier;
import static biomesoplenty.api.biome.BOPBiomes.grassland;
import static biomesoplenty.api.biome.BOPBiomes.gravel_beach;
import static biomesoplenty.api.biome.BOPBiomes.grove;
import static biomesoplenty.api.biome.BOPBiomes.heathland;
import static biomesoplenty.api.biome.BOPBiomes.highland;
import static biomesoplenty.api.biome.BOPBiomes.ice_mountains_extension;
import static biomesoplenty.api.biome.BOPBiomes.ice_plains_extension;
import static biomesoplenty.api.biome.BOPBiomes.jungle_extension;
import static biomesoplenty.api.biome.BOPBiomes.jungle_hills_extension;
import static biomesoplenty.api.biome.BOPBiomes.kelp_forest;
import static biomesoplenty.api.biome.BOPBiomes.land_of_lakes;
import static biomesoplenty.api.biome.BOPBiomes.lavender_fields;
import static biomesoplenty.api.biome.BOPBiomes.lush_desert;
import static biomesoplenty.api.biome.BOPBiomes.lush_swamp;
import static biomesoplenty.api.biome.BOPBiomes.mangrove;
import static biomesoplenty.api.biome.BOPBiomes.maple_woods;
import static biomesoplenty.api.biome.BOPBiomes.marsh;
import static biomesoplenty.api.biome.BOPBiomes.meadow;
import static biomesoplenty.api.biome.BOPBiomes.mega_taiga_extension;
import static biomesoplenty.api.biome.BOPBiomes.mega_taiga_hills_extension;
import static biomesoplenty.api.biome.BOPBiomes.mesa_extension;
import static biomesoplenty.api.biome.BOPBiomes.mesa_plateau_extension;
import static biomesoplenty.api.biome.BOPBiomes.moor;
import static biomesoplenty.api.biome.BOPBiomes.mountain;
import static biomesoplenty.api.biome.BOPBiomes.mountain_foothills;
import static biomesoplenty.api.biome.BOPBiomes.mushroom_island_extension;
import static biomesoplenty.api.biome.BOPBiomes.mystic_grove;
import static biomesoplenty.api.biome.BOPBiomes.oasis;
import static biomesoplenty.api.biome.BOPBiomes.ocean_extension;
import static biomesoplenty.api.biome.BOPBiomes.ominous_woods;
import static biomesoplenty.api.biome.BOPBiomes.orchard;
import static biomesoplenty.api.biome.BOPBiomes.origin_island;
import static biomesoplenty.api.biome.BOPBiomes.outback;
import static biomesoplenty.api.biome.BOPBiomes.overgrown_cliffs;
import static biomesoplenty.api.biome.BOPBiomes.plains_extension;
import static biomesoplenty.api.biome.BOPBiomes.prairie;
import static biomesoplenty.api.biome.BOPBiomes.quagmire;
import static biomesoplenty.api.biome.BOPBiomes.rainforest;
import static biomesoplenty.api.biome.BOPBiomes.redwood_forest;
import static biomesoplenty.api.biome.BOPBiomes.roofed_forest_extension;
import static biomesoplenty.api.biome.BOPBiomes.sacred_springs;
import static biomesoplenty.api.biome.BOPBiomes.savanna_extension;
import static biomesoplenty.api.biome.BOPBiomes.savanna_plateau_extension;
import static biomesoplenty.api.biome.BOPBiomes.seasonal_forest;
import static biomesoplenty.api.biome.BOPBiomes.shield;
import static biomesoplenty.api.biome.BOPBiomes.shrubland;
import static biomesoplenty.api.biome.BOPBiomes.snowy_coniferous_forest;
import static biomesoplenty.api.biome.BOPBiomes.snowy_forest;
import static biomesoplenty.api.biome.BOPBiomes.steppe;
import static biomesoplenty.api.biome.BOPBiomes.swampland_extension;
import static biomesoplenty.api.biome.BOPBiomes.taiga_extension;
import static biomesoplenty.api.biome.BOPBiomes.taiga_hills_extension;
import static biomesoplenty.api.biome.BOPBiomes.temperate_rainforest;
import static biomesoplenty.api.biome.BOPBiomes.tropical_island;
import static biomesoplenty.api.biome.BOPBiomes.tropical_rainforest;
import static biomesoplenty.api.biome.BOPBiomes.tundra;
import static biomesoplenty.api.biome.BOPBiomes.volcanic_island;
import static biomesoplenty.api.biome.BOPBiomes.wasteland;
import static biomesoplenty.api.biome.BOPBiomes.wetland;
import static biomesoplenty.api.biome.BOPBiomes.woodland;
import static biomesoplenty.api.biome.BOPBiomes.xeric_shrubland;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.google.common.base.Optional;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
import biomesoplenty.api.biome.BOPBiomes;
import biomesoplenty.api.biome.IExtendedBiome;
import biomesoplenty.api.config.IConfigObj;
import biomesoplenty.api.enums.BOPClimates;
import biomesoplenty.common.biome.overworld.*;
import biomesoplenty.common.biome.vanilla.*;
import biomesoplenty.common.biome.overworld.BOPBiome;
import biomesoplenty.common.biome.overworld.BiomeGenAlps;
import biomesoplenty.common.biome.overworld.BiomeGenBambooForest;
import biomesoplenty.common.biome.overworld.BiomeGenBayou;
import biomesoplenty.common.biome.overworld.BiomeGenBog;
import biomesoplenty.common.biome.overworld.BiomeGenBorealForest;
import biomesoplenty.common.biome.overworld.BiomeGenBrushland;
import biomesoplenty.common.biome.overworld.BiomeGenChaparral;
import biomesoplenty.common.biome.overworld.BiomeGenCherryBlossomGrove;
import biomesoplenty.common.biome.overworld.BiomeGenColdDesert;
import biomesoplenty.common.biome.overworld.BiomeGenConiferousForest;
import biomesoplenty.common.biome.overworld.BiomeGenCoralReef;
import biomesoplenty.common.biome.overworld.BiomeGenCrag;
import biomesoplenty.common.biome.overworld.BiomeGenDeadForest;
import biomesoplenty.common.biome.overworld.BiomeGenDeadSwamp;
import biomesoplenty.common.biome.overworld.BiomeGenEucalyptusForest;
import biomesoplenty.common.biome.overworld.BiomeGenFen;
import biomesoplenty.common.biome.overworld.BiomeGenFlowerField;
import biomesoplenty.common.biome.overworld.BiomeGenFlowerIsland;
import biomesoplenty.common.biome.overworld.BiomeGenGlacier;
import biomesoplenty.common.biome.overworld.BiomeGenGrassland;
import biomesoplenty.common.biome.overworld.BiomeGenGravelBeach;
import biomesoplenty.common.biome.overworld.BiomeGenGrove;
import biomesoplenty.common.biome.overworld.BiomeGenHeathland;
import biomesoplenty.common.biome.overworld.BiomeGenHighland;
import biomesoplenty.common.biome.overworld.BiomeGenKelpForest;
import biomesoplenty.common.biome.overworld.BiomeGenLandOfLakes;
import biomesoplenty.common.biome.overworld.BiomeGenLavenderFields;
import biomesoplenty.common.biome.overworld.BiomeGenLushDesert;
import biomesoplenty.common.biome.overworld.BiomeGenLushSwamp;
import biomesoplenty.common.biome.overworld.BiomeGenMangrove;
import biomesoplenty.common.biome.overworld.BiomeGenMapleWoods;
import biomesoplenty.common.biome.overworld.BiomeGenMarsh;
import biomesoplenty.common.biome.overworld.BiomeGenMeadow;
import biomesoplenty.common.biome.overworld.BiomeGenMoor;
import biomesoplenty.common.biome.overworld.BiomeGenMountain;
import biomesoplenty.common.biome.overworld.BiomeGenMysticGrove;
import biomesoplenty.common.biome.overworld.BiomeGenOasis;
import biomesoplenty.common.biome.overworld.BiomeGenOminousWoods;
import biomesoplenty.common.biome.overworld.BiomeGenOrchard;
import biomesoplenty.common.biome.overworld.BiomeGenOriginIsland;
import biomesoplenty.common.biome.overworld.BiomeGenOutback;
import biomesoplenty.common.biome.overworld.BiomeGenOvergrownCliffs;
import biomesoplenty.common.biome.overworld.BiomeGenPrairie;
import biomesoplenty.common.biome.overworld.BiomeGenQuagmire;
import biomesoplenty.common.biome.overworld.BiomeGenRainforest;
import biomesoplenty.common.biome.overworld.BiomeGenRedwoodForest;
import biomesoplenty.common.biome.overworld.BiomeGenSacredSprings;
import biomesoplenty.common.biome.overworld.BiomeGenSeasonalForest;
import biomesoplenty.common.biome.overworld.BiomeGenShield;
import biomesoplenty.common.biome.overworld.BiomeGenShrubland;
import biomesoplenty.common.biome.overworld.BiomeGenSnowyConiferousForest;
import biomesoplenty.common.biome.overworld.BiomeGenSnowyForest;
import biomesoplenty.common.biome.overworld.BiomeGenSteppe;
import biomesoplenty.common.biome.overworld.BiomeGenTemperateRainforest;
import biomesoplenty.common.biome.overworld.BiomeGenTropicalIsland;
import biomesoplenty.common.biome.overworld.BiomeGenTropicalRainforest;
import biomesoplenty.common.biome.overworld.BiomeGenTundra;
import biomesoplenty.common.biome.overworld.BiomeGenVolcanicIsland;
import biomesoplenty.common.biome.overworld.BiomeGenWasteland;
import biomesoplenty.common.biome.overworld.BiomeGenWetland;
import biomesoplenty.common.biome.overworld.BiomeGenWoodland;
import biomesoplenty.common.biome.overworld.BiomeGenXericShrubland;
import biomesoplenty.common.biome.vanilla.BiomeExtBirchForest;
import biomesoplenty.common.biome.vanilla.BiomeExtBirchForestHills;
import biomesoplenty.common.biome.vanilla.BiomeExtColdTaiga;
import biomesoplenty.common.biome.vanilla.BiomeExtColdTaigaHills;
import biomesoplenty.common.biome.vanilla.BiomeExtDesert;
import biomesoplenty.common.biome.vanilla.BiomeExtDesertHills;
import biomesoplenty.common.biome.vanilla.BiomeExtEnd;
import biomesoplenty.common.biome.vanilla.BiomeExtExtremeHills;
import biomesoplenty.common.biome.vanilla.BiomeExtExtremeHillsPlus;
import biomesoplenty.common.biome.vanilla.BiomeExtForest;
import biomesoplenty.common.biome.vanilla.BiomeExtForestHills;
import biomesoplenty.common.biome.vanilla.BiomeExtIceMountains;
import biomesoplenty.common.biome.vanilla.BiomeExtIcePlains;
import biomesoplenty.common.biome.vanilla.BiomeExtJungle;
import biomesoplenty.common.biome.vanilla.BiomeExtJungleHills;
import biomesoplenty.common.biome.vanilla.BiomeExtMegaTaiga;
import biomesoplenty.common.biome.vanilla.BiomeExtMegaTaigaHills;
import biomesoplenty.common.biome.vanilla.BiomeExtMesa;
import biomesoplenty.common.biome.vanilla.BiomeExtMesaPlateau;
import biomesoplenty.common.biome.vanilla.BiomeExtMushroomIsland;
import biomesoplenty.common.biome.vanilla.BiomeExtOcean;
import biomesoplenty.common.biome.vanilla.BiomeExtPlains;
import biomesoplenty.common.biome.vanilla.BiomeExtRoofedForest;
import biomesoplenty.common.biome.vanilla.BiomeExtSavanna;
import biomesoplenty.common.biome.vanilla.BiomeExtSavannaPlateau;
import biomesoplenty.common.biome.vanilla.BiomeExtSwampland;
import biomesoplenty.common.biome.vanilla.BiomeExtTaiga;
import biomesoplenty.common.biome.vanilla.BiomeExtTaigaHills;
import biomesoplenty.common.command.BOPCommand;
import biomesoplenty.common.util.config.BOPConfig;
import biomesoplenty.common.world.WorldTypeBOP;
import biomesoplenty.core.BiomesOPlenty;
import com.google.common.base.Optional;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
import net.minecraft.init.Biomes;
import net.minecraft.world.WorldType;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.Biome;
import net.minecraftforge.common.BiomeDictionary;
import net.minecraftforge.common.BiomeDictionary.Type;
import net.minecraftforge.common.BiomeManager;
import java.io.File;
import java.io.IOException;
import java.util.*;
import java.util.Map.Entry;
import static biomesoplenty.api.biome.BOPBiomes.*;
public class ModBiomes implements BOPBiomes.IBiomeRegistry
{
public static WorldTypeBOP worldTypeBOP;
@ -46,7 +232,7 @@ public class ModBiomes implements BOPBiomes.IBiomeRegistry
private static Set<Integer> idsReservedInConfig;
private static Map<Integer, IExtendedBiome> biomeWrapperMap;
public static Set<BiomeGenBase> presentBiomes;
public static Set<Biome> presentBiomes;
public static Map<Integer, List<Integer>> subBiomesMap;
public static Map<Integer, Integer> islandBiomesMap = new HashMap<Integer, Integer>();
@ -338,7 +524,7 @@ public class ModBiomes implements BOPBiomes.IBiomeRegistry
presentBiomes.add(extendedBiome.getBaseBiome());
//Extra functionality builtin, such as with BOPBiome
if (extendedBiome instanceof BiomeGenBase)
if (extendedBiome instanceof Biome)
{
for (Entry<BOPClimates, Integer> entry : extendedBiome.getWeightMap().entrySet())
{
@ -352,14 +538,14 @@ public class ModBiomes implements BOPBiomes.IBiomeRegistry
}
else //extendedBiome is a wrapper
{
biomeWrapperMap.put(BiomeGenBase.getIdForBiome(extendedBiome.getBaseBiome()), extendedBiome);
biomeWrapperMap.put(Biome.getIdForBiome(extendedBiome.getBaseBiome()), extendedBiome);
}
return extendedBiome;
}
@Override
public IExtendedBiome getExtendedBiome(BiomeGenBase biome)
public IExtendedBiome getExtendedBiome(Biome biome)
{
//Extra functionality builtin, such as with BOPBiome
if (biome instanceof IExtendedBiome)
@ -368,7 +554,7 @@ public class ModBiomes implements BOPBiomes.IBiomeRegistry
}
else
{
IExtendedBiome wrapper = biomeWrapperMap.get(BiomeGenBase.getIdForBiome(biome));
IExtendedBiome wrapper = biomeWrapperMap.get(Biome.getIdForBiome(biome));
//This biome may not have a wrapper
if (wrapper != null)
@ -382,7 +568,7 @@ public class ModBiomes implements BOPBiomes.IBiomeRegistry
}
@Override
public ImmutableSet<BiomeGenBase> getPresentBiomes()
public ImmutableSet<Biome> getPresentBiomes()
{
return ImmutableSet.copyOf(presentBiomes);
}
@ -398,11 +584,11 @@ public class ModBiomes implements BOPBiomes.IBiomeRegistry
return conf;
}
private static void setSubBiome(Optional<BiomeGenBase> parent, Optional<BiomeGenBase>... subBiomes)
private static void setSubBiome(Optional<Biome> parent, Optional<Biome>... subBiomes)
{
if (parent.isPresent())
{
for (Optional<BiomeGenBase> subBiome : subBiomes)
for (Optional<Biome> subBiome : subBiomes)
{
if (subBiome.isPresent())
{
@ -412,26 +598,26 @@ public class ModBiomes implements BOPBiomes.IBiomeRegistry
}
}
private static void setSubBiome(BiomeGenBase parent, BiomeGenBase... subBiomes)
private static void setSubBiome(Biome parent, Biome... subBiomes)
{
Map<Integer, List<Integer>> map = subBiomesMap;
int parentId = BiomeGenBase.getIdForBiome(parent);
int parentId = Biome.getIdForBiome(parent);
if (!map.containsKey(parentId))
{
map.put(parentId, new ArrayList<Integer>());
}
for (BiomeGenBase subBiome : subBiomes)
for (Biome subBiome : subBiomes)
{
map.get(parentId).add(BiomeGenBase.getIdForBiome(subBiome));
map.get(parentId).add(Biome.getIdForBiome(subBiome));
}
}
private static void addIslandBiome(Optional<BiomeGenBase> biome, int weight)
private static void addIslandBiome(Optional<Biome> biome, int weight)
{
if (biome.isPresent())
{
totalIslandBiomesWeight += weight;
islandBiomesMap.put(BiomeGenBase.getIdForBiome(biome.get()), weight);
islandBiomesMap.put(Biome.getIdForBiome(biome.get()), weight);
}
}
@ -444,7 +630,7 @@ public class ModBiomes implements BOPBiomes.IBiomeRegistry
return BOPBiomes.REG_INSTANCE.registerBiome(extendedBiome, idName);
}
private static Optional<BiomeGenBase> registerBOPBiome(BOPBiome biome)
private static Optional<Biome> registerBOPBiome(BOPBiome biome)
{
String idName = biome.getResourceLocation().getResourcePath();
Integer id = biomeIdMapConf.getInt(idName, null);
@ -455,7 +641,7 @@ public class ModBiomes implements BOPBiomes.IBiomeRegistry
BOPCommand.biomeCount++;
BOPBiomes.REG_INSTANCE.registerBiome(biome, idName);
BiomeGenBase.registerBiome(id, biome.getResourceLocation().toString(), biome);
Biome.registerBiome(id, biome.getResourceLocation().toString(), biome);
//Enable spwning and village generation in the biome
if (biome.canSpawnInBiome)
@ -464,14 +650,14 @@ public class ModBiomes implements BOPBiomes.IBiomeRegistry
if (biome.canGenerateVillages)
BiomeManager.addVillageBiome(biome, true);
return Optional.of((BiomeGenBase)biome);
return Optional.of((Biome)biome);
} else {
return Optional.absent();
}
}
private static void registerBiomeToDictionary(Optional<BiomeGenBase> biome, Type...types)
private static void registerBiomeToDictionary(Optional<Biome> biome, Type...types)
{
if (biome.isPresent())
{
@ -483,7 +669,7 @@ public class ModBiomes implements BOPBiomes.IBiomeRegistry
{
for (int i = nextBiomeId; i < 256; i++)
{
if (BiomeGenBase.getBiome(i) != null)
if (Biome.getBiome(i) != null)
{
if (i == 255) throw new IllegalArgumentException("There are no more biome ids avaliable!");
continue;

View File

@ -8,6 +8,37 @@
package biomesoplenty.common.init;
import static biomesoplenty.api.block.BlockQueries.air;
import static biomesoplenty.api.block.BlockQueries.airAbove;
import static biomesoplenty.api.block.BlockQueries.airBelow;
import static biomesoplenty.api.block.BlockQueries.airOrLeaves;
import static biomesoplenty.api.block.BlockQueries.anything;
import static biomesoplenty.api.block.BlockQueries.breakable;
import static biomesoplenty.api.block.BlockQueries.endish;
import static biomesoplenty.api.block.BlockQueries.fertile;
import static biomesoplenty.api.block.BlockQueries.fertileOrNetherrack;
import static biomesoplenty.api.block.BlockQueries.fertileSeaBed;
import static biomesoplenty.api.block.BlockQueries.groundBlocks;
import static biomesoplenty.api.block.BlockQueries.hasWater;
import static biomesoplenty.api.block.BlockQueries.hellish;
import static biomesoplenty.api.block.BlockQueries.litBeach;
import static biomesoplenty.api.block.BlockQueries.litDry;
import static biomesoplenty.api.block.BlockQueries.litFertile;
import static biomesoplenty.api.block.BlockQueries.litFertileOrDry;
import static biomesoplenty.api.block.BlockQueries.litFertileWaterside;
import static biomesoplenty.api.block.BlockQueries.litSand;
import static biomesoplenty.api.block.BlockQueries.nothing;
import static biomesoplenty.api.block.BlockQueries.replaceable;
import static biomesoplenty.api.block.BlockQueries.rootsCanDigThrough;
import static biomesoplenty.api.block.BlockQueries.solid;
import static biomesoplenty.api.block.BlockQueries.spectralMoss;
import static biomesoplenty.api.block.BlockQueries.suitableForReed;
import static biomesoplenty.api.block.BlockQueries.surfaceBlocks;
import static biomesoplenty.api.block.BlockQueries.sustainsCave;
import static biomesoplenty.api.block.BlockQueries.sustainsNether;
import static biomesoplenty.api.block.BlockQueries.underwater;
import static biomesoplenty.api.block.BlockQueries.waterCovered;
import biomesoplenty.api.block.BOPBlocks;
import biomesoplenty.api.block.IBlockPosQuery;
import biomesoplenty.common.block.BlockBOPGrass;
@ -22,8 +53,6 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.common.EnumPlantType;
import static biomesoplenty.api.block.BlockQueries.*;
public class ModBlockQueries
{

View File

@ -8,8 +8,56 @@
package biomesoplenty.common.init;
import static biomesoplenty.api.block.BOPBlocks.*;
import static biomesoplenty.api.item.BOPItems.blood_bucket;
import static biomesoplenty.api.item.BOPItems.honey_bucket;
import static biomesoplenty.api.item.BOPItems.hot_spring_water_bucket;
import static biomesoplenty.api.item.BOPItems.poison_bucket;
import com.google.common.collect.ImmutableSet;
import biomesoplenty.api.item.BOPItems;
import biomesoplenty.common.block.*;
import biomesoplenty.common.block.BlockBOPAsh;
import biomesoplenty.common.block.BlockBOPBamboo;
import biomesoplenty.common.block.BlockBOPBiomeBlock;
import biomesoplenty.common.block.BlockBOPBones;
import biomesoplenty.common.block.BlockBOPCoral;
import biomesoplenty.common.block.BlockBOPCrystal;
import biomesoplenty.common.block.BlockBOPDirt;
import biomesoplenty.common.block.BlockBOPDoor;
import biomesoplenty.common.block.BlockBOPDoubleOtherSlab;
import biomesoplenty.common.block.BlockBOPDoublePlant;
import biomesoplenty.common.block.BlockBOPDoubleWoodSlab;
import biomesoplenty.common.block.BlockBOPFarmland;
import biomesoplenty.common.block.BlockBOPFence;
import biomesoplenty.common.block.BlockBOPFenceGate;
import biomesoplenty.common.block.BlockBOPFlesh;
import biomesoplenty.common.block.BlockBOPFlower;
import biomesoplenty.common.block.BlockBOPGem;
import biomesoplenty.common.block.BlockBOPGemOre;
import biomesoplenty.common.block.BlockBOPGeneric;
import biomesoplenty.common.block.BlockBOPGrass;
import biomesoplenty.common.block.BlockBOPHalfOtherSlab;
import biomesoplenty.common.block.BlockBOPHalfWoodSlab;
import biomesoplenty.common.block.BlockBOPHive;
import biomesoplenty.common.block.BlockBOPHoney;
import biomesoplenty.common.block.BlockBOPLeaves;
import biomesoplenty.common.block.BlockBOPLilypad;
import biomesoplenty.common.block.BlockBOPLog;
import biomesoplenty.common.block.BlockBOPMud;
import biomesoplenty.common.block.BlockBOPMushroom;
import biomesoplenty.common.block.BlockBOPPlanks;
import biomesoplenty.common.block.BlockBOPPlant;
import biomesoplenty.common.block.BlockBOPSand;
import biomesoplenty.common.block.BlockBOPSapling;
import biomesoplenty.common.block.BlockBOPSeaweed;
import biomesoplenty.common.block.BlockBOPStone;
import biomesoplenty.common.block.BlockBOPStoneFormations;
import biomesoplenty.common.block.BlockBOPTerrarium;
import biomesoplenty.common.block.BlockBOPTurnip;
import biomesoplenty.common.block.BlockBOPVine;
import biomesoplenty.common.block.BlockBOPWoodStairs;
import biomesoplenty.common.block.IBOPBlock;
import biomesoplenty.common.command.BOPCommand;
import biomesoplenty.common.enums.BOPWoods;
import biomesoplenty.common.fluids.BloodFluid;
@ -24,7 +72,6 @@ import biomesoplenty.common.util.BOPReflectionHelper;
import biomesoplenty.common.util.block.BlockStateUtils;
import biomesoplenty.common.util.inventory.CreativeTabBOP;
import biomesoplenty.core.BiomesOPlenty;
import com.google.common.collect.ImmutableSet;
import net.minecraft.block.Block;
import net.minecraft.block.BlockSlab;
import net.minecraft.block.BlockStairs;
@ -33,7 +80,12 @@ import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items;
import net.minecraft.item.*;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemBucket;
import net.minecraft.item.ItemDoor;
import net.minecraft.item.ItemSlab;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.EnumPlantType;
import net.minecraftforge.fluids.Fluid;
@ -41,28 +93,6 @@ import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fml.common.registry.GameRegistry;
import static biomesoplenty.api.block.BOPBlocks.*;
import static biomesoplenty.api.block.BOPBlocks.cherry_door;
import static biomesoplenty.api.block.BOPBlocks.ebony_door;
import static biomesoplenty.api.block.BOPBlocks.ethereal_door;
import static biomesoplenty.api.block.BOPBlocks.eucalyptus_door;
import static biomesoplenty.api.block.BOPBlocks.fir_door;
import static biomesoplenty.api.block.BOPBlocks.hellbark_door;
import static biomesoplenty.api.block.BOPBlocks.jacaranda_door;
import static biomesoplenty.api.block.BOPBlocks.magic_door;
import static biomesoplenty.api.block.BOPBlocks.mahogany_door;
import static biomesoplenty.api.block.BOPBlocks.mangrove_door;
import static biomesoplenty.api.block.BOPBlocks.other_slab;
import static biomesoplenty.api.block.BOPBlocks.palm_door;
import static biomesoplenty.api.block.BOPBlocks.pine_door;
import static biomesoplenty.api.block.BOPBlocks.redwood_door;
import static biomesoplenty.api.block.BOPBlocks.sacred_oak_door;
import static biomesoplenty.api.block.BOPBlocks.umbran_door;
import static biomesoplenty.api.block.BOPBlocks.willow_door;
import static biomesoplenty.api.block.BOPBlocks.wood_slab_0;
import static biomesoplenty.api.block.BOPBlocks.wood_slab_1;
import static biomesoplenty.api.item.BOPItems.*;
public class ModBlocks
{
// TODO: use getDrops() in classes where the drops are very specific, instead of implementing all 3 of quantityDropped() getItemDropped() and damageDropped()

View File

@ -8,7 +8,7 @@ import com.google.common.collect.Lists;
import biomesoplenty.api.enums.BOPClimates;
import biomesoplenty.common.integration.ThaumcraftCompat;
import biomesoplenty.core.BiomesOPlenty;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.Biome;
import net.minecraftforge.common.BiomeManager;
import net.minecraftforge.common.BiomeManager.BiomeEntry;
import net.minecraftforge.common.BiomeManager.BiomeType;
@ -66,7 +66,7 @@ public class ModCompatibility
}
//TODO: Make this more accurate, possibly analyze heights, temps, rainfall and/or biome dictionary tags
private static void remapBiomeToBoP(BiomeGenBase biome, BiomeType type, int weight)
private static void remapBiomeToBoP(Biome biome, BiomeType type, int weight)
{
for (BOPClimates climate : BOPClimates.values())
{

View File

@ -8,10 +8,112 @@
package biomesoplenty.common.init;
import static biomesoplenty.api.item.BOPItems.ambrosia;
import static biomesoplenty.api.item.BOPItems.amethyst_axe;
import static biomesoplenty.api.item.BOPItems.amethyst_boots;
import static biomesoplenty.api.item.BOPItems.amethyst_chestplate;
import static biomesoplenty.api.item.BOPItems.amethyst_helmet;
import static biomesoplenty.api.item.BOPItems.amethyst_hoe;
import static biomesoplenty.api.item.BOPItems.amethyst_leggings;
import static biomesoplenty.api.item.BOPItems.amethyst_pickaxe;
import static biomesoplenty.api.item.BOPItems.amethyst_scythe;
import static biomesoplenty.api.item.BOPItems.amethyst_shovel;
import static biomesoplenty.api.item.BOPItems.amethyst_sword;
import static biomesoplenty.api.item.BOPItems.ash;
import static biomesoplenty.api.item.BOPItems.berries;
import static biomesoplenty.api.item.BOPItems.biome_essence;
import static biomesoplenty.api.item.BOPItems.biome_finder;
import static biomesoplenty.api.item.BOPItems.black_dye;
import static biomesoplenty.api.item.BOPItems.blue_dye;
import static biomesoplenty.api.item.BOPItems.brown_dye;
import static biomesoplenty.api.item.BOPItems.crystal_shard;
import static biomesoplenty.api.item.BOPItems.dart;
import static biomesoplenty.api.item.BOPItems.dart_blower;
import static biomesoplenty.api.item.BOPItems.diamond_scythe;
import static biomesoplenty.api.item.BOPItems.dull_flower_band;
import static biomesoplenty.api.item.BOPItems.earth;
import static biomesoplenty.api.item.BOPItems.enderporter;
import static biomesoplenty.api.item.BOPItems.exotic_flower_band;
import static biomesoplenty.api.item.BOPItems.filled_honeycomb;
import static biomesoplenty.api.item.BOPItems.flax_string;
import static biomesoplenty.api.item.BOPItems.fleshchunk;
import static biomesoplenty.api.item.BOPItems.flippers;
import static biomesoplenty.api.item.BOPItems.flower_basket;
import static biomesoplenty.api.item.BOPItems.gem;
import static biomesoplenty.api.item.BOPItems.gold_scythe;
import static biomesoplenty.api.item.BOPItems.green_dye;
import static biomesoplenty.api.item.BOPItems.honeycomb;
import static biomesoplenty.api.item.BOPItems.ichor;
import static biomesoplenty.api.item.BOPItems.iron_scythe;
import static biomesoplenty.api.item.BOPItems.jar_empty;
import static biomesoplenty.api.item.BOPItems.jar_filled;
import static biomesoplenty.api.item.BOPItems.lush_flower_band;
import static biomesoplenty.api.item.BOPItems.mud_axe;
import static biomesoplenty.api.item.BOPItems.mud_boots;
import static biomesoplenty.api.item.BOPItems.mud_brick;
import static biomesoplenty.api.item.BOPItems.mud_chestplate;
import static biomesoplenty.api.item.BOPItems.mud_helmet;
import static biomesoplenty.api.item.BOPItems.mud_hoe;
import static biomesoplenty.api.item.BOPItems.mud_leggings;
import static biomesoplenty.api.item.BOPItems.mud_pickaxe;
import static biomesoplenty.api.item.BOPItems.mud_scythe;
import static biomesoplenty.api.item.BOPItems.mud_shovel;
import static biomesoplenty.api.item.BOPItems.mud_sword;
import static biomesoplenty.api.item.BOPItems.mudball;
import static biomesoplenty.api.item.BOPItems.peach;
import static biomesoplenty.api.item.BOPItems.pear;
import static biomesoplenty.api.item.BOPItems.persimmon;
import static biomesoplenty.api.item.BOPItems.pinecone;
import static biomesoplenty.api.item.BOPItems.pixie_dust;
import static biomesoplenty.api.item.BOPItems.plain_flower_band;
import static biomesoplenty.api.item.BOPItems.record_corruption;
import static biomesoplenty.api.item.BOPItems.record_wanderer;
import static biomesoplenty.api.item.BOPItems.ricebowl;
import static biomesoplenty.api.item.BOPItems.saladfruit;
import static biomesoplenty.api.item.BOPItems.saladshroom;
import static biomesoplenty.api.item.BOPItems.saladveggie;
import static biomesoplenty.api.item.BOPItems.shroompowder;
import static biomesoplenty.api.item.BOPItems.soul;
import static biomesoplenty.api.item.BOPItems.spawn_egg;
import static biomesoplenty.api.item.BOPItems.stone_scythe;
import static biomesoplenty.api.item.BOPItems.terrestrial_artifact;
import static biomesoplenty.api.item.BOPItems.turnip;
import static biomesoplenty.api.item.BOPItems.turnip_seeds;
import static biomesoplenty.api.item.BOPItems.wading_boots;
import static biomesoplenty.api.item.BOPItems.white_dye;
import static biomesoplenty.api.item.BOPItems.wood_scythe;
import static biomesoplenty.api.item.BOPMaterials.amethyst_armor_material;
import static biomesoplenty.api.item.BOPMaterials.amethyst_tool_material;
import static biomesoplenty.api.item.BOPMaterials.dull_flower_band_material;
import static biomesoplenty.api.item.BOPMaterials.exotic_flower_band_material;
import static biomesoplenty.api.item.BOPMaterials.flippers_material;
import static biomesoplenty.api.item.BOPMaterials.lush_flower_band_material;
import static biomesoplenty.api.item.BOPMaterials.mud_armor_material;
import static biomesoplenty.api.item.BOPMaterials.mud_tool_material;
import static biomesoplenty.api.item.BOPMaterials.plain_flower_band_material;
import static biomesoplenty.api.item.BOPMaterials.wading_boots_material;
import biomesoplenty.api.block.BOPBlocks;
import biomesoplenty.api.sound.BOPSounds;
import biomesoplenty.common.command.BOPCommand;
import biomesoplenty.common.item.*;
import biomesoplenty.common.item.ItemAmbrosia;
import biomesoplenty.common.item.ItemBOPFood;
import biomesoplenty.common.item.ItemBOPRecord;
import biomesoplenty.common.item.ItemBOPScythe;
import biomesoplenty.common.item.ItemBOPSpawnEgg;
import biomesoplenty.common.item.ItemBiomeEssence;
import biomesoplenty.common.item.ItemBiomeFinder;
import biomesoplenty.common.item.ItemDart;
import biomesoplenty.common.item.ItemDartBlower;
import biomesoplenty.common.item.ItemEnderporter;
import biomesoplenty.common.item.ItemFlippers;
import biomesoplenty.common.item.ItemFlowerBand;
import biomesoplenty.common.item.ItemFlowerBasket;
import biomesoplenty.common.item.ItemGem;
import biomesoplenty.common.item.ItemJarEmpty;
import biomesoplenty.common.item.ItemJarFilled;
import biomesoplenty.common.item.ItemMudball;
import biomesoplenty.common.item.ItemWadingBoots;
import biomesoplenty.common.util.BOPReflectionHelper;
import biomesoplenty.common.util.inventory.CreativeTabBOP;
import biomesoplenty.core.BiomesOPlenty;
@ -20,17 +122,26 @@ import net.minecraft.init.Blocks;
import net.minecraft.init.MobEffects;
import net.minecraft.init.SoundEvents;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.*;
import net.minecraft.item.EnumAction;
import net.minecraft.item.Item;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.item.ItemArmor.ArmorMaterial;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemAxe;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemHoe;
import net.minecraft.item.ItemPickaxe;
import net.minecraft.item.ItemSeeds;
import net.minecraft.item.ItemSoup;
import net.minecraft.item.ItemSpade;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.fml.common.registry.GameRegistry;
import static biomesoplenty.api.item.BOPMaterials.*;
import static biomesoplenty.api.item.BOPItems.*;
public class ModItems
{
public static void init()
@ -97,16 +208,16 @@ public class ModItems
// DIAMOND("diamond", 33, new int[]{3, 8, 6, 3}, 10);
// TODO: do we really want durability of -1 for these unprotective armor items? does that mean it lasts forever?
wading_boots_material = addArmorMaterial("WADING_BOOTS", "biomesoplenty:wading_boots", -1, new int[]{0,0,0,0}, 0, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC);
flippers_material = addArmorMaterial("FLIPPERS", "biomesoplenty:flippers", -1, new int[]{0,0,0,0}, 0, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC);
plain_flower_band_material = addArmorMaterial("PLAIN_FLOWER_BAND", "biomesoplenty:plain_flower_band", -1, new int[]{0,0,0,0}, 0, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC);
lush_flower_band_material = addArmorMaterial("LUSH_FLOWER_BAND", "biomesoplenty:lush_flower_band", -1, new int[]{0,0,0,0}, 0, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC);
exotic_flower_band_material = addArmorMaterial("EXOTIC_FLOWER_BAND", "biomesoplenty:exotic_flower_band", -1, new int[]{0,0,0,0}, 0, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC);
dull_flower_band_material = addArmorMaterial("DULL_FLOWER_BAND", "biomesoplenty:dull_flower_band", -1, new int[]{0,0,0,0}, 0, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC);
wading_boots_material = addArmorMaterial("WADING_BOOTS", "biomesoplenty:wading_boots", -1, new int[]{0,0,0,0}, 0, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0.0F);
flippers_material = addArmorMaterial("FLIPPERS", "biomesoplenty:flippers", -1, new int[]{0,0,0,0}, 0, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0.0F);
plain_flower_band_material = addArmorMaterial("PLAIN_FLOWER_BAND", "biomesoplenty:plain_flower_band", -1, new int[]{0,0,0,0}, 0, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0.0F);
lush_flower_band_material = addArmorMaterial("LUSH_FLOWER_BAND", "biomesoplenty:lush_flower_band", -1, new int[]{0,0,0,0}, 0, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0.0F);
exotic_flower_band_material = addArmorMaterial("EXOTIC_FLOWER_BAND", "biomesoplenty:exotic_flower_band", -1, new int[]{0,0,0,0}, 0, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0.0F);
dull_flower_band_material = addArmorMaterial("DULL_FLOWER_BAND", "biomesoplenty:dull_flower_band", -1, new int[]{0,0,0,0}, 0, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0.0F);
mud_armor_material = addArmorMaterial("MUD", "biomesoplenty:mud_armor", 2, new int[]{1,1,1,1}, 5, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC);
mud_armor_material = addArmorMaterial("MUD", "biomesoplenty:mud_armor", 2, new int[]{1,1,1,1}, 5, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0.0F);
mud_armor_material.customCraftingMaterial = mudball;
amethyst_armor_material = addArmorMaterial("AMETHYST", "biomesoplenty:amethyst_armor", 40, new int[]{3,8,8,3}, 20, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC);
amethyst_armor_material = addArmorMaterial("AMETHYST", "biomesoplenty:amethyst_armor", 40, new int[]{3,8,8,3}, 20, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 2.0F);
wading_boots = registerItem(new ItemWadingBoots(wading_boots_material, 0), "wading_boots");
flippers = registerItem(new ItemFlippers(flippers_material, 0), "flippers");
@ -200,9 +311,14 @@ public class ModItems
return item;
}
private static ItemArmor.ArmorMaterial addArmorMaterial(String name, String textureName, int durability, int[] reductionAmounts, int enchantability, SoundEvent soundOnEquip)
private static Class<?>[][] enumTypes =
{
return EnumHelper.addArmorMaterial(name, textureName, durability, reductionAmounts, enchantability, soundOnEquip);
{ArmorMaterial.class, String.class, int.class, int[].class, int.class, SoundEvent.class, float.class}
};
private static ItemArmor.ArmorMaterial addArmorMaterial(String name, String textureName, int durability, int[] reductionAmounts, int enchantability, SoundEvent soundOnEquip, float toughness)
{
return EnumHelper.addEnum(enumTypes, ItemArmor.ArmorMaterial.class, name, textureName, durability, reductionAmounts, enchantability, soundOnEquip, toughness);
}
private static void setAxeDamageAndSpeed(ToolMaterial material, float damage, float speed)

View File

@ -8,15 +8,15 @@
package biomesoplenty.common.init;
import static biomesoplenty.api.potion.BOPPotions.paralysis;
import static biomesoplenty.api.potion.BOPPotions.possession;
import biomesoplenty.common.potion.PotionParalysis;
import biomesoplenty.common.potion.PotionPossession;
import biomesoplenty.core.BiomesOPlenty;
import net.minecraft.potion.Potion;
import net.minecraft.util.ResourceLocation;
import static biomesoplenty.api.potion.BOPPotions.paralysis;
import static biomesoplenty.api.potion.BOPPotions.possession;
public class ModPotions
{

View File

@ -7,12 +7,17 @@
******************************************************************************/
package biomesoplenty.common.init;
import static biomesoplenty.api.sound.BOPSounds.pixie_ambient;
import static biomesoplenty.api.sound.BOPSounds.pixie_hurt;
import static biomesoplenty.api.sound.BOPSounds.records_corruption;
import static biomesoplenty.api.sound.BOPSounds.records_wanderer;
import static biomesoplenty.api.sound.BOPSounds.wasp_ambient;
import static biomesoplenty.api.sound.BOPSounds.wasp_hurt;
import biomesoplenty.core.BiomesOPlenty;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent;
import static biomesoplenty.api.sound.BOPSounds.*;
public class ModSounds
{
public static void init()

View File

@ -1,36 +1,5 @@
package biomesoplenty.common.integration;
import com.sun.jna.platform.unix.X11.XSizeHints.Aspect;
import biomesoplenty.api.block.BOPBlocks;
import biomesoplenty.api.item.BOPItems;
import biomesoplenty.common.block.BlockBOPBones;
import biomesoplenty.common.block.BlockBOPBones.BoneType;
import biomesoplenty.common.block.BlockBOPFlower;
import biomesoplenty.common.block.BlockBOPGem;
import biomesoplenty.common.block.BlockBOPGrass;
import biomesoplenty.common.block.BlockBOPGrass.BOPGrassType;
import biomesoplenty.common.block.BlockBOPLeaves;
import biomesoplenty.common.block.BlockBOPLog;
import biomesoplenty.common.block.BlockBOPMushroom;
import biomesoplenty.common.block.BlockBOPMushroom.MushroomType;
import biomesoplenty.common.block.BlockBOPPlanks;
import biomesoplenty.common.block.BlockBOPPlant;
import biomesoplenty.common.block.BlockBOPSand;
import biomesoplenty.common.block.BlockBOPSapling;
import biomesoplenty.common.block.BlockBOPSeaweed;
import biomesoplenty.common.block.BlockBOPSeaweed.SeaweedType;
import biomesoplenty.common.enums.BOPFlowers;
import biomesoplenty.common.enums.BOPGems;
import biomesoplenty.common.enums.BOPPlants;
import biomesoplenty.common.enums.BOPTrees;
import biomesoplenty.common.enums.BOPWoods;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.event.FMLInterModComms;
//TODO: Re-add this
public class ThaumcraftCompat
{

View File

@ -8,7 +8,6 @@
package biomesoplenty.common.item;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.ItemRecord;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent;

View File

@ -8,13 +8,20 @@
package biomesoplenty.common.item;
import java.util.List;
import java.util.Map.Entry;
import biomesoplenty.common.init.ModEntities;
import net.minecraft.block.BlockFence;
import net.minecraft.block.BlockLiquid;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.color.IItemColor;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.*;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IEntityLivingData;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
@ -33,9 +40,6 @@ import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import java.util.List;
import java.util.Map.Entry;
public class ItemBOPSpawnEgg extends Item implements IColoredItem
{

View File

@ -13,27 +13,24 @@ import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraft.world.biome.Biome;
public class ItemBiomeEssence extends Item
{
public ItemBiomeEssence() {}
public BiomeGenBase getBiome(ItemStack itemStack)
public Biome getBiome(ItemStack itemStack)
{
if (itemStack.hasTagCompound() && itemStack.getTagCompound().hasKey("biomeID"))
{
return BiomeGenBase.getBiome(itemStack.getTagCompound().getInteger("biomeID"));
return Biome.getBiome(itemStack.getTagCompound().getInteger("biomeID"));
}
return null;
}
@Override
public void addInformation(ItemStack itemStack, EntityPlayer player, List infoList, boolean advancedItemTooltips) {
BiomeGenBase biome = this.getBiome(itemStack);
Biome biome = this.getBiome(itemStack);
if (biome != null) {
infoList.add(biome.getBiomeName());
}

View File

@ -8,6 +8,8 @@
package biomesoplenty.common.item;
import java.util.List;
import biomesoplenty.common.util.biome.BiomeUtils;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.EntityLivingBase;
@ -24,12 +26,10 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.Biome;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import java.util.List;
public class ItemBiomeFinder extends Item
{
@ -111,7 +111,7 @@ public class ItemBiomeFinder extends Item
{
return new ActionResult<ItemStack>(EnumActionResult.FAIL, stack);
}
BiomeGenBase biomeToFind = BiomeGenBase.getBiome(nbt.getInteger("biomeIDToFind")); // returns ocean if biomeIDToFind is out of bounds
Biome biomeToFind = Biome.getBiome(nbt.getInteger("biomeIDToFind")); // returns ocean if biomeIDToFind is out of bounds
// both client and server set the 'searching' tag - client to update the rendering, server so it can't be used again too quickly
writeNBTSearching(nbt, world);
@ -189,7 +189,7 @@ public class ItemBiomeFinder extends Item
NBTTagCompound nbt = itemStack.getTagCompound();
if (nbt.hasKey("biomeIDToFind"))
{
BiomeGenBase biomeToFind = BiomeGenBase.getBiome(nbt.getInteger("biomeIDToFind")); // returns ocean if biomeIDToFind is out of bounds
Biome biomeToFind = Biome.getBiome(nbt.getInteger("biomeIDToFind")); // returns ocean if biomeIDToFind is out of bounds
infoList.add(biomeToFind.getBiomeName());
}
}

View File

@ -59,7 +59,7 @@ public class ItemDartBlower extends Item
// there is a dart available to blow - blow it.
EntityDart entityDart = new EntityDart(world, player);
entityDart.setDartType(bestAvailableDartType);
entityDart.func_184547_a(player, player.rotationPitch, player.rotationYaw, 0.0F, 3.0F, 1.0F);
entityDart.setAim(player, player.rotationPitch, player.rotationYaw, 0.0F, 3.0F, 1.0F);
if (!isCreative)
{
stack.damageItem(1, player);

View File

@ -15,7 +15,11 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.*;
import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.IStringSerializable;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.RayTraceResult;

View File

@ -8,21 +8,24 @@
package biomesoplenty.common.util.biome;
import java.util.List;
import javax.annotation.Nullable;
import org.apache.commons.lang3.tuple.Pair;
import com.google.common.base.Function;
import com.google.common.collect.Lists;
import biomesoplenty.common.world.BOPWorldSettings;
import biomesoplenty.common.world.WorldTypeBOP;
import biomesoplenty.core.BiomesOPlenty;
import com.google.common.base.Function;
import com.google.common.collect.Lists;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.BiomeProvider;
import net.minecraft.world.gen.ChunkProviderSettings;
import org.apache.commons.lang3.tuple.Pair;
import javax.annotation.Nullable;
import java.util.List;
public class BiomeUtils
{
@ -41,32 +44,32 @@ public class BiomeUtils
/**Use getRegistryName() instead**/
@Deprecated
public static ResourceLocation getLocForBiome(BiomeGenBase biome)
public static ResourceLocation getLocForBiome(Biome biome)
{
return BiomeGenBase.REGISTRY.getNameForObject(biome);
return Biome.REGISTRY.getNameForObject(biome);
}
public static BiomeGenBase getBiomeForLoc(ResourceLocation location)
public static Biome getBiomeForLoc(ResourceLocation location)
{
return BiomeGenBase.REGISTRY.getObject(location);
return Biome.REGISTRY.getObject(location);
}
private static final Function<ResourceLocation, Pair<ResourceLocation, BiomeGenBase>> MAPPING_FOR_LOCATION = new Function<ResourceLocation, Pair<ResourceLocation, BiomeGenBase>>()
private static final Function<ResourceLocation, Pair<ResourceLocation, Biome>> MAPPING_FOR_LOCATION = new Function<ResourceLocation, Pair<ResourceLocation, Biome>>()
{
@Nullable
@Override
public Pair<ResourceLocation, BiomeGenBase> apply(@Nullable ResourceLocation input)
public Pair<ResourceLocation, Biome> apply(@Nullable ResourceLocation input)
{
return Pair.of(input, BiomeGenBase.REGISTRY.getObject(input));
return Pair.of(input, Biome.REGISTRY.getObject(input));
}
};
public static List<BiomeGenBase> getRegisteredBiomes()
public static List<Biome> getRegisteredBiomes()
{
return Lists.newArrayList(BiomeGenBase.REGISTRY.iterator());
return Lists.newArrayList(Biome.REGISTRY.iterator());
}
public static BlockPos spiralOutwardsLookingForBiome(World world, BiomeGenBase biomeToFind, double startX, double startZ)
public static BlockPos spiralOutwardsLookingForBiome(World world, Biome biomeToFind, double startX, double startZ)
{
int sampleSpacing = 4 << BiomeUtils.getBiomeSize(world);
int maxDist = sampleSpacing * 100;
@ -75,7 +78,7 @@ public class BiomeUtils
// sample points in an archimedean spiral starting from startX,startY each one sampleSpace apart
// stop when the specified biome is found (and return the position it was found at) or when we reach maxDistance (and return null)
public static BlockPos spiralOutwardsLookingForBiome(World world, BiomeGenBase biomeToFind, double startX, double startZ, int maxDist, int sampleSpace)
public static BlockPos spiralOutwardsLookingForBiome(World world, Biome biomeToFind, double startX, double startZ, int maxDist, int sampleSpace)
{
if (maxDist <= 0 || sampleSpace <= 0) {throw new IllegalArgumentException("maxDist and sampleSpace must be positive");}
@ -95,7 +98,7 @@ public class BiomeUtils
// chunkManager.genBiomes is the first layer returned from initializeAllBiomeGenerators()
// chunkManager.biomeIndexLayer is the second layer returned from initializeAllBiomeGenerators(), it's zoomed twice from genBiomes (>> 2) this one is actual size
// chunkManager.getBiomeGenAt uses biomeIndexLayer to get the biome
BiomeGenBase[] biomesAtSample = chunkManager.getBiomeGenAt(null, (int)x, (int)z, 1, 1, false);
Biome[] biomesAtSample = chunkManager.getBiomeGenAt(null, (int)x, (int)z, 1, 1, false);
if (biomesAtSample[0] == biomeToFind)
{
BiomesOPlenty.logger.info("Found "+biomeToFind.getBiomeName()+" after "+n+" samples, spaced "+sampleSpace+" blocks apart at ("+((int)x)+","+((int)z)+") distance "+((int)dist));

View File

@ -8,13 +8,22 @@
package biomesoplenty.common.util.block;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Sets;
import biomesoplenty.api.block.BOPBlocks;
import biomesoplenty.api.block.BlockQueries;
import biomesoplenty.api.block.IBlockPosQuery;
import biomesoplenty.common.block.ISustainsPlantType;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Sets;
import net.minecraft.block.Block;
import net.minecraft.block.BlockLiquid;
import net.minecraft.block.material.Material;
@ -26,11 +35,6 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.common.EnumPlantType;
import java.lang.reflect.Field;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class BlockQuery
{
// for compound queries

View File

@ -30,7 +30,7 @@ import biomesoplenty.common.world.layer.GenLayerTemperatureNoise;
import biomesoplenty.common.world.layer.GenLayerTemperatureRandom;
import net.minecraft.world.World;
import net.minecraft.world.WorldType;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.BiomeProvider;
import net.minecraft.world.gen.layer.GenLayer;
import net.minecraft.world.gen.layer.GenLayerAddMushroomIsland;
@ -62,7 +62,7 @@ public class BiomeProviderBOP extends BiomeProvider
BOPWorldSettings settings = new BOPWorldSettings(chunkProviderSettings);
// loop through the biomes and apply the settings
for (BiomeGenBase biome : BiomeUtils.getRegisteredBiomes())
for (Biome biome : BiomeUtils.getRegisteredBiomes())
{
if (biome == null) {continue;}
@ -77,7 +77,7 @@ public class BiomeProviderBOP extends BiomeProvider
// set up all the gen layers
GenLayer[] agenlayer = setupBOPGenLayers(seed, settings);
agenlayer = getModdedBiomeGenerators(worldType, seed, agenlayer);
agenlayer = getModdedBiomeerators(worldType, seed, agenlayer);
this.genBiomes = Generators.biomeGenLayer = agenlayer[0];
this.biomeIndexLayer = Generators.biomeIndexLayer = agenlayer[1];
}

View File

@ -8,6 +8,24 @@
package biomesoplenty.common.world;
import static net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.CAVE;
import static net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.MINESHAFT;
import static net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.OCEAN_MONUMENT;
import static net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.RAVINE;
import static net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.SCATTERED_FEATURE;
import static net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.STRONGHOLD;
import static net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.VILLAGE;
import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.ANIMALS;
import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.DUNGEON;
import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.ICE;
import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAKE;
import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAVA;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import biomesoplenty.common.biome.overworld.BOPBiome;
import biomesoplenty.common.util.biome.BiomeUtils;
import net.minecraft.block.BlockFalling;
@ -16,30 +34,30 @@ import net.minecraft.entity.EnumCreatureType;
import net.minecraft.init.Biomes;
import net.minecraft.init.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.ChunkPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.ChunkCoordIntPair;
import net.minecraft.world.World;
import net.minecraft.world.WorldEntitySpawner;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.ChunkPrimer;
import net.minecraft.world.chunk.IChunkGenerator;
import net.minecraft.world.gen.*;
import net.minecraft.world.gen.MapGenBase;
import net.minecraft.world.gen.MapGenCaves;
import net.minecraft.world.gen.MapGenRavine;
import net.minecraft.world.gen.NoiseGeneratorOctaves;
import net.minecraft.world.gen.NoiseGeneratorPerlin;
import net.minecraft.world.gen.feature.WorldGenDungeons;
import net.minecraft.world.gen.feature.WorldGenLakes;
import net.minecraft.world.gen.structure.*;
import net.minecraft.world.gen.structure.MapGenMineshaft;
import net.minecraft.world.gen.structure.MapGenScatteredFeature;
import net.minecraft.world.gen.structure.MapGenStronghold;
import net.minecraft.world.gen.structure.MapGenVillage;
import net.minecraft.world.gen.structure.StructureOceanMonument;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.terraingen.PopulateChunkEvent;
import net.minecraftforge.event.terraingen.TerrainGen;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import static net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.*;
import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.*;
public class ChunkProviderGenerateBOP implements IChunkGenerator
{
@ -66,7 +84,7 @@ public class ChunkProviderGenerateBOP implements IChunkGenerator
private double[] xyzNoiseArrayB;
private double[] stoneNoiseArray;
private final double[] noiseArray;
private Map<BiomeGenBase, TerrainSettings> biomeTerrainSettings;
private Map<Biome, TerrainSettings> biomeTerrainSettings;
public ChunkProviderGenerateBOP(World worldIn, long seed, boolean mapFeaturesEnabled, String chunkProviderSettingsString)
{
@ -102,8 +120,8 @@ public class ChunkProviderGenerateBOP implements IChunkGenerator
this.seaBlockState = Blocks.WATER.getDefaultState();
// store a TerrainSettings object for each biome
this.biomeTerrainSettings = new HashMap<BiomeGenBase, TerrainSettings>();
for (BiomeGenBase biome : BiomeUtils.getRegisteredBiomes())
this.biomeTerrainSettings = new HashMap<Biome, TerrainSettings>();
for (Biome biome : BiomeUtils.getRegisteredBiomes())
{
if (biome == null) {continue;}
this.biomeTerrainSettings.put(biome, (biome instanceof BOPBiome) ? ((BOPBiome)biome).terrainSettings : TerrainSettings.forVanillaBiome(biome));
@ -126,7 +144,7 @@ public class ChunkProviderGenerateBOP implements IChunkGenerator
this.setChunkAirStoneWater(chunkX, chunkZ, chunkprimer);
// hand over to the biomes for them to set bedrock grass and dirt
BiomeGenBase[] biomes = this.worldObj.getBiomeProvider().loadBlockGeneratorData(null, chunkX * 16, chunkZ * 16, 16, 16);
Biome[] biomes = this.worldObj.getBiomeProvider().loadBlockGeneratorData(null, chunkX * 16, chunkZ * 16, 16, 16);
this.replaceBlocksForBiome(chunkX, chunkZ, chunkprimer, biomes);
// add structures
@ -164,7 +182,7 @@ public class ChunkProviderGenerateBOP implements IChunkGenerator
byte[] chunkBiomes = chunk.getBiomeArray();
for (int k = 0; k < chunkBiomes.length; ++k)
{
chunkBiomes[k] = (byte)BiomeGenBase.getIdForBiome(biomes[k]);
chunkBiomes[k] = (byte)Biome.getIdForBiome(biomes[k]);
}
chunk.generateSkylightMap();
return chunk;
@ -279,18 +297,18 @@ public class ChunkProviderGenerateBOP implements IChunkGenerator
// Biomes add their top blocks and filler blocks to the primer here
public void replaceBlocksForBiome(int chunkX, int chunkZ, ChunkPrimer primer, BiomeGenBase[] biomes)
public void replaceBlocksForBiome(int chunkX, int chunkZ, ChunkPrimer primer, Biome[] biomes)
{
if (!net.minecraftforge.event.ForgeEventFactory.onReplaceBiomeBlocks(this, chunkX, chunkZ, primer, this.worldObj)) return;
double d0 = 0.03125D;
this.stoneNoiseArray = this.stoneNoiseGen.func_151599_a(this.stoneNoiseArray, (double)(chunkX * 16), (double)(chunkZ * 16), 16, 16, d0 * 2.0D, d0 * 2.0D, 1.0D);
this.stoneNoiseArray = this.stoneNoiseGen.getRegion(this.stoneNoiseArray, (double)(chunkX * 16), (double)(chunkZ * 16), 16, 16, d0 * 2.0D, d0 * 2.0D, 1.0D);
for (int localX = 0; localX < 16; ++localX)
{
for (int localZ = 0; localZ < 16; ++localZ)
{
BiomeGenBase biome = biomes[localZ + localX * 16];
Biome biome = biomes[localZ + localX * 16];
biome.genTerrainBlocks(this.worldObj, this.rand, primer, chunkX * 16 + localX, chunkZ * 16 + localZ, this.stoneNoiseArray[localZ + localX * 16]);
}
}
@ -315,11 +333,11 @@ public class ChunkProviderGenerateBOP implements IChunkGenerator
}
private TerrainSettings getWeightedTerrainSettings(int localX, int localZ, BiomeGenBase[] biomes)
private TerrainSettings getWeightedTerrainSettings(int localX, int localZ, Biome[] biomes)
{
// Rivers shouldn't be influenced by the neighbors
BiomeGenBase centerBiome = biomes[localX + 2 + (localZ + 2) * 10];
Biome centerBiome = biomes[localX + 2 + (localZ + 2) * 10];
if (centerBiome == Biomes.RIVER || centerBiome == Biomes.FROZEN_RIVER || ((centerBiome instanceof BOPBiome) && ((BOPBiome)centerBiome).noNeighborTerrainInfuence))
{
return this.biomeTerrainSettings.get(centerBiome);
@ -358,7 +376,7 @@ public class ChunkProviderGenerateBOP implements IChunkGenerator
private void populateNoiseArray(int chunkX, int chunkZ)
{
BiomeGenBase[] biomes = this.worldObj.getBiomeProvider().getBiomesForGeneration(null, chunkX * 4 - 2, chunkZ * 4 - 2, 10, 10);
Biome[] biomes = this.worldObj.getBiomeProvider().getBiomesForGeneration(null, chunkX * 4 - 2, chunkZ * 4 - 2, 10, 10);
// values from vanilla
float coordinateScale = 684.412F;
@ -452,14 +470,14 @@ public class ChunkProviderGenerateBOP implements IChunkGenerator
BlockPos blockpos = new BlockPos(x, 0, z);
BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(blockpos.add(16, 0, 16));
Biome Biome = this.worldObj.getBiomeGenForCoords(blockpos.add(16, 0, 16));
this.rand.setSeed(this.worldObj.getSeed());
long l0 = this.rand.nextLong() / 2L * 2L + 1L;
long l1 = this.rand.nextLong() / 2L * 2L + 1L;
this.rand.setSeed((long)chunkX * l0 + (long)chunkZ * l1 ^ this.worldObj.getSeed());
boolean hasVillageGenerated = false;
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(chunkX, chunkZ);
ChunkPos chunkcoordintpair = new ChunkPos(chunkX, chunkZ);
MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(this, worldObj, rand, chunkX, chunkZ, hasVillageGenerated));
@ -489,7 +507,7 @@ public class ChunkProviderGenerateBOP implements IChunkGenerator
BlockPos target;
// add water lakes
if (biomegenbase.getRainfall() > 0.01F && biomegenbase != Biomes.DESERT && biomegenbase != Biomes.DESERT_HILLS && this.settings.useWaterLakes && !hasVillageGenerated && this.rand.nextInt(this.settings.waterLakeChance) == 0 && TerrainGen.populate(this, worldObj, rand, chunkX, chunkZ, hasVillageGenerated, LAKE))
if (Biome.getRainfall() > 0.01F && Biome != Biomes.DESERT && Biome != Biomes.DESERT_HILLS && this.settings.useWaterLakes && !hasVillageGenerated && this.rand.nextInt(this.settings.waterLakeChance) == 0 && TerrainGen.populate(this, worldObj, rand, chunkX, chunkZ, hasVillageGenerated, LAKE))
{
target = decorateStart.add(this.rand.nextInt(16), this.rand.nextInt(256), this.rand.nextInt(16));
(new WorldGenLakes(Blocks.WATER)).generate(this.worldObj, this.rand, target);
@ -516,12 +534,12 @@ public class ChunkProviderGenerateBOP implements IChunkGenerator
}
// hand over to the biome to decorate itself
biomegenbase.decorate(this.worldObj, this.rand, new BlockPos(x, 0, z));
Biome.decorate(this.worldObj, this.rand, new BlockPos(x, 0, z));
// add animals
if (TerrainGen.populate(this, worldObj, rand, chunkX, chunkZ, hasVillageGenerated, ANIMALS))
{
WorldEntitySpawner.performWorldGenSpawning(this.worldObj, biomegenbase, x + 8, z + 8, 16, 16, this.rand);
WorldEntitySpawner.performWorldGenSpawning(this.worldObj, Biome, x + 8, z + 8, 16, 16, this.rand);
}
// add ice and snow
@ -532,7 +550,7 @@ public class ChunkProviderGenerateBOP implements IChunkGenerator
for (int j = 0; j < 16; ++j)
{
target = this.worldObj.getPrecipitationHeight(decorateStart.add(i, 0, j));
BiomeGenBase biome = this.worldObj.getBiomeGenForCoords(target);
Biome biome = this.worldObj.getBiomeGenForCoords(target);
// if it's cold enough for ice, and there's exposed water, then freeze it
if (this.worldObj.canBlockFreezeWater(target.down()))
{
@ -559,20 +577,20 @@ public class ChunkProviderGenerateBOP implements IChunkGenerator
if (this.settings.useMonuments && this.mapFeaturesEnabled && chunkIn.getInhabitedTime() < 3600L)
{
flag |= this.oceanMonumentGenerator.generateStructure(this.worldObj, this.rand, new ChunkCoordIntPair(x, z));
flag |= this.oceanMonumentGenerator.generateStructure(this.worldObj, this.rand, new ChunkPos(x, z));
}
return flag;
}
@Override
public List<BiomeGenBase.SpawnListEntry> getPossibleCreatures(EnumCreatureType creatureType, BlockPos pos)
public List<Biome.SpawnListEntry> getPossibleCreatures(EnumCreatureType creatureType, BlockPos pos)
{
BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(pos);
Biome Biome = this.worldObj.getBiomeGenForCoords(pos);
if (this.mapFeaturesEnabled)
{
if (creatureType == EnumCreatureType.MONSTER && this.scatteredFeatureGenerator.func_175798_a(pos))
if (creatureType == EnumCreatureType.MONSTER && this.scatteredFeatureGenerator.isSwampHut(pos))
{
return this.scatteredFeatureGenerator.getScatteredFeatureSpawnList();
}
@ -583,7 +601,7 @@ public class ChunkProviderGenerateBOP implements IChunkGenerator
}
}
return biomegenbase.getSpawnableList(creatureType);
return Biome.getSpawnableList(creatureType);
}
@Override

View File

@ -9,7 +9,7 @@
package biomesoplenty.common.world;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.Biome;
public class TerrainSettings
{
@ -99,7 +99,7 @@ public class TerrainSettings
return this;
}
public static TerrainSettings forVanillaBiome(BiomeGenBase biome)
public static TerrainSettings forVanillaBiome(Biome biome)
{
// Transform vanilla height parameters into equivalent BOP terrain parameters
// Note they're named appallingly - minHeight and maxHeight in the vanilla biomes should be called baseHeight and scale

View File

@ -8,6 +8,8 @@
package biomesoplenty.common.world.generator;
import java.util.Random;
import biomesoplenty.api.block.BlockQueries;
import biomesoplenty.api.block.IBlockPosQuery;
import biomesoplenty.api.config.IConfigObj;
@ -24,8 +26,6 @@ import net.minecraft.init.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import java.util.Random;
public class GeneratorBigMushroom extends BOPGeneratorBase
{

View File

@ -19,7 +19,6 @@ import biomesoplenty.common.util.block.BlockQuery.BlockQueryMaterial;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

View File

@ -1,5 +1,7 @@
package biomesoplenty.common.world.generator;
import java.util.Random;
import biomesoplenty.api.block.BlockQueries;
import biomesoplenty.api.block.IBlockPosQuery;
import biomesoplenty.api.config.IConfigObj;
@ -12,8 +14,6 @@ import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import java.util.Random;
public class GeneratorCrystals extends GeneratorReplacing
{
public static class Builder extends GeneratorReplacing.InnerBuilder<Builder, GeneratorCrystals> implements IGeneratorBuilder<GeneratorCrystals>

View File

@ -8,6 +8,8 @@
package biomesoplenty.common.world.generator;
import java.util.Random;
import biomesoplenty.api.block.BOPBlocks;
import biomesoplenty.api.block.BlockQueries;
import biomesoplenty.api.block.IBlockPosQuery;
@ -26,8 +28,6 @@ import net.minecraft.init.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import java.util.Random;
public class GeneratorDoubleFlora extends GeneratorReplacing
{

View File

@ -8,6 +8,8 @@
package biomesoplenty.common.world.generator;
import java.util.Random;
import biomesoplenty.api.block.IBlockPosQuery;
import biomesoplenty.api.config.IConfigObj;
import biomesoplenty.api.generation.BOPGeneratorBase;
@ -23,9 +25,7 @@ import net.minecraft.init.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.EnumSkyBlock;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import java.util.Random;
import net.minecraft.world.biome.Biome;
public class GeneratorLakes extends BOPGeneratorBase
{
@ -51,7 +51,7 @@ public class GeneratorLakes extends BOPGeneratorBase
public Builder lineWith(IBlockState a) {this.lineWith = a; return this.self();}
public Builder lineWith(Block a) {this.lineWith = a.getDefaultState(); return this.self();}
public Builder waterLakeForBiome(BiomeGenBase a)
public Builder waterLakeForBiome(Biome a)
{
this.liquid = Blocks.WATER.getDefaultState();
this.frozenLiquid = Blocks.ICE.getDefaultState();

View File

@ -16,7 +16,6 @@ import biomesoplenty.api.config.IConfigObj;
import biomesoplenty.api.generation.BOPGeneratorBase;
import biomesoplenty.api.generation.GeneratorStage;
import biomesoplenty.api.generation.IGenerator;
import biomesoplenty.api.generation.IGenerator.IGeneratorBuilder;
import biomesoplenty.common.world.GeneratorRegistry;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

View File

@ -8,12 +8,19 @@
package biomesoplenty.common.world.generator.tree;
import java.util.Random;
import org.apache.commons.lang3.tuple.Pair;
import biomesoplenty.api.block.BlockQueries;
import biomesoplenty.api.block.IBlockPosQuery;
import biomesoplenty.api.config.IConfigObj;
import biomesoplenty.common.util.biome.GeneratorUtils;
import biomesoplenty.common.util.block.BlockQuery;
import biomesoplenty.common.util.block.BlockQuery.*;
import biomesoplenty.common.util.block.BlockQuery.BlockQueryBlock;
import biomesoplenty.common.util.block.BlockQuery.BlockQueryMaterial;
import biomesoplenty.common.util.block.BlockQuery.BlockQueryParseException;
import biomesoplenty.common.util.block.BlockQuery.BlockQueryState;
import net.minecraft.block.Block;
import net.minecraft.block.BlockCocoa;
import net.minecraft.block.BlockSapling;
@ -24,9 +31,6 @@ import net.minecraft.init.Blocks;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import org.apache.commons.lang3.tuple.Pair;
import java.util.Random;
public class GeneratorBasicTree extends GeneratorTreeBase
{

View File

@ -8,13 +8,18 @@
package biomesoplenty.common.world.generator.tree;
import java.util.List;
import java.util.Random;
import org.apache.commons.lang3.tuple.Pair;
import com.google.common.collect.Lists;
import biomesoplenty.api.block.BlockQueries;
import biomesoplenty.api.block.IBlockPosQuery;
import biomesoplenty.api.config.IConfigObj;
import biomesoplenty.common.util.biome.GeneratorUtils;
import biomesoplenty.common.util.block.BlockQuery.BlockQueryMaterial;
import com.google.common.collect.Lists;
import net.minecraft.block.BlockLeaves;
import net.minecraft.block.BlockLog;
import net.minecraft.block.BlockSapling;
@ -25,10 +30,6 @@ import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
import org.apache.commons.lang3.tuple.Pair;
import java.util.List;
import java.util.Random;
/*This class is heavily based on https://gist.github.com/grum/62cfdec0537e8db24eb3#file-bigtreefeature-java
additional information has been added from http://pastebin.com/XBLdGqXQ. This class has been cross-checked

View File

@ -18,7 +18,6 @@ import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
public class GeneratorPalmTree extends GeneratorTreeBase

View File

@ -2,7 +2,7 @@ package biomesoplenty.common.world.layer;
import biomesoplenty.api.generation.BOPGenLayer;
import net.minecraft.init.Biomes;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.layer.GenLayer;
import net.minecraft.world.gen.layer.IntCache;
@ -40,7 +40,7 @@ public class GenLayerBOPRiver extends BOPGenLayer
}
else
{
out[x + y * areaWidth] = BiomeGenBase.getIdForBiome(Biomes.RIVER);
out[x + y * areaWidth] = Biome.getIdForBiome(Biomes.RIVER);
}
}
}

View File

@ -13,7 +13,7 @@ import biomesoplenty.api.generation.BOPGenLayer;
import biomesoplenty.common.init.ModBiomes;
import biomesoplenty.common.world.BOPWorldSettings;
import net.minecraft.init.Biomes;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.layer.GenLayer;
import net.minecraft.world.gen.layer.IntCache;
import net.minecraftforge.common.BiomeManager.BiomeType;
@ -54,22 +54,22 @@ public class GenLayerBiomeBOP extends BOPGenLayer
BOPClimates climate = BOPClimates.lookup(climateValues[index]);
// At this point, oceans and land have been assigned, and so have mushroom islands
if (landSeaVal == BiomeGenBase.getIdForBiome(Biomes.DEEP_OCEAN))
if (landSeaVal == Biome.getIdForBiome(Biomes.DEEP_OCEAN))
{
out[index] = BiomeGenBase.getIdForBiome(climate.getRandomOceanBiome(this, true));
out[index] = Biome.getIdForBiome(climate.getRandomOceanBiome(this, true));
}
else if ((landSeaVal == BiomeGenBase.getIdForBiome(Biomes.MUSHROOM_ISLAND) || ModBiomes.islandBiomesMap.containsKey(landSeaVal)) && climate.biomeType != BiomeType.ICY)
else if ((landSeaVal == Biome.getIdForBiome(Biomes.MUSHROOM_ISLAND) || ModBiomes.islandBiomesMap.containsKey(landSeaVal)) && climate.biomeType != BiomeType.ICY)
{
// keep islands, unless it's in an icy climate in which case, replace
out[index] = landSeaVal;
}
else if (landSeaVal == 0)
{
out[index] = BiomeGenBase.getIdForBiome(climate.getRandomOceanBiome(this, false));
out[index] = Biome.getIdForBiome(climate.getRandomOceanBiome(this, false));
}
else
{
out[index] = BiomeGenBase.getIdForBiome(climate.getRandomLandBiome(this));
out[index] = Biome.getIdForBiome(climate.getRandomLandBiome(this));
}
}
}

View File

@ -13,7 +13,7 @@ import com.google.common.base.Optional;
import biomesoplenty.api.biome.BOPBiomes;
import biomesoplenty.api.generation.BOPGenLayer;
import net.minecraft.init.Biomes;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.layer.GenLayer;
import net.minecraft.world.gen.layer.IntCache;
@ -46,21 +46,21 @@ public class GenLayerBiomeEdgeBOP extends BOPGenLayer
if (this.replaceBiomeEdge(parentVals, out, x, y, areaWidth, biomeId, BOPBiomes.wasteland, Optional.of(Biomes.DESERT))) {continue;}
// line extreme hills with extreme hills edge
if (this.replaceBiomeEdgeIfNecessary(parentVals, out, x, y, areaWidth, biomeId, BiomeGenBase.getIdForBiome(Biomes.EXTREME_HILLS), BiomeGenBase.getIdForBiome(Biomes.EXTREME_HILLS_EDGE))) {continue;}
if (this.replaceBiomeEdgeIfNecessary(parentVals, out, x, y, areaWidth, biomeId, Biome.getIdForBiome(Biomes.EXTREME_HILLS), Biome.getIdForBiome(Biomes.EXTREME_HILLS_EDGE))) {continue;}
// line mesa plateau with mesa
if (this.replaceBiomeEdge(parentVals, out, x, y, areaWidth, biomeId, BiomeGenBase.getIdForBiome(Biomes.MESA_ROCK), BiomeGenBase.getIdForBiome(Biomes.MESA))) {continue;}
if (this.replaceBiomeEdge(parentVals, out, x, y, areaWidth, biomeId, BiomeGenBase.getIdForBiome(Biomes.MESA_CLEAR_ROCK), BiomeGenBase.getIdForBiome(Biomes.MESA))) {continue;}
if (this.replaceBiomeEdge(parentVals, out, x, y, areaWidth, biomeId, Biome.getIdForBiome(Biomes.MESA_ROCK), Biome.getIdForBiome(Biomes.MESA))) {continue;}
if (this.replaceBiomeEdge(parentVals, out, x, y, areaWidth, biomeId, Biome.getIdForBiome(Biomes.MESA_CLEAR_ROCK), Biome.getIdForBiome(Biomes.MESA))) {continue;}
// line mega taiga with ordinary taiga
if (this.replaceBiomeEdge(parentVals, out, x, y, areaWidth, biomeId, BiomeGenBase.getIdForBiome(Biomes.REDWOOD_TAIGA), BiomeGenBase.getIdForBiome(Biomes.TAIGA))) {continue;}
if (this.replaceBiomeEdge(parentVals, out, x, y, areaWidth, biomeId, Biome.getIdForBiome(Biomes.REDWOOD_TAIGA), Biome.getIdForBiome(Biomes.TAIGA))) {continue;}
int northBiomeId;
int eastBiomeId;
int westBiomeId;
int southBiomeId;
if (biomeId == BiomeGenBase.getIdForBiome(Biomes.DESERT))
if (biomeId == Biome.getIdForBiome(Biomes.DESERT))
{
// if desert is next to ice plains turn it into extremeGillsPlus (separate the ice and desert with a big mountain)
northBiomeId = parentVals[x + 1 + (y + 1 - 1) * (areaWidth + 2)];
@ -68,16 +68,16 @@ public class GenLayerBiomeEdgeBOP extends BOPGenLayer
westBiomeId = parentVals[x + 1 - 1 + (y + 1) * (areaWidth + 2)];
southBiomeId = parentVals[x + 1 + (y + 1 + 1) * (areaWidth + 2)];
if (northBiomeId != BiomeGenBase.getIdForBiome(Biomes.ICE_PLAINS) && eastBiomeId != BiomeGenBase.getIdForBiome(Biomes.ICE_PLAINS) && westBiomeId != BiomeGenBase.getIdForBiome(Biomes.ICE_PLAINS) && southBiomeId != BiomeGenBase.getIdForBiome(Biomes.ICE_PLAINS))
if (northBiomeId != Biome.getIdForBiome(Biomes.ICE_PLAINS) && eastBiomeId != Biome.getIdForBiome(Biomes.ICE_PLAINS) && westBiomeId != Biome.getIdForBiome(Biomes.ICE_PLAINS) && southBiomeId != Biome.getIdForBiome(Biomes.ICE_PLAINS))
{
out[x + y * areaWidth] = biomeId;
}
else
{
out[x + y * areaWidth] = BiomeGenBase.getIdForBiome(Biomes.EXTREME_HILLS_WITH_TREES);
out[x + y * areaWidth] = Biome.getIdForBiome(Biomes.EXTREME_HILLS_WITH_TREES);
}
}
else if (biomeId == BiomeGenBase.getIdForBiome(Biomes.SWAMPLAND))
else if (biomeId == Biome.getIdForBiome(Biomes.SWAMPLAND))
{
// if swamp is next to desert, cold taiga or ice planes, turn it into plains
// if swamp is next to jungle, turn it into jungle edge
@ -86,20 +86,20 @@ public class GenLayerBiomeEdgeBOP extends BOPGenLayer
westBiomeId = parentVals[x + 1 - 1 + (y + 1) * (areaWidth + 2)];
southBiomeId = parentVals[x + 1 + (y + 1 + 1) * (areaWidth + 2)];
if (northBiomeId != BiomeGenBase.getIdForBiome(Biomes.DESERT) && eastBiomeId != BiomeGenBase.getIdForBiome(Biomes.DESERT) && westBiomeId != BiomeGenBase.getIdForBiome(Biomes.DESERT) && southBiomeId != BiomeGenBase.getIdForBiome(Biomes.DESERT) && northBiomeId != BiomeGenBase.getIdForBiome(Biomes.COLD_TAIGA) && eastBiomeId != BiomeGenBase.getIdForBiome(Biomes.COLD_TAIGA) && westBiomeId != BiomeGenBase.getIdForBiome(Biomes.COLD_TAIGA) && southBiomeId != BiomeGenBase.getIdForBiome(Biomes.COLD_TAIGA) && northBiomeId != BiomeGenBase.getIdForBiome(Biomes.ICE_PLAINS) && eastBiomeId != BiomeGenBase.getIdForBiome(Biomes.ICE_PLAINS) && westBiomeId != BiomeGenBase.getIdForBiome(Biomes.ICE_PLAINS) && southBiomeId != BiomeGenBase.getIdForBiome(Biomes.ICE_PLAINS))
if (northBiomeId != Biome.getIdForBiome(Biomes.DESERT) && eastBiomeId != Biome.getIdForBiome(Biomes.DESERT) && westBiomeId != Biome.getIdForBiome(Biomes.DESERT) && southBiomeId != Biome.getIdForBiome(Biomes.DESERT) && northBiomeId != Biome.getIdForBiome(Biomes.COLD_TAIGA) && eastBiomeId != Biome.getIdForBiome(Biomes.COLD_TAIGA) && westBiomeId != Biome.getIdForBiome(Biomes.COLD_TAIGA) && southBiomeId != Biome.getIdForBiome(Biomes.COLD_TAIGA) && northBiomeId != Biome.getIdForBiome(Biomes.ICE_PLAINS) && eastBiomeId != Biome.getIdForBiome(Biomes.ICE_PLAINS) && westBiomeId != Biome.getIdForBiome(Biomes.ICE_PLAINS) && southBiomeId != Biome.getIdForBiome(Biomes.ICE_PLAINS))
{
if (northBiomeId != BiomeGenBase.getIdForBiome(Biomes.JUNGLE) && southBiomeId != BiomeGenBase.getIdForBiome(Biomes.JUNGLE) && eastBiomeId != BiomeGenBase.getIdForBiome(Biomes.JUNGLE) && westBiomeId != BiomeGenBase.getIdForBiome(Biomes.JUNGLE))
if (northBiomeId != Biome.getIdForBiome(Biomes.JUNGLE) && southBiomeId != Biome.getIdForBiome(Biomes.JUNGLE) && eastBiomeId != Biome.getIdForBiome(Biomes.JUNGLE) && westBiomeId != Biome.getIdForBiome(Biomes.JUNGLE))
{
out[x + y * areaWidth] = biomeId;
}
else
{
out[x + y * areaWidth] = BiomeGenBase.getIdForBiome(Biomes.JUNGLE_EDGE);
out[x + y * areaWidth] = Biome.getIdForBiome(Biomes.JUNGLE_EDGE);
}
}
else
{
out[x + y * areaWidth] = BiomeGenBase.getIdForBiome(Biomes.PLAINS);
out[x + y * areaWidth] = Biome.getIdForBiome(Biomes.PLAINS);
}
}
else
@ -138,9 +138,9 @@ public class GenLayerBiomeEdgeBOP extends BOPGenLayer
}
}
private boolean replaceBiomeEdge(int[] parentVals, int[] out, int x, int y, int areaWidth, int biomeId, Optional<BiomeGenBase> fromBiome, Optional<BiomeGenBase> toBiome)
private boolean replaceBiomeEdge(int[] parentVals, int[] out, int x, int y, int areaWidth, int biomeId, Optional<Biome> fromBiome, Optional<Biome> toBiome)
{
return fromBiome.isPresent() && toBiome.isPresent() && this.replaceBiomeEdge(parentVals, out, x, y, areaWidth, biomeId, BiomeGenBase.getIdForBiome(fromBiome.get()), BiomeGenBase.getIdForBiome(toBiome.get()));
return fromBiome.isPresent() && toBiome.isPresent() && this.replaceBiomeEdge(parentVals, out, x, y, areaWidth, biomeId, Biome.getIdForBiome(fromBiome.get()), Biome.getIdForBiome(toBiome.get()));
}
private boolean replaceBiomeEdge(int[] parentVals, int[] out, int x, int y, int areaWidth, int biomeId, int fromBiomeId, int toBiomeId)
@ -177,14 +177,14 @@ public class GenLayerBiomeEdgeBOP extends BOPGenLayer
}
else
{
BiomeGenBase biomegenbaseA = BiomeGenBase.getBiome(biomeA);
BiomeGenBase biomegenbaseB = BiomeGenBase.getBiome(biomeB);
Biome BiomeA = Biome.getBiome(biomeA);
Biome BiomeB = Biome.getBiome(biomeB);
if (biomegenbaseA != null && biomegenbaseB != null)
if (BiomeA != null && BiomeB != null)
{
BiomeGenBase.TempCategory tempcategory = biomegenbaseA.getTempCategory();
BiomeGenBase.TempCategory tempcategory1 = biomegenbaseB.getTempCategory();
return tempcategory == tempcategory1 || tempcategory == BiomeGenBase.TempCategory.MEDIUM || tempcategory1 == BiomeGenBase.TempCategory.MEDIUM;
Biome.TempCategory tempcategory = BiomeA.getTempCategory();
Biome.TempCategory tempcategory1 = BiomeB.getTempCategory();
return tempcategory == tempcategory1 || tempcategory == Biome.TempCategory.MEDIUM || tempcategory1 == Biome.TempCategory.MEDIUM;
}
else
{

View File

@ -11,7 +11,7 @@ package biomesoplenty.common.world.layer;
import biomesoplenty.api.enums.BOPClimates;
import biomesoplenty.api.generation.BOPGenLayer;
import net.minecraft.init.Biomes;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.layer.GenLayer;
import net.minecraft.world.gen.layer.IntCache;
@ -44,7 +44,7 @@ public class GenLayerBiomeIslands extends BOPGenLayer
this.initChunkSeed((long)(x + areaX), (long)(z + areaY));
// if it's an ocean, there's a chance of creating an island here
if ((biomeID == BiomeGenBase.getIdForBiome(Biomes.OCEAN) || biomeID == BiomeGenBase.getIdForBiome(Biomes.DEEP_OCEAN)) && (this.nextInt(this.islandChance) == 0))
if ((biomeID == Biome.getIdForBiome(Biomes.OCEAN) || biomeID == Biome.getIdForBiome(Biomes.DEEP_OCEAN)) && (this.nextInt(this.islandChance) == 0))
{
// check that the tile is surrounded by ocean
int biomeNorth = biomeIds[x + 1 + (z + 1 - 1) * (areaWidth + 2)];
@ -52,14 +52,14 @@ public class GenLayerBiomeIslands extends BOPGenLayer
int biomeWest = biomeIds[x + 1 - 1 + (z + 1) * (areaWidth + 2)];
int biomeSouth = biomeIds[x + 1 + (z + 1 + 1) * (areaWidth + 2)];
if (
(biomeNorth == BiomeGenBase.getIdForBiome(Biomes.OCEAN) || biomeNorth == BiomeGenBase.getIdForBiome(Biomes.DEEP_OCEAN)) &&
(biomeEast == BiomeGenBase.getIdForBiome(Biomes.OCEAN) || biomeEast == BiomeGenBase.getIdForBiome(Biomes.DEEP_OCEAN)) &&
(biomeWest == BiomeGenBase.getIdForBiome(Biomes.OCEAN) || biomeWest == BiomeGenBase.getIdForBiome(Biomes.DEEP_OCEAN)) &&
(biomeSouth == BiomeGenBase.getIdForBiome(Biomes.OCEAN) || biomeSouth == BiomeGenBase.getIdForBiome(Biomes.DEEP_OCEAN))
(biomeNorth == Biome.getIdForBiome(Biomes.OCEAN) || biomeNorth == Biome.getIdForBiome(Biomes.DEEP_OCEAN)) &&
(biomeEast == Biome.getIdForBiome(Biomes.OCEAN) || biomeEast == Biome.getIdForBiome(Biomes.DEEP_OCEAN)) &&
(biomeWest == Biome.getIdForBiome(Biomes.OCEAN) || biomeWest == Biome.getIdForBiome(Biomes.DEEP_OCEAN)) &&
(biomeSouth == Biome.getIdForBiome(Biomes.OCEAN) || biomeSouth == Biome.getIdForBiome(Biomes.DEEP_OCEAN))
)
{
int climateVal = climateVals[x + z * areaWidth];
out[x + z * areaWidth] = BiomeGenBase.getIdForBiome(BOPClimates.lookup(climateVal).getRandomLandBiome(this));
out[x + z * areaWidth] = Biome.getIdForBiome(BOPClimates.lookup(climateVal).getRandomLandBiome(this));
}
else
{

View File

@ -12,7 +12,7 @@ import biomesoplenty.api.biome.BOPBiomes;
import biomesoplenty.api.generation.BOPGenLayer;
import biomesoplenty.common.biome.overworld.BOPBiome;
import net.minecraft.init.Biomes;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.layer.GenLayer;
import net.minecraft.world.gen.layer.IntCache;
@ -45,21 +45,21 @@ public class GenLayerRiverMixBOP extends BOPGenLayer
for (int i = 0; i < areaWidth * areaHeight; ++i)
{
if (biomeIds[i] != BiomeGenBase.getIdForBiome(Biomes.FROZEN_OCEAN) && biomeIds[i] != BiomeGenBase.getIdForBiome(Biomes.OCEAN) && biomeIds[i] != BiomeGenBase.getIdForBiome(Biomes.DEEP_OCEAN) && biomeSupportsRivers(biomeIds[i]))
if (biomeIds[i] != Biome.getIdForBiome(Biomes.FROZEN_OCEAN) && biomeIds[i] != Biome.getIdForBiome(Biomes.OCEAN) && biomeIds[i] != Biome.getIdForBiome(Biomes.DEEP_OCEAN) && biomeSupportsRivers(biomeIds[i]))
{
if (riverValues[i] == BiomeGenBase.getIdForBiome(Biomes.RIVER))
if (riverValues[i] == Biome.getIdForBiome(Biomes.RIVER))
{
if (biomeIds[i] == BiomeGenBase.getIdForBiome(Biomes.ICE_PLAINS) || (BOPBiomes.snowy_forest.isPresent() && biomeIds[i] == BiomeGenBase.getIdForBiome(BOPBiomes.snowy_forest.get())) || (BOPBiomes.alps.isPresent() && biomeIds[i] == BiomeGenBase.getIdForBiome(BOPBiomes.alps.get())))
if (biomeIds[i] == Biome.getIdForBiome(Biomes.ICE_PLAINS) || (BOPBiomes.snowy_forest.isPresent() && biomeIds[i] == Biome.getIdForBiome(BOPBiomes.snowy_forest.get())) || (BOPBiomes.alps.isPresent() && biomeIds[i] == Biome.getIdForBiome(BOPBiomes.alps.get())))
{
out[i] = BiomeGenBase.getIdForBiome(Biomes.FROZEN_RIVER);
out[i] = Biome.getIdForBiome(Biomes.FROZEN_RIVER);
}
else if (biomeIds[i] != BiomeGenBase.getIdForBiome(Biomes.MUSHROOM_ISLAND) && biomeIds[i] != BiomeGenBase.getIdForBiome(Biomes.MUSHROOM_ISLAND_SHORE))
else if (biomeIds[i] != Biome.getIdForBiome(Biomes.MUSHROOM_ISLAND) && biomeIds[i] != Biome.getIdForBiome(Biomes.MUSHROOM_ISLAND_SHORE))
{
out[i] = riverValues[i] & 255;
}
else
{
out[i] = BiomeGenBase.getIdForBiome(Biomes.MUSHROOM_ISLAND_SHORE);
out[i] = Biome.getIdForBiome(Biomes.MUSHROOM_ISLAND_SHORE);
}
}
else
@ -78,7 +78,7 @@ public class GenLayerRiverMixBOP extends BOPGenLayer
private boolean biomeSupportsRivers(int biomeId)
{
BiomeGenBase biome = BiomeGenBase.getBiome(biomeId);
Biome biome = Biome.getBiome(biomeId);
if (biome != null && biome instanceof BOPBiome)
{

View File

@ -14,9 +14,9 @@ import biomesoplenty.api.biome.IExtendedBiome;
import biomesoplenty.api.generation.BOPGenLayer;
import biomesoplenty.common.util.biome.BiomeUtils;
import net.minecraft.init.Biomes;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.BiomeGenJungle;
import net.minecraft.world.biome.BiomeGenMesa;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.BiomeJungle;
import net.minecraft.world.biome.BiomeMesa;
import net.minecraft.world.gen.layer.GenLayer;
import net.minecraft.world.gen.layer.IntCache;
@ -41,13 +41,13 @@ public class GenLayerShoreBOP extends BOPGenLayer
this.initChunkSeed((long)(x + areaX), (long)(z + areaY));
//The biome we're going to attempt to put a beach beside
int biomeId = biomeIds[x + 1 + (z + 1) * (areaWidth + 2)];
BiomeGenBase biome = BiomeGenBase.getBiome(biomeId);
Biome biome = Biome.getBiome(biomeId);
if (biomeId == BiomeGenBase.getIdForBiome(Biomes.MUSHROOM_ISLAND))
if (biomeId == Biome.getIdForBiome(Biomes.MUSHROOM_ISLAND))
{
setBiomeWithAdjacent(biomeIds, out, x, z, areaWidth, biomeId, BiomeGenBase.getIdForBiome(Biomes.MUSHROOM_ISLAND_SHORE), OCEAN_PREDICATE);
setBiomeWithAdjacent(biomeIds, out, x, z, areaWidth, biomeId, Biome.getIdForBiome(Biomes.MUSHROOM_ISLAND_SHORE), OCEAN_PREDICATE);
}
else if (biome != null && biome.getBiomeClass() == BiomeGenJungle.class)
else if (biome != null && biome.getBiomeClass() == BiomeJungle.class)
{
int biomeNorth = biomeIds[x + 1 + (z + 1 - 1) * (areaWidth + 2)];
int biomeEast = biomeIds[x + 1 + 1 + (z + 1) * (areaWidth + 2)];
@ -57,36 +57,36 @@ public class GenLayerShoreBOP extends BOPGenLayer
//Ensure the biomes surrounding the jungle are all suitable before generating a beach
if (JUNGLE_BORDER_PREDICATE.apply(biomeNorth) && JUNGLE_BORDER_PREDICATE.apply(biomeEast) && JUNGLE_BORDER_PREDICATE.apply(biomeWest) && JUNGLE_BORDER_PREDICATE.apply(biomeSouth))
{
setBiomeWithAdjacent(biomeIds, out, x, z, areaWidth, biomeId, BiomeGenBase.getIdForBiome(Biomes.BEACH), OCEANIC_PREDICATE);
setBiomeWithAdjacent(biomeIds, out, x, z, areaWidth, biomeId, Biome.getIdForBiome(Biomes.BEACH), OCEANIC_PREDICATE);
}
else //There is a non-jungle/ocean/taiga/forest next to the jungle, generate an edge biome
{
out[x + z * areaWidth] = BiomeGenBase.getIdForBiome(Biomes.JUNGLE_EDGE);
out[x + z * areaWidth] = Biome.getIdForBiome(Biomes.JUNGLE_EDGE);
}
}
else if (biomeId != BiomeGenBase.getIdForBiome(Biomes.EXTREME_HILLS) && biomeId != BiomeGenBase.getIdForBiome(Biomes.EXTREME_HILLS_WITH_TREES) && biomeId != BiomeGenBase.getIdForBiome(Biomes.EXTREME_HILLS_EDGE))
else if (biomeId != Biome.getIdForBiome(Biomes.EXTREME_HILLS) && biomeId != Biome.getIdForBiome(Biomes.EXTREME_HILLS_WITH_TREES) && biomeId != Biome.getIdForBiome(Biomes.EXTREME_HILLS_EDGE))
{
if (biome != null && biome.isSnowyBiome()) //Snowy biomes should have cold beaches
{
//Frozen ocean should not have a beach
if (isBiomeOceanic(biomeId)) out[x + z * areaWidth] = biomeId;
else
setBiomeWithAdjacent(biomeIds, out, x, z, areaWidth, biomeId, BiomeGenBase.getIdForBiome(Biomes.COLD_BEACH), OCEANIC_PREDICATE);
setBiomeWithAdjacent(biomeIds, out, x, z, areaWidth, biomeId, Biome.getIdForBiome(Biomes.COLD_BEACH), OCEANIC_PREDICATE);
}
else if (biomeId != BiomeGenBase.getIdForBiome(Biomes.MESA) && biomeId != BiomeGenBase.getIdForBiome(Biomes.MESA_ROCK))
else if (biomeId != Biome.getIdForBiome(Biomes.MESA) && biomeId != Biome.getIdForBiome(Biomes.MESA_ROCK))
{
if (biomeId != BiomeGenBase.getIdForBiome(Biomes.OCEAN) && biomeId != BiomeGenBase.getIdForBiome(Biomes.DEEP_OCEAN) && biomeId != BiomeGenBase.getIdForBiome(Biomes.RIVER) && biomeId != BiomeGenBase.getIdForBiome(Biomes.SWAMPLAND))
if (biomeId != Biome.getIdForBiome(Biomes.OCEAN) && biomeId != Biome.getIdForBiome(Biomes.DEEP_OCEAN) && biomeId != Biome.getIdForBiome(Biomes.RIVER) && biomeId != Biome.getIdForBiome(Biomes.SWAMPLAND))
{
//Generate custom beaches for our biomes
if (biome != null && BOPBiomes.REG_INSTANCE.getExtendedBiome(biome) != null)
{
IExtendedBiome extBiome = BOPBiomes.REG_INSTANCE.getExtendedBiome(biome);
BiomeGenBase beachBiome = BiomeUtils.getBiomeForLoc(extBiome.getBeachLocation());
setBiomeWithAdjacent(biomeIds, out, x, z, areaWidth, biomeId, beachBiome == null ? biomeId : BiomeGenBase.getIdForBiome(beachBiome), OCEANIC_PREDICATE);
Biome beachBiome = BiomeUtils.getBiomeForLoc(extBiome.getBeachLocation());
setBiomeWithAdjacent(biomeIds, out, x, z, areaWidth, biomeId, beachBiome == null ? biomeId : Biome.getIdForBiome(beachBiome), OCEANIC_PREDICATE);
}
else
{
setBiomeWithAdjacent(biomeIds, out, x, z, areaWidth, biomeId, BiomeGenBase.getIdForBiome(Biomes.BEACH), OCEANIC_PREDICATE);
setBiomeWithAdjacent(biomeIds, out, x, z, areaWidth, biomeId, Biome.getIdForBiome(Biomes.BEACH), OCEANIC_PREDICATE);
}
}
else //Biome is watery, don't put any beaches next to it
@ -105,7 +105,7 @@ public class GenLayerShoreBOP extends BOPGenLayer
if (!isBiomeOceanic(biomeNorth) && !isBiomeOceanic(biomeEast) && !isBiomeOceanic(biomeWest) && !isBiomeOceanic(biomeSouth))
{
//If at least one of the surrounding biomes is a non-mesa, set it to desert
setBiomeWithAdjacent(biomeIds, out, x, z, areaWidth, biomeId, BiomeGenBase.getIdForBiome(Biomes.DESERT), MESA_PREDICATE);
setBiomeWithAdjacent(biomeIds, out, x, z, areaWidth, biomeId, Biome.getIdForBiome(Biomes.DESERT), MESA_PREDICATE);
}
else
{
@ -115,7 +115,7 @@ public class GenLayerShoreBOP extends BOPGenLayer
}
else //Biome is a variant of the extreme hills
{
this.setBiomeWithAdjacent(biomeIds, out, x, z, areaWidth, biomeId, BiomeGenBase.getIdForBiome(Biomes.STONE_BEACH), OCEANIC_PREDICATE);
this.setBiomeWithAdjacent(biomeIds, out, x, z, areaWidth, biomeId, Biome.getIdForBiome(Biomes.STONE_BEACH), OCEANIC_PREDICATE);
}
}
}
@ -145,7 +145,7 @@ public class GenLayerShoreBOP extends BOPGenLayer
@Override
public boolean apply(Integer input)
{
return input == BiomeGenBase.getIdForBiome(Biomes.OCEAN);
return input == Biome.getIdForBiome(Biomes.OCEAN);
}
};
@ -163,7 +163,7 @@ public class GenLayerShoreBOP extends BOPGenLayer
@Override
public boolean apply(Integer input)
{
return BiomeGenBase.getBiome(input) != null && BiomeGenBase.getBiome(input).getBiomeClass() == BiomeGenJungle.class ? true : input == BiomeGenBase.getIdForBiome(Biomes.JUNGLE_EDGE) || input == BiomeGenBase.getIdForBiome(Biomes.JUNGLE) || input == BiomeGenBase.getIdForBiome(Biomes.JUNGLE_HILLS) || input == BiomeGenBase.getIdForBiome(Biomes.FOREST) || input == BiomeGenBase.getIdForBiome(Biomes.TAIGA) || isBiomeOceanic(input);
return Biome.getBiome(input) != null && Biome.getBiome(input).getBiomeClass() == BiomeJungle.class ? true : input == Biome.getIdForBiome(Biomes.JUNGLE_EDGE) || input == Biome.getIdForBiome(Biomes.JUNGLE) || input == Biome.getIdForBiome(Biomes.JUNGLE_HILLS) || input == Biome.getIdForBiome(Biomes.FOREST) || input == Biome.getIdForBiome(Biomes.TAIGA) || isBiomeOceanic(input);
}
};
@ -172,7 +172,7 @@ public class GenLayerShoreBOP extends BOPGenLayer
@Override
public boolean apply(Integer input)
{
return !(BiomeGenBase.getBiome(input) instanceof BiomeGenMesa);
return !(Biome.getBiome(input) instanceof BiomeMesa);
}
};
}

View File

@ -12,7 +12,7 @@ import java.util.List;
import biomesoplenty.api.generation.BOPGenLayer;
import biomesoplenty.common.init.ModBiomes;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.layer.GenLayer;
import net.minecraft.world.gen.layer.IntCache;
@ -112,7 +112,7 @@ public class GenLayerSubBiomesBOP extends BOPGenLayer
// This is usually the 'mutated' version of a biome
public int getRareSubBiome(int biomeId)
{
return BiomeGenBase.getIdForBiome(BiomeGenBase.getMutationForBiome(BiomeGenBase.getBiome(biomeId)));
return Biome.getIdForBiome(Biome.getMutationForBiome(Biome.getBiome(biomeId)));
}
// Given a biomeId, return the biomeId of a reasonably common alternative biome which you might expect to find a patch of within the outer biome

View File

@ -8,6 +8,12 @@
package biomesoplenty.core;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import com.google.common.collect.Lists;
import biomesoplenty.api.item.BOPItems;
import biomesoplenty.api.particle.BOPParticleTypes;
import biomesoplenty.client.particle.EntityPixieTrailFX;
@ -15,20 +21,26 @@ import biomesoplenty.client.particle.EntityTrailFX;
import biomesoplenty.client.texture.ForgeRedirectedResourcePack;
import biomesoplenty.common.block.IBOPBlock;
import biomesoplenty.common.config.MiscConfigurationHandler;
import biomesoplenty.common.entities.*;
import biomesoplenty.common.entities.EntityButterfly;
import biomesoplenty.common.entities.EntityPixie;
import biomesoplenty.common.entities.EntitySnail;
import biomesoplenty.common.entities.EntityWasp;
import biomesoplenty.common.entities.RenderButterfly;
import biomesoplenty.common.entities.RenderPixie;
import biomesoplenty.common.entities.RenderSnail;
import biomesoplenty.common.entities.RenderWasp;
import biomesoplenty.common.entities.projectiles.EntityDart;
import biomesoplenty.common.entities.projectiles.EntityMudball;
import biomesoplenty.common.entities.projectiles.RenderDart;
import biomesoplenty.common.entities.projectiles.RenderMudball;
import biomesoplenty.common.item.IColoredItem;
import biomesoplenty.common.util.inventory.CreativeTabBOP;
import com.google.common.collect.Lists;
import net.minecraft.block.Block;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiMainMenu;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.particle.Particle;
import net.minecraft.client.renderer.block.model.ModelBakery;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.client.renderer.block.statemap.IStateMapper;
@ -52,10 +64,6 @@ import net.minecraftforge.fml.client.registry.RenderingRegistry;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.relauncher.ReflectionHelper;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public class ClientProxy extends CommonProxy
{
public static ResourceLocation[] bopTitlePanoramaPaths = new ResourceLocation[] {new ResourceLocation("biomesoplenty:textures/gui/title/background/panorama_0.png"), new ResourceLocation("biomesoplenty:textures/gui/title/background/panorama_1.png"), new ResourceLocation("biomesoplenty:textures/gui/title/background/panorama_2.png"), new ResourceLocation("biomesoplenty:textures/gui/title/background/panorama_3.png"), new ResourceLocation("biomesoplenty:textures/gui/title/background/panorama_4.png"), new ResourceLocation("biomesoplenty:textures/gui/title/background/panorama_5.png")};
@ -182,7 +190,7 @@ public class ClientProxy extends CommonProxy
public void spawnParticle(BOPParticleTypes type, double x, double y, double z, Object... info)
{
Minecraft minecraft = Minecraft.getMinecraft();
EntityFX entityFx = null;
Particle entityFx = null;
switch (type)
{
case PIXIETRAIL: