From 124aa77d063682e92e05ef79136ca31b00d3802e Mon Sep 17 00:00:00 2001 From: CDAGaming Date: Mon, 30 Oct 2017 18:43:09 -0500 Subject: [PATCH 1/3] Update Forge and MCP Mappings Version (Also Includes Code Simplifying) --- build.properties | 4 ++-- .../client/gui/GuiBOPPageList.java | 5 ++-- .../common/block/BlockBOPPlant.java | 23 ++++++++----------- .../common/block/BlockColoring.java | 13 ++++------- .../common/crafting/BiomeEssenceRecipe.java | 2 +- .../entities/ai/EntityAIEatBOPGrass.java | 2 +- .../common/item/ItemMudball.java | 2 +- .../world/BOPMapGenScatteredFeature.java | 6 ++--- .../world/ChunkGeneratorOverworldBOP.java | 4 ++-- 9 files changed, 25 insertions(+), 36 deletions(-) diff --git a/build.properties b/build.properties index ab80144b9..9c26a5687 100644 --- a/build.properties +++ b/build.properties @@ -1,4 +1,4 @@ minecraft_version=1.12.2 -forge_version=14.23.0.2491 +forge_version=14.23.0.2517 mod_version=7.0.1 -mappings_version=snapshot_nodoc_20170619 +mappings_version=snapshot_nodoc_20171030 diff --git a/src/main/java/biomesoplenty/client/gui/GuiBOPPageList.java b/src/main/java/biomesoplenty/client/gui/GuiBOPPageList.java index d01b380b5..798bb28ac 100644 --- a/src/main/java/biomesoplenty/client/gui/GuiBOPPageList.java +++ b/src/main/java/biomesoplenty/client/gui/GuiBOPPageList.java @@ -53,7 +53,7 @@ public abstract class GuiBOPPageList extends GuiBOPPageDelegate @Override protected void updateItemPos(int p_178040_1_, int p_178040_2_, int p_178040_3_, float partialTicks) { - this.getListEntry(p_178040_1_).func_192633_a(p_178040_1_, p_178040_2_, p_178040_3_, partialTicks); + this.getListEntry(p_178040_1_).updatePosition(p_178040_1_, p_178040_2_, p_178040_3_, partialTicks); } @Override @@ -268,8 +268,7 @@ public abstract class GuiBOPPageList extends GuiBOPPageDelegate } // setSelected - @Override - public void func_192633_a(int p_178011_1_, int p_178011_2_, int p_178011_3_, float partialTicks) + public void updatePosition(int p_178011_1_, int p_178011_2_, int p_178011_3_, float partialTicks) { this.drawGui(this.guiLeft, p_178011_3_, 0, 0, true, partialTicks); this.drawGui(this.guiRight, p_178011_3_, 0, 0, true, partialTicks); diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPPlant.java b/src/main/java/biomesoplenty/common/block/BlockBOPPlant.java index 7af1ae49b..33029115d 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPPlant.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPPlant.java @@ -158,21 +158,16 @@ public class BlockBOPPlant extends BlockBOPDecoration implements IShearable, IHo @SideOnly(Side.CLIENT) public IItemColor getItemColor() { - return new IItemColor() - { - @Override - public int getColorFromItemstack(ItemStack stack, int tintIndex) + return (stack, tintIndex) -> { + IBlockState state = ((ItemBlock)stack.getItem()).getBlock().getStateFromMeta(stack.getMetadata()); + + switch ((BOPPlants) state.getValue(BlockBOPPlant.this.variantProperty)) { - IBlockState state = ((ItemBlock)stack.getItem()).getBlock().getStateFromMeta(stack.getMetadata()); - - switch ((BOPPlants) state.getValue(BlockBOPPlant.this.variantProperty)) - { - case BUSH: case BERRYBUSH: case SHRUB: - return 0xFFFFFF; - - default: - return BlockBOPPlant.this.getBlockColor().colorMultiplier(state, null, null, tintIndex); - } + case BUSH: case BERRYBUSH: case SHRUB: + return 0xFFFFFF; + + default: + return BlockBOPPlant.this.getBlockColor().colorMultiplier(state, null, null, tintIndex); } }; } diff --git a/src/main/java/biomesoplenty/common/block/BlockColoring.java b/src/main/java/biomesoplenty/common/block/BlockColoring.java index 2b1a7a7f6..aade807de 100644 --- a/src/main/java/biomesoplenty/common/block/BlockColoring.java +++ b/src/main/java/biomesoplenty/common/block/BlockColoring.java @@ -42,14 +42,9 @@ public class BlockColoring } }; - public static final IItemColor BLOCK_ITEM_COLORING = new IItemColor() - { - @Override - public int getColorFromItemstack(ItemStack stack, int tintIndex) - { - IBlockState state = ((ItemBlock)stack.getItem()).getBlock().getStateFromMeta(stack.getMetadata()); - IBlockColor blockColor = ((IBOPBlock)state.getBlock()).getBlockColor(); - return blockColor == null ? 0xFFFFFF : blockColor.colorMultiplier(state, null, null, tintIndex); - } + public static final IItemColor BLOCK_ITEM_COLORING = (stack, tintIndex) -> { + IBlockState state = ((ItemBlock)stack.getItem()).getBlock().getStateFromMeta(stack.getMetadata()); + IBlockColor blockColor = ((IBOPBlock)state.getBlock()).getBlockColor(); + return blockColor == null ? 0xFFFFFF : blockColor.colorMultiplier(state, null, null, tintIndex); }; } \ No newline at end of file diff --git a/src/main/java/biomesoplenty/common/crafting/BiomeEssenceRecipe.java b/src/main/java/biomesoplenty/common/crafting/BiomeEssenceRecipe.java index dcfdf621d..7ee2159dc 100644 --- a/src/main/java/biomesoplenty/common/crafting/BiomeEssenceRecipe.java +++ b/src/main/java/biomesoplenty/common/crafting/BiomeEssenceRecipe.java @@ -93,7 +93,7 @@ public class BiomeEssenceRecipe extends net.minecraftforge.registries.IForgeRegi } @Override - public boolean isHidden() + public boolean isDynamic() { return true; } diff --git a/src/main/java/biomesoplenty/common/entities/ai/EntityAIEatBOPGrass.java b/src/main/java/biomesoplenty/common/entities/ai/EntityAIEatBOPGrass.java index c35d75f7d..40cf662f2 100644 --- a/src/main/java/biomesoplenty/common/entities/ai/EntityAIEatBOPGrass.java +++ b/src/main/java/biomesoplenty/common/entities/ai/EntityAIEatBOPGrass.java @@ -58,7 +58,7 @@ public class EntityAIEatBOPGrass extends EntityAIEatGrass { this.bopEatingGrassTimer = 40; this.world.setEntityState(this.sheep, (byte)10); - this.sheep.getNavigator().clearPathEntity(); + this.sheep.getNavigator().clearPath(); } @Override diff --git a/src/main/java/biomesoplenty/common/item/ItemMudball.java b/src/main/java/biomesoplenty/common/item/ItemMudball.java index 41150944e..ea85868a1 100644 --- a/src/main/java/biomesoplenty/common/item/ItemMudball.java +++ b/src/main/java/biomesoplenty/common/item/ItemMudball.java @@ -42,7 +42,7 @@ public class ItemMudball extends Item if (!world.isRemote) { EntityMudball mudball = new EntityMudball(world, player); - mudball.setHeadingFromThrower(player, player.rotationPitch, player.rotationYaw, 0.0F, 1.5F, 1.0F); + mudball.shoot(player, player.rotationPitch, player.rotationYaw, 0.0F, 1.5F, 1.0F); world.spawnEntity(mudball); } diff --git a/src/main/java/biomesoplenty/common/world/BOPMapGenScatteredFeature.java b/src/main/java/biomesoplenty/common/world/BOPMapGenScatteredFeature.java index 6f5d4b041..ef35f16aa 100644 --- a/src/main/java/biomesoplenty/common/world/BOPMapGenScatteredFeature.java +++ b/src/main/java/biomesoplenty/common/world/BOPMapGenScatteredFeature.java @@ -56,7 +56,7 @@ public class BOPMapGenScatteredFeature extends MapGenScatteredFeature for (Entry entry : p_i2061_1_.entrySet()) { - if (((String)entry.getKey()).equals("distance")) + if (entry.getKey().equals("distance")) { this.maxDistanceBetweenScatteredFeatures = MathHelper.getInt((String)entry.getValue(), this.maxDistanceBetweenScatteredFeatures, 9); } @@ -126,7 +126,7 @@ public class BOPMapGenScatteredFeature extends MapGenScatteredFeature if (structurestart != null && structurestart instanceof BOPMapGenScatteredFeature.Start && !structurestart.getComponents().isEmpty()) { - StructureComponent structurecomponent = (StructureComponent)structurestart.getComponents().get(0); + StructureComponent structurecomponent = structurestart.getComponents().get(0); return structurecomponent instanceof ComponentScatteredFeaturePieces.SwampHut; } else @@ -136,7 +136,7 @@ public class BOPMapGenScatteredFeature extends MapGenScatteredFeature } @Override - public List getScatteredFeatureSpawnList() + public List getMonsters() { return this.scatteredFeatureSpawnList; } diff --git a/src/main/java/biomesoplenty/common/world/ChunkGeneratorOverworldBOP.java b/src/main/java/biomesoplenty/common/world/ChunkGeneratorOverworldBOP.java index 1f2ea17c2..2a09aa5f9 100644 --- a/src/main/java/biomesoplenty/common/world/ChunkGeneratorOverworldBOP.java +++ b/src/main/java/biomesoplenty/common/world/ChunkGeneratorOverworldBOP.java @@ -620,12 +620,12 @@ public class ChunkGeneratorOverworldBOP implements IChunkGenerator { if (creatureType == EnumCreatureType.MONSTER && this.scatteredFeatureGenerator.isSwampHut(pos)) { - return this.scatteredFeatureGenerator.getScatteredFeatureSpawnList(); + return this.scatteredFeatureGenerator.getMonsters(); } if (creatureType == EnumCreatureType.MONSTER && this.settings.useMonuments && this.oceanMonumentGenerator.isPositionInStructure(this.world, pos)) { - return this.oceanMonumentGenerator.getScatteredFeatureSpawnList(); + return this.oceanMonumentGenerator.getMonsters(); } } From 05a805eb469a169dc2e3759c2b61c728239f92d6 Mon Sep 17 00:00:00 2001 From: CDAGaming Date: Mon, 30 Oct 2017 19:06:00 -0500 Subject: [PATCH 2/3] Code Cleanup -- Optional --- .../botania/api/item/IHornHarvestable.java | 10 +-- .../biomesoplenty/api/biome/BOPBiomes.java | 8 +- .../biomesoplenty/api/biome/BiomeOwner.java | 2 +- .../api/biome/IExtendedBiome.java | 22 ++--- .../api/block/IBlockPosQuery.java | 2 +- .../api/config/IBOPWorldSettings.java | 4 +- .../biomesoplenty/api/config/IConfigObj.java | 86 +++++++++---------- .../biomesoplenty/api/enums/BOPClimates.java | 2 +- .../java/biomesoplenty/api/enums/BOPGems.java | 2 +- .../api/generation/BOPGeneratorBase.java | 2 +- .../api/generation/GeneratorStage.java | 2 +- .../api/generation/IGenerator.java | 20 ++--- .../api/particle/BOPParticleTypes.java | 2 +- .../client/gui/GuiBOPConfigureWorld.java | 20 ++--- .../client/gui/GuiBOPPageList.java | 2 +- .../client/gui/GuiBOPPageTable.java | 22 ++--- .../client/gui/GuiEnumButton.java | 2 +- .../client/particle/EntityPixieTrailFX.java | 2 +- .../texture/ForgeRedirectedResourcePack.java | 2 +- .../client/util/TextureUtils.java | 2 +- .../common/biome/overworld/BiomeGenAlps.java | 2 +- .../biome/overworld/BiomeGenMountain.java | 2 +- .../common/block/BlockBOPAsh.java | 2 +- .../common/block/BlockBOPBamboo.java | 6 +- .../common/block/BlockBOPBiomeBlock.java | 5 +- .../common/block/BlockBOPCoral.java | 7 +- .../common/block/BlockBOPCrystal.java | 7 +- .../common/block/BlockBOPDirt.java | 7 +- .../block/BlockBOPDoubleDecoration.java | 7 +- .../common/block/BlockBOPDoublePlant.java | 9 +- .../common/block/BlockBOPDoubleWoodSlab.java | 2 +- .../common/block/BlockBOPFarmland.java | 2 +- .../common/block/BlockBOPFlower.java | 10 +-- .../common/block/BlockBOPGem.java | 2 +- .../common/block/BlockBOPGemOre.java | 2 +- .../common/block/BlockBOPGrass.java | 9 +- .../common/block/BlockBOPGrassPath.java | 2 +- .../common/block/BlockBOPHalfOtherSlab.java | 8 +- .../common/block/BlockBOPHalfWoodSlab.java | 2 +- .../common/block/BlockBOPHive.java | 7 +- .../common/block/BlockBOPLeaves.java | 8 +- .../common/block/BlockBOPLilypad.java | 7 +- .../common/block/BlockBOPLog.java | 4 +- .../common/block/BlockBOPMud.java | 7 +- .../common/block/BlockBOPMushroom.java | 9 +- .../common/block/BlockBOPPlanks.java | 2 +- .../common/block/BlockBOPPlant.java | 4 +- .../common/block/BlockBOPSapling.java | 8 +- .../common/block/BlockBOPSeaweed.java | 10 +-- .../common/block/BlockBOPStoneFormations.java | 10 +-- .../common/block/BlockBOPTerrarium.java | 9 +- .../common/block/BlockBOPWhiteSandstone.java | 7 +- .../biomesoplenty/common/block/IBOPBlock.java | 12 +-- .../common/block/ISustainsPlantType.java | 2 +- .../common/command/BOPCommand.java | 3 +- .../common/entities/EntityPixie.java | 6 +- .../common/entities/EntityWasp.java | 6 +- .../entities/ai/EntityAIEatBOPGrass.java | 4 +- .../common/fluids/blocks/BlockBloodFluid.java | 2 +- .../common/fluids/blocks/BlockHoneyFluid.java | 2 +- .../blocks/BlockHotSpringWaterFluid.java | 4 +- .../fluids/blocks/BlockPoisonFluid.java | 2 +- .../fluids/blocks/BlockQuicksandFluid.java | 2 +- .../common/handler/BucketEventHandler.java | 10 +-- .../common/handler/TrailsEventHandler.java | 2 +- .../biomesoplenty/common/init/ModBiomes.java | 4 +- .../common/init/ModBlockQueries.java | 2 +- .../biomesoplenty/common/init/ModBlocks.java | 2 +- .../common/init/ModCompatibility.java | 2 +- .../common/init/ModEntities.java | 2 +- .../common/init/ModVanillaCompat.java | 2 +- .../inventory/ContainerFlowerBasket.java | 2 +- .../common/item/IColoredItem.java | 2 +- .../common/item/ItemBOPLilypad.java | 2 +- .../common/item/ItemBOPPlant.java | 2 +- .../common/remote/TrailManager.java | 4 +- .../common/util/biome/GeneratorUtils.java | 2 +- .../common/util/block/BlockQuery.java | 17 ++-- .../common/util/block/BlockStateUtils.java | 4 +- .../util/block/VariantPagingHelper.java | 2 +- .../common/util/config/BOPConfig.java | 54 ++++++------ .../common/util/inventory/CraftingUtil.java | 2 +- .../world/BOPMapGenScatteredFeature.java | 9 +- .../common/world/BOPWorldSettings.java | 14 +-- .../common/world/ChunkGeneratorHellBOP.java | 6 +- .../world/ChunkGeneratorOverworldBOP.java | 14 +-- .../common/world/GenerationManager.java | 2 +- .../common/world/NoiseGeneratorBOPByte.java | 4 +- .../common/world/TerrainSettings.java | 4 +- .../world/generator/GeneratorBigFlower.java | 4 +- .../world/generator/GeneratorBigMushroom.java | 2 +- .../world/generator/GeneratorDoubleFlora.java | 2 +- .../world/generator/GeneratorFlora.java | 2 +- .../common/world/generator/GeneratorHive.java | 2 +- .../generator/tree/GeneratorBigTree.java | 1 - .../generator/tree/GeneratorProfileTree.java | 2 +- .../common/world/layer/GenLayerShoreBOP.java | 2 +- .../java/biomesoplenty/core/ClientProxy.java | 4 +- 98 files changed, 314 insertions(+), 325 deletions(-) diff --git a/src/api/java/vazkii/botania/api/item/IHornHarvestable.java b/src/api/java/vazkii/botania/api/item/IHornHarvestable.java index a6ef982fc..6a0128332 100644 --- a/src/api/java/vazkii/botania/api/item/IHornHarvestable.java +++ b/src/api/java/vazkii/botania/api/item/IHornHarvestable.java @@ -23,22 +23,22 @@ public interface IHornHarvestable { * Returns true if this block can be uprooted. * Note that the stack param can be null if it's a drum breaking it. */ - public boolean canHornHarvest(World world, BlockPos pos, ItemStack stack, EnumHornType hornType); + boolean canHornHarvest(World world, BlockPos pos, ItemStack stack, EnumHornType hornType); /** * Returns true if harvestByHorn() should be called. If false it just uses the normal * block breaking method. * Note that the stack param can be null if it's a drum breaking it. */ - public boolean hasSpecialHornHarvest(World world, BlockPos pos, ItemStack stack, EnumHornType hornType); + boolean hasSpecialHornHarvest(World world, BlockPos pos, ItemStack stack, EnumHornType hornType); /** * Called to harvest by a horn. * Note that the stack param can be null if it's a drum breaking it. */ - public void harvestByHorn(World world, BlockPos pos, ItemStack stack, EnumHornType hornType); + void harvestByHorn(World world, BlockPos pos, ItemStack stack, EnumHornType hornType); - public static enum EnumHornType { + enum EnumHornType { /** * Horn of the Wild, for grass and crops @@ -60,6 +60,6 @@ public interface IHornHarvestable { return values[Math.min(values.length - 1, meta)]; } - }; + } } diff --git a/src/main/java/biomesoplenty/api/biome/BOPBiomes.java b/src/main/java/biomesoplenty/api/biome/BOPBiomes.java index 982949390..4f2822e3c 100644 --- a/src/main/java/biomesoplenty/api/biome/BOPBiomes.java +++ b/src/main/java/biomesoplenty/api/biome/BOPBiomes.java @@ -147,10 +147,10 @@ public class BOPBiomes return instance; } - public static interface IBiomeRegistry + public interface IBiomeRegistry { - public IExtendedBiome registerBiome(IExtendedBiome biome, String idName); - public IExtendedBiome getExtendedBiome(Biome biome); - public ImmutableSet getPresentBiomes(); + IExtendedBiome registerBiome(IExtendedBiome biome, String idName); + IExtendedBiome getExtendedBiome(Biome biome); + ImmutableSet getPresentBiomes(); } } diff --git a/src/main/java/biomesoplenty/api/biome/BiomeOwner.java b/src/main/java/biomesoplenty/api/biome/BiomeOwner.java index 83d2a60cb..74fcc62d5 100644 --- a/src/main/java/biomesoplenty/api/biome/BiomeOwner.java +++ b/src/main/java/biomesoplenty/api/biome/BiomeOwner.java @@ -10,5 +10,5 @@ package biomesoplenty.api.biome; public enum BiomeOwner { - BIOMESOPLENTY, OTHER; + BIOMESOPLENTY, OTHER } diff --git a/src/main/java/biomesoplenty/api/biome/IExtendedBiome.java b/src/main/java/biomesoplenty/api/biome/IExtendedBiome.java index 4646f7a60..2c572d121 100644 --- a/src/main/java/biomesoplenty/api/biome/IExtendedBiome.java +++ b/src/main/java/biomesoplenty/api/biome/IExtendedBiome.java @@ -21,19 +21,19 @@ import net.minecraft.world.biome.Biome; public interface IExtendedBiome { - public void applySettings(IBOPWorldSettings settings); - public void configure(IConfigObj conf); + void applySettings(IBOPWorldSettings settings); + void configure(IConfigObj conf); - public BiomeOwner getBiomeOwner(); - public void addGenerator(String name, GeneratorStage stage, IGenerator generator); - public IGenerationManager getGenerationManager(); - public Map getWeightMap(); - public void clearWeights(); - public void addWeight(BOPClimates climate, int weight); + BiomeOwner getBiomeOwner(); + void addGenerator(String name, GeneratorStage stage, IGenerator generator); + IGenerationManager getGenerationManager(); + Map getWeightMap(); + void clearWeights(); + void addWeight(BOPClimates climate, int weight); - public ResourceLocation getBeachLocation(); + ResourceLocation getBeachLocation(); /**Get the base biome associated with this extension**/ - public Biome getBaseBiome(); - public ResourceLocation getResourceLocation(); + Biome getBaseBiome(); + ResourceLocation getResourceLocation(); } diff --git a/src/main/java/biomesoplenty/api/block/IBlockPosQuery.java b/src/main/java/biomesoplenty/api/block/IBlockPosQuery.java index 2a79fe7b4..fdcf00a12 100644 --- a/src/main/java/biomesoplenty/api/block/IBlockPosQuery.java +++ b/src/main/java/biomesoplenty/api/block/IBlockPosQuery.java @@ -13,5 +13,5 @@ import net.minecraft.world.World; // for queries on a particular block position in the world public interface IBlockPosQuery { - public boolean matches(World world, BlockPos pos); + boolean matches(World world, BlockPos pos); } \ No newline at end of file diff --git a/src/main/java/biomesoplenty/api/config/IBOPWorldSettings.java b/src/main/java/biomesoplenty/api/config/IBOPWorldSettings.java index b1aef6463..b7dd2f945 100644 --- a/src/main/java/biomesoplenty/api/config/IBOPWorldSettings.java +++ b/src/main/java/biomesoplenty/api/config/IBOPWorldSettings.java @@ -11,10 +11,10 @@ public interface IBOPWorldSettings { boolean isEnabled(GeneratorType type); - public static enum GeneratorType + enum GeneratorType { GEMS, SOILS, TREES, GRASSES, FOLIAGE, FLOWERS, PLANTS, WATER_PLANTS, MUSHROOMS, ROCK_FORMATIONS, POISON_IVY, BERRY_BUSHES, THORNS, QUICKSAND, LIQUID_POISON, HOT_SPRINGS, - NETHER_HIVES, END_FEATURES; + NETHER_HIVES, END_FEATURES } } diff --git a/src/main/java/biomesoplenty/api/config/IConfigObj.java b/src/main/java/biomesoplenty/api/config/IConfigObj.java index 69fe540ac..2257162c8 100644 --- a/src/main/java/biomesoplenty/api/config/IConfigObj.java +++ b/src/main/java/biomesoplenty/api/config/IConfigObj.java @@ -18,62 +18,62 @@ import net.minecraft.util.ResourceLocation; public interface IConfigObj { - public JsonElement serializeDefaults(); - public void addMessage(String message); - public void addMessage(String extraPrefix, String message); - public List flushMessages(); - public boolean isEmpty(); - public boolean has(String name); - public Set getKeys(); + JsonElement serializeDefaults(); + void addMessage(String message); + void addMessage(String extraPrefix, String message); + List flushMessages(); + boolean isEmpty(); + boolean has(String name); + Set getKeys(); - public IConfigObj getObject(String name); - public ArrayList getObjectArray(String name); - public IConfigObj getObject(String name, boolean warnIfMissing); - public ArrayList getObjectArray(String name, boolean warnIfMissing); + IConfigObj getObject(String name); + ArrayList getObjectArray(String name); + IConfigObj getObject(String name, boolean warnIfMissing); + ArrayList getObjectArray(String name, boolean warnIfMissing); // Use the methods below when you want to obtain a value from a config file, if it is present, but you have a default value to use if it isn't // No warning messages will be logged using these methods if the value is missing - public Boolean getBool(String name, Boolean defaultVal); - public String getString(String name, String defaultVal); - public Integer getInt(String name, Integer defaultVal); - public Float getFloat(String name, Float defaultVal); - public IBlockState getBlockState(String name, IBlockState defaultVal); - public IBlockPosQuery getBlockPosQuery(String name, IBlockPosQuery defaultVal); - public ResourceLocation getResourceLocation(String name, ResourceLocation defaultVal); - public E getEnum(String name, E defaultVal, Class clazz); + Boolean getBool(String name, Boolean defaultVal); + String getString(String name, String defaultVal); + Integer getInt(String name, Integer defaultVal); + Float getFloat(String name, Float defaultVal); + IBlockState getBlockState(String name, IBlockState defaultVal); + IBlockPosQuery getBlockPosQuery(String name, IBlockPosQuery defaultVal); + ResourceLocation getResourceLocation(String name, ResourceLocation defaultVal); + E getEnum(String name, E defaultVal, Class clazz); // Use the methods below when you want to obtain a value from a config file which SHOULD be present // If the value is missing, a warning message is logged, and null is returned - public Boolean getBool(String name); - public String getString(String name); - public Integer getInt(String name); - public Float getFloat(String name); - public IBlockState getBlockState(String name); - public IBlockPosQuery getBlockPosQuery(String name); - public ResourceLocation getResourceLocation(String name); - public E getEnum(String name, Class clazz); + Boolean getBool(String name); + String getString(String name); + Integer getInt(String name); + Float getFloat(String name); + IBlockState getBlockState(String name); + IBlockPosQuery getBlockPosQuery(String name); + ResourceLocation getResourceLocation(String name); + E getEnum(String name, Class clazz); // Use the methods below when you want to obtain an array of values from a config file, if it is present, but you have a default value to use if it isn't // No warning messages will be logged using these methods if the value is missing - public ArrayList getBoolArray(String name, ArrayList defaultVal); - public ArrayList getStringArray(String name, ArrayList defaultVal); - public ArrayList getIntArray(String name, ArrayList defaultVal); - public ArrayList getFloatArray(String name, ArrayList defaultVal); - public ArrayList getBlockStateArray(String name, ArrayList defaultVal); - public ArrayList getBlockPosQueryArray(String name, ArrayList defaultVal); - public ArrayList getResourceLocationArray(String name, ArrayList defaultVal); - public ArrayList getEnumArray(String name, ArrayList defaultVal, Class clazz); + ArrayList getBoolArray(String name, ArrayList defaultVal); + ArrayList getStringArray(String name, ArrayList defaultVal); + ArrayList getIntArray(String name, ArrayList defaultVal); + ArrayList getFloatArray(String name, ArrayList defaultVal); + ArrayList getBlockStateArray(String name, ArrayList defaultVal); + ArrayList getBlockPosQueryArray(String name, ArrayList defaultVal); + ArrayList getResourceLocationArray(String name, ArrayList defaultVal); + ArrayList getEnumArray(String name, ArrayList defaultVal, Class clazz); // Use the methods below when you want to obtain an array of values from a config file which SHOULD be present // If the value is missing, a warning message is logged, and null is returned - public ArrayList getBoolArray(String name); - public ArrayList getStringArray(String name); - public ArrayList getIntArray(String name); - public ArrayList getFloatArray(String name); - public ArrayList getBlockStateArray(String name); - public ArrayList getBlockPosQueryArray(String name); - public ArrayList getResourceLocationArray(String name); - public ArrayList getEnumArray(String name, Class clazz); + ArrayList getBoolArray(String name); + ArrayList getStringArray(String name); + ArrayList getIntArray(String name); + ArrayList getFloatArray(String name); + ArrayList getBlockStateArray(String name); + ArrayList getBlockPosQueryArray(String name); + ArrayList getResourceLocationArray(String name); + ArrayList getEnumArray(String name, Class clazz); } \ No newline at end of file diff --git a/src/main/java/biomesoplenty/api/enums/BOPClimates.java b/src/main/java/biomesoplenty/api/enums/BOPClimates.java index 83c031435..e554fb6f4 100644 --- a/src/main/java/biomesoplenty/api/enums/BOPClimates.java +++ b/src/main/java/biomesoplenty/api/enums/BOPClimates.java @@ -31,7 +31,7 @@ public enum BOPClimates { private ArrayList landBiomes = new ArrayList(); - private BOPClimates(BiomeType biomeType) + BOPClimates(BiomeType biomeType) { this.biomeType = biomeType; } diff --git a/src/main/java/biomesoplenty/api/enums/BOPGems.java b/src/main/java/biomesoplenty/api/enums/BOPGems.java index 0c27650a6..26b89af07 100644 --- a/src/main/java/biomesoplenty/api/enums/BOPGems.java +++ b/src/main/java/biomesoplenty/api/enums/BOPGems.java @@ -23,4 +23,4 @@ public enum BOPGems implements IStringSerializable { return this.getName(); } -}; \ No newline at end of file +} \ No newline at end of file diff --git a/src/main/java/biomesoplenty/api/generation/BOPGeneratorBase.java b/src/main/java/biomesoplenty/api/generation/BOPGeneratorBase.java index 190f95577..02dfe6747 100644 --- a/src/main/java/biomesoplenty/api/generation/BOPGeneratorBase.java +++ b/src/main/java/biomesoplenty/api/generation/BOPGeneratorBase.java @@ -24,7 +24,7 @@ public abstract class BOPGeneratorBase extends WorldGenerator implements IGenera protected BOPGeneratorBase(float amountPerChunk) { - this.identifier = Generators.registry.getIdentifier((Class)this.getClass()); + this.identifier = Generators.registry.getIdentifier(this.getClass()); if (this.identifier == null) { diff --git a/src/main/java/biomesoplenty/api/generation/GeneratorStage.java b/src/main/java/biomesoplenty/api/generation/GeneratorStage.java index 2242a3f44..752da8012 100644 --- a/src/main/java/biomesoplenty/api/generation/GeneratorStage.java +++ b/src/main/java/biomesoplenty/api/generation/GeneratorStage.java @@ -68,7 +68,7 @@ public enum GeneratorStage private Decorate.EventType decorateType; - private GeneratorStage(Decorate.EventType decorateType) + GeneratorStage(Decorate.EventType decorateType) { this.decorateType = decorateType; } diff --git a/src/main/java/biomesoplenty/api/generation/IGenerator.java b/src/main/java/biomesoplenty/api/generation/IGenerator.java index 2810a73f9..5ea697f25 100644 --- a/src/main/java/biomesoplenty/api/generation/IGenerator.java +++ b/src/main/java/biomesoplenty/api/generation/IGenerator.java @@ -16,25 +16,25 @@ import net.minecraft.world.World; public interface IGenerator { - public void scatter(World world, Random random, BlockPos pos); - public boolean generate(World world, Random random, BlockPos pos); + void scatter(World world, Random random, BlockPos pos); + boolean generate(World world, Random random, BlockPos pos); - public void setStage(GeneratorStage stage); - public void setName(String name); + void setStage(GeneratorStage stage); + void setName(String name); /** * A unique name used to classify the purpose of a generator. For example, emeralds and ruby use the * same generator (and thus, have the same identifier) but have differing names. */ - public String getName(); + String getName(); /**The identifier for this generator should be consistent across all instances of the same type*/ - public String getIdentifier(); - public GeneratorStage getStage(); + String getIdentifier(); + GeneratorStage getStage(); - public static interface IGeneratorBuilder + interface IGeneratorBuilder { - public T create(); + T create(); } - public void configure(IConfigObj conf); + void configure(IConfigObj conf); } diff --git a/src/main/java/biomesoplenty/api/particle/BOPParticleTypes.java b/src/main/java/biomesoplenty/api/particle/BOPParticleTypes.java index 8390b4b98..1c4c9271b 100644 --- a/src/main/java/biomesoplenty/api/particle/BOPParticleTypes.java +++ b/src/main/java/biomesoplenty/api/particle/BOPParticleTypes.java @@ -2,5 +2,5 @@ package biomesoplenty.api.particle; public enum BOPParticleTypes { - PIXIETRAIL, MUD, PLAYER_TRAIL; + PIXIETRAIL, MUD, PLAYER_TRAIL } \ No newline at end of file diff --git a/src/main/java/biomesoplenty/client/gui/GuiBOPConfigureWorld.java b/src/main/java/biomesoplenty/client/gui/GuiBOPConfigureWorld.java index 6f0592439..027391da4 100644 --- a/src/main/java/biomesoplenty/client/gui/GuiBOPConfigureWorld.java +++ b/src/main/java/biomesoplenty/client/gui/GuiBOPConfigureWorld.java @@ -76,7 +76,7 @@ public class GuiBOPConfigureWorld extends GuiScreen implements GuiSlider.FormatH } } - private static enum Actions + private enum Actions { PREVIOUS (301), NEXT (302), @@ -87,7 +87,7 @@ public class GuiBOPConfigureWorld extends GuiScreen implements GuiSlider.FormatH private int id; - private Actions(int id) + Actions(int id) { this.id = id; } @@ -166,7 +166,7 @@ public class GuiBOPConfigureWorld extends GuiScreen implements GuiSlider.FormatH } - private static enum GuiEntries + private enum GuiEntries { TEMP_SCHEME (101), GENERATE_BOP_GEMS (102), @@ -201,7 +201,7 @@ public class GuiBOPConfigureWorld extends GuiScreen implements GuiSlider.FormatH private int id; - private GuiEntries(int id) + GuiEntries(int id) { this.id = id; } @@ -318,7 +318,7 @@ public class GuiBOPConfigureWorld extends GuiScreen implements GuiSlider.FormatH case HEIGHT_SCALE: case UPPER_LIMIT_SCALE: case LOWER_LIMIT_SCALE: - return String.format("%5.3f", new Object[] {Float.valueOf(value)}); + return String.format("%5.3f", Float.valueOf(value)); default: return ""; } @@ -474,14 +474,12 @@ public class GuiBOPConfigureWorld extends GuiScreen implements GuiSlider.FormatH @Override public void handleStringSelection(int fieldId, String value) { - ; } @Override public void handleIntSelection(int fieldId, int value) { - ; } @@ -583,7 +581,7 @@ public class GuiBOPConfigureWorld extends GuiScreen implements GuiSlider.FormatH { this.prevButton.enabled = this.pageManager.getActivePage().pageNumber != 0; this.nextButton.enabled = this.pageManager.getActivePage().pageNumber != this.pageManager.getNumPages() - 1; - this.pageInfo = I18n.format("book.pageIndicator", new Object[] {Integer.valueOf(this.pageManager.getActivePage().pageNumber + 1), Integer.valueOf(this.pageManager.getNumPages())}); + this.pageInfo = I18n.format("book.pageIndicator", Integer.valueOf(this.pageManager.getActivePage().pageNumber + 1), Integer.valueOf(this.pageManager.getNumPages())); this.page0Title = this.pageNames[this.pageManager.getActivePage().pageNumber]; } @@ -678,9 +676,9 @@ public class GuiBOPConfigureWorld extends GuiScreen implements GuiSlider.FormatH bufferBuilder.pos((double)(this.width / 2 + 90), 100.0D, 0.0D).tex(5.625D, 0.0D).color(64, 64, 64, 64).endVertex(); bufferBuilder.pos((double)(this.width / 2 - 90), 100.0D, 0.0D).tex(0.0D, 0.0D).color(64, 64, 64, 64).endVertex(); tessellator.draw(); - this.drawCenteredString(this.fontRenderer, I18n.format("createWorld.customize.custom.confirmTitle", new Object[0]), this.width / 2, 105, 16777215); - this.drawCenteredString(this.fontRenderer, I18n.format("createWorld.customize.custom.confirm1", new Object[0]), this.width / 2, 125, 16777215); - this.drawCenteredString(this.fontRenderer, I18n.format("createWorld.customize.custom.confirm2", new Object[0]), this.width / 2, 135, 16777215); + this.drawCenteredString(this.fontRenderer, I18n.format("createWorld.customize.custom.confirmTitle"), this.width / 2, 105, 16777215); + this.drawCenteredString(this.fontRenderer, I18n.format("createWorld.customize.custom.confirm1"), this.width / 2, 125, 16777215); + this.drawCenteredString(this.fontRenderer, I18n.format("createWorld.customize.custom.confirm2"), this.width / 2, 135, 16777215); this.yesButton.drawButton(this.mc, mouseX, mouseY, partialTicks); this.noButton.drawButton(this.mc, mouseX, mouseY, partialTicks); } diff --git a/src/main/java/biomesoplenty/client/gui/GuiBOPPageList.java b/src/main/java/biomesoplenty/client/gui/GuiBOPPageList.java index 798bb28ac..b2a909b52 100644 --- a/src/main/java/biomesoplenty/client/gui/GuiBOPPageList.java +++ b/src/main/java/biomesoplenty/client/gui/GuiBOPPageList.java @@ -372,7 +372,7 @@ public abstract class GuiBOPPageList extends GuiBOPPageDelegate public EditBoxEntry(int fieldId, String labelText, boolean isVisible, Predicate validator) { super(fieldId, labelText, isVisible); - this.validator = (Predicate) MoreObjects.firstNonNull(validator, Predicates.alwaysTrue()); + this.validator = MoreObjects.firstNonNull(validator, Predicates.alwaysTrue()); } public Predicate getValidator() diff --git a/src/main/java/biomesoplenty/client/gui/GuiBOPPageTable.java b/src/main/java/biomesoplenty/client/gui/GuiBOPPageTable.java index d7abf76b4..eae2906b4 100644 --- a/src/main/java/biomesoplenty/client/gui/GuiBOPPageTable.java +++ b/src/main/java/biomesoplenty/client/gui/GuiBOPPageTable.java @@ -131,8 +131,8 @@ public class GuiBOPPageTable extends GuiBOPPageList { GuiBOPPageList.GuiFieldEntry guilistentryLeft = this.fields[i]; GuiBOPPageList.GuiFieldEntry guilistentryRight = i < this.fields.length - 1 ? this.fields[i + 1] : null; - Gui guiLeft = (Gui)this.fieldIdToGuiMap.get(guilistentryLeft.getFieldId()); - Gui guiRight = guilistentryRight != null ? (Gui)this.fieldIdToGuiMap.get(guilistentryRight.getFieldId()) : null; + Gui guiLeft = this.fieldIdToGuiMap.get(guilistentryLeft.getFieldId()); + Gui guiRight = guilistentryRight != null ? this.fieldIdToGuiMap.get(guilistentryRight.getFieldId()) : null; GuiBOPPageList.GuiRowEntry guientry = new GuiBOPPageList.GuiRowEntry(guiLeft, guiRight); this.allRows.add(guientry); } @@ -147,7 +147,7 @@ public class GuiBOPPageTable extends GuiBOPPageList @Override public Gui getGui(int fieldId) { - return (Gui)this.fieldIdToGuiMap.get(fieldId); + return this.fieldIdToGuiMap.get(fieldId); } @@ -156,23 +156,23 @@ public class GuiBOPPageTable extends GuiBOPPageList { if (field instanceof GuiBOPPageList.GuiSlideEntry) { - return (Gui)this.createSlider(this.width / 2 - 155 + xOffset, 0, (GuiBOPPageList.GuiSlideEntry)field); + return this.createSlider(this.width / 2 - 155 + xOffset, 0, (GuiSlideEntry)field); } else if (field instanceof GuiBOPPageList.GuiButtonEntry) { - return (Gui)this.createListButton(this.width / 2 - 155 + xOffset, 0, (GuiBOPPageList.GuiButtonEntry)field); + return this.createListButton(this.width / 2 - 155 + xOffset, 0, (GuiButtonEntry)field); } else if (field instanceof GuiBOPPageList.EditBoxEntry) { - return (Gui)this.createTextField(this.width / 2 - 155 + xOffset, 0, (GuiBOPPageList.EditBoxEntry)field); + return this.createTextField(this.width / 2 - 155 + xOffset, 0, (EditBoxEntry)field); } else if (field instanceof GuiBOPPageList.GuiLabelEntry) { - return (Gui)this.createLabel(this.width / 2 - 155 + xOffset, 0, (GuiBOPPageList.GuiLabelEntry)field, hasNoNeighbor); + return this.createLabel(this.width / 2 - 155 + xOffset, 0, (GuiLabelEntry)field, hasNoNeighbor); } else if (field instanceof GuiBOPPageList.GuiEnumButtonEntry) { - return (Gui)this.createEnumButton(this.width / 2 - 155 + xOffset, 0, (GuiBOPPageList.GuiEnumButtonEntry)field); + return this.createEnumButton(this.width / 2 - 155 + xOffset, 0, (GuiEnumButtonEntry)field); } else { @@ -268,7 +268,7 @@ public class GuiBOPPageTable extends GuiBOPPageList ++focusedGuiIndex; //Cycle forwards through the text fields } - this.focusedGui = (Gui)this.allTextFieldGuis.get(focusedGuiIndex); + this.focusedGui = this.allTextFieldGuis.get(focusedGuiIndex); guitextfield = (GuiTextField)this.focusedGui; guitextfield.setFocused(true); int k1 = guitextfield.y + this.slotHeight; @@ -300,7 +300,7 @@ public class GuiBOPPageTable extends GuiBOPPageList for (int i1 = 0; i1 < l; ++i1) { String s1 = astring1[i1]; - ((GuiTextField)this.allTextFieldGuis.get(k)).setText(s1); + this.allTextFieldGuis.get(k).setText(s1); if (k == this.allTextFieldGuis.size() - 1) { @@ -322,7 +322,7 @@ public class GuiBOPPageTable extends GuiBOPPageList public GuiBOPPageList.GuiRowEntry getRow(int rowNum) { - return (GuiBOPPageList.GuiRowEntry)this.allRows.get(rowNum); + return this.allRows.get(rowNum); } @Override diff --git a/src/main/java/biomesoplenty/client/gui/GuiEnumButton.java b/src/main/java/biomesoplenty/client/gui/GuiEnumButton.java index 7a6c59073..8e5440647 100644 --- a/src/main/java/biomesoplenty/client/gui/GuiEnumButton.java +++ b/src/main/java/biomesoplenty/client/gui/GuiEnumButton.java @@ -24,7 +24,7 @@ public class GuiEnumButton extends GuiButton private String buildDisplayString() { - return I18n.format(this.localizationStr, new Object[] {this.value.toString()}); + return I18n.format(this.localizationStr, this.value.toString()); } public void setValue(T value) diff --git a/src/main/java/biomesoplenty/client/particle/EntityPixieTrailFX.java b/src/main/java/biomesoplenty/client/particle/EntityPixieTrailFX.java index 5b51fa4d9..7f8222953 100644 --- a/src/main/java/biomesoplenty/client/particle/EntityPixieTrailFX.java +++ b/src/main/java/biomesoplenty/client/particle/EntityPixieTrailFX.java @@ -43,7 +43,7 @@ public class EntityPixieTrailFX extends Particle this.particleScale *= par14; this.particleMaxAge = (int)((8.0D / (Math.random() * 0.8D + 0.2D)) * 8); this.particleMaxAge = (int)((float)this.particleMaxAge * par14); - this.particleAge = (particleMaxAge / 2) + (int)((particleMaxAge / 2) * world.rand.nextInt(7)); + this.particleAge = (particleMaxAge / 2) + (particleMaxAge / 2) * world.rand.nextInt(7); this.particleAlpha = 1.0F; this.particleRed = 1.0F; this.particleGreen = 1.0F; diff --git a/src/main/java/biomesoplenty/client/texture/ForgeRedirectedResourcePack.java b/src/main/java/biomesoplenty/client/texture/ForgeRedirectedResourcePack.java index c76e4697e..4513400cb 100644 --- a/src/main/java/biomesoplenty/client/texture/ForgeRedirectedResourcePack.java +++ b/src/main/java/biomesoplenty/client/texture/ForgeRedirectedResourcePack.java @@ -19,7 +19,7 @@ public class ForgeRedirectedResourcePack extends FMLFileResourcePack { super(container); - this.bopResourcePack = (IResourcePack)FMLClientHandler.instance().getResourcePackFor(BiomesOPlenty.MOD_ID); + this.bopResourcePack = FMLClientHandler.instance().getResourcePackFor(BiomesOPlenty.MOD_ID); } @Override diff --git a/src/main/java/biomesoplenty/client/util/TextureUtils.java b/src/main/java/biomesoplenty/client/util/TextureUtils.java index e683b3673..5a9afb3ef 100644 --- a/src/main/java/biomesoplenty/client/util/TextureUtils.java +++ b/src/main/java/biomesoplenty/client/util/TextureUtils.java @@ -16,6 +16,6 @@ public class TextureUtils public static ResourceLocation completeResourceLocation(ResourceLocation location, int mode) { - return mode == 0 ? new ResourceLocation(location.getResourceDomain(), String.format("%s/%s%s", new Object[] {TEXTURES_BASE_PATH, location.getResourcePath(), ".png"})) : new ResourceLocation(location.getResourceDomain(), String.format("%s/mipmaps/%s.%d%s", new Object[] {TEXTURES_BASE_PATH, location.getResourcePath(), Integer.valueOf(mode), ".png"})); + return mode == 0 ? new ResourceLocation(location.getResourceDomain(), String.format("%s/%s%s", TEXTURES_BASE_PATH, location.getResourcePath(), ".png")) : new ResourceLocation(location.getResourceDomain(), String.format("%s/mipmaps/%s.%d%s", TEXTURES_BASE_PATH, location.getResourcePath(), Integer.valueOf(mode), ".png")); } } diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenAlps.java b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenAlps.java index 96c5b640c..9eaa4f997 100644 --- a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenAlps.java +++ b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenAlps.java @@ -36,7 +36,7 @@ import net.minecraft.world.biome.Biome.SpawnListEntry; public class BiomeGenAlps extends BOPOverworldBiome { - public static enum AlpsType {ALPS, ALPS_FOOTHILLS} + public enum AlpsType {ALPS, ALPS_FOOTHILLS} public AlpsType type; diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenMountain.java b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenMountain.java index 398b3d0b1..99c640652 100644 --- a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenMountain.java +++ b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenMountain.java @@ -51,7 +51,7 @@ import net.minecraft.world.chunk.ChunkPrimer; public class BiomeGenMountain extends BOPOverworldBiome { - public static enum MountainType {MOUNTAIN, MOUNTAIN_FOOTHILLS} + public enum MountainType {MOUNTAIN, MOUNTAIN_FOOTHILLS} public MountainType type; public IBlockState grassBlock; diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPAsh.java b/src/main/java/biomesoplenty/common/block/BlockBOPAsh.java index ce8564394..26bf83e9a 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPAsh.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPAsh.java @@ -79,7 +79,7 @@ public class BlockBOPAsh extends BlockBOPGeneric { if (random.nextInt(2) == 0) { - world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, pos.getX() + random.nextFloat(), pos.getY() + 1.1F, pos.getZ() + random.nextFloat(), 0.0D, 0.0D, 0.0D, new int[0]); + world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, pos.getX() + random.nextFloat(), pos.getY() + 1.1F, pos.getZ() + random.nextFloat(), 0.0D, 0.0D, 0.0D); } } diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPBamboo.java b/src/main/java/biomesoplenty/common/block/BlockBOPBamboo.java index 0ca08e9e8..a28e6603f 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPBamboo.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPBamboo.java @@ -34,7 +34,7 @@ public class BlockBOPBamboo extends BlockBOPDecoration // add properties public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 15); @Override - protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { AGE });} + protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, AGE);} public BlockBOPBamboo() @@ -104,7 +104,7 @@ public class BlockBOPBamboo extends BlockBOPDecoration @Override public int getMetaFromState(IBlockState state) { - return ((Integer)state.getValue(AGE)).intValue(); + return state.getValue(AGE).intValue(); } @Override @@ -128,7 +128,7 @@ public class BlockBOPBamboo extends BlockBOPDecoration { if (this.checkAndDropBlock(worldIn, pos, state) && worldIn.isAirBlock(pos.up())) { - int age = ((Integer)state.getValue(AGE)).intValue(); + int age = state.getValue(AGE).intValue(); int treeHeight = 1; while (worldIn.getBlockState(pos.down(treeHeight)).getBlock() == this) {++treeHeight;} diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPBiomeBlock.java b/src/main/java/biomesoplenty/common/block/BlockBOPBiomeBlock.java index b7b27e58c..a5d33a39d 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPBiomeBlock.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPBiomeBlock.java @@ -48,7 +48,6 @@ public class BlockBOPBiomeBlock extends BlockBOPGeneric biomesWithEssence = new ArrayList(); List vanillaBiomesToExclude = Arrays.asList( - new Biome[] { Biomes.DEFAULT, Biomes.SKY, Biomes.HELL, @@ -96,9 +95,7 @@ public class BlockBOPBiomeBlock extends BlockBOPGeneric Biomes.MUTATED_TAIGA_COLD, Biomes.REDWOOD_TAIGA_HILLS, Biomes.SAVANNA_PLATEAU, - Biomes.TAIGA_HILLS - } - ); + Biomes.TAIGA_HILLS); for (Biome biome : BiomeUtils.getRegisteredBiomes()) { diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPCoral.java b/src/main/java/biomesoplenty/common/block/BlockBOPCoral.java index b28536ef2..6a96bc27d 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPCoral.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPCoral.java @@ -24,7 +24,7 @@ import net.minecraft.world.World; public class BlockBOPCoral extends BlockBOPDecoration { - public static enum CoralType implements IStringSerializable + public enum CoralType implements IStringSerializable { PINK, ORANGE, BLUE, GLOWING, ALGAE; @Override @@ -37,10 +37,11 @@ public class BlockBOPCoral extends BlockBOPDecoration { return this.getName(); } - }; + } + public static PropertyEnum VARIANT = PropertyEnum.create("variant", CoralType.class); @Override - protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { LEVEL, VARIANT });} + protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, LEVEL, VARIANT);} // implement IBOPBlock @Override diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPCrystal.java b/src/main/java/biomesoplenty/common/block/BlockBOPCrystal.java index 9cfda9f73..be13eb04c 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPCrystal.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPCrystal.java @@ -59,12 +59,7 @@ public class BlockBOPCrystal extends Block implements IBOPBlock public boolean canEntityDestroy(IBlockState state, IBlockAccess world, BlockPos pos, Entity entity) { //Prevent the ender dragon from destroying this block - if (entity instanceof EntityDragon) - { - return false; - } - - return true; + return !(entity instanceof EntityDragon); } @Override diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPDirt.java b/src/main/java/biomesoplenty/common/block/BlockBOPDirt.java index d40333813..e1d48d0f1 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPDirt.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPDirt.java @@ -37,7 +37,7 @@ import net.minecraftforge.fml.relauncher.SideOnly; public class BlockBOPDirt extends Block implements IBOPBlock, ISustainsPlantType { // add properties - public static enum BOPDirtType implements IStringSerializable, IPagedVariants + public enum BOPDirtType implements IStringSerializable, IPagedVariants { LOAMY, SANDY, SILTY; @Override @@ -50,11 +50,12 @@ public class BlockBOPDirt extends Block implements IBOPBlock, ISustainsPlantType { return this.getName(); } - }; + } + public static final PropertyEnum VARIANT = PropertyEnum.create("variant", BOPDirtType.class); public static final PropertyBool COARSE = PropertyBool.create("coarse"); @Override - protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { COARSE, VARIANT });} + protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, COARSE, VARIANT);} // implement IBOPBlock @Override diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPDoubleDecoration.java b/src/main/java/biomesoplenty/common/block/BlockBOPDoubleDecoration.java index 0c73bf95b..4f71f7ac1 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPDoubleDecoration.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPDoubleDecoration.java @@ -28,7 +28,7 @@ import net.minecraft.world.World; public class BlockBOPDoubleDecoration extends BlockBOPDecoration { // add half property - public static enum Half implements IStringSerializable + public enum Half implements IStringSerializable { LOWER, UPPER; @Override @@ -41,10 +41,11 @@ public class BlockBOPDoubleDecoration extends BlockBOPDecoration { { return this.getName(); } - }; + } + public static final PropertyEnum HALF = PropertyEnum.create("half", Half.class); @Override - protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { HALF });} + protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, HALF);} @Override public IProperty[] getNonRenderingProperties() { return null; } diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPDoublePlant.java b/src/main/java/biomesoplenty/common/block/BlockBOPDoublePlant.java index aef103230..8aacbe1b1 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPDoublePlant.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPDoublePlant.java @@ -42,7 +42,7 @@ import net.minecraftforge.fml.relauncher.SideOnly; public class BlockBOPDoublePlant extends BlockBOPDoubleDecoration implements IShearable { // add properties (note we inherit HALF from BlockDoubleDecoration) - public static enum DoublePlantType implements IStringSerializable + public enum DoublePlantType implements IStringSerializable { FLAX, TALL_CATTAIL, EYEBULB; @Override @@ -55,10 +55,11 @@ public class BlockBOPDoublePlant extends BlockBOPDoubleDecoration implements ISh { return this.getName(); } - }; + } + public static final PropertyEnum VARIANT = PropertyEnum.create("variant", DoublePlantType.class); @Override - protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { HALF, VARIANT });} + protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, HALF, VARIANT);} // implement IBOPBlock @@ -72,7 +73,7 @@ public class BlockBOPDoublePlant extends BlockBOPDoubleDecoration implements ISh return ((DoublePlantType) state.getValue(VARIANT)).getName(); } - public enum ColoringType {PLAIN, LIKE_LEAVES, LIKE_GRASS}; + public enum ColoringType {PLAIN, LIKE_LEAVES, LIKE_GRASS} public static ColoringType getColoringType(DoublePlantType plant) { diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPDoubleWoodSlab.java b/src/main/java/biomesoplenty/common/block/BlockBOPDoubleWoodSlab.java index 69a02f175..efe20e864 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPDoubleWoodSlab.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPDoubleWoodSlab.java @@ -72,7 +72,7 @@ public class BlockBOPDoubleWoodSlab extends BlockSlab implements IBOPBlock protected BlockStateContainer createBlockState() { this.variantProperty = currentVariantProperty; // get from static variable - return new BlockStateContainer(this, new IProperty[] { HALF, this.variantProperty }); + return new BlockStateContainer(this, HALF, this.variantProperty); } // implement IBOPBlock diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPFarmland.java b/src/main/java/biomesoplenty/common/block/BlockBOPFarmland.java index 3471de89c..996da3ee7 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPFarmland.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPFarmland.java @@ -62,7 +62,7 @@ public class BlockBOPFarmland extends BlockFarmland implements IBOPBlock protected BlockStateContainer createBlockState() { this.variantProperty = currentVariantProperty; - return new BlockStateContainer(this, new IProperty[] { MOISTURE, this.variantProperty }); + return new BlockStateContainer(this, MOISTURE, this.variantProperty); } @Override diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPFlower.java b/src/main/java/biomesoplenty/common/block/BlockBOPFlower.java index 3da143c6f..bdcdee8fe 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPFlower.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPFlower.java @@ -77,7 +77,7 @@ public class BlockBOPFlower extends BlockBOPDecoration implements IShearable, IH protected BlockStateContainer createBlockState() { this.variantProperty = currentVariantProperty; // get from static variable - return new BlockStateContainer(this, new IProperty[] { this.variantProperty }); + return new BlockStateContainer(this, this.variantProperty); } @@ -220,16 +220,16 @@ public class BlockBOPFlower extends BlockBOPDecoration implements IShearable, IH { case DEATHBLOOM: if (rand.nextInt(4) != 0) - world.spawnParticle(EnumParticleTypes.TOWN_AURA, pos.getX() + rand.nextFloat(), pos.getY() + rand.nextFloat(), pos.getZ() + rand.nextFloat(), 0.0D, 0.0D, 0.0D, new int[0]); + world.spawnParticle(EnumParticleTypes.TOWN_AURA, pos.getX() + rand.nextFloat(), pos.getY() + rand.nextFloat(), pos.getZ() + rand.nextFloat(), 0.0D, 0.0D, 0.0D); if (rand.nextInt(4) == 0) - world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, pos.getX() + rand.nextFloat(), pos.getY() + rand.nextFloat(), pos.getZ() + rand.nextFloat(), 0.0D, 0.0D, 0.0D, new int[0]); + world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, pos.getX() + rand.nextFloat(), pos.getY() + rand.nextFloat(), pos.getZ() + rand.nextFloat(), 0.0D, 0.0D, 0.0D); break; case BURNING_BLOSSOM: if (rand.nextInt(2) == 0) - world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, pos.getX() + rand.nextFloat(), pos.getY() + rand.nextFloat(), pos.getZ() + rand.nextFloat(), 0.0D, 0.0D, 0.0D, new int[0]); + world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, pos.getX() + rand.nextFloat(), pos.getY() + rand.nextFloat(), pos.getZ() + rand.nextFloat(), 0.0D, 0.0D, 0.0D); if (rand.nextInt(4) == 0) - world.spawnParticle(EnumParticleTypes.FLAME, pos.getX() + rand.nextFloat(), pos.getY() + rand.nextFloat(), pos.getZ() + rand.nextFloat(), 0.0D, 0.0D, 0.0D, new int[0]); + world.spawnParticle(EnumParticleTypes.FLAME, pos.getX() + rand.nextFloat(), pos.getY() + rand.nextFloat(), pos.getZ() + rand.nextFloat(), 0.0D, 0.0D, 0.0D); break; default: diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPGem.java b/src/main/java/biomesoplenty/common/block/BlockBOPGem.java index 21a0479d2..3dd05f2e8 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPGem.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPGem.java @@ -28,7 +28,7 @@ public class BlockBOPGem extends Block implements IBOPBlock // add properties public static final PropertyEnum VARIANT = PropertyEnum.create("variant", BOPGems.class); @Override - protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { VARIANT });} + protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, VARIANT);} // implement IBOPBlock diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPGemOre.java b/src/main/java/biomesoplenty/common/block/BlockBOPGemOre.java index caefae43f..74ed79536 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPGemOre.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPGemOre.java @@ -38,7 +38,7 @@ public class BlockBOPGemOre extends Block implements IBOPBlock // add properties (note VARIANT is imported statically from the BlockGem class) @Override - protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { VARIANT });} + protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, VARIANT);} // implement IBOPBlock diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPGrass.java b/src/main/java/biomesoplenty/common/block/BlockBOPGrass.java index 26d7dbf0e..d74a9ecea 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPGrass.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPGrass.java @@ -49,7 +49,7 @@ import net.minecraftforge.fml.relauncher.SideOnly; public class BlockBOPGrass extends BlockGrass implements IBOPBlock, ISustainsPlantType { // add properties (note we also inherit the SNOWY property from BlockGrass) - public static enum BOPGrassType implements IStringSerializable + public enum BOPGrassType implements IStringSerializable { SPECTRAL_MOSS, OVERGROWN_STONE, LOAMY, SANDY, SILTY, ORIGIN, OVERGROWN_NETHERRACK, DAISY, MYCELIAL_NETHERRACK; @Override @@ -62,10 +62,11 @@ public class BlockBOPGrass extends BlockGrass implements IBOPBlock, ISustainsPla { return this.getName(); } - }; + } + public static final PropertyEnum VARIANT = PropertyEnum.create("variant", BOPGrassType.class); @Override - protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { SNOWY, VARIANT });} + protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, SNOWY, VARIANT);} // implement IBOPBlock @@ -466,7 +467,7 @@ public class BlockBOPGrass extends BlockGrass implements IBOPBlock, ISustainsPla { if (rand.nextInt(10) == 0) { - world.spawnParticle(EnumParticleTypes.TOWN_AURA, (double)((float)pos.getX() + rand.nextFloat()), (double)((float)pos.getY() + 1.1F), (double)((float)pos.getZ() + rand.nextFloat()), 0.0D, 0.0D, 0.0D, new int[0]); + world.spawnParticle(EnumParticleTypes.TOWN_AURA, (double)((float)pos.getX() + rand.nextFloat()), (double)((float)pos.getY() + 1.1F), (double)((float)pos.getZ() + rand.nextFloat()), 0.0D, 0.0D, 0.0D); } } } diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPGrassPath.java b/src/main/java/biomesoplenty/common/block/BlockBOPGrassPath.java index 1e7aef68c..12d30e0eb 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPGrassPath.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPGrassPath.java @@ -47,7 +47,7 @@ public class BlockBOPGrassPath extends BlockGrassPath implements IBOPBlock protected BlockStateContainer createBlockState() { this.variantProperty = currentVariantProperty; - return new BlockStateContainer(this, new IProperty[] { this.variantProperty }); + return new BlockStateContainer(this, this.variantProperty); } @Override diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPHalfOtherSlab.java b/src/main/java/biomesoplenty/common/block/BlockBOPHalfOtherSlab.java index cf62a8a93..5cc72ea36 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPHalfOtherSlab.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPHalfOtherSlab.java @@ -42,7 +42,7 @@ public class BlockBOPHalfOtherSlab extends BlockSlab implements IBOPBlock { // add properties - public static enum SlabType implements IStringSerializable + public enum SlabType implements IStringSerializable { MUD_BRICK, WHITE_SANDSTONE; @Override @@ -73,12 +73,12 @@ public class BlockBOPHalfOtherSlab extends BlockSlab implements IBOPBlock } return state; } - }; - + } + // add properties (note we inherit HALF property from parent BlockSlab) public static final PropertyEnum VARIANT = PropertyEnum.create("variant", SlabType.class); @Override - protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { HALF, VARIANT });} + protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, HALF, VARIANT);} // implement IBOPBlock diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPHalfWoodSlab.java b/src/main/java/biomesoplenty/common/block/BlockBOPHalfWoodSlab.java index b1b5ab023..618f64fff 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPHalfWoodSlab.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPHalfWoodSlab.java @@ -71,7 +71,7 @@ public class BlockBOPHalfWoodSlab extends BlockSlab implements IBOPBlock protected BlockStateContainer createBlockState() { this.variantProperty = currentVariantProperty; // get from static variable - return new BlockStateContainer(this, new IProperty[] { HALF, this.variantProperty }); + return new BlockStateContainer(this, HALF, this.variantProperty); } // implement IBOPBlock diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPHive.java b/src/main/java/biomesoplenty/common/block/BlockBOPHive.java index d10cabeeb..78db74c0e 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPHive.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPHive.java @@ -37,7 +37,7 @@ public class BlockBOPHive extends Block implements IBOPBlock { // add properties - public static enum HiveType implements IStringSerializable + public enum HiveType implements IStringSerializable { HIVE, HONEYCOMB, EMPTY_HONEYCOMB, FILLED_HONEYCOMB; @Override @@ -50,10 +50,11 @@ public class BlockBOPHive extends Block implements IBOPBlock { return this.getName(); } - }; + } + public static final PropertyEnum VARIANT = PropertyEnum.create("variant", HiveType.class); @Override - protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { VARIANT });} + protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, VARIANT);} // implement IBOPBlock diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPLeaves.java b/src/main/java/biomesoplenty/common/block/BlockBOPLeaves.java index bf3485f41..4ca83d2c1 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPLeaves.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPLeaves.java @@ -82,7 +82,7 @@ public class BlockBOPLeaves extends BlockLeaves implements IBOPBlock protected BlockStateContainer createBlockState() { this.variantProperty = currentVariantProperty; // get from static variable - return new BlockStateContainer(this, new IProperty[] { CHECK_DECAY, DECAYABLE, this.variantProperty }); + return new BlockStateContainer(this, CHECK_DECAY, DECAYABLE, this.variantProperty); } @@ -106,7 +106,7 @@ public class BlockBOPLeaves extends BlockLeaves implements IBOPBlock } } - public enum ColoringType {PLAIN, TINTED, OVERLAY}; + public enum ColoringType {PLAIN, TINTED, OVERLAY} public static ColoringType getColoringType(BOPTrees tree) { @@ -174,11 +174,11 @@ public class BlockBOPLeaves extends BlockLeaves implements IBOPBlock { BOPTrees tree = (BOPTrees) state.getValue(this.variantProperty); int meta = paging.getIndex(tree); - if (!((Boolean)state.getValue(DECAYABLE)).booleanValue()) + if (!state.getValue(DECAYABLE).booleanValue()) { meta |= 4; } - if (((Boolean)state.getValue(CHECK_DECAY)).booleanValue()) + if (state.getValue(CHECK_DECAY).booleanValue()) { meta |= 8; } diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPLilypad.java b/src/main/java/biomesoplenty/common/block/BlockBOPLilypad.java index ab6cffc22..9d668f09a 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPLilypad.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPLilypad.java @@ -32,7 +32,7 @@ public class BlockBOPLilypad extends BlockLilyPad implements IBOPBlock { // add properties - public static enum LilypadType implements IStringSerializable + public enum LilypadType implements IStringSerializable { MEDIUM, SMALL, TINY, FLOWER; @Override @@ -45,10 +45,11 @@ public class BlockBOPLilypad extends BlockLilyPad implements IBOPBlock { return this.getName(); } - }; + } + public static final PropertyEnum VARIANT = PropertyEnum.create("variant", LilypadType.class); @Override - protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { VARIANT });} + protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, VARIANT);} // implement IBOPBlock diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPLog.java b/src/main/java/biomesoplenty/common/block/BlockBOPLog.java index a63ec3560..b6f4d5f6b 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPLog.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPLog.java @@ -63,7 +63,7 @@ public class BlockBOPLog extends BlockLog implements IBOPBlock protected BlockStateContainer createBlockState() { this.variantProperty = currentVariantProperty; // get from static variable - return new BlockStateContainer(this, new IProperty[] { LOG_AXIS, this.variantProperty }); + return new BlockStateContainer(this, LOG_AXIS, this.variantProperty); } @@ -114,7 +114,7 @@ public class BlockBOPLog extends BlockLog implements IBOPBlock public int getMetaFromState(IBlockState state) { BOPWoods wood = (BOPWoods) state.getValue(this.variantProperty); - return ((BlockLog.EnumAxis) state.getValue(LOG_AXIS)).ordinal() * 4 + paging.getIndex(wood); + return state.getValue(LOG_AXIS).ordinal() * 4 + paging.getIndex(wood); } // discard the axis information - otherwise logs facing different directions would not stack together diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPMud.java b/src/main/java/biomesoplenty/common/block/BlockBOPMud.java index ca236f1b1..9199b29ac 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPMud.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPMud.java @@ -45,7 +45,7 @@ public class BlockBOPMud extends Block implements IBOPBlock, ISustainsPlantType protected static final AxisAlignedBB MUD_AABB = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.875D, 1.0D); // add properties - public static enum MudType implements IStringSerializable + public enum MudType implements IStringSerializable { MUD; @Override @@ -58,10 +58,11 @@ public class BlockBOPMud extends Block implements IBOPBlock, ISustainsPlantType { return this.getName(); } - }; + } + public static final PropertyEnum VARIANT = PropertyEnum.create("variant", MudType.class); @Override - protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { VARIANT });} + protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, VARIANT);} // implement IBOPBlock diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPMushroom.java b/src/main/java/biomesoplenty/common/block/BlockBOPMushroom.java index 64ec3a612..1f62b1013 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPMushroom.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPMushroom.java @@ -29,7 +29,7 @@ import net.minecraftforge.fml.relauncher.SideOnly; public class BlockBOPMushroom extends BlockBOPDecoration { // add properties - public static enum MushroomType implements IStringSerializable + public enum MushroomType implements IStringSerializable { TOADSTOOL, PORTOBELLO, BLUE_MILK_CAP, GLOWSHROOM, FLAT_MUSHROOM, SHADOW_SHROOM; @Override @@ -42,10 +42,11 @@ public class BlockBOPMushroom extends BlockBOPDecoration { return this.getName(); } - }; + } + public static final PropertyEnum VARIANT = PropertyEnum.create("variant", MushroomType.class); @Override - protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { VARIANT });} + protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, VARIANT);} // implement IBOPBlock @@ -98,7 +99,7 @@ public class BlockBOPMushroom extends BlockBOPDecoration @Override public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { - MushroomType plant = (MushroomType) state.getValue(this.VARIANT); + MushroomType plant = (MushroomType) state.getValue(VARIANT); switch (plant) { case GLOWSHROOM: case SHADOW_SHROOM: diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPPlanks.java b/src/main/java/biomesoplenty/common/block/BlockBOPPlanks.java index 641c29efe..45cf197e6 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPPlanks.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPPlanks.java @@ -60,7 +60,7 @@ public class BlockBOPPlanks extends Block implements IBOPBlock protected BlockStateContainer createBlockState() { this.variantProperty = currentVariantProperty; // get from static variable - return new BlockStateContainer(this, new IProperty[] { this.variantProperty }); + return new BlockStateContainer(this, this.variantProperty); } diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPPlant.java b/src/main/java/biomesoplenty/common/block/BlockBOPPlant.java index 33029115d..73c9805d9 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPPlant.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPPlant.java @@ -91,7 +91,7 @@ public class BlockBOPPlant extends BlockBOPDecoration implements IShearable, IHo protected BlockStateContainer createBlockState() { this.variantProperty = currentVariantProperty; // get from static variable - return new BlockStateContainer(this, new IProperty[] { this.variantProperty }); + return new BlockStateContainer(this, this.variantProperty); } @@ -114,7 +114,7 @@ public class BlockBOPPlant extends BlockBOPDecoration implements IShearable, IHo } } - public enum ColoringType {PLAIN, LIKE_LEAVES, LIKE_GRASS}; + public enum ColoringType {PLAIN, LIKE_LEAVES, LIKE_GRASS} public static ColoringType getColoringType(BOPPlants plant) { diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPSapling.java b/src/main/java/biomesoplenty/common/block/BlockBOPSapling.java index acaf4c9b4..20b0b6c07 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPSapling.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPSapling.java @@ -85,7 +85,7 @@ public class BlockBOPSapling extends BlockBOPDecoration implements IGrowable, IP protected BlockStateContainer createBlockState() { this.variantProperty = currentVariantProperty; // get from static variable - return new BlockStateContainer(this, new IProperty[] { STAGE, this.variantProperty }); + return new BlockStateContainer(this, STAGE, this.variantProperty); } @@ -122,7 +122,7 @@ public class BlockBOPSapling extends BlockBOPDecoration implements IGrowable, IP public int getMetaFromState(IBlockState state) { BOPTrees tree = (BOPTrees)state.getValue(this.variantProperty); - return ((Integer)state.getValue(STAGE)).intValue() * 8 + paging.getIndex(tree); + return state.getValue(STAGE).intValue() * 8 + paging.getIndex(tree); } // which types of mushroom can live on which types of block @@ -261,7 +261,7 @@ public class BlockBOPSapling extends BlockBOPDecoration implements IGrowable, IP @Override public void grow(World worldIn, Random rand, BlockPos pos, IBlockState state) { - if (((Integer)state.getValue(STAGE)).intValue() == 0) + if (state.getValue(STAGE).intValue() == 0) { worldIn.setBlockState(pos, state.cycleProperty(STAGE), 4); } @@ -313,7 +313,7 @@ public class BlockBOPSapling extends BlockBOPDecoration implements IGrowable, IP // otherwise, try to grow a small tree if (smallTreeGenerator != null) { - if (this.generateSmallOrBigTree(worldIn, pos, state, rand, smallTreeGenerator)) {return true;} + return this.generateSmallOrBigTree(worldIn, pos, state, rand, smallTreeGenerator); } return false; } diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPSeaweed.java b/src/main/java/biomesoplenty/common/block/BlockBOPSeaweed.java index dd6bd1f53..162143820 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPSeaweed.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPSeaweed.java @@ -30,7 +30,7 @@ public class BlockBOPSeaweed extends BlockBOPDecoration implements IBOPBlock // TODO: is it supposed to grow? - public static enum SeaweedType implements IStringSerializable + public enum SeaweedType implements IStringSerializable { KELP; @Override @@ -43,9 +43,9 @@ public class BlockBOPSeaweed extends BlockBOPDecoration implements IBOPBlock { return this.getName(); } - }; - - public static enum SeaweedPosition implements IStringSerializable + } + + public enum SeaweedPosition implements IStringSerializable { SINGLE, BOTTOM, MIDDLE, TOP; @Override @@ -64,7 +64,7 @@ public class BlockBOPSeaweed extends BlockBOPDecoration implements IBOPBlock public static final PropertyEnum POSITION = PropertyEnum.create("position", SeaweedPosition.class); @Override - protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { LEVEL, POSITION, VARIANT });} + protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, LEVEL, POSITION, VARIANT);} // implement IBOPBlock diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPStoneFormations.java b/src/main/java/biomesoplenty/common/block/BlockBOPStoneFormations.java index e15d0d6f2..80218c252 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPStoneFormations.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPStoneFormations.java @@ -31,7 +31,7 @@ import net.minecraftforge.fml.relauncher.SideOnly; public class BlockBOPStoneFormations extends BlockBOPDecoration implements IBOPBlock { // add properties - public static enum FormationType implements IStringSerializable + public enum FormationType implements IStringSerializable { STONE_FORMATION; @Override @@ -44,9 +44,9 @@ public class BlockBOPStoneFormations extends BlockBOPDecoration implements IBOPB { return this.getName(); } - }; - - public static enum FormationPosition implements IStringSerializable + } + + public enum FormationPosition implements IStringSerializable { STALAGMITE_SMALL, STALACTITE_SMALL, STAL_SINGLE, STAL_CONNECTOR, STALAGMITE_MEDIUM, STALACTITE_MEDIUM, STALAGMITE_TOP, STALACTITE_BOTTOM; @Override @@ -64,7 +64,7 @@ public class BlockBOPStoneFormations extends BlockBOPDecoration implements IBOPB public static final PropertyEnum VARIANT = PropertyEnum.create("variant", FormationType.class); public static final PropertyEnum POSITION = PropertyEnum.create("position", FormationPosition.class); @Override - protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { POSITION, VARIANT });} + protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, POSITION, VARIANT);} // implement IBOPBlock diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPTerrarium.java b/src/main/java/biomesoplenty/common/block/BlockBOPTerrarium.java index 12036069b..9ff3b5379 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPTerrarium.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPTerrarium.java @@ -34,7 +34,7 @@ public class BlockBOPTerrarium extends Block implements IBOPBlock protected static final AxisAlignedBB BOUNDING_BOX = new AxisAlignedBB(0.19999998807D, 0.0D, 0.19999998807D, 0.69999998808D, 0.69999998808D, 0.69999998808D); // add properties - public static enum TerrariumType implements IStringSerializable + public enum TerrariumType implements IStringSerializable { FERN, MUSHROOM, CACTUS, FLAX, FLOWER, KORU, BAMBOO, SAPLING, GLOWSHROOM, DEAD, MYSTIC, OMINOUS, WASTELAND, ORIGIN, NETHER, ENDER; @Override @@ -47,10 +47,11 @@ public class BlockBOPTerrarium extends Block implements IBOPBlock { return this.getName(); } - }; + } + public static final PropertyEnum VARIANT = PropertyEnum.create("variant", TerrariumType.class); @Override - protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { VARIANT });} + protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, VARIANT);} // implement IBOPBlock @@ -99,7 +100,7 @@ public class BlockBOPTerrarium extends Block implements IBOPBlock @Override public int getLightValue(IBlockState state) { - switch ((TerrariumType) state.getValue(this.VARIANT)) + switch ((TerrariumType) state.getValue(VARIANT)) { case GLOWSHROOM: return 5; diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPWhiteSandstone.java b/src/main/java/biomesoplenty/common/block/BlockBOPWhiteSandstone.java index f2517f68f..a9c795e44 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPWhiteSandstone.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPWhiteSandstone.java @@ -39,7 +39,7 @@ public class BlockBOPWhiteSandstone extends Block implements IBOPBlock { // add properties - public static enum StoneType implements IStringSerializable + public enum StoneType implements IStringSerializable { DEFAULT, CHISELED, SMOOTH; @Override @@ -52,10 +52,11 @@ public class BlockBOPWhiteSandstone extends Block implements IBOPBlock { return this.getName(); } - }; + } + public static final PropertyEnum VARIANT = PropertyEnum.create("variant", StoneType.class); @Override - protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { VARIANT });} + protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, VARIANT);} // implement IBOPBlock diff --git a/src/main/java/biomesoplenty/common/block/IBOPBlock.java b/src/main/java/biomesoplenty/common/block/IBOPBlock.java index f6220199f..cb8642b40 100644 --- a/src/main/java/biomesoplenty/common/block/IBOPBlock.java +++ b/src/main/java/biomesoplenty/common/block/IBOPBlock.java @@ -18,13 +18,13 @@ import net.minecraftforge.fml.relauncher.SideOnly; public interface IBOPBlock { - public Class getItemClass(); - public IProperty[] getPresetProperties(); - public IProperty[] getNonRenderingProperties(); - public String getStateName(IBlockState state); + Class getItemClass(); + IProperty[] getPresetProperties(); + IProperty[] getNonRenderingProperties(); + String getStateName(IBlockState state); @SideOnly(Side.CLIENT) - public IBlockColor getBlockColor(); + IBlockColor getBlockColor(); @SideOnly(Side.CLIENT) - public IItemColor getItemColor(); + IItemColor getItemColor(); } \ No newline at end of file diff --git a/src/main/java/biomesoplenty/common/block/ISustainsPlantType.java b/src/main/java/biomesoplenty/common/block/ISustainsPlantType.java index cdc5c204c..686fc5d66 100644 --- a/src/main/java/biomesoplenty/common/block/ISustainsPlantType.java +++ b/src/main/java/biomesoplenty/common/block/ISustainsPlantType.java @@ -14,5 +14,5 @@ import net.minecraftforge.common.EnumPlantType; public interface ISustainsPlantType { - public boolean canSustainPlantType(IBlockAccess world, BlockPos pos, EnumPlantType plantType); + boolean canSustainPlantType(IBlockAccess world, BlockPos pos, EnumPlantType plantType); } \ No newline at end of file diff --git a/src/main/java/biomesoplenty/common/command/BOPCommand.java b/src/main/java/biomesoplenty/common/command/BOPCommand.java index 2940fca39..f02ead198 100644 --- a/src/main/java/biomesoplenty/common/command/BOPCommand.java +++ b/src/main/java/biomesoplenty/common/command/BOPCommand.java @@ -142,8 +142,7 @@ public class BOPCommand extends CommandBase } } - private void printStats(ICommandSender sender, String[] args) throws CommandException - { + private void printStats(ICommandSender sender, String[] args) { TextComponentTranslation text = new TextComponentTranslation("commands.biomesoplenty.stats.blocks", blockCount); text.getStyle().setColor(TextFormatting.GREEN); diff --git a/src/main/java/biomesoplenty/common/entities/EntityPixie.java b/src/main/java/biomesoplenty/common/entities/EntityPixie.java index 8499723bf..7e6e8ddbc 100644 --- a/src/main/java/biomesoplenty/common/entities/EntityPixie.java +++ b/src/main/java/biomesoplenty/common/entities/EntityPixie.java @@ -186,11 +186,7 @@ public class EntityPixie extends EntityFlying implements IMob { return false; } } - if (this.isBoxBlocked(box.offset(this.aimX * howFar, this.aimY * howFar, this.aimZ * howFar))) - { - return false; - } - return true; + return !this.isBoxBlocked(box.offset(this.aimX * howFar, this.aimY * howFar, this.aimZ * howFar)); } } diff --git a/src/main/java/biomesoplenty/common/entities/EntityWasp.java b/src/main/java/biomesoplenty/common/entities/EntityWasp.java index bf918f4d5..0e9cd1099 100644 --- a/src/main/java/biomesoplenty/common/entities/EntityWasp.java +++ b/src/main/java/biomesoplenty/common/entities/EntityWasp.java @@ -151,11 +151,7 @@ public class EntityWasp extends EntityFlying implements IMob { return false; } } - if (this.isBoxBlocked(box.offset(this.aimX * howFar, this.aimY * howFar, this.aimZ * howFar))) - { - return false; - } - return true; + return !this.isBoxBlocked(box.offset(this.aimX * howFar, this.aimY * howFar, this.aimZ * howFar)); } } diff --git a/src/main/java/biomesoplenty/common/entities/ai/EntityAIEatBOPGrass.java b/src/main/java/biomesoplenty/common/entities/ai/EntityAIEatBOPGrass.java index 40cf662f2..1e958557e 100644 --- a/src/main/java/biomesoplenty/common/entities/ai/EntityAIEatBOPGrass.java +++ b/src/main/java/biomesoplenty/common/entities/ai/EntityAIEatBOPGrass.java @@ -105,14 +105,14 @@ public class EntityAIEatBOPGrass extends EntityAIEatGrass if (stateDown.getBlock() instanceof BlockBOPGrass) { BlockBOPGrass grass = (BlockBOPGrass) stateDown.getBlock(); - Block dirtBlock = grass.getDirtBlockState(stateDown).getBlock(); + Block dirtBlock = BlockBOPGrass.getDirtBlockState(stateDown).getBlock(); if (dirtBlock instanceof BlockBOPDirt) { if (this.world.getGameRules().getBoolean("mobGriefing")) { this.world.playEvent(2001, posDown, Block.getIdFromBlock(BOPBlocks.grass)); - this.world.setBlockState(posDown, grass.getDirtBlockState(stateDown), 2); + this.world.setBlockState(posDown, BlockBOPGrass.getDirtBlockState(stateDown), 2); } } else if (stateDown.getValue(BlockBOPGrass.VARIANT) == BlockBOPGrass.BOPGrassType.DAISY) diff --git a/src/main/java/biomesoplenty/common/fluids/blocks/BlockBloodFluid.java b/src/main/java/biomesoplenty/common/fluids/blocks/BlockBloodFluid.java index ec17f6158..7089c80d0 100644 --- a/src/main/java/biomesoplenty/common/fluids/blocks/BlockBloodFluid.java +++ b/src/main/java/biomesoplenty/common/fluids/blocks/BlockBloodFluid.java @@ -73,7 +73,7 @@ public class BlockBloodFluid extends BlockFluidClassic if (flag) { - Integer integer = (Integer)state.getValue(LEVEL); + Integer integer = state.getValue(LEVEL); if (integer.intValue() == 0) { diff --git a/src/main/java/biomesoplenty/common/fluids/blocks/BlockHoneyFluid.java b/src/main/java/biomesoplenty/common/fluids/blocks/BlockHoneyFluid.java index 29d72403e..8d7832b0c 100644 --- a/src/main/java/biomesoplenty/common/fluids/blocks/BlockHoneyFluid.java +++ b/src/main/java/biomesoplenty/common/fluids/blocks/BlockHoneyFluid.java @@ -88,7 +88,7 @@ public class BlockHoneyFluid extends BlockFluidFinite if (flag) { - Integer integer = (Integer)state.getValue(LEVEL); + Integer integer = state.getValue(LEVEL); if (integer.intValue() == 0) { diff --git a/src/main/java/biomesoplenty/common/fluids/blocks/BlockHotSpringWaterFluid.java b/src/main/java/biomesoplenty/common/fluids/blocks/BlockHotSpringWaterFluid.java index 57a2d580a..ab3bbdea7 100644 --- a/src/main/java/biomesoplenty/common/fluids/blocks/BlockHotSpringWaterFluid.java +++ b/src/main/java/biomesoplenty/common/fluids/blocks/BlockHotSpringWaterFluid.java @@ -55,7 +55,7 @@ public class BlockHotSpringWaterFluid extends BlockFluidClassic super.randomDisplayTick(state, world, pos, rand); if (rand.nextInt(25)==0) { - world.spawnParticle(EnumParticleTypes.CLOUD, pos.getX() + rand.nextFloat(), pos.getY() + 1.0F, pos.getZ() + rand.nextFloat(), 0.0D, 0.0D, 0.0D, new int[0]); + world.spawnParticle(EnumParticleTypes.CLOUD, pos.getX() + rand.nextFloat(), pos.getY() + 1.0F, pos.getZ() + rand.nextFloat(), 0.0D, 0.0D, 0.0D); } } @@ -103,7 +103,7 @@ public class BlockHotSpringWaterFluid extends BlockFluidClassic if (flag) { - Integer integer = (Integer)state.getValue(LEVEL); + Integer integer = state.getValue(LEVEL); if (integer.intValue() == 0) { diff --git a/src/main/java/biomesoplenty/common/fluids/blocks/BlockPoisonFluid.java b/src/main/java/biomesoplenty/common/fluids/blocks/BlockPoisonFluid.java index afb5cb9b1..695fb14af 100644 --- a/src/main/java/biomesoplenty/common/fluids/blocks/BlockPoisonFluid.java +++ b/src/main/java/biomesoplenty/common/fluids/blocks/BlockPoisonFluid.java @@ -88,7 +88,7 @@ public class BlockPoisonFluid extends BlockFluidClassic if (flag) { - Integer integer = (Integer)state.getValue(LEVEL); + Integer integer = state.getValue(LEVEL); if (integer.intValue() == 0) { diff --git a/src/main/java/biomesoplenty/common/fluids/blocks/BlockQuicksandFluid.java b/src/main/java/biomesoplenty/common/fluids/blocks/BlockQuicksandFluid.java index 1a6ad43e5..358508133 100644 --- a/src/main/java/biomesoplenty/common/fluids/blocks/BlockQuicksandFluid.java +++ b/src/main/java/biomesoplenty/common/fluids/blocks/BlockQuicksandFluid.java @@ -78,7 +78,7 @@ public class BlockQuicksandFluid extends BlockFluidClassic if (flag) { - Integer integer = (Integer)state.getValue(LEVEL); + Integer integer = state.getValue(LEVEL); if (integer.intValue() == 0) { diff --git a/src/main/java/biomesoplenty/common/handler/BucketEventHandler.java b/src/main/java/biomesoplenty/common/handler/BucketEventHandler.java index d332727b8..bcabd0af2 100644 --- a/src/main/java/biomesoplenty/common/handler/BucketEventHandler.java +++ b/src/main/java/biomesoplenty/common/handler/BucketEventHandler.java @@ -47,23 +47,23 @@ public class BucketEventHandler // determine if the block is one of our BOP fluids IBlockState iblockstate = event.getWorld().getBlockState(blockpos); Fluid filled_fluid = null; - if (iblockstate.getBlock() == BOPBlocks.sand && ((Integer)iblockstate.getValue(BlockQuicksandFluid.LEVEL)).intValue() == 0) + if (iblockstate.getBlock() == BOPBlocks.sand && iblockstate.getValue(BlockQuicksandFluid.LEVEL).intValue() == 0) { filled_fluid = QuicksandFluid.instance; } - else if (iblockstate.getBlock() == BOPBlocks.honey && ((Integer)iblockstate.getValue(BlockHoneyFluid.LEVEL)).intValue() == 0) + else if (iblockstate.getBlock() == BOPBlocks.honey && iblockstate.getValue(BlockHoneyFluid.LEVEL).intValue() == 0) { filled_fluid = HoneyFluid.instance; } - else if (iblockstate.getBlock() == BOPBlocks.blood && ((Integer)iblockstate.getValue(BlockBloodFluid.LEVEL)).intValue() == 0) + else if (iblockstate.getBlock() == BOPBlocks.blood && iblockstate.getValue(BlockBloodFluid.LEVEL).intValue() == 0) { filled_fluid = BloodFluid.instance; } - else if (iblockstate.getBlock() == BOPBlocks.poison && ((Integer)iblockstate.getValue(BlockPoisonFluid.LEVEL)).intValue() == 0) + else if (iblockstate.getBlock() == BOPBlocks.poison && iblockstate.getValue(BlockPoisonFluid.LEVEL).intValue() == 0) { filled_fluid = PoisonFluid.instance; } - else if (iblockstate.getBlock() == BOPBlocks.hot_spring_water && ((Integer)iblockstate.getValue(BlockHotSpringWaterFluid.LEVEL)).intValue() == 0) + else if (iblockstate.getBlock() == BOPBlocks.hot_spring_water && iblockstate.getValue(BlockHotSpringWaterFluid.LEVEL).intValue() == 0) { filled_fluid = HotSpringWaterFluid.instance; } diff --git a/src/main/java/biomesoplenty/common/handler/TrailsEventHandler.java b/src/main/java/biomesoplenty/common/handler/TrailsEventHandler.java index 02da62be1..76e553f3d 100644 --- a/src/main/java/biomesoplenty/common/handler/TrailsEventHandler.java +++ b/src/main/java/biomesoplenty/common/handler/TrailsEventHandler.java @@ -34,7 +34,7 @@ public class TrailsEventHandler if (event.phase == TickEvent.Phase.START) { Minecraft minecraft = Minecraft.getMinecraft(); - EntityPlayer player = (EntityPlayer)event.player; + EntityPlayer player = event.player; //Check if the player has a trail if (minecraft.player != null && TrailManager.trailsMap.containsKey(player.getUniqueID())) diff --git a/src/main/java/biomesoplenty/common/init/ModBiomes.java b/src/main/java/biomesoplenty/common/init/ModBiomes.java index 2b97e7c57..216af8c0d 100644 --- a/src/main/java/biomesoplenty/common/init/ModBiomes.java +++ b/src/main/java/biomesoplenty/common/init/ModBiomes.java @@ -631,7 +631,7 @@ public class ModBiomes implements BOPBiomes.IBiomeRegistry if (biome.canGenerateVillages) BiomeManager.addVillageBiome(biome, true); - return Optional.of((Biome)biome); + return Optional.of(biome); } else { return Optional.absent(); @@ -653,7 +653,7 @@ public class ModBiomes implements BOPBiomes.IBiomeRegistry biome.setRegistryName(biome.getResourceLocation()); ForgeRegistries.BIOMES.register(biome); - return Optional.of((Biome)biome); + return Optional.of(biome); } else { return Optional.absent(); diff --git a/src/main/java/biomesoplenty/common/init/ModBlockQueries.java b/src/main/java/biomesoplenty/common/init/ModBlockQueries.java index 3404c3b67..42c400bb2 100644 --- a/src/main/java/biomesoplenty/common/init/ModBlockQueries.java +++ b/src/main/java/biomesoplenty/common/init/ModBlockQueries.java @@ -164,7 +164,7 @@ public class ModBlockQueries // reed needs the ground block to be water, but the block below that to NOT be water @Override public boolean matches(World world, BlockPos pos) { BlockPos groundPos = pos.down(); - return (world.getBlockState(pos).getMaterial() == Material.WATER && ((Integer)world.getBlockState(pos).getValue(BlockLiquid.LEVEL)).intValue() == 0 || world.getBlockState(pos).getMaterial() == Material.ICE) && + return (world.getBlockState(pos).getMaterial() == Material.WATER && world.getBlockState(pos).getValue(BlockLiquid.LEVEL).intValue() == 0 || world.getBlockState(pos).getMaterial() == Material.ICE) && (world.getBlockState(groundPos).getBlock() != Blocks.WATER && world.getBlockState(groundPos).isSideSolid(world, groundPos, EnumFacing.UP)); } }).withLightAboveAtLeast(8).create(); diff --git a/src/main/java/biomesoplenty/common/init/ModBlocks.java b/src/main/java/biomesoplenty/common/init/ModBlocks.java index 20ec6422e..961b9b80c 100644 --- a/src/main/java/biomesoplenty/common/init/ModBlocks.java +++ b/src/main/java/biomesoplenty/common/init/ModBlocks.java @@ -409,7 +409,7 @@ public class ModBlocks { try { - Item itemBlock = clazz != null ? (Item)clazz.getConstructor(Block.class).newInstance(block) : null; + Item itemBlock = clazz != null ? clazz.getConstructor(Block.class).newInstance(block) : null; ResourceLocation location = new ResourceLocation(BiomesOPlenty.MOD_ID, blockName); block.setRegistryName(new ResourceLocation(BiomesOPlenty.MOD_ID, blockName)); diff --git a/src/main/java/biomesoplenty/common/init/ModCompatibility.java b/src/main/java/biomesoplenty/common/init/ModCompatibility.java index a90313596..f85bb8852 100644 --- a/src/main/java/biomesoplenty/common/init/ModCompatibility.java +++ b/src/main/java/biomesoplenty/common/init/ModCompatibility.java @@ -46,7 +46,7 @@ public class ModCompatibility // Creates a mutable version of the current biome type's biome array and wraps entries to support .equals() List entries = Lists.transform(Lists.newArrayList(BiomeManager.getBiomes(type)), WRAP_BIOME_ENTRIES); // Custom types may have been added, we only want the vanilla ones - final List vanillaEntries = type.ordinal() < vanillaBiomes.length ? Lists.transform(vanillaBiomes[type.ordinal()], WRAP_BIOME_ENTRIES) : (List)Lists.newArrayList(); + final List vanillaEntries = type.ordinal() < vanillaBiomes.length ? Lists.transform(vanillaBiomes[type.ordinal()], WRAP_BIOME_ENTRIES) : Lists.newArrayList(); //Remove all default biomes from the entries list entries.removeAll(vanillaEntries); diff --git a/src/main/java/biomesoplenty/common/init/ModEntities.java b/src/main/java/biomesoplenty/common/init/ModEntities.java index 5a27172fc..5c7d03566 100644 --- a/src/main/java/biomesoplenty/common/init/ModEntities.java +++ b/src/main/java/biomesoplenty/common/init/ModEntities.java @@ -66,7 +66,7 @@ public class ModEntities { if (clazz != null) { - entity = (Entity)clazz.getConstructor(new Class[] {World.class}).newInstance(new Object[] {worldIn}); + entity = clazz.getConstructor(new Class[] {World.class}).newInstance(new Object[] {worldIn}); } } catch (Exception exception) diff --git a/src/main/java/biomesoplenty/common/init/ModVanillaCompat.java b/src/main/java/biomesoplenty/common/init/ModVanillaCompat.java index 069dd8ac7..341ace99e 100644 --- a/src/main/java/biomesoplenty/common/init/ModVanillaCompat.java +++ b/src/main/java/biomesoplenty/common/init/ModVanillaCompat.java @@ -25,7 +25,7 @@ public class ModVanillaCompat MapGenStructureIO.registerStructure(BOPMapGenScatteredFeature.Start.class, "BOPTemple"); List mansionBiomes = BiomeUtils.filterPresentBiomes(BOPBiomes.coniferous_forest, BOPBiomes.dead_forest, BOPBiomes.ominous_woods, BOPBiomes.snowy_coniferous_forest, BOPBiomes.woodland); - mansionBiomes.addAll(Lists.newArrayList(Biomes.ROOFED_FOREST, Biomes.MUTATED_ROOFED_FOREST)); + mansionBiomes.addAll(Lists.newArrayList(Biomes.ROOFED_FOREST, Biomes.MUTATED_ROOFED_FOREST)); WoodlandMansion.ALLOWED_BIOMES = mansionBiomes; } diff --git a/src/main/java/biomesoplenty/common/inventory/ContainerFlowerBasket.java b/src/main/java/biomesoplenty/common/inventory/ContainerFlowerBasket.java index b5c2c9c00..eb9e10743 100644 --- a/src/main/java/biomesoplenty/common/inventory/ContainerFlowerBasket.java +++ b/src/main/java/biomesoplenty/common/inventory/ContainerFlowerBasket.java @@ -82,7 +82,7 @@ public class ContainerFlowerBasket extends Container public ItemStack transferStackInSlot(EntityPlayer player, int index) { ItemStack oldStack = ItemStack.EMPTY; - Slot slot = (Slot)this.inventorySlots.get(index); + Slot slot = this.inventorySlots.get(index); //Ensure there is a slot at this index and it has an item in it if (slot != null && slot.getHasStack()) diff --git a/src/main/java/biomesoplenty/common/item/IColoredItem.java b/src/main/java/biomesoplenty/common/item/IColoredItem.java index 144f93968..64e74db42 100644 --- a/src/main/java/biomesoplenty/common/item/IColoredItem.java +++ b/src/main/java/biomesoplenty/common/item/IColoredItem.java @@ -14,5 +14,5 @@ import net.minecraftforge.fml.relauncher.SideOnly; public interface IColoredItem { @SideOnly(Side.CLIENT) - public IItemColor getItemColor(); + IItemColor getItemColor(); } diff --git a/src/main/java/biomesoplenty/common/item/ItemBOPLilypad.java b/src/main/java/biomesoplenty/common/item/ItemBOPLilypad.java index 7205429e4..f7d2d38ef 100644 --- a/src/main/java/biomesoplenty/common/item/ItemBOPLilypad.java +++ b/src/main/java/biomesoplenty/common/item/ItemBOPLilypad.java @@ -60,7 +60,7 @@ public class ItemBOPLilypad extends ItemBOPBlock { BlockPos blockpos1 = blockpos.up(); IBlockState iblockstate = worldIn.getBlockState(blockpos); - if (iblockstate.getMaterial() == Material.WATER && ((Integer)iblockstate.getValue(BlockLiquid.LEVEL)).intValue() == 0 && worldIn.isAirBlock(blockpos1)) + if (iblockstate.getMaterial() == Material.WATER && iblockstate.getValue(BlockLiquid.LEVEL).intValue() == 0 && worldIn.isAirBlock(blockpos1)) { // special case for handling block placement with water lilies net.minecraftforge.common.util.BlockSnapshot blocksnapshot = net.minecraftforge.common.util.BlockSnapshot.getBlockSnapshot(worldIn, blockpos1); diff --git a/src/main/java/biomesoplenty/common/item/ItemBOPPlant.java b/src/main/java/biomesoplenty/common/item/ItemBOPPlant.java index 4b1b2323f..e91efd013 100644 --- a/src/main/java/biomesoplenty/common/item/ItemBOPPlant.java +++ b/src/main/java/biomesoplenty/common/item/ItemBOPPlant.java @@ -68,7 +68,7 @@ public class ItemBOPPlant extends ItemBOPBlock { BlockPos blockpos1 = blockpos.up(); IBlockState iblockstate = worldIn.getBlockState(blockpos); - if (iblockstate.getMaterial() == Material.WATER && ((Integer)iblockstate.getValue(BlockLiquid.LEVEL)).intValue() == 0 && worldIn.isAirBlock(blockpos1)) + if (iblockstate.getMaterial() == Material.WATER && iblockstate.getValue(BlockLiquid.LEVEL).intValue() == 0 && worldIn.isAirBlock(blockpos1)) { // special case for handling block placement with reeds net.minecraftforge.common.util.BlockSnapshot blocksnapshot = net.minecraftforge.common.util.BlockSnapshot.getBlockSnapshot(worldIn, blockpos1); diff --git a/src/main/java/biomesoplenty/common/remote/TrailManager.java b/src/main/java/biomesoplenty/common/remote/TrailManager.java index 6191bea12..7f78b305a 100644 --- a/src/main/java/biomesoplenty/common/remote/TrailManager.java +++ b/src/main/java/biomesoplenty/common/remote/TrailManager.java @@ -56,8 +56,8 @@ public class TrailManager } } - public static enum TrailVisibilityMode + public enum TrailVisibilityMode { - ALL, OTHERS, NOBODY; //TODO: Implement NOBODY mode + ALL, OTHERS, NOBODY //TODO: Implement NOBODY mode } } diff --git a/src/main/java/biomesoplenty/common/util/biome/GeneratorUtils.java b/src/main/java/biomesoplenty/common/util/biome/GeneratorUtils.java index c806bdb9c..d444ca806 100644 --- a/src/main/java/biomesoplenty/common/util/biome/GeneratorUtils.java +++ b/src/main/java/biomesoplenty/common/util/biome/GeneratorUtils.java @@ -81,7 +81,7 @@ public class GeneratorUtils return null; } - public static enum ScatterYMethod + public enum ScatterYMethod { ANYWHERE, NETHER_SURFACE, NETHER_ROOF, AT_SURFACE, AT_GROUND, BELOW_SURFACE, BELOW_GROUND, ABOVE_SURFACE, ABOVE_GROUND; public BlockPos getBlockPos(World world, Random random, int x, int z) diff --git a/src/main/java/biomesoplenty/common/util/block/BlockQuery.java b/src/main/java/biomesoplenty/common/util/block/BlockQuery.java index 975795009..a9a0df480 100644 --- a/src/main/java/biomesoplenty/common/util/block/BlockQuery.java +++ b/src/main/java/biomesoplenty/common/util/block/BlockQuery.java @@ -39,16 +39,16 @@ import net.minecraftforge.common.EnumPlantType; public class BlockQuery { // for compound queries - public static interface ICompoundBlockPosQuery extends IBlockPosQuery + public interface ICompoundBlockPosQuery extends IBlockPosQuery { - public void add(IBlockPosQuery a); - public IBlockPosQuery instance(); + void add(IBlockPosQuery a); + IBlockPosQuery instance(); } // for queries which depend only on the block state, and not on it's neighbors or position in the world - public static interface IBlockQuery extends IBlockPosQuery + public interface IBlockQuery extends IBlockPosQuery { - public boolean matches(IBlockState state); + boolean matches(IBlockState state); } @@ -296,7 +296,7 @@ public class BlockQuery case Crop: return block == Blocks.FARMLAND || block == BOPBlocks.farmland_0 || block == BOPBlocks.farmland_1; case Cave: return block.isSideSolid(state, world, pos, EnumFacing.UP); case Plains: return block == Blocks.GRASS || state == BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.LOAMY) || state == BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.SILTY) || state == BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.SANDY) || state == BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.DAISY) || block == Blocks.DIRT || block == BOPBlocks.dirt || block == Blocks.FARMLAND || block == BOPBlocks.farmland_0 || block == BOPBlocks.farmland_1 || block == Blocks.MYCELIUM; - case Water: return state.getMaterial() == Material.WATER && ((Integer)state.getValue(BlockLiquid.LEVEL)) == 0; + case Water: return state.getMaterial() == Material.WATER && state.getValue(BlockLiquid.LEVEL) == 0; case Beach: boolean isBeach = block == Blocks.GRASS || state == BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.LOAMY) || state == BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.SILTY) || state == BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.SANDY) || state == BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.DAISY) || block == Blocks.DIRT || block == BOPBlocks.dirt || block == BOPBlocks.white_sand || block == Blocks.SAND || block == Blocks.MYCELIUM; boolean hasWater = (world.getBlockState(pos.east()).getMaterial() == Material.WATER || @@ -448,7 +448,7 @@ public class BlockQuery { if (((IProperty)property).getName().equalsIgnoreCase(this.propName)) { - String thisPropValue = ((Comparable)properties.get(property)).toString(); + String thisPropValue = properties.get(property).toString(); for (String value : this.propValues) { if (thisPropValue.equalsIgnoreCase(value)) @@ -501,7 +501,8 @@ public class BlockQuery IBlockQuery bm = new BlockQueryMaterial((Material)mat); return negated ? new BlockQueryNot(bm) : bm; } - } catch (Exception e) {;} + } catch (Exception e) { + } throw new BlockQueryParseException("No block material found called "+materialName); } } diff --git a/src/main/java/biomesoplenty/common/util/block/BlockStateUtils.java b/src/main/java/biomesoplenty/common/util/block/BlockStateUtils.java index 7bab3397d..ee711c322 100644 --- a/src/main/java/biomesoplenty/common/util/block/BlockStateUtils.java +++ b/src/main/java/biomesoplenty/common/util/block/BlockStateUtils.java @@ -82,7 +82,7 @@ public class BlockStateUtils // only works on blocks supporting IBOPBlock - returns an empty set for vanilla blocks public static ImmutableSet getBlockPresets(Block block) { - if (!(block instanceof IBOPBlock)) {return ImmutableSet.of();} + if (!(block instanceof IBOPBlock)) {return ImmutableSet.of();} IBlockState defaultState = block.getDefaultState(); if (defaultState == null) {defaultState = block.getBlockState().getBaseState();} return getStatesSet(defaultState, ((IBOPBlock)block).getPresetProperties()); @@ -141,7 +141,7 @@ public class BlockStateUtils public static IProperty getPropertyByName(IBlockState blockState, String propertyName) { - for (IProperty property : (ImmutableSet>) blockState.getProperties().keySet()) + for (IProperty property : blockState.getProperties().keySet()) { if (property.getName().equals(propertyName)) return property; diff --git a/src/main/java/biomesoplenty/common/util/block/VariantPagingHelper.java b/src/main/java/biomesoplenty/common/util/block/VariantPagingHelper.java index 9aeaffa70..52b0474ca 100644 --- a/src/main/java/biomesoplenty/common/util/block/VariantPagingHelper.java +++ b/src/main/java/biomesoplenty/common/util/block/VariantPagingHelper.java @@ -60,7 +60,7 @@ public class VariantPagingHelper & IStringSer public VariantPagingHelper(int variantsPerPage, Class variantsEnumClass) { - this(variantsPerPage, variantsEnumClass, Predicates.alwaysTrue()); + this(variantsPerPage, variantsEnumClass, Predicates.alwaysTrue()); } public VariantPagingHelper(int variantsPerPage, Class variantsEnumClass, Predicate filter) diff --git a/src/main/java/biomesoplenty/common/util/config/BOPConfig.java b/src/main/java/biomesoplenty/common/util/config/BOPConfig.java index 6ba475834..4f979bb91 100644 --- a/src/main/java/biomesoplenty/common/util/config/BOPConfig.java +++ b/src/main/java/biomesoplenty/common/util/config/BOPConfig.java @@ -37,7 +37,7 @@ public class BOPConfig public static Gson serializer = new GsonBuilder().setPrettyPrinting().create(); public static JsonParser parser = new JsonParser(); - private static enum Types {BOOLEAN, STRING, INTEGER, FLOAT, BLOCKSTATE, BLOCKPOSQUERY, RESOURCELOCATION} + private enum Types {BOOLEAN, STRING, INTEGER, FLOAT, BLOCKSTATE, BLOCKPOSQUERY, RESOURCELOCATION} public static boolean writeFile(File outputFile, Object obj) { @@ -232,68 +232,68 @@ public class BOPConfig @Override public Boolean getBool(String name, Boolean defaultVal) {return this.get(name, defaultVal, false, Types.BOOLEAN);} @Override - public String getString(String name, String defaultVal) {return this.get(name, defaultVal, false, Types.STRING);} + public String getString(String name, String defaultVal) {return this.get(name, defaultVal, false, Types.STRING);} @Override public Integer getInt(String name, Integer defaultVal) {return this.get(name, defaultVal, false, Types.INTEGER);} @Override public Float getFloat(String name, Float defaultVal) {return this.get(name, defaultVal, false, Types.FLOAT);} @Override - public IBlockState getBlockState(String name, IBlockState defaultVal) {return this.get(name, defaultVal, false, Types.BLOCKSTATE);} + public IBlockState getBlockState(String name, IBlockState defaultVal) {return this.get(name, defaultVal, false, Types.BLOCKSTATE);} @Override - public IBlockPosQuery getBlockPosQuery(String name, IBlockPosQuery defaultVal) {return this.get(name, defaultVal, false, Types.BLOCKPOSQUERY);} + public IBlockPosQuery getBlockPosQuery(String name, IBlockPosQuery defaultVal) {return this.get(name, defaultVal, false, Types.BLOCKPOSQUERY);} @Override - public ResourceLocation getResourceLocation(String name, ResourceLocation defaultVal) {return this.get(name, defaultVal, false, Types.RESOURCELOCATION);} + public ResourceLocation getResourceLocation(String name, ResourceLocation defaultVal) {return this.get(name, defaultVal, false, Types.RESOURCELOCATION);} @Override public E getEnum(String name, E defaultVal, Class clazz) {return this.getEnum(name, defaultVal, false, clazz);} @Override public Boolean getBool(String name) {return this.get(name, null, true, Types.BOOLEAN);} @Override - public String getString(String name) {return this.get(name, null, true, Types.STRING);} + public String getString(String name) {return this.get(name, null, true, Types.STRING);} @Override public Integer getInt(String name) {return this.get(name, null, true, Types.INTEGER);} @Override public Float getFloat(String name) {return this.get(name, null, true, Types.FLOAT);} @Override - public IBlockState getBlockState(String name) {return this.get(name, null, true, Types.BLOCKSTATE);} + public IBlockState getBlockState(String name) {return this.get(name, null, true, Types.BLOCKSTATE);} @Override - public IBlockPosQuery getBlockPosQuery(String name) {return this.get(name, null, true, Types.BLOCKPOSQUERY);} + public IBlockPosQuery getBlockPosQuery(String name) {return this.get(name, null, true, Types.BLOCKPOSQUERY);} @Override - public ResourceLocation getResourceLocation(String name) {return this.get(name, null, true, Types.RESOURCELOCATION);} + public ResourceLocation getResourceLocation(String name) {return this.get(name, null, true, Types.RESOURCELOCATION);} @Override public E getEnum(String name, Class clazz) {return this.getEnum(name, null, true, clazz);} @Override - public ArrayList getBoolArray(String name, ArrayList defaultVal) {return this.getArray(name, defaultVal, false, Types.BOOLEAN);} + public ArrayList getBoolArray(String name, ArrayList defaultVal) {return this.getArray(name, defaultVal, false, Types.BOOLEAN);} @Override - public ArrayList getStringArray(String name, ArrayList defaultVal) {return this.getArray(name, defaultVal, false, Types.STRING);} + public ArrayList getStringArray(String name, ArrayList defaultVal) {return this.getArray(name, defaultVal, false, Types.STRING);} @Override - public ArrayList getIntArray(String name, ArrayList defaultVal) {return this.getArray(name, defaultVal, false, Types.INTEGER);} + public ArrayList getIntArray(String name, ArrayList defaultVal) {return this.getArray(name, defaultVal, false, Types.INTEGER);} @Override - public ArrayList getFloatArray(String name, ArrayList defaultVal) {return this.getArray(name, defaultVal, false, Types.FLOAT);} + public ArrayList getFloatArray(String name, ArrayList defaultVal) {return this.getArray(name, defaultVal, false, Types.FLOAT);} @Override - public ArrayList getBlockStateArray(String name, ArrayList defaultVal) {return this.getArray(name, defaultVal, false, Types.BLOCKSTATE);} + public ArrayList getBlockStateArray(String name, ArrayList defaultVal) {return this.getArray(name, defaultVal, false, Types.BLOCKSTATE);} @Override - public ArrayList getBlockPosQueryArray(String name, ArrayList defaultVal) {return this.getArray(name, defaultVal, false, Types.BLOCKPOSQUERY);} + public ArrayList getBlockPosQueryArray(String name, ArrayList defaultVal) {return this.getArray(name, defaultVal, false, Types.BLOCKPOSQUERY);} @Override - public ArrayList getResourceLocationArray(String name, ArrayList defaultVal) {return this.getArray(name, defaultVal, false, Types.RESOURCELOCATION);} + public ArrayList getResourceLocationArray(String name, ArrayList defaultVal) {return this.getArray(name, defaultVal, false, Types.RESOURCELOCATION);} @Override public ArrayList getEnumArray(String name, ArrayList defaultVal, Class clazz) {return this.getEnumArray(name, defaultVal, false, clazz);} @Override - public ArrayList getBoolArray(String name) {return this.getArray(name, null, true, Types.BOOLEAN);} + public ArrayList getBoolArray(String name) {return this.getArray(name, null, true, Types.BOOLEAN);} @Override - public ArrayList getStringArray(String name) {return this.getArray(name, null, true, Types.STRING);} + public ArrayList getStringArray(String name) {return this.getArray(name, null, true, Types.STRING);} @Override - public ArrayList getIntArray(String name) {return this.getArray(name, null, true, Types.INTEGER);} + public ArrayList getIntArray(String name) {return this.getArray(name, null, true, Types.INTEGER);} @Override - public ArrayList getFloatArray(String name) {return this.getArray(name, null, true, Types.FLOAT);} + public ArrayList getFloatArray(String name) {return this.getArray(name, null, true, Types.FLOAT);} @Override - public ArrayList getBlockStateArray(String name) {return this.getArray(name, null, true, Types.BLOCKSTATE);} + public ArrayList getBlockStateArray(String name) {return this.getArray(name, null, true, Types.BLOCKSTATE);} @Override - public ArrayList getBlockPosQueryArray(String name) {return this.getArray(name, null, true, Types.BLOCKPOSQUERY);} + public ArrayList getBlockPosQueryArray(String name) {return this.getArray(name, null, true, Types.BLOCKPOSQUERY);} @Override - public ArrayList getResourceLocationArray(String name) {return this.getArray(name, null, true, Types.RESOURCELOCATION);} + public ArrayList getResourceLocationArray(String name) {return this.getArray(name, null, true, Types.RESOURCELOCATION);} @Override public ArrayList getEnumArray(String name, Class clazz) {return this.getEnumArray(name, null, true, clazz);} @@ -316,7 +316,7 @@ public class BOPConfig JsonArray arr = this.members.get(name).getAsJsonArray(); for (int i = 0; i < arr.size(); i++) { - E ele = this.asEnum(arr.get(i), clazz, name + "." + i); + E ele = this.asEnum(arr.get(i), clazz, name + "." + i); if (ele != null) {list.add(ele);} } } catch (Exception e) { @@ -335,7 +335,7 @@ public class BOPConfig } return defaultVal; } - E out = this.asEnum(this.members.get(name), clazz, name); + E out = this.asEnum(this.members.get(name), clazz, name); return out == null ? defaultVal : out; } @@ -357,7 +357,7 @@ public class BOPConfig } return defaultVal; } - T out = this.as(this.members.get(name), type, name); + T out = this.as(this.members.get(name), type, name); // warn people who try to copy-paste default configs if (this.warnIfDefault && out != null && out.equals(defaultVal)) { @@ -382,7 +382,7 @@ public class BOPConfig JsonArray arr = this.members.get(name).getAsJsonArray(); for (int i = 0; i < arr.size(); i++) { - T ele = this.as(arr.get(i), type, name + "." + i); + T ele = this.as(arr.get(i), type, name + "." + i); if (ele != null) {list.add(ele);} } } catch (Exception e) { diff --git a/src/main/java/biomesoplenty/common/util/inventory/CraftingUtil.java b/src/main/java/biomesoplenty/common/util/inventory/CraftingUtil.java index aa72628f7..7887d7ad7 100644 --- a/src/main/java/biomesoplenty/common/util/inventory/CraftingUtil.java +++ b/src/main/java/biomesoplenty/common/util/inventory/CraftingUtil.java @@ -29,7 +29,7 @@ import java.util.*; public class CraftingUtil { private static final Gson SERIALIZER = new GsonBuilder().setPrettyPrinting().create(); - public static final File RECIPES_DIR = new File(BiomesOPlenty.configDirectory, "recipes");; + public static final File RECIPES_DIR = new File(BiomesOPlenty.configDirectory, "recipes"); // We should no longer need this now we've switched over to JSON, however // it might be handy to keep around for future reference diff --git a/src/main/java/biomesoplenty/common/world/BOPMapGenScatteredFeature.java b/src/main/java/biomesoplenty/common/world/BOPMapGenScatteredFeature.java index ef35f16aa..c30aea8df 100644 --- a/src/main/java/biomesoplenty/common/world/BOPMapGenScatteredFeature.java +++ b/src/main/java/biomesoplenty/common/world/BOPMapGenScatteredFeature.java @@ -44,7 +44,7 @@ public class BOPMapGenScatteredFeature extends MapGenScatteredFeature public BOPMapGenScatteredFeature() { - this.scatteredFeatureSpawnList = Lists.newArrayList(); + this.scatteredFeatureSpawnList = Lists.newArrayList(); this.maxDistanceBetweenScatteredFeatures = 32; this.minDistanceBetweenScatteredFeatures = 8; this.scatteredFeatureSpawnList.add(new Biome.SpawnListEntry(EntityWitch.class, 1, 1, 1)); @@ -58,7 +58,7 @@ public class BOPMapGenScatteredFeature extends MapGenScatteredFeature { if (entry.getKey().equals("distance")) { - this.maxDistanceBetweenScatteredFeatures = MathHelper.getInt((String)entry.getValue(), this.maxDistanceBetweenScatteredFeatures, 9); + this.maxDistanceBetweenScatteredFeatures = MathHelper.getInt(entry.getValue(), this.maxDistanceBetweenScatteredFeatures, 9); } } } @@ -97,10 +97,7 @@ public class BOPMapGenScatteredFeature extends MapGenScatteredFeature { Biome biome = this.world.getBiomeProvider().getBiome(new BlockPos(i * 16 + 8, 0, j * 16 + 8)); - if (biome != null && (JUNGLE_BIOMES.contains(biome) || SWAMP_BIOMES.contains(biome) || DESERT_BIOMES.contains(biome) || ICE_BIOMES.contains(biome))) - { - return true; - } + return biome != null && (JUNGLE_BIOMES.contains(biome) || SWAMP_BIOMES.contains(biome) || DESERT_BIOMES.contains(biome) || ICE_BIOMES.contains(biome)); } return false; diff --git a/src/main/java/biomesoplenty/common/world/BOPWorldSettings.java b/src/main/java/biomesoplenty/common/world/BOPWorldSettings.java index fd9e9f432..0372d3a32 100644 --- a/src/main/java/biomesoplenty/common/world/BOPWorldSettings.java +++ b/src/main/java/biomesoplenty/common/world/BOPWorldSettings.java @@ -24,31 +24,31 @@ public class BOPWorldSettings implements IBOPWorldSettings public static Gson serializer = new GsonBuilder().create(); - public static enum LandMassScheme + public enum LandMassScheme { VANILLA, CONTINENTS, - ARCHIPELAGO; + ARCHIPELAGO } - public static enum TemperatureVariationScheme + public enum TemperatureVariationScheme { LATITUDE, SMALL_ZONES, MEDIUM_ZONES, LARGE_ZONES, - RANDOM; + RANDOM } - public static enum RainfallVariationScheme + public enum RainfallVariationScheme { SMALL_ZONES, MEDIUM_ZONES, LARGE_ZONES, - RANDOM; + RANDOM } - public static enum BiomeSize + public enum BiomeSize { TINY (2), SMALL (3), diff --git a/src/main/java/biomesoplenty/common/world/ChunkGeneratorHellBOP.java b/src/main/java/biomesoplenty/common/world/ChunkGeneratorHellBOP.java index 606c67b3b..b0cf6bda6 100644 --- a/src/main/java/biomesoplenty/common/world/ChunkGeneratorHellBOP.java +++ b/src/main/java/biomesoplenty/common/world/ChunkGeneratorHellBOP.java @@ -337,7 +337,7 @@ public class ChunkGeneratorHellBOP implements IChunkGenerator this.genNetherBridge.generate(this.world, chunkX, chunkZ, chunkprimer); } - Biome[] biomes = this.world.getBiomeProvider().getBiomes((Biome[])null, chunkX * 16, chunkZ * 16, 16, 16); + Biome[] biomes = this.world.getBiomeProvider().getBiomes(null, chunkX * 16, chunkZ * 16, 16, 16); this.replaceBlocksForBiome(chunkX, chunkZ, chunkprimer, biomes); Chunk chunk = new Chunk(this.world, chunkprimer, chunkX, chunkZ); @@ -578,12 +578,12 @@ public class ChunkGeneratorHellBOP implements IChunkGenerator @Override public boolean isInsideStructure(World world, String structureName, BlockPos pos) { - return "Fortress".equals(structureName) && this.genNetherBridge != null ? this.genNetherBridge.isInsideStructure(pos) : false; + return ("Fortress".equals(structureName) && this.genNetherBridge != null) && this.genNetherBridge.isInsideStructure(pos); } @Override public void recreateStructures(Chunk chunkIn, int x, int z) { - this.genNetherBridge.generate(this.world, x, z, (ChunkPrimer)null); + this.genNetherBridge.generate(this.world, x, z, null); } } diff --git a/src/main/java/biomesoplenty/common/world/ChunkGeneratorOverworldBOP.java b/src/main/java/biomesoplenty/common/world/ChunkGeneratorOverworldBOP.java index 2a09aa5f9..e1b9c3acb 100644 --- a/src/main/java/biomesoplenty/common/world/ChunkGeneratorOverworldBOP.java +++ b/src/main/java/biomesoplenty/common/world/ChunkGeneratorOverworldBOP.java @@ -645,32 +645,32 @@ public class ChunkGeneratorOverworldBOP implements IChunkGenerator { if (this.settings.useMineShafts) { - this.mineshaftGenerator.generate(this.world, chunkX, chunkZ, (ChunkPrimer)null); + this.mineshaftGenerator.generate(this.world, chunkX, chunkZ, null); } if (this.settings.useVillages) { - this.villageGenerator.generate(this.world, chunkX, chunkZ, (ChunkPrimer)null); + this.villageGenerator.generate(this.world, chunkX, chunkZ, null); } if (this.settings.useStrongholds) { - this.strongholdGenerator.generate(this.world, chunkX, chunkZ, (ChunkPrimer)null); + this.strongholdGenerator.generate(this.world, chunkX, chunkZ, null); } if (this.settings.useTemples) { - this.scatteredFeatureGenerator.generate(this.world, chunkX, chunkZ, (ChunkPrimer)null); + this.scatteredFeatureGenerator.generate(this.world, chunkX, chunkZ, null); } if (this.settings.useMonuments) { - this.oceanMonumentGenerator.generate(this.world, chunkX, chunkZ, (ChunkPrimer)null); + this.oceanMonumentGenerator.generate(this.world, chunkX, chunkZ, null); } if (this.settings.useMansions) { - this.woodlandMansionGenerator.generate(this.world, chunkX, chunkZ, (ChunkPrimer)null); + this.woodlandMansionGenerator.generate(this.world, chunkX, chunkZ, null); } } } @@ -704,7 +704,7 @@ public class ChunkGeneratorOverworldBOP implements IChunkGenerator } else { - return "Temple".equals(structureName) && this.scatteredFeatureGenerator != null ? this.scatteredFeatureGenerator.isInsideStructure(pos) : false; + return ("Temple".equals(structureName) && this.scatteredFeatureGenerator != null) && this.scatteredFeatureGenerator.isInsideStructure(pos); } } diff --git a/src/main/java/biomesoplenty/common/world/GenerationManager.java b/src/main/java/biomesoplenty/common/world/GenerationManager.java index fa36a48c1..383acbed7 100644 --- a/src/main/java/biomesoplenty/common/world/GenerationManager.java +++ b/src/main/java/biomesoplenty/common/world/GenerationManager.java @@ -46,7 +46,7 @@ public class GenerationManager implements IGenerationManager out.add(generator); } } - return ImmutableList.copyOf(out); + return ImmutableList.copyOf(out); } public void removeGenerator(String name) diff --git a/src/main/java/biomesoplenty/common/world/NoiseGeneratorBOPByte.java b/src/main/java/biomesoplenty/common/world/NoiseGeneratorBOPByte.java index 29b6afc17..fd54801f4 100644 --- a/src/main/java/biomesoplenty/common/world/NoiseGeneratorBOPByte.java +++ b/src/main/java/biomesoplenty/common/world/NoiseGeneratorBOPByte.java @@ -16,10 +16,10 @@ public class NoiseGeneratorBOPByte // TODO: get rid of the interpolater classes - there's only one sensible interpolater /*** Interpolation ***/ - public static interface IIntInterpolater + public interface IIntInterpolater { // interpolation between a and b, where t is the fraction (between 0 and 255) - public int interpolate(int t, int a, int b); + int interpolate(int t, int a, int b); } public static class IntInterpolateLinear implements IIntInterpolater diff --git a/src/main/java/biomesoplenty/common/world/TerrainSettings.java b/src/main/java/biomesoplenty/common/world/TerrainSettings.java index 4491c809d..2ec502f27 100644 --- a/src/main/java/biomesoplenty/common/world/TerrainSettings.java +++ b/src/main/java/biomesoplenty/common/world/TerrainSettings.java @@ -13,12 +13,12 @@ import net.minecraft.world.biome.Biome; public class TerrainSettings { - public static enum PresetOctaveWeights + public enum PresetOctaveWeights { DEFAULT (new double[] {1 / 24.0D, 2 / 24.0D, 4 / 24.0D, 8 / 24.0D, 6 / 24.0D, 3 / 24.0D}); private final double[] weights; - private PresetOctaveWeights(double[] weights) + PresetOctaveWeights(double[] weights) { this.weights = weights; } diff --git a/src/main/java/biomesoplenty/common/world/generator/GeneratorBigFlower.java b/src/main/java/biomesoplenty/common/world/generator/GeneratorBigFlower.java index 97cdc3f66..4c2bc03c4 100644 --- a/src/main/java/biomesoplenty/common/world/generator/GeneratorBigFlower.java +++ b/src/main/java/biomesoplenty/common/world/generator/GeneratorBigFlower.java @@ -34,9 +34,9 @@ import net.minecraft.world.World; public class GeneratorBigFlower extends BOPGeneratorBase { - public static enum BigFlowerType + public enum BigFlowerType { - RED, YELLOW; + RED, YELLOW } protected static IBlockState stem = BlockBOPLog.paging.getVariantState(BOPWoods.GIANT_FLOWER); diff --git a/src/main/java/biomesoplenty/common/world/generator/GeneratorBigMushroom.java b/src/main/java/biomesoplenty/common/world/generator/GeneratorBigMushroom.java index c502ad71c..9041a46c1 100644 --- a/src/main/java/biomesoplenty/common/world/generator/GeneratorBigMushroom.java +++ b/src/main/java/biomesoplenty/common/world/generator/GeneratorBigMushroom.java @@ -31,7 +31,7 @@ import net.minecraft.world.World; public class GeneratorBigMushroom extends BOPGeneratorBase { - public static enum BigMushroomType + public enum BigMushroomType { BROWN, RED; public IBlockState getDefaultState() diff --git a/src/main/java/biomesoplenty/common/world/generator/GeneratorDoubleFlora.java b/src/main/java/biomesoplenty/common/world/generator/GeneratorDoubleFlora.java index 162b79029..e74c92c23 100644 --- a/src/main/java/biomesoplenty/common/world/generator/GeneratorDoubleFlora.java +++ b/src/main/java/biomesoplenty/common/world/generator/GeneratorDoubleFlora.java @@ -100,7 +100,7 @@ public class GeneratorDoubleFlora extends GeneratorReplacing { canStay = ((BlockBOPDecoration)bottomBlock).canBlockStay(world, genPos, this.with); } else if (bottomBlock instanceof BlockBush) { - canStay = ((BlockBush)bottomBlock).canPlaceBlockAt(world, genPos); + canStay = bottomBlock.canPlaceBlockAt(world, genPos); } else { canStay = bottomBlock.canPlaceBlockAt(world, genPos); } diff --git a/src/main/java/biomesoplenty/common/world/generator/GeneratorFlora.java b/src/main/java/biomesoplenty/common/world/generator/GeneratorFlora.java index 1d4dd6699..2212ab224 100644 --- a/src/main/java/biomesoplenty/common/world/generator/GeneratorFlora.java +++ b/src/main/java/biomesoplenty/common/world/generator/GeneratorFlora.java @@ -124,7 +124,7 @@ public class GeneratorFlora extends GeneratorReplacing { canStay = ((BlockBOPDecoration)block).canBlockStay(world, genPos, this.with); } else if (block instanceof BlockBush) { - canStay = ((BlockBush)block).canPlaceBlockAt(world, genPos); + canStay = block.canPlaceBlockAt(world, genPos); } else { canStay = block.canPlaceBlockAt(world, genPos); } diff --git a/src/main/java/biomesoplenty/common/world/generator/GeneratorHive.java b/src/main/java/biomesoplenty/common/world/generator/GeneratorHive.java index 443f49923..8cc250a82 100644 --- a/src/main/java/biomesoplenty/common/world/generator/GeneratorHive.java +++ b/src/main/java/biomesoplenty/common/world/generator/GeneratorHive.java @@ -50,7 +50,7 @@ public class GeneratorHive extends GeneratorReplacing { // defaults this.amountPerChunk = 1.0F; - this.placeOn = BlockQuery.buildAnd().states(Blocks.NETHERRACK.getDefaultState()).withAirBelow().create();; + this.placeOn = BlockQuery.buildAnd().states(Blocks.NETHERRACK.getDefaultState()).withAirBelow().create(); this.replace = new BlockQuery.BlockQueryMaterial(Material.AIR); this.with = null; this.scatterYMethod = GeneratorUtils.ScatterYMethod.NETHER_ROOF; diff --git a/src/main/java/biomesoplenty/common/world/generator/tree/GeneratorBigTree.java b/src/main/java/biomesoplenty/common/world/generator/tree/GeneratorBigTree.java index e9efab9ef..6b8151fd7 100644 --- a/src/main/java/biomesoplenty/common/world/generator/tree/GeneratorBigTree.java +++ b/src/main/java/biomesoplenty/common/world/generator/tree/GeneratorBigTree.java @@ -491,7 +491,6 @@ public class GeneratorBigTree extends GeneratorTreeBase makeBranches(); } catch (RuntimeException e) { // TODO: deal with this. - ; } this.world = null; //Fix vanilla Mem leak, holds latest world diff --git a/src/main/java/biomesoplenty/common/world/generator/tree/GeneratorProfileTree.java b/src/main/java/biomesoplenty/common/world/generator/tree/GeneratorProfileTree.java index 8ddd9a85b..bfd9b407a 100644 --- a/src/main/java/biomesoplenty/common/world/generator/tree/GeneratorProfileTree.java +++ b/src/main/java/biomesoplenty/common/world/generator/tree/GeneratorProfileTree.java @@ -61,7 +61,7 @@ public class GeneratorProfileTree extends GeneratorTreeBase this.profile = profile; } - public static enum TreeProfile + public enum TreeProfile { POPLAR; diff --git a/src/main/java/biomesoplenty/common/world/layer/GenLayerShoreBOP.java b/src/main/java/biomesoplenty/common/world/layer/GenLayerShoreBOP.java index 476fcbc67..1da8d2223 100644 --- a/src/main/java/biomesoplenty/common/world/layer/GenLayerShoreBOP.java +++ b/src/main/java/biomesoplenty/common/world/layer/GenLayerShoreBOP.java @@ -174,7 +174,7 @@ public class GenLayerShoreBOP extends BOPGenLayer @Override public boolean apply(Integer 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); + return Biome.getBiome(input) != null && Biome.getBiome(input).getBiomeClass() == BiomeJungle.class || (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)); } }; diff --git a/src/main/java/biomesoplenty/core/ClientProxy.java b/src/main/java/biomesoplenty/core/ClientProxy.java index bd86578cd..061f36ae9 100644 --- a/src/main/java/biomesoplenty/core/ClientProxy.java +++ b/src/main/java/biomesoplenty/core/ClientProxy.java @@ -172,7 +172,7 @@ public class ClientProxy extends CommonProxy //Register colour handlers if (item instanceof IColoredItem && ((IColoredItem)item).getItemColor() != null) { - this.itemsToColor.add(item); + itemsToColor.add(item); } } @@ -204,7 +204,7 @@ public class ClientProxy extends CommonProxy break; case MUD: int itemId = Item.getIdFromItem(BOPItems.mudball); - minecraft.world.spawnParticle(EnumParticleTypes.ITEM_CRACK, x, y, z, MathHelper.nextDouble(minecraft.world.rand, -0.08D, 0.08D), MathHelper.nextDouble(minecraft.world.rand, -0.08D, 0.08D), MathHelper.nextDouble(minecraft.world.rand, -0.08D, 0.08D), new int[] {itemId}); + minecraft.world.spawnParticle(EnumParticleTypes.ITEM_CRACK, x, y, z, MathHelper.nextDouble(minecraft.world.rand, -0.08D, 0.08D), MathHelper.nextDouble(minecraft.world.rand, -0.08D, 0.08D), MathHelper.nextDouble(minecraft.world.rand, -0.08D, 0.08D), itemId); return; case PLAYER_TRAIL: if (info.length < 1) From 8aa95d18188f6335a67875ab29f8634f0b390d2a Mon Sep 17 00:00:00 2001 From: CDAGaming Date: Tue, 31 Oct 2017 19:01:35 -0500 Subject: [PATCH 3/3] Revert "Code Cleanup -- Optional" & MCP Update --- build.properties | 4 +- .../botania/api/item/IHornHarvestable.java | 10 +-- .../biomesoplenty/api/biome/BOPBiomes.java | 8 +- .../biomesoplenty/api/biome/BiomeOwner.java | 2 +- .../api/biome/IExtendedBiome.java | 22 ++--- .../api/block/IBlockPosQuery.java | 2 +- .../api/config/IBOPWorldSettings.java | 4 +- .../biomesoplenty/api/config/IConfigObj.java | 86 +++++++++---------- .../biomesoplenty/api/enums/BOPClimates.java | 2 +- .../java/biomesoplenty/api/enums/BOPGems.java | 2 +- .../api/generation/BOPGeneratorBase.java | 2 +- .../api/generation/GeneratorStage.java | 2 +- .../api/generation/IGenerator.java | 20 ++--- .../api/particle/BOPParticleTypes.java | 2 +- .../client/gui/GuiBOPConfigureWorld.java | 20 +++-- .../client/gui/GuiBOPPageList.java | 2 +- .../client/gui/GuiBOPPageTable.java | 22 ++--- .../client/gui/GuiEnumButton.java | 2 +- .../client/particle/EntityPixieTrailFX.java | 2 +- .../texture/ForgeRedirectedResourcePack.java | 2 +- .../client/util/TextureUtils.java | 2 +- .../common/biome/overworld/BiomeGenAlps.java | 2 +- .../biome/overworld/BiomeGenMountain.java | 2 +- .../common/block/BlockBOPAsh.java | 2 +- .../common/block/BlockBOPBamboo.java | 6 +- .../common/block/BlockBOPBiomeBlock.java | 5 +- .../common/block/BlockBOPCoral.java | 7 +- .../common/block/BlockBOPCrystal.java | 7 +- .../common/block/BlockBOPDirt.java | 7 +- .../block/BlockBOPDoubleDecoration.java | 7 +- .../common/block/BlockBOPDoublePlant.java | 9 +- .../common/block/BlockBOPDoubleWoodSlab.java | 2 +- .../common/block/BlockBOPFarmland.java | 2 +- .../common/block/BlockBOPFlower.java | 10 +-- .../common/block/BlockBOPGem.java | 2 +- .../common/block/BlockBOPGemOre.java | 2 +- .../common/block/BlockBOPGrass.java | 9 +- .../common/block/BlockBOPGrassPath.java | 2 +- .../common/block/BlockBOPHalfOtherSlab.java | 8 +- .../common/block/BlockBOPHalfWoodSlab.java | 2 +- .../common/block/BlockBOPHive.java | 7 +- .../common/block/BlockBOPLeaves.java | 8 +- .../common/block/BlockBOPLilypad.java | 7 +- .../common/block/BlockBOPLog.java | 4 +- .../common/block/BlockBOPMud.java | 7 +- .../common/block/BlockBOPMushroom.java | 9 +- .../common/block/BlockBOPPlanks.java | 2 +- .../common/block/BlockBOPPlant.java | 4 +- .../common/block/BlockBOPSapling.java | 8 +- .../common/block/BlockBOPSeaweed.java | 10 +-- .../common/block/BlockBOPStoneFormations.java | 10 +-- .../common/block/BlockBOPTerrarium.java | 9 +- .../common/block/BlockBOPWhiteSandstone.java | 7 +- .../biomesoplenty/common/block/IBOPBlock.java | 12 +-- .../common/block/ISustainsPlantType.java | 2 +- .../common/command/BOPCommand.java | 3 +- .../common/entities/EntityPixie.java | 6 +- .../common/entities/EntityWasp.java | 6 +- .../entities/ai/EntityAIEatBOPGrass.java | 4 +- .../common/fluids/blocks/BlockBloodFluid.java | 2 +- .../common/fluids/blocks/BlockHoneyFluid.java | 2 +- .../blocks/BlockHotSpringWaterFluid.java | 4 +- .../fluids/blocks/BlockPoisonFluid.java | 2 +- .../fluids/blocks/BlockQuicksandFluid.java | 2 +- .../common/handler/BucketEventHandler.java | 10 +-- .../common/handler/TrailsEventHandler.java | 2 +- .../biomesoplenty/common/init/ModBiomes.java | 4 +- .../common/init/ModBlockQueries.java | 2 +- .../biomesoplenty/common/init/ModBlocks.java | 2 +- .../common/init/ModCompatibility.java | 2 +- .../common/init/ModEntities.java | 2 +- .../common/init/ModVanillaCompat.java | 2 +- .../inventory/ContainerFlowerBasket.java | 2 +- .../common/item/IColoredItem.java | 2 +- .../common/item/ItemBOPLilypad.java | 2 +- .../common/item/ItemBOPPlant.java | 2 +- .../common/remote/TrailManager.java | 4 +- .../common/util/biome/GeneratorUtils.java | 2 +- .../common/util/block/BlockQuery.java | 17 ++-- .../common/util/block/BlockStateUtils.java | 4 +- .../util/block/VariantPagingHelper.java | 2 +- .../common/util/config/BOPConfig.java | 54 ++++++------ .../common/util/inventory/CraftingUtil.java | 2 +- .../world/BOPMapGenScatteredFeature.java | 9 +- .../common/world/BOPWorldSettings.java | 14 +-- .../common/world/ChunkGeneratorHellBOP.java | 6 +- .../world/ChunkGeneratorOverworldBOP.java | 14 +-- .../common/world/GenerationManager.java | 2 +- .../common/world/NoiseGeneratorBOPByte.java | 4 +- .../common/world/TerrainSettings.java | 4 +- .../world/generator/GeneratorBigFlower.java | 4 +- .../world/generator/GeneratorBigMushroom.java | 2 +- .../world/generator/GeneratorDoubleFlora.java | 2 +- .../world/generator/GeneratorFlora.java | 2 +- .../common/world/generator/GeneratorHive.java | 2 +- .../generator/tree/GeneratorBigTree.java | 1 + .../generator/tree/GeneratorProfileTree.java | 2 +- .../common/world/layer/GenLayerShoreBOP.java | 2 +- .../java/biomesoplenty/core/ClientProxy.java | 4 +- 99 files changed, 327 insertions(+), 316 deletions(-) diff --git a/build.properties b/build.properties index 9c26a5687..775bfd64b 100644 --- a/build.properties +++ b/build.properties @@ -1,4 +1,4 @@ minecraft_version=1.12.2 -forge_version=14.23.0.2517 +forge_version=14.23.0.2528 mod_version=7.0.1 -mappings_version=snapshot_nodoc_20171030 +mappings_version=snapshot_nodoc_20171031 diff --git a/src/api/java/vazkii/botania/api/item/IHornHarvestable.java b/src/api/java/vazkii/botania/api/item/IHornHarvestable.java index 6a0128332..a6ef982fc 100644 --- a/src/api/java/vazkii/botania/api/item/IHornHarvestable.java +++ b/src/api/java/vazkii/botania/api/item/IHornHarvestable.java @@ -23,22 +23,22 @@ public interface IHornHarvestable { * Returns true if this block can be uprooted. * Note that the stack param can be null if it's a drum breaking it. */ - boolean canHornHarvest(World world, BlockPos pos, ItemStack stack, EnumHornType hornType); + public boolean canHornHarvest(World world, BlockPos pos, ItemStack stack, EnumHornType hornType); /** * Returns true if harvestByHorn() should be called. If false it just uses the normal * block breaking method. * Note that the stack param can be null if it's a drum breaking it. */ - boolean hasSpecialHornHarvest(World world, BlockPos pos, ItemStack stack, EnumHornType hornType); + public boolean hasSpecialHornHarvest(World world, BlockPos pos, ItemStack stack, EnumHornType hornType); /** * Called to harvest by a horn. * Note that the stack param can be null if it's a drum breaking it. */ - void harvestByHorn(World world, BlockPos pos, ItemStack stack, EnumHornType hornType); + public void harvestByHorn(World world, BlockPos pos, ItemStack stack, EnumHornType hornType); - enum EnumHornType { + public static enum EnumHornType { /** * Horn of the Wild, for grass and crops @@ -60,6 +60,6 @@ public interface IHornHarvestable { return values[Math.min(values.length - 1, meta)]; } - } + }; } diff --git a/src/main/java/biomesoplenty/api/biome/BOPBiomes.java b/src/main/java/biomesoplenty/api/biome/BOPBiomes.java index 4f2822e3c..982949390 100644 --- a/src/main/java/biomesoplenty/api/biome/BOPBiomes.java +++ b/src/main/java/biomesoplenty/api/biome/BOPBiomes.java @@ -147,10 +147,10 @@ public class BOPBiomes return instance; } - public interface IBiomeRegistry + public static interface IBiomeRegistry { - IExtendedBiome registerBiome(IExtendedBiome biome, String idName); - IExtendedBiome getExtendedBiome(Biome biome); - ImmutableSet getPresentBiomes(); + public IExtendedBiome registerBiome(IExtendedBiome biome, String idName); + public IExtendedBiome getExtendedBiome(Biome biome); + public ImmutableSet getPresentBiomes(); } } diff --git a/src/main/java/biomesoplenty/api/biome/BiomeOwner.java b/src/main/java/biomesoplenty/api/biome/BiomeOwner.java index 74fcc62d5..83d2a60cb 100644 --- a/src/main/java/biomesoplenty/api/biome/BiomeOwner.java +++ b/src/main/java/biomesoplenty/api/biome/BiomeOwner.java @@ -10,5 +10,5 @@ package biomesoplenty.api.biome; public enum BiomeOwner { - BIOMESOPLENTY, OTHER + BIOMESOPLENTY, OTHER; } diff --git a/src/main/java/biomesoplenty/api/biome/IExtendedBiome.java b/src/main/java/biomesoplenty/api/biome/IExtendedBiome.java index 2c572d121..4646f7a60 100644 --- a/src/main/java/biomesoplenty/api/biome/IExtendedBiome.java +++ b/src/main/java/biomesoplenty/api/biome/IExtendedBiome.java @@ -21,19 +21,19 @@ import net.minecraft.world.biome.Biome; public interface IExtendedBiome { - void applySettings(IBOPWorldSettings settings); - void configure(IConfigObj conf); + public void applySettings(IBOPWorldSettings settings); + public void configure(IConfigObj conf); - BiomeOwner getBiomeOwner(); - void addGenerator(String name, GeneratorStage stage, IGenerator generator); - IGenerationManager getGenerationManager(); - Map getWeightMap(); - void clearWeights(); - void addWeight(BOPClimates climate, int weight); + public BiomeOwner getBiomeOwner(); + public void addGenerator(String name, GeneratorStage stage, IGenerator generator); + public IGenerationManager getGenerationManager(); + public Map getWeightMap(); + public void clearWeights(); + public void addWeight(BOPClimates climate, int weight); - ResourceLocation getBeachLocation(); + public ResourceLocation getBeachLocation(); /**Get the base biome associated with this extension**/ - Biome getBaseBiome(); - ResourceLocation getResourceLocation(); + public Biome getBaseBiome(); + public ResourceLocation getResourceLocation(); } diff --git a/src/main/java/biomesoplenty/api/block/IBlockPosQuery.java b/src/main/java/biomesoplenty/api/block/IBlockPosQuery.java index fdcf00a12..2a79fe7b4 100644 --- a/src/main/java/biomesoplenty/api/block/IBlockPosQuery.java +++ b/src/main/java/biomesoplenty/api/block/IBlockPosQuery.java @@ -13,5 +13,5 @@ import net.minecraft.world.World; // for queries on a particular block position in the world public interface IBlockPosQuery { - boolean matches(World world, BlockPos pos); + public boolean matches(World world, BlockPos pos); } \ No newline at end of file diff --git a/src/main/java/biomesoplenty/api/config/IBOPWorldSettings.java b/src/main/java/biomesoplenty/api/config/IBOPWorldSettings.java index b7dd2f945..b1aef6463 100644 --- a/src/main/java/biomesoplenty/api/config/IBOPWorldSettings.java +++ b/src/main/java/biomesoplenty/api/config/IBOPWorldSettings.java @@ -11,10 +11,10 @@ public interface IBOPWorldSettings { boolean isEnabled(GeneratorType type); - enum GeneratorType + public static enum GeneratorType { GEMS, SOILS, TREES, GRASSES, FOLIAGE, FLOWERS, PLANTS, WATER_PLANTS, MUSHROOMS, ROCK_FORMATIONS, POISON_IVY, BERRY_BUSHES, THORNS, QUICKSAND, LIQUID_POISON, HOT_SPRINGS, - NETHER_HIVES, END_FEATURES + NETHER_HIVES, END_FEATURES; } } diff --git a/src/main/java/biomesoplenty/api/config/IConfigObj.java b/src/main/java/biomesoplenty/api/config/IConfigObj.java index 2257162c8..69fe540ac 100644 --- a/src/main/java/biomesoplenty/api/config/IConfigObj.java +++ b/src/main/java/biomesoplenty/api/config/IConfigObj.java @@ -18,62 +18,62 @@ import net.minecraft.util.ResourceLocation; public interface IConfigObj { - JsonElement serializeDefaults(); - void addMessage(String message); - void addMessage(String extraPrefix, String message); - List flushMessages(); - boolean isEmpty(); - boolean has(String name); - Set getKeys(); + public JsonElement serializeDefaults(); + public void addMessage(String message); + public void addMessage(String extraPrefix, String message); + public List flushMessages(); + public boolean isEmpty(); + public boolean has(String name); + public Set getKeys(); - IConfigObj getObject(String name); - ArrayList getObjectArray(String name); - IConfigObj getObject(String name, boolean warnIfMissing); - ArrayList getObjectArray(String name, boolean warnIfMissing); + public IConfigObj getObject(String name); + public ArrayList getObjectArray(String name); + public IConfigObj getObject(String name, boolean warnIfMissing); + public ArrayList getObjectArray(String name, boolean warnIfMissing); // Use the methods below when you want to obtain a value from a config file, if it is present, but you have a default value to use if it isn't // No warning messages will be logged using these methods if the value is missing - Boolean getBool(String name, Boolean defaultVal); - String getString(String name, String defaultVal); - Integer getInt(String name, Integer defaultVal); - Float getFloat(String name, Float defaultVal); - IBlockState getBlockState(String name, IBlockState defaultVal); - IBlockPosQuery getBlockPosQuery(String name, IBlockPosQuery defaultVal); - ResourceLocation getResourceLocation(String name, ResourceLocation defaultVal); - E getEnum(String name, E defaultVal, Class clazz); + public Boolean getBool(String name, Boolean defaultVal); + public String getString(String name, String defaultVal); + public Integer getInt(String name, Integer defaultVal); + public Float getFloat(String name, Float defaultVal); + public IBlockState getBlockState(String name, IBlockState defaultVal); + public IBlockPosQuery getBlockPosQuery(String name, IBlockPosQuery defaultVal); + public ResourceLocation getResourceLocation(String name, ResourceLocation defaultVal); + public E getEnum(String name, E defaultVal, Class clazz); // Use the methods below when you want to obtain a value from a config file which SHOULD be present // If the value is missing, a warning message is logged, and null is returned - Boolean getBool(String name); - String getString(String name); - Integer getInt(String name); - Float getFloat(String name); - IBlockState getBlockState(String name); - IBlockPosQuery getBlockPosQuery(String name); - ResourceLocation getResourceLocation(String name); - E getEnum(String name, Class clazz); + public Boolean getBool(String name); + public String getString(String name); + public Integer getInt(String name); + public Float getFloat(String name); + public IBlockState getBlockState(String name); + public IBlockPosQuery getBlockPosQuery(String name); + public ResourceLocation getResourceLocation(String name); + public E getEnum(String name, Class clazz); // Use the methods below when you want to obtain an array of values from a config file, if it is present, but you have a default value to use if it isn't // No warning messages will be logged using these methods if the value is missing - ArrayList getBoolArray(String name, ArrayList defaultVal); - ArrayList getStringArray(String name, ArrayList defaultVal); - ArrayList getIntArray(String name, ArrayList defaultVal); - ArrayList getFloatArray(String name, ArrayList defaultVal); - ArrayList getBlockStateArray(String name, ArrayList defaultVal); - ArrayList getBlockPosQueryArray(String name, ArrayList defaultVal); - ArrayList getResourceLocationArray(String name, ArrayList defaultVal); - ArrayList getEnumArray(String name, ArrayList defaultVal, Class clazz); + public ArrayList getBoolArray(String name, ArrayList defaultVal); + public ArrayList getStringArray(String name, ArrayList defaultVal); + public ArrayList getIntArray(String name, ArrayList defaultVal); + public ArrayList getFloatArray(String name, ArrayList defaultVal); + public ArrayList getBlockStateArray(String name, ArrayList defaultVal); + public ArrayList getBlockPosQueryArray(String name, ArrayList defaultVal); + public ArrayList getResourceLocationArray(String name, ArrayList defaultVal); + public ArrayList getEnumArray(String name, ArrayList defaultVal, Class clazz); // Use the methods below when you want to obtain an array of values from a config file which SHOULD be present // If the value is missing, a warning message is logged, and null is returned - ArrayList getBoolArray(String name); - ArrayList getStringArray(String name); - ArrayList getIntArray(String name); - ArrayList getFloatArray(String name); - ArrayList getBlockStateArray(String name); - ArrayList getBlockPosQueryArray(String name); - ArrayList getResourceLocationArray(String name); - ArrayList getEnumArray(String name, Class clazz); + public ArrayList getBoolArray(String name); + public ArrayList getStringArray(String name); + public ArrayList getIntArray(String name); + public ArrayList getFloatArray(String name); + public ArrayList getBlockStateArray(String name); + public ArrayList getBlockPosQueryArray(String name); + public ArrayList getResourceLocationArray(String name); + public ArrayList getEnumArray(String name, Class clazz); } \ No newline at end of file diff --git a/src/main/java/biomesoplenty/api/enums/BOPClimates.java b/src/main/java/biomesoplenty/api/enums/BOPClimates.java index e554fb6f4..83c031435 100644 --- a/src/main/java/biomesoplenty/api/enums/BOPClimates.java +++ b/src/main/java/biomesoplenty/api/enums/BOPClimates.java @@ -31,7 +31,7 @@ public enum BOPClimates { private ArrayList landBiomes = new ArrayList(); - BOPClimates(BiomeType biomeType) + private BOPClimates(BiomeType biomeType) { this.biomeType = biomeType; } diff --git a/src/main/java/biomesoplenty/api/enums/BOPGems.java b/src/main/java/biomesoplenty/api/enums/BOPGems.java index 26b89af07..0c27650a6 100644 --- a/src/main/java/biomesoplenty/api/enums/BOPGems.java +++ b/src/main/java/biomesoplenty/api/enums/BOPGems.java @@ -23,4 +23,4 @@ public enum BOPGems implements IStringSerializable { return this.getName(); } -} \ No newline at end of file +}; \ No newline at end of file diff --git a/src/main/java/biomesoplenty/api/generation/BOPGeneratorBase.java b/src/main/java/biomesoplenty/api/generation/BOPGeneratorBase.java index 02dfe6747..190f95577 100644 --- a/src/main/java/biomesoplenty/api/generation/BOPGeneratorBase.java +++ b/src/main/java/biomesoplenty/api/generation/BOPGeneratorBase.java @@ -24,7 +24,7 @@ public abstract class BOPGeneratorBase extends WorldGenerator implements IGenera protected BOPGeneratorBase(float amountPerChunk) { - this.identifier = Generators.registry.getIdentifier(this.getClass()); + this.identifier = Generators.registry.getIdentifier((Class)this.getClass()); if (this.identifier == null) { diff --git a/src/main/java/biomesoplenty/api/generation/GeneratorStage.java b/src/main/java/biomesoplenty/api/generation/GeneratorStage.java index 752da8012..2242a3f44 100644 --- a/src/main/java/biomesoplenty/api/generation/GeneratorStage.java +++ b/src/main/java/biomesoplenty/api/generation/GeneratorStage.java @@ -68,7 +68,7 @@ public enum GeneratorStage private Decorate.EventType decorateType; - GeneratorStage(Decorate.EventType decorateType) + private GeneratorStage(Decorate.EventType decorateType) { this.decorateType = decorateType; } diff --git a/src/main/java/biomesoplenty/api/generation/IGenerator.java b/src/main/java/biomesoplenty/api/generation/IGenerator.java index 5ea697f25..2810a73f9 100644 --- a/src/main/java/biomesoplenty/api/generation/IGenerator.java +++ b/src/main/java/biomesoplenty/api/generation/IGenerator.java @@ -16,25 +16,25 @@ import net.minecraft.world.World; public interface IGenerator { - void scatter(World world, Random random, BlockPos pos); - boolean generate(World world, Random random, BlockPos pos); + public void scatter(World world, Random random, BlockPos pos); + public boolean generate(World world, Random random, BlockPos pos); - void setStage(GeneratorStage stage); - void setName(String name); + public void setStage(GeneratorStage stage); + public void setName(String name); /** * A unique name used to classify the purpose of a generator. For example, emeralds and ruby use the * same generator (and thus, have the same identifier) but have differing names. */ - String getName(); + public String getName(); /**The identifier for this generator should be consistent across all instances of the same type*/ - String getIdentifier(); - GeneratorStage getStage(); + public String getIdentifier(); + public GeneratorStage getStage(); - interface IGeneratorBuilder + public static interface IGeneratorBuilder { - T create(); + public T create(); } - void configure(IConfigObj conf); + public void configure(IConfigObj conf); } diff --git a/src/main/java/biomesoplenty/api/particle/BOPParticleTypes.java b/src/main/java/biomesoplenty/api/particle/BOPParticleTypes.java index 1c4c9271b..8390b4b98 100644 --- a/src/main/java/biomesoplenty/api/particle/BOPParticleTypes.java +++ b/src/main/java/biomesoplenty/api/particle/BOPParticleTypes.java @@ -2,5 +2,5 @@ package biomesoplenty.api.particle; public enum BOPParticleTypes { - PIXIETRAIL, MUD, PLAYER_TRAIL + PIXIETRAIL, MUD, PLAYER_TRAIL; } \ No newline at end of file diff --git a/src/main/java/biomesoplenty/client/gui/GuiBOPConfigureWorld.java b/src/main/java/biomesoplenty/client/gui/GuiBOPConfigureWorld.java index 027391da4..6f0592439 100644 --- a/src/main/java/biomesoplenty/client/gui/GuiBOPConfigureWorld.java +++ b/src/main/java/biomesoplenty/client/gui/GuiBOPConfigureWorld.java @@ -76,7 +76,7 @@ public class GuiBOPConfigureWorld extends GuiScreen implements GuiSlider.FormatH } } - private enum Actions + private static enum Actions { PREVIOUS (301), NEXT (302), @@ -87,7 +87,7 @@ public class GuiBOPConfigureWorld extends GuiScreen implements GuiSlider.FormatH private int id; - Actions(int id) + private Actions(int id) { this.id = id; } @@ -166,7 +166,7 @@ public class GuiBOPConfigureWorld extends GuiScreen implements GuiSlider.FormatH } - private enum GuiEntries + private static enum GuiEntries { TEMP_SCHEME (101), GENERATE_BOP_GEMS (102), @@ -201,7 +201,7 @@ public class GuiBOPConfigureWorld extends GuiScreen implements GuiSlider.FormatH private int id; - GuiEntries(int id) + private GuiEntries(int id) { this.id = id; } @@ -318,7 +318,7 @@ public class GuiBOPConfigureWorld extends GuiScreen implements GuiSlider.FormatH case HEIGHT_SCALE: case UPPER_LIMIT_SCALE: case LOWER_LIMIT_SCALE: - return String.format("%5.3f", Float.valueOf(value)); + return String.format("%5.3f", new Object[] {Float.valueOf(value)}); default: return ""; } @@ -474,12 +474,14 @@ public class GuiBOPConfigureWorld extends GuiScreen implements GuiSlider.FormatH @Override public void handleStringSelection(int fieldId, String value) { + ; } @Override public void handleIntSelection(int fieldId, int value) { + ; } @@ -581,7 +583,7 @@ public class GuiBOPConfigureWorld extends GuiScreen implements GuiSlider.FormatH { this.prevButton.enabled = this.pageManager.getActivePage().pageNumber != 0; this.nextButton.enabled = this.pageManager.getActivePage().pageNumber != this.pageManager.getNumPages() - 1; - this.pageInfo = I18n.format("book.pageIndicator", Integer.valueOf(this.pageManager.getActivePage().pageNumber + 1), Integer.valueOf(this.pageManager.getNumPages())); + this.pageInfo = I18n.format("book.pageIndicator", new Object[] {Integer.valueOf(this.pageManager.getActivePage().pageNumber + 1), Integer.valueOf(this.pageManager.getNumPages())}); this.page0Title = this.pageNames[this.pageManager.getActivePage().pageNumber]; } @@ -676,9 +678,9 @@ public class GuiBOPConfigureWorld extends GuiScreen implements GuiSlider.FormatH bufferBuilder.pos((double)(this.width / 2 + 90), 100.0D, 0.0D).tex(5.625D, 0.0D).color(64, 64, 64, 64).endVertex(); bufferBuilder.pos((double)(this.width / 2 - 90), 100.0D, 0.0D).tex(0.0D, 0.0D).color(64, 64, 64, 64).endVertex(); tessellator.draw(); - this.drawCenteredString(this.fontRenderer, I18n.format("createWorld.customize.custom.confirmTitle"), this.width / 2, 105, 16777215); - this.drawCenteredString(this.fontRenderer, I18n.format("createWorld.customize.custom.confirm1"), this.width / 2, 125, 16777215); - this.drawCenteredString(this.fontRenderer, I18n.format("createWorld.customize.custom.confirm2"), this.width / 2, 135, 16777215); + this.drawCenteredString(this.fontRenderer, I18n.format("createWorld.customize.custom.confirmTitle", new Object[0]), this.width / 2, 105, 16777215); + this.drawCenteredString(this.fontRenderer, I18n.format("createWorld.customize.custom.confirm1", new Object[0]), this.width / 2, 125, 16777215); + this.drawCenteredString(this.fontRenderer, I18n.format("createWorld.customize.custom.confirm2", new Object[0]), this.width / 2, 135, 16777215); this.yesButton.drawButton(this.mc, mouseX, mouseY, partialTicks); this.noButton.drawButton(this.mc, mouseX, mouseY, partialTicks); } diff --git a/src/main/java/biomesoplenty/client/gui/GuiBOPPageList.java b/src/main/java/biomesoplenty/client/gui/GuiBOPPageList.java index b2a909b52..798bb28ac 100644 --- a/src/main/java/biomesoplenty/client/gui/GuiBOPPageList.java +++ b/src/main/java/biomesoplenty/client/gui/GuiBOPPageList.java @@ -372,7 +372,7 @@ public abstract class GuiBOPPageList extends GuiBOPPageDelegate public EditBoxEntry(int fieldId, String labelText, boolean isVisible, Predicate validator) { super(fieldId, labelText, isVisible); - this.validator = MoreObjects.firstNonNull(validator, Predicates.alwaysTrue()); + this.validator = (Predicate) MoreObjects.firstNonNull(validator, Predicates.alwaysTrue()); } public Predicate getValidator() diff --git a/src/main/java/biomesoplenty/client/gui/GuiBOPPageTable.java b/src/main/java/biomesoplenty/client/gui/GuiBOPPageTable.java index eae2906b4..d7abf76b4 100644 --- a/src/main/java/biomesoplenty/client/gui/GuiBOPPageTable.java +++ b/src/main/java/biomesoplenty/client/gui/GuiBOPPageTable.java @@ -131,8 +131,8 @@ public class GuiBOPPageTable extends GuiBOPPageList { GuiBOPPageList.GuiFieldEntry guilistentryLeft = this.fields[i]; GuiBOPPageList.GuiFieldEntry guilistentryRight = i < this.fields.length - 1 ? this.fields[i + 1] : null; - Gui guiLeft = this.fieldIdToGuiMap.get(guilistentryLeft.getFieldId()); - Gui guiRight = guilistentryRight != null ? this.fieldIdToGuiMap.get(guilistentryRight.getFieldId()) : null; + Gui guiLeft = (Gui)this.fieldIdToGuiMap.get(guilistentryLeft.getFieldId()); + Gui guiRight = guilistentryRight != null ? (Gui)this.fieldIdToGuiMap.get(guilistentryRight.getFieldId()) : null; GuiBOPPageList.GuiRowEntry guientry = new GuiBOPPageList.GuiRowEntry(guiLeft, guiRight); this.allRows.add(guientry); } @@ -147,7 +147,7 @@ public class GuiBOPPageTable extends GuiBOPPageList @Override public Gui getGui(int fieldId) { - return this.fieldIdToGuiMap.get(fieldId); + return (Gui)this.fieldIdToGuiMap.get(fieldId); } @@ -156,23 +156,23 @@ public class GuiBOPPageTable extends GuiBOPPageList { if (field instanceof GuiBOPPageList.GuiSlideEntry) { - return this.createSlider(this.width / 2 - 155 + xOffset, 0, (GuiSlideEntry)field); + return (Gui)this.createSlider(this.width / 2 - 155 + xOffset, 0, (GuiBOPPageList.GuiSlideEntry)field); } else if (field instanceof GuiBOPPageList.GuiButtonEntry) { - return this.createListButton(this.width / 2 - 155 + xOffset, 0, (GuiButtonEntry)field); + return (Gui)this.createListButton(this.width / 2 - 155 + xOffset, 0, (GuiBOPPageList.GuiButtonEntry)field); } else if (field instanceof GuiBOPPageList.EditBoxEntry) { - return this.createTextField(this.width / 2 - 155 + xOffset, 0, (EditBoxEntry)field); + return (Gui)this.createTextField(this.width / 2 - 155 + xOffset, 0, (GuiBOPPageList.EditBoxEntry)field); } else if (field instanceof GuiBOPPageList.GuiLabelEntry) { - return this.createLabel(this.width / 2 - 155 + xOffset, 0, (GuiLabelEntry)field, hasNoNeighbor); + return (Gui)this.createLabel(this.width / 2 - 155 + xOffset, 0, (GuiBOPPageList.GuiLabelEntry)field, hasNoNeighbor); } else if (field instanceof GuiBOPPageList.GuiEnumButtonEntry) { - return this.createEnumButton(this.width / 2 - 155 + xOffset, 0, (GuiEnumButtonEntry)field); + return (Gui)this.createEnumButton(this.width / 2 - 155 + xOffset, 0, (GuiBOPPageList.GuiEnumButtonEntry)field); } else { @@ -268,7 +268,7 @@ public class GuiBOPPageTable extends GuiBOPPageList ++focusedGuiIndex; //Cycle forwards through the text fields } - this.focusedGui = this.allTextFieldGuis.get(focusedGuiIndex); + this.focusedGui = (Gui)this.allTextFieldGuis.get(focusedGuiIndex); guitextfield = (GuiTextField)this.focusedGui; guitextfield.setFocused(true); int k1 = guitextfield.y + this.slotHeight; @@ -300,7 +300,7 @@ public class GuiBOPPageTable extends GuiBOPPageList for (int i1 = 0; i1 < l; ++i1) { String s1 = astring1[i1]; - this.allTextFieldGuis.get(k).setText(s1); + ((GuiTextField)this.allTextFieldGuis.get(k)).setText(s1); if (k == this.allTextFieldGuis.size() - 1) { @@ -322,7 +322,7 @@ public class GuiBOPPageTable extends GuiBOPPageList public GuiBOPPageList.GuiRowEntry getRow(int rowNum) { - return this.allRows.get(rowNum); + return (GuiBOPPageList.GuiRowEntry)this.allRows.get(rowNum); } @Override diff --git a/src/main/java/biomesoplenty/client/gui/GuiEnumButton.java b/src/main/java/biomesoplenty/client/gui/GuiEnumButton.java index 8e5440647..7a6c59073 100644 --- a/src/main/java/biomesoplenty/client/gui/GuiEnumButton.java +++ b/src/main/java/biomesoplenty/client/gui/GuiEnumButton.java @@ -24,7 +24,7 @@ public class GuiEnumButton extends GuiButton private String buildDisplayString() { - return I18n.format(this.localizationStr, this.value.toString()); + return I18n.format(this.localizationStr, new Object[] {this.value.toString()}); } public void setValue(T value) diff --git a/src/main/java/biomesoplenty/client/particle/EntityPixieTrailFX.java b/src/main/java/biomesoplenty/client/particle/EntityPixieTrailFX.java index 7f8222953..5b51fa4d9 100644 --- a/src/main/java/biomesoplenty/client/particle/EntityPixieTrailFX.java +++ b/src/main/java/biomesoplenty/client/particle/EntityPixieTrailFX.java @@ -43,7 +43,7 @@ public class EntityPixieTrailFX extends Particle this.particleScale *= par14; this.particleMaxAge = (int)((8.0D / (Math.random() * 0.8D + 0.2D)) * 8); this.particleMaxAge = (int)((float)this.particleMaxAge * par14); - this.particleAge = (particleMaxAge / 2) + (particleMaxAge / 2) * world.rand.nextInt(7); + this.particleAge = (particleMaxAge / 2) + (int)((particleMaxAge / 2) * world.rand.nextInt(7)); this.particleAlpha = 1.0F; this.particleRed = 1.0F; this.particleGreen = 1.0F; diff --git a/src/main/java/biomesoplenty/client/texture/ForgeRedirectedResourcePack.java b/src/main/java/biomesoplenty/client/texture/ForgeRedirectedResourcePack.java index 4513400cb..c76e4697e 100644 --- a/src/main/java/biomesoplenty/client/texture/ForgeRedirectedResourcePack.java +++ b/src/main/java/biomesoplenty/client/texture/ForgeRedirectedResourcePack.java @@ -19,7 +19,7 @@ public class ForgeRedirectedResourcePack extends FMLFileResourcePack { super(container); - this.bopResourcePack = FMLClientHandler.instance().getResourcePackFor(BiomesOPlenty.MOD_ID); + this.bopResourcePack = (IResourcePack)FMLClientHandler.instance().getResourcePackFor(BiomesOPlenty.MOD_ID); } @Override diff --git a/src/main/java/biomesoplenty/client/util/TextureUtils.java b/src/main/java/biomesoplenty/client/util/TextureUtils.java index 5a9afb3ef..e683b3673 100644 --- a/src/main/java/biomesoplenty/client/util/TextureUtils.java +++ b/src/main/java/biomesoplenty/client/util/TextureUtils.java @@ -16,6 +16,6 @@ public class TextureUtils public static ResourceLocation completeResourceLocation(ResourceLocation location, int mode) { - return mode == 0 ? new ResourceLocation(location.getResourceDomain(), String.format("%s/%s%s", TEXTURES_BASE_PATH, location.getResourcePath(), ".png")) : new ResourceLocation(location.getResourceDomain(), String.format("%s/mipmaps/%s.%d%s", TEXTURES_BASE_PATH, location.getResourcePath(), Integer.valueOf(mode), ".png")); + return mode == 0 ? new ResourceLocation(location.getResourceDomain(), String.format("%s/%s%s", new Object[] {TEXTURES_BASE_PATH, location.getResourcePath(), ".png"})) : new ResourceLocation(location.getResourceDomain(), String.format("%s/mipmaps/%s.%d%s", new Object[] {TEXTURES_BASE_PATH, location.getResourcePath(), Integer.valueOf(mode), ".png"})); } } diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenAlps.java b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenAlps.java index 9eaa4f997..96c5b640c 100644 --- a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenAlps.java +++ b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenAlps.java @@ -36,7 +36,7 @@ import net.minecraft.world.biome.Biome.SpawnListEntry; public class BiomeGenAlps extends BOPOverworldBiome { - public enum AlpsType {ALPS, ALPS_FOOTHILLS} + public static enum AlpsType {ALPS, ALPS_FOOTHILLS} public AlpsType type; diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenMountain.java b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenMountain.java index 99c640652..398b3d0b1 100644 --- a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenMountain.java +++ b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenMountain.java @@ -51,7 +51,7 @@ import net.minecraft.world.chunk.ChunkPrimer; public class BiomeGenMountain extends BOPOverworldBiome { - public enum MountainType {MOUNTAIN, MOUNTAIN_FOOTHILLS} + public static enum MountainType {MOUNTAIN, MOUNTAIN_FOOTHILLS} public MountainType type; public IBlockState grassBlock; diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPAsh.java b/src/main/java/biomesoplenty/common/block/BlockBOPAsh.java index 26bf83e9a..ce8564394 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPAsh.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPAsh.java @@ -79,7 +79,7 @@ public class BlockBOPAsh extends BlockBOPGeneric { if (random.nextInt(2) == 0) { - world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, pos.getX() + random.nextFloat(), pos.getY() + 1.1F, pos.getZ() + random.nextFloat(), 0.0D, 0.0D, 0.0D); + world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, pos.getX() + random.nextFloat(), pos.getY() + 1.1F, pos.getZ() + random.nextFloat(), 0.0D, 0.0D, 0.0D, new int[0]); } } diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPBamboo.java b/src/main/java/biomesoplenty/common/block/BlockBOPBamboo.java index a28e6603f..0ca08e9e8 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPBamboo.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPBamboo.java @@ -34,7 +34,7 @@ public class BlockBOPBamboo extends BlockBOPDecoration // add properties public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 15); @Override - protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, AGE);} + protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { AGE });} public BlockBOPBamboo() @@ -104,7 +104,7 @@ public class BlockBOPBamboo extends BlockBOPDecoration @Override public int getMetaFromState(IBlockState state) { - return state.getValue(AGE).intValue(); + return ((Integer)state.getValue(AGE)).intValue(); } @Override @@ -128,7 +128,7 @@ public class BlockBOPBamboo extends BlockBOPDecoration { if (this.checkAndDropBlock(worldIn, pos, state) && worldIn.isAirBlock(pos.up())) { - int age = state.getValue(AGE).intValue(); + int age = ((Integer)state.getValue(AGE)).intValue(); int treeHeight = 1; while (worldIn.getBlockState(pos.down(treeHeight)).getBlock() == this) {++treeHeight;} diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPBiomeBlock.java b/src/main/java/biomesoplenty/common/block/BlockBOPBiomeBlock.java index a5d33a39d..b7b27e58c 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPBiomeBlock.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPBiomeBlock.java @@ -48,6 +48,7 @@ public class BlockBOPBiomeBlock extends BlockBOPGeneric biomesWithEssence = new ArrayList(); List vanillaBiomesToExclude = Arrays.asList( + new Biome[] { Biomes.DEFAULT, Biomes.SKY, Biomes.HELL, @@ -95,7 +96,9 @@ public class BlockBOPBiomeBlock extends BlockBOPGeneric Biomes.MUTATED_TAIGA_COLD, Biomes.REDWOOD_TAIGA_HILLS, Biomes.SAVANNA_PLATEAU, - Biomes.TAIGA_HILLS); + Biomes.TAIGA_HILLS + } + ); for (Biome biome : BiomeUtils.getRegisteredBiomes()) { diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPCoral.java b/src/main/java/biomesoplenty/common/block/BlockBOPCoral.java index 6a96bc27d..b28536ef2 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPCoral.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPCoral.java @@ -24,7 +24,7 @@ import net.minecraft.world.World; public class BlockBOPCoral extends BlockBOPDecoration { - public enum CoralType implements IStringSerializable + public static enum CoralType implements IStringSerializable { PINK, ORANGE, BLUE, GLOWING, ALGAE; @Override @@ -37,11 +37,10 @@ public class BlockBOPCoral extends BlockBOPDecoration { return this.getName(); } - } - + }; public static PropertyEnum VARIANT = PropertyEnum.create("variant", CoralType.class); @Override - protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, LEVEL, VARIANT);} + protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { LEVEL, VARIANT });} // implement IBOPBlock @Override diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPCrystal.java b/src/main/java/biomesoplenty/common/block/BlockBOPCrystal.java index be13eb04c..9cfda9f73 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPCrystal.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPCrystal.java @@ -59,7 +59,12 @@ public class BlockBOPCrystal extends Block implements IBOPBlock public boolean canEntityDestroy(IBlockState state, IBlockAccess world, BlockPos pos, Entity entity) { //Prevent the ender dragon from destroying this block - return !(entity instanceof EntityDragon); + if (entity instanceof EntityDragon) + { + return false; + } + + return true; } @Override diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPDirt.java b/src/main/java/biomesoplenty/common/block/BlockBOPDirt.java index e1d48d0f1..d40333813 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPDirt.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPDirt.java @@ -37,7 +37,7 @@ import net.minecraftforge.fml.relauncher.SideOnly; public class BlockBOPDirt extends Block implements IBOPBlock, ISustainsPlantType { // add properties - public enum BOPDirtType implements IStringSerializable, IPagedVariants + public static enum BOPDirtType implements IStringSerializable, IPagedVariants { LOAMY, SANDY, SILTY; @Override @@ -50,12 +50,11 @@ public class BlockBOPDirt extends Block implements IBOPBlock, ISustainsPlantType { return this.getName(); } - } - + }; public static final PropertyEnum VARIANT = PropertyEnum.create("variant", BOPDirtType.class); public static final PropertyBool COARSE = PropertyBool.create("coarse"); @Override - protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, COARSE, VARIANT);} + protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { COARSE, VARIANT });} // implement IBOPBlock @Override diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPDoubleDecoration.java b/src/main/java/biomesoplenty/common/block/BlockBOPDoubleDecoration.java index 4f71f7ac1..0c73bf95b 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPDoubleDecoration.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPDoubleDecoration.java @@ -28,7 +28,7 @@ import net.minecraft.world.World; public class BlockBOPDoubleDecoration extends BlockBOPDecoration { // add half property - public enum Half implements IStringSerializable + public static enum Half implements IStringSerializable { LOWER, UPPER; @Override @@ -41,11 +41,10 @@ public class BlockBOPDoubleDecoration extends BlockBOPDecoration { { return this.getName(); } - } - + }; public static final PropertyEnum HALF = PropertyEnum.create("half", Half.class); @Override - protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, HALF);} + protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { HALF });} @Override public IProperty[] getNonRenderingProperties() { return null; } diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPDoublePlant.java b/src/main/java/biomesoplenty/common/block/BlockBOPDoublePlant.java index 8aacbe1b1..aef103230 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPDoublePlant.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPDoublePlant.java @@ -42,7 +42,7 @@ import net.minecraftforge.fml.relauncher.SideOnly; public class BlockBOPDoublePlant extends BlockBOPDoubleDecoration implements IShearable { // add properties (note we inherit HALF from BlockDoubleDecoration) - public enum DoublePlantType implements IStringSerializable + public static enum DoublePlantType implements IStringSerializable { FLAX, TALL_CATTAIL, EYEBULB; @Override @@ -55,11 +55,10 @@ public class BlockBOPDoublePlant extends BlockBOPDoubleDecoration implements ISh { return this.getName(); } - } - + }; public static final PropertyEnum VARIANT = PropertyEnum.create("variant", DoublePlantType.class); @Override - protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, HALF, VARIANT);} + protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { HALF, VARIANT });} // implement IBOPBlock @@ -73,7 +72,7 @@ public class BlockBOPDoublePlant extends BlockBOPDoubleDecoration implements ISh return ((DoublePlantType) state.getValue(VARIANT)).getName(); } - public enum ColoringType {PLAIN, LIKE_LEAVES, LIKE_GRASS} + public enum ColoringType {PLAIN, LIKE_LEAVES, LIKE_GRASS}; public static ColoringType getColoringType(DoublePlantType plant) { diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPDoubleWoodSlab.java b/src/main/java/biomesoplenty/common/block/BlockBOPDoubleWoodSlab.java index efe20e864..69a02f175 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPDoubleWoodSlab.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPDoubleWoodSlab.java @@ -72,7 +72,7 @@ public class BlockBOPDoubleWoodSlab extends BlockSlab implements IBOPBlock protected BlockStateContainer createBlockState() { this.variantProperty = currentVariantProperty; // get from static variable - return new BlockStateContainer(this, HALF, this.variantProperty); + return new BlockStateContainer(this, new IProperty[] { HALF, this.variantProperty }); } // implement IBOPBlock diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPFarmland.java b/src/main/java/biomesoplenty/common/block/BlockBOPFarmland.java index 996da3ee7..3471de89c 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPFarmland.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPFarmland.java @@ -62,7 +62,7 @@ public class BlockBOPFarmland extends BlockFarmland implements IBOPBlock protected BlockStateContainer createBlockState() { this.variantProperty = currentVariantProperty; - return new BlockStateContainer(this, MOISTURE, this.variantProperty); + return new BlockStateContainer(this, new IProperty[] { MOISTURE, this.variantProperty }); } @Override diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPFlower.java b/src/main/java/biomesoplenty/common/block/BlockBOPFlower.java index bdcdee8fe..3da143c6f 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPFlower.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPFlower.java @@ -77,7 +77,7 @@ public class BlockBOPFlower extends BlockBOPDecoration implements IShearable, IH protected BlockStateContainer createBlockState() { this.variantProperty = currentVariantProperty; // get from static variable - return new BlockStateContainer(this, this.variantProperty); + return new BlockStateContainer(this, new IProperty[] { this.variantProperty }); } @@ -220,16 +220,16 @@ public class BlockBOPFlower extends BlockBOPDecoration implements IShearable, IH { case DEATHBLOOM: if (rand.nextInt(4) != 0) - world.spawnParticle(EnumParticleTypes.TOWN_AURA, pos.getX() + rand.nextFloat(), pos.getY() + rand.nextFloat(), pos.getZ() + rand.nextFloat(), 0.0D, 0.0D, 0.0D); + world.spawnParticle(EnumParticleTypes.TOWN_AURA, pos.getX() + rand.nextFloat(), pos.getY() + rand.nextFloat(), pos.getZ() + rand.nextFloat(), 0.0D, 0.0D, 0.0D, new int[0]); if (rand.nextInt(4) == 0) - world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, pos.getX() + rand.nextFloat(), pos.getY() + rand.nextFloat(), pos.getZ() + rand.nextFloat(), 0.0D, 0.0D, 0.0D); + world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, pos.getX() + rand.nextFloat(), pos.getY() + rand.nextFloat(), pos.getZ() + rand.nextFloat(), 0.0D, 0.0D, 0.0D, new int[0]); break; case BURNING_BLOSSOM: if (rand.nextInt(2) == 0) - world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, pos.getX() + rand.nextFloat(), pos.getY() + rand.nextFloat(), pos.getZ() + rand.nextFloat(), 0.0D, 0.0D, 0.0D); + world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, pos.getX() + rand.nextFloat(), pos.getY() + rand.nextFloat(), pos.getZ() + rand.nextFloat(), 0.0D, 0.0D, 0.0D, new int[0]); if (rand.nextInt(4) == 0) - world.spawnParticle(EnumParticleTypes.FLAME, pos.getX() + rand.nextFloat(), pos.getY() + rand.nextFloat(), pos.getZ() + rand.nextFloat(), 0.0D, 0.0D, 0.0D); + world.spawnParticle(EnumParticleTypes.FLAME, pos.getX() + rand.nextFloat(), pos.getY() + rand.nextFloat(), pos.getZ() + rand.nextFloat(), 0.0D, 0.0D, 0.0D, new int[0]); break; default: diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPGem.java b/src/main/java/biomesoplenty/common/block/BlockBOPGem.java index 3dd05f2e8..21a0479d2 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPGem.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPGem.java @@ -28,7 +28,7 @@ public class BlockBOPGem extends Block implements IBOPBlock // add properties public static final PropertyEnum VARIANT = PropertyEnum.create("variant", BOPGems.class); @Override - protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, VARIANT);} + protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { VARIANT });} // implement IBOPBlock diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPGemOre.java b/src/main/java/biomesoplenty/common/block/BlockBOPGemOre.java index 74ed79536..caefae43f 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPGemOre.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPGemOre.java @@ -38,7 +38,7 @@ public class BlockBOPGemOre extends Block implements IBOPBlock // add properties (note VARIANT is imported statically from the BlockGem class) @Override - protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, VARIANT);} + protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { VARIANT });} // implement IBOPBlock diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPGrass.java b/src/main/java/biomesoplenty/common/block/BlockBOPGrass.java index d74a9ecea..26d7dbf0e 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPGrass.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPGrass.java @@ -49,7 +49,7 @@ import net.minecraftforge.fml.relauncher.SideOnly; public class BlockBOPGrass extends BlockGrass implements IBOPBlock, ISustainsPlantType { // add properties (note we also inherit the SNOWY property from BlockGrass) - public enum BOPGrassType implements IStringSerializable + public static enum BOPGrassType implements IStringSerializable { SPECTRAL_MOSS, OVERGROWN_STONE, LOAMY, SANDY, SILTY, ORIGIN, OVERGROWN_NETHERRACK, DAISY, MYCELIAL_NETHERRACK; @Override @@ -62,11 +62,10 @@ public class BlockBOPGrass extends BlockGrass implements IBOPBlock, ISustainsPla { return this.getName(); } - } - + }; public static final PropertyEnum VARIANT = PropertyEnum.create("variant", BOPGrassType.class); @Override - protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, SNOWY, VARIANT);} + protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { SNOWY, VARIANT });} // implement IBOPBlock @@ -467,7 +466,7 @@ public class BlockBOPGrass extends BlockGrass implements IBOPBlock, ISustainsPla { if (rand.nextInt(10) == 0) { - world.spawnParticle(EnumParticleTypes.TOWN_AURA, (double)((float)pos.getX() + rand.nextFloat()), (double)((float)pos.getY() + 1.1F), (double)((float)pos.getZ() + rand.nextFloat()), 0.0D, 0.0D, 0.0D); + world.spawnParticle(EnumParticleTypes.TOWN_AURA, (double)((float)pos.getX() + rand.nextFloat()), (double)((float)pos.getY() + 1.1F), (double)((float)pos.getZ() + rand.nextFloat()), 0.0D, 0.0D, 0.0D, new int[0]); } } } diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPGrassPath.java b/src/main/java/biomesoplenty/common/block/BlockBOPGrassPath.java index 12d30e0eb..1e7aef68c 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPGrassPath.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPGrassPath.java @@ -47,7 +47,7 @@ public class BlockBOPGrassPath extends BlockGrassPath implements IBOPBlock protected BlockStateContainer createBlockState() { this.variantProperty = currentVariantProperty; - return new BlockStateContainer(this, this.variantProperty); + return new BlockStateContainer(this, new IProperty[] { this.variantProperty }); } @Override diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPHalfOtherSlab.java b/src/main/java/biomesoplenty/common/block/BlockBOPHalfOtherSlab.java index 5cc72ea36..cf62a8a93 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPHalfOtherSlab.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPHalfOtherSlab.java @@ -42,7 +42,7 @@ public class BlockBOPHalfOtherSlab extends BlockSlab implements IBOPBlock { // add properties - public enum SlabType implements IStringSerializable + public static enum SlabType implements IStringSerializable { MUD_BRICK, WHITE_SANDSTONE; @Override @@ -73,12 +73,12 @@ public class BlockBOPHalfOtherSlab extends BlockSlab implements IBOPBlock } return state; } - } - + }; + // add properties (note we inherit HALF property from parent BlockSlab) public static final PropertyEnum VARIANT = PropertyEnum.create("variant", SlabType.class); @Override - protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, HALF, VARIANT);} + protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { HALF, VARIANT });} // implement IBOPBlock diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPHalfWoodSlab.java b/src/main/java/biomesoplenty/common/block/BlockBOPHalfWoodSlab.java index 618f64fff..b1b5ab023 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPHalfWoodSlab.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPHalfWoodSlab.java @@ -71,7 +71,7 @@ public class BlockBOPHalfWoodSlab extends BlockSlab implements IBOPBlock protected BlockStateContainer createBlockState() { this.variantProperty = currentVariantProperty; // get from static variable - return new BlockStateContainer(this, HALF, this.variantProperty); + return new BlockStateContainer(this, new IProperty[] { HALF, this.variantProperty }); } // implement IBOPBlock diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPHive.java b/src/main/java/biomesoplenty/common/block/BlockBOPHive.java index 78db74c0e..d10cabeeb 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPHive.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPHive.java @@ -37,7 +37,7 @@ public class BlockBOPHive extends Block implements IBOPBlock { // add properties - public enum HiveType implements IStringSerializable + public static enum HiveType implements IStringSerializable { HIVE, HONEYCOMB, EMPTY_HONEYCOMB, FILLED_HONEYCOMB; @Override @@ -50,11 +50,10 @@ public class BlockBOPHive extends Block implements IBOPBlock { return this.getName(); } - } - + }; public static final PropertyEnum VARIANT = PropertyEnum.create("variant", HiveType.class); @Override - protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, VARIANT);} + protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { VARIANT });} // implement IBOPBlock diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPLeaves.java b/src/main/java/biomesoplenty/common/block/BlockBOPLeaves.java index 4ca83d2c1..bf3485f41 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPLeaves.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPLeaves.java @@ -82,7 +82,7 @@ public class BlockBOPLeaves extends BlockLeaves implements IBOPBlock protected BlockStateContainer createBlockState() { this.variantProperty = currentVariantProperty; // get from static variable - return new BlockStateContainer(this, CHECK_DECAY, DECAYABLE, this.variantProperty); + return new BlockStateContainer(this, new IProperty[] { CHECK_DECAY, DECAYABLE, this.variantProperty }); } @@ -106,7 +106,7 @@ public class BlockBOPLeaves extends BlockLeaves implements IBOPBlock } } - public enum ColoringType {PLAIN, TINTED, OVERLAY} + public enum ColoringType {PLAIN, TINTED, OVERLAY}; public static ColoringType getColoringType(BOPTrees tree) { @@ -174,11 +174,11 @@ public class BlockBOPLeaves extends BlockLeaves implements IBOPBlock { BOPTrees tree = (BOPTrees) state.getValue(this.variantProperty); int meta = paging.getIndex(tree); - if (!state.getValue(DECAYABLE).booleanValue()) + if (!((Boolean)state.getValue(DECAYABLE)).booleanValue()) { meta |= 4; } - if (state.getValue(CHECK_DECAY).booleanValue()) + if (((Boolean)state.getValue(CHECK_DECAY)).booleanValue()) { meta |= 8; } diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPLilypad.java b/src/main/java/biomesoplenty/common/block/BlockBOPLilypad.java index 9d668f09a..ab6cffc22 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPLilypad.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPLilypad.java @@ -32,7 +32,7 @@ public class BlockBOPLilypad extends BlockLilyPad implements IBOPBlock { // add properties - public enum LilypadType implements IStringSerializable + public static enum LilypadType implements IStringSerializable { MEDIUM, SMALL, TINY, FLOWER; @Override @@ -45,11 +45,10 @@ public class BlockBOPLilypad extends BlockLilyPad implements IBOPBlock { return this.getName(); } - } - + }; public static final PropertyEnum VARIANT = PropertyEnum.create("variant", LilypadType.class); @Override - protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, VARIANT);} + protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { VARIANT });} // implement IBOPBlock diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPLog.java b/src/main/java/biomesoplenty/common/block/BlockBOPLog.java index b6f4d5f6b..a63ec3560 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPLog.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPLog.java @@ -63,7 +63,7 @@ public class BlockBOPLog extends BlockLog implements IBOPBlock protected BlockStateContainer createBlockState() { this.variantProperty = currentVariantProperty; // get from static variable - return new BlockStateContainer(this, LOG_AXIS, this.variantProperty); + return new BlockStateContainer(this, new IProperty[] { LOG_AXIS, this.variantProperty }); } @@ -114,7 +114,7 @@ public class BlockBOPLog extends BlockLog implements IBOPBlock public int getMetaFromState(IBlockState state) { BOPWoods wood = (BOPWoods) state.getValue(this.variantProperty); - return state.getValue(LOG_AXIS).ordinal() * 4 + paging.getIndex(wood); + return ((BlockLog.EnumAxis) state.getValue(LOG_AXIS)).ordinal() * 4 + paging.getIndex(wood); } // discard the axis information - otherwise logs facing different directions would not stack together diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPMud.java b/src/main/java/biomesoplenty/common/block/BlockBOPMud.java index 9199b29ac..ca236f1b1 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPMud.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPMud.java @@ -45,7 +45,7 @@ public class BlockBOPMud extends Block implements IBOPBlock, ISustainsPlantType protected static final AxisAlignedBB MUD_AABB = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.875D, 1.0D); // add properties - public enum MudType implements IStringSerializable + public static enum MudType implements IStringSerializable { MUD; @Override @@ -58,11 +58,10 @@ public class BlockBOPMud extends Block implements IBOPBlock, ISustainsPlantType { return this.getName(); } - } - + }; public static final PropertyEnum VARIANT = PropertyEnum.create("variant", MudType.class); @Override - protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, VARIANT);} + protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { VARIANT });} // implement IBOPBlock diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPMushroom.java b/src/main/java/biomesoplenty/common/block/BlockBOPMushroom.java index 1f62b1013..64ec3a612 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPMushroom.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPMushroom.java @@ -29,7 +29,7 @@ import net.minecraftforge.fml.relauncher.SideOnly; public class BlockBOPMushroom extends BlockBOPDecoration { // add properties - public enum MushroomType implements IStringSerializable + public static enum MushroomType implements IStringSerializable { TOADSTOOL, PORTOBELLO, BLUE_MILK_CAP, GLOWSHROOM, FLAT_MUSHROOM, SHADOW_SHROOM; @Override @@ -42,11 +42,10 @@ public class BlockBOPMushroom extends BlockBOPDecoration { return this.getName(); } - } - + }; public static final PropertyEnum VARIANT = PropertyEnum.create("variant", MushroomType.class); @Override - protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, VARIANT);} + protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { VARIANT });} // implement IBOPBlock @@ -99,7 +98,7 @@ public class BlockBOPMushroom extends BlockBOPDecoration @Override public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { - MushroomType plant = (MushroomType) state.getValue(VARIANT); + MushroomType plant = (MushroomType) state.getValue(this.VARIANT); switch (plant) { case GLOWSHROOM: case SHADOW_SHROOM: diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPPlanks.java b/src/main/java/biomesoplenty/common/block/BlockBOPPlanks.java index 45cf197e6..641c29efe 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPPlanks.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPPlanks.java @@ -60,7 +60,7 @@ public class BlockBOPPlanks extends Block implements IBOPBlock protected BlockStateContainer createBlockState() { this.variantProperty = currentVariantProperty; // get from static variable - return new BlockStateContainer(this, this.variantProperty); + return new BlockStateContainer(this, new IProperty[] { this.variantProperty }); } diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPPlant.java b/src/main/java/biomesoplenty/common/block/BlockBOPPlant.java index 73c9805d9..33029115d 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPPlant.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPPlant.java @@ -91,7 +91,7 @@ public class BlockBOPPlant extends BlockBOPDecoration implements IShearable, IHo protected BlockStateContainer createBlockState() { this.variantProperty = currentVariantProperty; // get from static variable - return new BlockStateContainer(this, this.variantProperty); + return new BlockStateContainer(this, new IProperty[] { this.variantProperty }); } @@ -114,7 +114,7 @@ public class BlockBOPPlant extends BlockBOPDecoration implements IShearable, IHo } } - public enum ColoringType {PLAIN, LIKE_LEAVES, LIKE_GRASS} + public enum ColoringType {PLAIN, LIKE_LEAVES, LIKE_GRASS}; public static ColoringType getColoringType(BOPPlants plant) { diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPSapling.java b/src/main/java/biomesoplenty/common/block/BlockBOPSapling.java index 20b0b6c07..acaf4c9b4 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPSapling.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPSapling.java @@ -85,7 +85,7 @@ public class BlockBOPSapling extends BlockBOPDecoration implements IGrowable, IP protected BlockStateContainer createBlockState() { this.variantProperty = currentVariantProperty; // get from static variable - return new BlockStateContainer(this, STAGE, this.variantProperty); + return new BlockStateContainer(this, new IProperty[] { STAGE, this.variantProperty }); } @@ -122,7 +122,7 @@ public class BlockBOPSapling extends BlockBOPDecoration implements IGrowable, IP public int getMetaFromState(IBlockState state) { BOPTrees tree = (BOPTrees)state.getValue(this.variantProperty); - return state.getValue(STAGE).intValue() * 8 + paging.getIndex(tree); + return ((Integer)state.getValue(STAGE)).intValue() * 8 + paging.getIndex(tree); } // which types of mushroom can live on which types of block @@ -261,7 +261,7 @@ public class BlockBOPSapling extends BlockBOPDecoration implements IGrowable, IP @Override public void grow(World worldIn, Random rand, BlockPos pos, IBlockState state) { - if (state.getValue(STAGE).intValue() == 0) + if (((Integer)state.getValue(STAGE)).intValue() == 0) { worldIn.setBlockState(pos, state.cycleProperty(STAGE), 4); } @@ -313,7 +313,7 @@ public class BlockBOPSapling extends BlockBOPDecoration implements IGrowable, IP // otherwise, try to grow a small tree if (smallTreeGenerator != null) { - return this.generateSmallOrBigTree(worldIn, pos, state, rand, smallTreeGenerator); + if (this.generateSmallOrBigTree(worldIn, pos, state, rand, smallTreeGenerator)) {return true;} } return false; } diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPSeaweed.java b/src/main/java/biomesoplenty/common/block/BlockBOPSeaweed.java index 162143820..dd6bd1f53 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPSeaweed.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPSeaweed.java @@ -30,7 +30,7 @@ public class BlockBOPSeaweed extends BlockBOPDecoration implements IBOPBlock // TODO: is it supposed to grow? - public enum SeaweedType implements IStringSerializable + public static enum SeaweedType implements IStringSerializable { KELP; @Override @@ -43,9 +43,9 @@ public class BlockBOPSeaweed extends BlockBOPDecoration implements IBOPBlock { return this.getName(); } - } - - public enum SeaweedPosition implements IStringSerializable + }; + + public static enum SeaweedPosition implements IStringSerializable { SINGLE, BOTTOM, MIDDLE, TOP; @Override @@ -64,7 +64,7 @@ public class BlockBOPSeaweed extends BlockBOPDecoration implements IBOPBlock public static final PropertyEnum POSITION = PropertyEnum.create("position", SeaweedPosition.class); @Override - protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, LEVEL, POSITION, VARIANT);} + protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { LEVEL, POSITION, VARIANT });} // implement IBOPBlock diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPStoneFormations.java b/src/main/java/biomesoplenty/common/block/BlockBOPStoneFormations.java index 80218c252..e15d0d6f2 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPStoneFormations.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPStoneFormations.java @@ -31,7 +31,7 @@ import net.minecraftforge.fml.relauncher.SideOnly; public class BlockBOPStoneFormations extends BlockBOPDecoration implements IBOPBlock { // add properties - public enum FormationType implements IStringSerializable + public static enum FormationType implements IStringSerializable { STONE_FORMATION; @Override @@ -44,9 +44,9 @@ public class BlockBOPStoneFormations extends BlockBOPDecoration implements IBOPB { return this.getName(); } - } - - public enum FormationPosition implements IStringSerializable + }; + + public static enum FormationPosition implements IStringSerializable { STALAGMITE_SMALL, STALACTITE_SMALL, STAL_SINGLE, STAL_CONNECTOR, STALAGMITE_MEDIUM, STALACTITE_MEDIUM, STALAGMITE_TOP, STALACTITE_BOTTOM; @Override @@ -64,7 +64,7 @@ public class BlockBOPStoneFormations extends BlockBOPDecoration implements IBOPB public static final PropertyEnum VARIANT = PropertyEnum.create("variant", FormationType.class); public static final PropertyEnum POSITION = PropertyEnum.create("position", FormationPosition.class); @Override - protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, POSITION, VARIANT);} + protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { POSITION, VARIANT });} // implement IBOPBlock diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPTerrarium.java b/src/main/java/biomesoplenty/common/block/BlockBOPTerrarium.java index 9ff3b5379..12036069b 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPTerrarium.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPTerrarium.java @@ -34,7 +34,7 @@ public class BlockBOPTerrarium extends Block implements IBOPBlock protected static final AxisAlignedBB BOUNDING_BOX = new AxisAlignedBB(0.19999998807D, 0.0D, 0.19999998807D, 0.69999998808D, 0.69999998808D, 0.69999998808D); // add properties - public enum TerrariumType implements IStringSerializable + public static enum TerrariumType implements IStringSerializable { FERN, MUSHROOM, CACTUS, FLAX, FLOWER, KORU, BAMBOO, SAPLING, GLOWSHROOM, DEAD, MYSTIC, OMINOUS, WASTELAND, ORIGIN, NETHER, ENDER; @Override @@ -47,11 +47,10 @@ public class BlockBOPTerrarium extends Block implements IBOPBlock { return this.getName(); } - } - + }; public static final PropertyEnum VARIANT = PropertyEnum.create("variant", TerrariumType.class); @Override - protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, VARIANT);} + protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { VARIANT });} // implement IBOPBlock @@ -100,7 +99,7 @@ public class BlockBOPTerrarium extends Block implements IBOPBlock @Override public int getLightValue(IBlockState state) { - switch ((TerrariumType) state.getValue(VARIANT)) + switch ((TerrariumType) state.getValue(this.VARIANT)) { case GLOWSHROOM: return 5; diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPWhiteSandstone.java b/src/main/java/biomesoplenty/common/block/BlockBOPWhiteSandstone.java index a9c795e44..f2517f68f 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPWhiteSandstone.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPWhiteSandstone.java @@ -39,7 +39,7 @@ public class BlockBOPWhiteSandstone extends Block implements IBOPBlock { // add properties - public enum StoneType implements IStringSerializable + public static enum StoneType implements IStringSerializable { DEFAULT, CHISELED, SMOOTH; @Override @@ -52,11 +52,10 @@ public class BlockBOPWhiteSandstone extends Block implements IBOPBlock { return this.getName(); } - } - + }; public static final PropertyEnum VARIANT = PropertyEnum.create("variant", StoneType.class); @Override - protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, VARIANT);} + protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { VARIANT });} // implement IBOPBlock diff --git a/src/main/java/biomesoplenty/common/block/IBOPBlock.java b/src/main/java/biomesoplenty/common/block/IBOPBlock.java index cb8642b40..f6220199f 100644 --- a/src/main/java/biomesoplenty/common/block/IBOPBlock.java +++ b/src/main/java/biomesoplenty/common/block/IBOPBlock.java @@ -18,13 +18,13 @@ import net.minecraftforge.fml.relauncher.SideOnly; public interface IBOPBlock { - Class getItemClass(); - IProperty[] getPresetProperties(); - IProperty[] getNonRenderingProperties(); - String getStateName(IBlockState state); + public Class getItemClass(); + public IProperty[] getPresetProperties(); + public IProperty[] getNonRenderingProperties(); + public String getStateName(IBlockState state); @SideOnly(Side.CLIENT) - IBlockColor getBlockColor(); + public IBlockColor getBlockColor(); @SideOnly(Side.CLIENT) - IItemColor getItemColor(); + public IItemColor getItemColor(); } \ No newline at end of file diff --git a/src/main/java/biomesoplenty/common/block/ISustainsPlantType.java b/src/main/java/biomesoplenty/common/block/ISustainsPlantType.java index 686fc5d66..cdc5c204c 100644 --- a/src/main/java/biomesoplenty/common/block/ISustainsPlantType.java +++ b/src/main/java/biomesoplenty/common/block/ISustainsPlantType.java @@ -14,5 +14,5 @@ import net.minecraftforge.common.EnumPlantType; public interface ISustainsPlantType { - boolean canSustainPlantType(IBlockAccess world, BlockPos pos, EnumPlantType plantType); + public boolean canSustainPlantType(IBlockAccess world, BlockPos pos, EnumPlantType plantType); } \ No newline at end of file diff --git a/src/main/java/biomesoplenty/common/command/BOPCommand.java b/src/main/java/biomesoplenty/common/command/BOPCommand.java index f02ead198..2940fca39 100644 --- a/src/main/java/biomesoplenty/common/command/BOPCommand.java +++ b/src/main/java/biomesoplenty/common/command/BOPCommand.java @@ -142,7 +142,8 @@ public class BOPCommand extends CommandBase } } - private void printStats(ICommandSender sender, String[] args) { + private void printStats(ICommandSender sender, String[] args) throws CommandException + { TextComponentTranslation text = new TextComponentTranslation("commands.biomesoplenty.stats.blocks", blockCount); text.getStyle().setColor(TextFormatting.GREEN); diff --git a/src/main/java/biomesoplenty/common/entities/EntityPixie.java b/src/main/java/biomesoplenty/common/entities/EntityPixie.java index 7e6e8ddbc..8499723bf 100644 --- a/src/main/java/biomesoplenty/common/entities/EntityPixie.java +++ b/src/main/java/biomesoplenty/common/entities/EntityPixie.java @@ -186,7 +186,11 @@ public class EntityPixie extends EntityFlying implements IMob { return false; } } - return !this.isBoxBlocked(box.offset(this.aimX * howFar, this.aimY * howFar, this.aimZ * howFar)); + if (this.isBoxBlocked(box.offset(this.aimX * howFar, this.aimY * howFar, this.aimZ * howFar))) + { + return false; + } + return true; } } diff --git a/src/main/java/biomesoplenty/common/entities/EntityWasp.java b/src/main/java/biomesoplenty/common/entities/EntityWasp.java index 0e9cd1099..bf918f4d5 100644 --- a/src/main/java/biomesoplenty/common/entities/EntityWasp.java +++ b/src/main/java/biomesoplenty/common/entities/EntityWasp.java @@ -151,7 +151,11 @@ public class EntityWasp extends EntityFlying implements IMob { return false; } } - return !this.isBoxBlocked(box.offset(this.aimX * howFar, this.aimY * howFar, this.aimZ * howFar)); + if (this.isBoxBlocked(box.offset(this.aimX * howFar, this.aimY * howFar, this.aimZ * howFar))) + { + return false; + } + return true; } } diff --git a/src/main/java/biomesoplenty/common/entities/ai/EntityAIEatBOPGrass.java b/src/main/java/biomesoplenty/common/entities/ai/EntityAIEatBOPGrass.java index 1e958557e..40cf662f2 100644 --- a/src/main/java/biomesoplenty/common/entities/ai/EntityAIEatBOPGrass.java +++ b/src/main/java/biomesoplenty/common/entities/ai/EntityAIEatBOPGrass.java @@ -105,14 +105,14 @@ public class EntityAIEatBOPGrass extends EntityAIEatGrass if (stateDown.getBlock() instanceof BlockBOPGrass) { BlockBOPGrass grass = (BlockBOPGrass) stateDown.getBlock(); - Block dirtBlock = BlockBOPGrass.getDirtBlockState(stateDown).getBlock(); + Block dirtBlock = grass.getDirtBlockState(stateDown).getBlock(); if (dirtBlock instanceof BlockBOPDirt) { if (this.world.getGameRules().getBoolean("mobGriefing")) { this.world.playEvent(2001, posDown, Block.getIdFromBlock(BOPBlocks.grass)); - this.world.setBlockState(posDown, BlockBOPGrass.getDirtBlockState(stateDown), 2); + this.world.setBlockState(posDown, grass.getDirtBlockState(stateDown), 2); } } else if (stateDown.getValue(BlockBOPGrass.VARIANT) == BlockBOPGrass.BOPGrassType.DAISY) diff --git a/src/main/java/biomesoplenty/common/fluids/blocks/BlockBloodFluid.java b/src/main/java/biomesoplenty/common/fluids/blocks/BlockBloodFluid.java index 7089c80d0..ec17f6158 100644 --- a/src/main/java/biomesoplenty/common/fluids/blocks/BlockBloodFluid.java +++ b/src/main/java/biomesoplenty/common/fluids/blocks/BlockBloodFluid.java @@ -73,7 +73,7 @@ public class BlockBloodFluid extends BlockFluidClassic if (flag) { - Integer integer = state.getValue(LEVEL); + Integer integer = (Integer)state.getValue(LEVEL); if (integer.intValue() == 0) { diff --git a/src/main/java/biomesoplenty/common/fluids/blocks/BlockHoneyFluid.java b/src/main/java/biomesoplenty/common/fluids/blocks/BlockHoneyFluid.java index 8d7832b0c..29d72403e 100644 --- a/src/main/java/biomesoplenty/common/fluids/blocks/BlockHoneyFluid.java +++ b/src/main/java/biomesoplenty/common/fluids/blocks/BlockHoneyFluid.java @@ -88,7 +88,7 @@ public class BlockHoneyFluid extends BlockFluidFinite if (flag) { - Integer integer = state.getValue(LEVEL); + Integer integer = (Integer)state.getValue(LEVEL); if (integer.intValue() == 0) { diff --git a/src/main/java/biomesoplenty/common/fluids/blocks/BlockHotSpringWaterFluid.java b/src/main/java/biomesoplenty/common/fluids/blocks/BlockHotSpringWaterFluid.java index ab3bbdea7..57a2d580a 100644 --- a/src/main/java/biomesoplenty/common/fluids/blocks/BlockHotSpringWaterFluid.java +++ b/src/main/java/biomesoplenty/common/fluids/blocks/BlockHotSpringWaterFluid.java @@ -55,7 +55,7 @@ public class BlockHotSpringWaterFluid extends BlockFluidClassic super.randomDisplayTick(state, world, pos, rand); if (rand.nextInt(25)==0) { - world.spawnParticle(EnumParticleTypes.CLOUD, pos.getX() + rand.nextFloat(), pos.getY() + 1.0F, pos.getZ() + rand.nextFloat(), 0.0D, 0.0D, 0.0D); + world.spawnParticle(EnumParticleTypes.CLOUD, pos.getX() + rand.nextFloat(), pos.getY() + 1.0F, pos.getZ() + rand.nextFloat(), 0.0D, 0.0D, 0.0D, new int[0]); } } @@ -103,7 +103,7 @@ public class BlockHotSpringWaterFluid extends BlockFluidClassic if (flag) { - Integer integer = state.getValue(LEVEL); + Integer integer = (Integer)state.getValue(LEVEL); if (integer.intValue() == 0) { diff --git a/src/main/java/biomesoplenty/common/fluids/blocks/BlockPoisonFluid.java b/src/main/java/biomesoplenty/common/fluids/blocks/BlockPoisonFluid.java index 695fb14af..afb5cb9b1 100644 --- a/src/main/java/biomesoplenty/common/fluids/blocks/BlockPoisonFluid.java +++ b/src/main/java/biomesoplenty/common/fluids/blocks/BlockPoisonFluid.java @@ -88,7 +88,7 @@ public class BlockPoisonFluid extends BlockFluidClassic if (flag) { - Integer integer = state.getValue(LEVEL); + Integer integer = (Integer)state.getValue(LEVEL); if (integer.intValue() == 0) { diff --git a/src/main/java/biomesoplenty/common/fluids/blocks/BlockQuicksandFluid.java b/src/main/java/biomesoplenty/common/fluids/blocks/BlockQuicksandFluid.java index 358508133..1a6ad43e5 100644 --- a/src/main/java/biomesoplenty/common/fluids/blocks/BlockQuicksandFluid.java +++ b/src/main/java/biomesoplenty/common/fluids/blocks/BlockQuicksandFluid.java @@ -78,7 +78,7 @@ public class BlockQuicksandFluid extends BlockFluidClassic if (flag) { - Integer integer = state.getValue(LEVEL); + Integer integer = (Integer)state.getValue(LEVEL); if (integer.intValue() == 0) { diff --git a/src/main/java/biomesoplenty/common/handler/BucketEventHandler.java b/src/main/java/biomesoplenty/common/handler/BucketEventHandler.java index bcabd0af2..d332727b8 100644 --- a/src/main/java/biomesoplenty/common/handler/BucketEventHandler.java +++ b/src/main/java/biomesoplenty/common/handler/BucketEventHandler.java @@ -47,23 +47,23 @@ public class BucketEventHandler // determine if the block is one of our BOP fluids IBlockState iblockstate = event.getWorld().getBlockState(blockpos); Fluid filled_fluid = null; - if (iblockstate.getBlock() == BOPBlocks.sand && iblockstate.getValue(BlockQuicksandFluid.LEVEL).intValue() == 0) + if (iblockstate.getBlock() == BOPBlocks.sand && ((Integer)iblockstate.getValue(BlockQuicksandFluid.LEVEL)).intValue() == 0) { filled_fluid = QuicksandFluid.instance; } - else if (iblockstate.getBlock() == BOPBlocks.honey && iblockstate.getValue(BlockHoneyFluid.LEVEL).intValue() == 0) + else if (iblockstate.getBlock() == BOPBlocks.honey && ((Integer)iblockstate.getValue(BlockHoneyFluid.LEVEL)).intValue() == 0) { filled_fluid = HoneyFluid.instance; } - else if (iblockstate.getBlock() == BOPBlocks.blood && iblockstate.getValue(BlockBloodFluid.LEVEL).intValue() == 0) + else if (iblockstate.getBlock() == BOPBlocks.blood && ((Integer)iblockstate.getValue(BlockBloodFluid.LEVEL)).intValue() == 0) { filled_fluid = BloodFluid.instance; } - else if (iblockstate.getBlock() == BOPBlocks.poison && iblockstate.getValue(BlockPoisonFluid.LEVEL).intValue() == 0) + else if (iblockstate.getBlock() == BOPBlocks.poison && ((Integer)iblockstate.getValue(BlockPoisonFluid.LEVEL)).intValue() == 0) { filled_fluid = PoisonFluid.instance; } - else if (iblockstate.getBlock() == BOPBlocks.hot_spring_water && iblockstate.getValue(BlockHotSpringWaterFluid.LEVEL).intValue() == 0) + else if (iblockstate.getBlock() == BOPBlocks.hot_spring_water && ((Integer)iblockstate.getValue(BlockHotSpringWaterFluid.LEVEL)).intValue() == 0) { filled_fluid = HotSpringWaterFluid.instance; } diff --git a/src/main/java/biomesoplenty/common/handler/TrailsEventHandler.java b/src/main/java/biomesoplenty/common/handler/TrailsEventHandler.java index 76e553f3d..02da62be1 100644 --- a/src/main/java/biomesoplenty/common/handler/TrailsEventHandler.java +++ b/src/main/java/biomesoplenty/common/handler/TrailsEventHandler.java @@ -34,7 +34,7 @@ public class TrailsEventHandler if (event.phase == TickEvent.Phase.START) { Minecraft minecraft = Minecraft.getMinecraft(); - EntityPlayer player = event.player; + EntityPlayer player = (EntityPlayer)event.player; //Check if the player has a trail if (minecraft.player != null && TrailManager.trailsMap.containsKey(player.getUniqueID())) diff --git a/src/main/java/biomesoplenty/common/init/ModBiomes.java b/src/main/java/biomesoplenty/common/init/ModBiomes.java index 216af8c0d..2b97e7c57 100644 --- a/src/main/java/biomesoplenty/common/init/ModBiomes.java +++ b/src/main/java/biomesoplenty/common/init/ModBiomes.java @@ -631,7 +631,7 @@ public class ModBiomes implements BOPBiomes.IBiomeRegistry if (biome.canGenerateVillages) BiomeManager.addVillageBiome(biome, true); - return Optional.of(biome); + return Optional.of((Biome)biome); } else { return Optional.absent(); @@ -653,7 +653,7 @@ public class ModBiomes implements BOPBiomes.IBiomeRegistry biome.setRegistryName(biome.getResourceLocation()); ForgeRegistries.BIOMES.register(biome); - return Optional.of(biome); + return Optional.of((Biome)biome); } else { return Optional.absent(); diff --git a/src/main/java/biomesoplenty/common/init/ModBlockQueries.java b/src/main/java/biomesoplenty/common/init/ModBlockQueries.java index 42c400bb2..3404c3b67 100644 --- a/src/main/java/biomesoplenty/common/init/ModBlockQueries.java +++ b/src/main/java/biomesoplenty/common/init/ModBlockQueries.java @@ -164,7 +164,7 @@ public class ModBlockQueries // reed needs the ground block to be water, but the block below that to NOT be water @Override public boolean matches(World world, BlockPos pos) { BlockPos groundPos = pos.down(); - return (world.getBlockState(pos).getMaterial() == Material.WATER && world.getBlockState(pos).getValue(BlockLiquid.LEVEL).intValue() == 0 || world.getBlockState(pos).getMaterial() == Material.ICE) && + return (world.getBlockState(pos).getMaterial() == Material.WATER && ((Integer)world.getBlockState(pos).getValue(BlockLiquid.LEVEL)).intValue() == 0 || world.getBlockState(pos).getMaterial() == Material.ICE) && (world.getBlockState(groundPos).getBlock() != Blocks.WATER && world.getBlockState(groundPos).isSideSolid(world, groundPos, EnumFacing.UP)); } }).withLightAboveAtLeast(8).create(); diff --git a/src/main/java/biomesoplenty/common/init/ModBlocks.java b/src/main/java/biomesoplenty/common/init/ModBlocks.java index 961b9b80c..20ec6422e 100644 --- a/src/main/java/biomesoplenty/common/init/ModBlocks.java +++ b/src/main/java/biomesoplenty/common/init/ModBlocks.java @@ -409,7 +409,7 @@ public class ModBlocks { try { - Item itemBlock = clazz != null ? clazz.getConstructor(Block.class).newInstance(block) : null; + Item itemBlock = clazz != null ? (Item)clazz.getConstructor(Block.class).newInstance(block) : null; ResourceLocation location = new ResourceLocation(BiomesOPlenty.MOD_ID, blockName); block.setRegistryName(new ResourceLocation(BiomesOPlenty.MOD_ID, blockName)); diff --git a/src/main/java/biomesoplenty/common/init/ModCompatibility.java b/src/main/java/biomesoplenty/common/init/ModCompatibility.java index f85bb8852..a90313596 100644 --- a/src/main/java/biomesoplenty/common/init/ModCompatibility.java +++ b/src/main/java/biomesoplenty/common/init/ModCompatibility.java @@ -46,7 +46,7 @@ public class ModCompatibility // Creates a mutable version of the current biome type's biome array and wraps entries to support .equals() List entries = Lists.transform(Lists.newArrayList(BiomeManager.getBiomes(type)), WRAP_BIOME_ENTRIES); // Custom types may have been added, we only want the vanilla ones - final List vanillaEntries = type.ordinal() < vanillaBiomes.length ? Lists.transform(vanillaBiomes[type.ordinal()], WRAP_BIOME_ENTRIES) : Lists.newArrayList(); + final List vanillaEntries = type.ordinal() < vanillaBiomes.length ? Lists.transform(vanillaBiomes[type.ordinal()], WRAP_BIOME_ENTRIES) : (List)Lists.newArrayList(); //Remove all default biomes from the entries list entries.removeAll(vanillaEntries); diff --git a/src/main/java/biomesoplenty/common/init/ModEntities.java b/src/main/java/biomesoplenty/common/init/ModEntities.java index 5c7d03566..5a27172fc 100644 --- a/src/main/java/biomesoplenty/common/init/ModEntities.java +++ b/src/main/java/biomesoplenty/common/init/ModEntities.java @@ -66,7 +66,7 @@ public class ModEntities { if (clazz != null) { - entity = clazz.getConstructor(new Class[] {World.class}).newInstance(new Object[] {worldIn}); + entity = (Entity)clazz.getConstructor(new Class[] {World.class}).newInstance(new Object[] {worldIn}); } } catch (Exception exception) diff --git a/src/main/java/biomesoplenty/common/init/ModVanillaCompat.java b/src/main/java/biomesoplenty/common/init/ModVanillaCompat.java index 341ace99e..069dd8ac7 100644 --- a/src/main/java/biomesoplenty/common/init/ModVanillaCompat.java +++ b/src/main/java/biomesoplenty/common/init/ModVanillaCompat.java @@ -25,7 +25,7 @@ public class ModVanillaCompat MapGenStructureIO.registerStructure(BOPMapGenScatteredFeature.Start.class, "BOPTemple"); List mansionBiomes = BiomeUtils.filterPresentBiomes(BOPBiomes.coniferous_forest, BOPBiomes.dead_forest, BOPBiomes.ominous_woods, BOPBiomes.snowy_coniferous_forest, BOPBiomes.woodland); - mansionBiomes.addAll(Lists.newArrayList(Biomes.ROOFED_FOREST, Biomes.MUTATED_ROOFED_FOREST)); + mansionBiomes.addAll(Lists.newArrayList(Biomes.ROOFED_FOREST, Biomes.MUTATED_ROOFED_FOREST)); WoodlandMansion.ALLOWED_BIOMES = mansionBiomes; } diff --git a/src/main/java/biomesoplenty/common/inventory/ContainerFlowerBasket.java b/src/main/java/biomesoplenty/common/inventory/ContainerFlowerBasket.java index eb9e10743..b5c2c9c00 100644 --- a/src/main/java/biomesoplenty/common/inventory/ContainerFlowerBasket.java +++ b/src/main/java/biomesoplenty/common/inventory/ContainerFlowerBasket.java @@ -82,7 +82,7 @@ public class ContainerFlowerBasket extends Container public ItemStack transferStackInSlot(EntityPlayer player, int index) { ItemStack oldStack = ItemStack.EMPTY; - Slot slot = this.inventorySlots.get(index); + Slot slot = (Slot)this.inventorySlots.get(index); //Ensure there is a slot at this index and it has an item in it if (slot != null && slot.getHasStack()) diff --git a/src/main/java/biomesoplenty/common/item/IColoredItem.java b/src/main/java/biomesoplenty/common/item/IColoredItem.java index 64e74db42..144f93968 100644 --- a/src/main/java/biomesoplenty/common/item/IColoredItem.java +++ b/src/main/java/biomesoplenty/common/item/IColoredItem.java @@ -14,5 +14,5 @@ import net.minecraftforge.fml.relauncher.SideOnly; public interface IColoredItem { @SideOnly(Side.CLIENT) - IItemColor getItemColor(); + public IItemColor getItemColor(); } diff --git a/src/main/java/biomesoplenty/common/item/ItemBOPLilypad.java b/src/main/java/biomesoplenty/common/item/ItemBOPLilypad.java index f7d2d38ef..7205429e4 100644 --- a/src/main/java/biomesoplenty/common/item/ItemBOPLilypad.java +++ b/src/main/java/biomesoplenty/common/item/ItemBOPLilypad.java @@ -60,7 +60,7 @@ public class ItemBOPLilypad extends ItemBOPBlock { BlockPos blockpos1 = blockpos.up(); IBlockState iblockstate = worldIn.getBlockState(blockpos); - if (iblockstate.getMaterial() == Material.WATER && iblockstate.getValue(BlockLiquid.LEVEL).intValue() == 0 && worldIn.isAirBlock(blockpos1)) + if (iblockstate.getMaterial() == Material.WATER && ((Integer)iblockstate.getValue(BlockLiquid.LEVEL)).intValue() == 0 && worldIn.isAirBlock(blockpos1)) { // special case for handling block placement with water lilies net.minecraftforge.common.util.BlockSnapshot blocksnapshot = net.minecraftforge.common.util.BlockSnapshot.getBlockSnapshot(worldIn, blockpos1); diff --git a/src/main/java/biomesoplenty/common/item/ItemBOPPlant.java b/src/main/java/biomesoplenty/common/item/ItemBOPPlant.java index e91efd013..4b1b2323f 100644 --- a/src/main/java/biomesoplenty/common/item/ItemBOPPlant.java +++ b/src/main/java/biomesoplenty/common/item/ItemBOPPlant.java @@ -68,7 +68,7 @@ public class ItemBOPPlant extends ItemBOPBlock { BlockPos blockpos1 = blockpos.up(); IBlockState iblockstate = worldIn.getBlockState(blockpos); - if (iblockstate.getMaterial() == Material.WATER && iblockstate.getValue(BlockLiquid.LEVEL).intValue() == 0 && worldIn.isAirBlock(blockpos1)) + if (iblockstate.getMaterial() == Material.WATER && ((Integer)iblockstate.getValue(BlockLiquid.LEVEL)).intValue() == 0 && worldIn.isAirBlock(blockpos1)) { // special case for handling block placement with reeds net.minecraftforge.common.util.BlockSnapshot blocksnapshot = net.minecraftforge.common.util.BlockSnapshot.getBlockSnapshot(worldIn, blockpos1); diff --git a/src/main/java/biomesoplenty/common/remote/TrailManager.java b/src/main/java/biomesoplenty/common/remote/TrailManager.java index 7f78b305a..6191bea12 100644 --- a/src/main/java/biomesoplenty/common/remote/TrailManager.java +++ b/src/main/java/biomesoplenty/common/remote/TrailManager.java @@ -56,8 +56,8 @@ public class TrailManager } } - public enum TrailVisibilityMode + public static enum TrailVisibilityMode { - ALL, OTHERS, NOBODY //TODO: Implement NOBODY mode + ALL, OTHERS, NOBODY; //TODO: Implement NOBODY mode } } diff --git a/src/main/java/biomesoplenty/common/util/biome/GeneratorUtils.java b/src/main/java/biomesoplenty/common/util/biome/GeneratorUtils.java index d444ca806..c806bdb9c 100644 --- a/src/main/java/biomesoplenty/common/util/biome/GeneratorUtils.java +++ b/src/main/java/biomesoplenty/common/util/biome/GeneratorUtils.java @@ -81,7 +81,7 @@ public class GeneratorUtils return null; } - public enum ScatterYMethod + public static enum ScatterYMethod { ANYWHERE, NETHER_SURFACE, NETHER_ROOF, AT_SURFACE, AT_GROUND, BELOW_SURFACE, BELOW_GROUND, ABOVE_SURFACE, ABOVE_GROUND; public BlockPos getBlockPos(World world, Random random, int x, int z) diff --git a/src/main/java/biomesoplenty/common/util/block/BlockQuery.java b/src/main/java/biomesoplenty/common/util/block/BlockQuery.java index a9a0df480..975795009 100644 --- a/src/main/java/biomesoplenty/common/util/block/BlockQuery.java +++ b/src/main/java/biomesoplenty/common/util/block/BlockQuery.java @@ -39,16 +39,16 @@ import net.minecraftforge.common.EnumPlantType; public class BlockQuery { // for compound queries - public interface ICompoundBlockPosQuery extends IBlockPosQuery + public static interface ICompoundBlockPosQuery extends IBlockPosQuery { - void add(IBlockPosQuery a); - IBlockPosQuery instance(); + public void add(IBlockPosQuery a); + public IBlockPosQuery instance(); } // for queries which depend only on the block state, and not on it's neighbors or position in the world - public interface IBlockQuery extends IBlockPosQuery + public static interface IBlockQuery extends IBlockPosQuery { - boolean matches(IBlockState state); + public boolean matches(IBlockState state); } @@ -296,7 +296,7 @@ public class BlockQuery case Crop: return block == Blocks.FARMLAND || block == BOPBlocks.farmland_0 || block == BOPBlocks.farmland_1; case Cave: return block.isSideSolid(state, world, pos, EnumFacing.UP); case Plains: return block == Blocks.GRASS || state == BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.LOAMY) || state == BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.SILTY) || state == BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.SANDY) || state == BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.DAISY) || block == Blocks.DIRT || block == BOPBlocks.dirt || block == Blocks.FARMLAND || block == BOPBlocks.farmland_0 || block == BOPBlocks.farmland_1 || block == Blocks.MYCELIUM; - case Water: return state.getMaterial() == Material.WATER && state.getValue(BlockLiquid.LEVEL) == 0; + case Water: return state.getMaterial() == Material.WATER && ((Integer)state.getValue(BlockLiquid.LEVEL)) == 0; case Beach: boolean isBeach = block == Blocks.GRASS || state == BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.LOAMY) || state == BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.SILTY) || state == BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.SANDY) || state == BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.DAISY) || block == Blocks.DIRT || block == BOPBlocks.dirt || block == BOPBlocks.white_sand || block == Blocks.SAND || block == Blocks.MYCELIUM; boolean hasWater = (world.getBlockState(pos.east()).getMaterial() == Material.WATER || @@ -448,7 +448,7 @@ public class BlockQuery { if (((IProperty)property).getName().equalsIgnoreCase(this.propName)) { - String thisPropValue = properties.get(property).toString(); + String thisPropValue = ((Comparable)properties.get(property)).toString(); for (String value : this.propValues) { if (thisPropValue.equalsIgnoreCase(value)) @@ -501,8 +501,7 @@ public class BlockQuery IBlockQuery bm = new BlockQueryMaterial((Material)mat); return negated ? new BlockQueryNot(bm) : bm; } - } catch (Exception e) { - } + } catch (Exception e) {;} throw new BlockQueryParseException("No block material found called "+materialName); } } diff --git a/src/main/java/biomesoplenty/common/util/block/BlockStateUtils.java b/src/main/java/biomesoplenty/common/util/block/BlockStateUtils.java index ee711c322..7bab3397d 100644 --- a/src/main/java/biomesoplenty/common/util/block/BlockStateUtils.java +++ b/src/main/java/biomesoplenty/common/util/block/BlockStateUtils.java @@ -82,7 +82,7 @@ public class BlockStateUtils // only works on blocks supporting IBOPBlock - returns an empty set for vanilla blocks public static ImmutableSet getBlockPresets(Block block) { - if (!(block instanceof IBOPBlock)) {return ImmutableSet.of();} + if (!(block instanceof IBOPBlock)) {return ImmutableSet.of();} IBlockState defaultState = block.getDefaultState(); if (defaultState == null) {defaultState = block.getBlockState().getBaseState();} return getStatesSet(defaultState, ((IBOPBlock)block).getPresetProperties()); @@ -141,7 +141,7 @@ public class BlockStateUtils public static IProperty getPropertyByName(IBlockState blockState, String propertyName) { - for (IProperty property : blockState.getProperties().keySet()) + for (IProperty property : (ImmutableSet>) blockState.getProperties().keySet()) { if (property.getName().equals(propertyName)) return property; diff --git a/src/main/java/biomesoplenty/common/util/block/VariantPagingHelper.java b/src/main/java/biomesoplenty/common/util/block/VariantPagingHelper.java index 52b0474ca..9aeaffa70 100644 --- a/src/main/java/biomesoplenty/common/util/block/VariantPagingHelper.java +++ b/src/main/java/biomesoplenty/common/util/block/VariantPagingHelper.java @@ -60,7 +60,7 @@ public class VariantPagingHelper & IStringSer public VariantPagingHelper(int variantsPerPage, Class variantsEnumClass) { - this(variantsPerPage, variantsEnumClass, Predicates.alwaysTrue()); + this(variantsPerPage, variantsEnumClass, Predicates.alwaysTrue()); } public VariantPagingHelper(int variantsPerPage, Class variantsEnumClass, Predicate filter) diff --git a/src/main/java/biomesoplenty/common/util/config/BOPConfig.java b/src/main/java/biomesoplenty/common/util/config/BOPConfig.java index 4f979bb91..6ba475834 100644 --- a/src/main/java/biomesoplenty/common/util/config/BOPConfig.java +++ b/src/main/java/biomesoplenty/common/util/config/BOPConfig.java @@ -37,7 +37,7 @@ public class BOPConfig public static Gson serializer = new GsonBuilder().setPrettyPrinting().create(); public static JsonParser parser = new JsonParser(); - private enum Types {BOOLEAN, STRING, INTEGER, FLOAT, BLOCKSTATE, BLOCKPOSQUERY, RESOURCELOCATION} + private static enum Types {BOOLEAN, STRING, INTEGER, FLOAT, BLOCKSTATE, BLOCKPOSQUERY, RESOURCELOCATION} public static boolean writeFile(File outputFile, Object obj) { @@ -232,68 +232,68 @@ public class BOPConfig @Override public Boolean getBool(String name, Boolean defaultVal) {return this.get(name, defaultVal, false, Types.BOOLEAN);} @Override - public String getString(String name, String defaultVal) {return this.get(name, defaultVal, false, Types.STRING);} + public String getString(String name, String defaultVal) {return this.get(name, defaultVal, false, Types.STRING);} @Override public Integer getInt(String name, Integer defaultVal) {return this.get(name, defaultVal, false, Types.INTEGER);} @Override public Float getFloat(String name, Float defaultVal) {return this.get(name, defaultVal, false, Types.FLOAT);} @Override - public IBlockState getBlockState(String name, IBlockState defaultVal) {return this.get(name, defaultVal, false, Types.BLOCKSTATE);} + public IBlockState getBlockState(String name, IBlockState defaultVal) {return this.get(name, defaultVal, false, Types.BLOCKSTATE);} @Override - public IBlockPosQuery getBlockPosQuery(String name, IBlockPosQuery defaultVal) {return this.get(name, defaultVal, false, Types.BLOCKPOSQUERY);} + public IBlockPosQuery getBlockPosQuery(String name, IBlockPosQuery defaultVal) {return this.get(name, defaultVal, false, Types.BLOCKPOSQUERY);} @Override - public ResourceLocation getResourceLocation(String name, ResourceLocation defaultVal) {return this.get(name, defaultVal, false, Types.RESOURCELOCATION);} + public ResourceLocation getResourceLocation(String name, ResourceLocation defaultVal) {return this.get(name, defaultVal, false, Types.RESOURCELOCATION);} @Override public E getEnum(String name, E defaultVal, Class clazz) {return this.getEnum(name, defaultVal, false, clazz);} @Override public Boolean getBool(String name) {return this.get(name, null, true, Types.BOOLEAN);} @Override - public String getString(String name) {return this.get(name, null, true, Types.STRING);} + public String getString(String name) {return this.get(name, null, true, Types.STRING);} @Override public Integer getInt(String name) {return this.get(name, null, true, Types.INTEGER);} @Override public Float getFloat(String name) {return this.get(name, null, true, Types.FLOAT);} @Override - public IBlockState getBlockState(String name) {return this.get(name, null, true, Types.BLOCKSTATE);} + public IBlockState getBlockState(String name) {return this.get(name, null, true, Types.BLOCKSTATE);} @Override - public IBlockPosQuery getBlockPosQuery(String name) {return this.get(name, null, true, Types.BLOCKPOSQUERY);} + public IBlockPosQuery getBlockPosQuery(String name) {return this.get(name, null, true, Types.BLOCKPOSQUERY);} @Override - public ResourceLocation getResourceLocation(String name) {return this.get(name, null, true, Types.RESOURCELOCATION);} + public ResourceLocation getResourceLocation(String name) {return this.get(name, null, true, Types.RESOURCELOCATION);} @Override public E getEnum(String name, Class clazz) {return this.getEnum(name, null, true, clazz);} @Override - public ArrayList getBoolArray(String name, ArrayList defaultVal) {return this.getArray(name, defaultVal, false, Types.BOOLEAN);} + public ArrayList getBoolArray(String name, ArrayList defaultVal) {return this.getArray(name, defaultVal, false, Types.BOOLEAN);} @Override - public ArrayList getStringArray(String name, ArrayList defaultVal) {return this.getArray(name, defaultVal, false, Types.STRING);} + public ArrayList getStringArray(String name, ArrayList defaultVal) {return this.getArray(name, defaultVal, false, Types.STRING);} @Override - public ArrayList getIntArray(String name, ArrayList defaultVal) {return this.getArray(name, defaultVal, false, Types.INTEGER);} + public ArrayList getIntArray(String name, ArrayList defaultVal) {return this.getArray(name, defaultVal, false, Types.INTEGER);} @Override - public ArrayList getFloatArray(String name, ArrayList defaultVal) {return this.getArray(name, defaultVal, false, Types.FLOAT);} + public ArrayList getFloatArray(String name, ArrayList defaultVal) {return this.getArray(name, defaultVal, false, Types.FLOAT);} @Override - public ArrayList getBlockStateArray(String name, ArrayList defaultVal) {return this.getArray(name, defaultVal, false, Types.BLOCKSTATE);} + public ArrayList getBlockStateArray(String name, ArrayList defaultVal) {return this.getArray(name, defaultVal, false, Types.BLOCKSTATE);} @Override - public ArrayList getBlockPosQueryArray(String name, ArrayList defaultVal) {return this.getArray(name, defaultVal, false, Types.BLOCKPOSQUERY);} + public ArrayList getBlockPosQueryArray(String name, ArrayList defaultVal) {return this.getArray(name, defaultVal, false, Types.BLOCKPOSQUERY);} @Override - public ArrayList getResourceLocationArray(String name, ArrayList defaultVal) {return this.getArray(name, defaultVal, false, Types.RESOURCELOCATION);} + public ArrayList getResourceLocationArray(String name, ArrayList defaultVal) {return this.getArray(name, defaultVal, false, Types.RESOURCELOCATION);} @Override public ArrayList getEnumArray(String name, ArrayList defaultVal, Class clazz) {return this.getEnumArray(name, defaultVal, false, clazz);} @Override - public ArrayList getBoolArray(String name) {return this.getArray(name, null, true, Types.BOOLEAN);} + public ArrayList getBoolArray(String name) {return this.getArray(name, null, true, Types.BOOLEAN);} @Override - public ArrayList getStringArray(String name) {return this.getArray(name, null, true, Types.STRING);} + public ArrayList getStringArray(String name) {return this.getArray(name, null, true, Types.STRING);} @Override - public ArrayList getIntArray(String name) {return this.getArray(name, null, true, Types.INTEGER);} + public ArrayList getIntArray(String name) {return this.getArray(name, null, true, Types.INTEGER);} @Override - public ArrayList getFloatArray(String name) {return this.getArray(name, null, true, Types.FLOAT);} + public ArrayList getFloatArray(String name) {return this.getArray(name, null, true, Types.FLOAT);} @Override - public ArrayList getBlockStateArray(String name) {return this.getArray(name, null, true, Types.BLOCKSTATE);} + public ArrayList getBlockStateArray(String name) {return this.getArray(name, null, true, Types.BLOCKSTATE);} @Override - public ArrayList getBlockPosQueryArray(String name) {return this.getArray(name, null, true, Types.BLOCKPOSQUERY);} + public ArrayList getBlockPosQueryArray(String name) {return this.getArray(name, null, true, Types.BLOCKPOSQUERY);} @Override - public ArrayList getResourceLocationArray(String name) {return this.getArray(name, null, true, Types.RESOURCELOCATION);} + public ArrayList getResourceLocationArray(String name) {return this.getArray(name, null, true, Types.RESOURCELOCATION);} @Override public ArrayList getEnumArray(String name, Class clazz) {return this.getEnumArray(name, null, true, clazz);} @@ -316,7 +316,7 @@ public class BOPConfig JsonArray arr = this.members.get(name).getAsJsonArray(); for (int i = 0; i < arr.size(); i++) { - E ele = this.asEnum(arr.get(i), clazz, name + "." + i); + E ele = this.asEnum(arr.get(i), clazz, name + "." + i); if (ele != null) {list.add(ele);} } } catch (Exception e) { @@ -335,7 +335,7 @@ public class BOPConfig } return defaultVal; } - E out = this.asEnum(this.members.get(name), clazz, name); + E out = this.asEnum(this.members.get(name), clazz, name); return out == null ? defaultVal : out; } @@ -357,7 +357,7 @@ public class BOPConfig } return defaultVal; } - T out = this.as(this.members.get(name), type, name); + T out = this.as(this.members.get(name), type, name); // warn people who try to copy-paste default configs if (this.warnIfDefault && out != null && out.equals(defaultVal)) { @@ -382,7 +382,7 @@ public class BOPConfig JsonArray arr = this.members.get(name).getAsJsonArray(); for (int i = 0; i < arr.size(); i++) { - T ele = this.as(arr.get(i), type, name + "." + i); + T ele = this.as(arr.get(i), type, name + "." + i); if (ele != null) {list.add(ele);} } } catch (Exception e) { diff --git a/src/main/java/biomesoplenty/common/util/inventory/CraftingUtil.java b/src/main/java/biomesoplenty/common/util/inventory/CraftingUtil.java index 7887d7ad7..aa72628f7 100644 --- a/src/main/java/biomesoplenty/common/util/inventory/CraftingUtil.java +++ b/src/main/java/biomesoplenty/common/util/inventory/CraftingUtil.java @@ -29,7 +29,7 @@ import java.util.*; public class CraftingUtil { private static final Gson SERIALIZER = new GsonBuilder().setPrettyPrinting().create(); - public static final File RECIPES_DIR = new File(BiomesOPlenty.configDirectory, "recipes"); + public static final File RECIPES_DIR = new File(BiomesOPlenty.configDirectory, "recipes");; // We should no longer need this now we've switched over to JSON, however // it might be handy to keep around for future reference diff --git a/src/main/java/biomesoplenty/common/world/BOPMapGenScatteredFeature.java b/src/main/java/biomesoplenty/common/world/BOPMapGenScatteredFeature.java index c30aea8df..ef35f16aa 100644 --- a/src/main/java/biomesoplenty/common/world/BOPMapGenScatteredFeature.java +++ b/src/main/java/biomesoplenty/common/world/BOPMapGenScatteredFeature.java @@ -44,7 +44,7 @@ public class BOPMapGenScatteredFeature extends MapGenScatteredFeature public BOPMapGenScatteredFeature() { - this.scatteredFeatureSpawnList = Lists.newArrayList(); + this.scatteredFeatureSpawnList = Lists.newArrayList(); this.maxDistanceBetweenScatteredFeatures = 32; this.minDistanceBetweenScatteredFeatures = 8; this.scatteredFeatureSpawnList.add(new Biome.SpawnListEntry(EntityWitch.class, 1, 1, 1)); @@ -58,7 +58,7 @@ public class BOPMapGenScatteredFeature extends MapGenScatteredFeature { if (entry.getKey().equals("distance")) { - this.maxDistanceBetweenScatteredFeatures = MathHelper.getInt(entry.getValue(), this.maxDistanceBetweenScatteredFeatures, 9); + this.maxDistanceBetweenScatteredFeatures = MathHelper.getInt((String)entry.getValue(), this.maxDistanceBetweenScatteredFeatures, 9); } } } @@ -97,7 +97,10 @@ public class BOPMapGenScatteredFeature extends MapGenScatteredFeature { Biome biome = this.world.getBiomeProvider().getBiome(new BlockPos(i * 16 + 8, 0, j * 16 + 8)); - return biome != null && (JUNGLE_BIOMES.contains(biome) || SWAMP_BIOMES.contains(biome) || DESERT_BIOMES.contains(biome) || ICE_BIOMES.contains(biome)); + if (biome != null && (JUNGLE_BIOMES.contains(biome) || SWAMP_BIOMES.contains(biome) || DESERT_BIOMES.contains(biome) || ICE_BIOMES.contains(biome))) + { + return true; + } } return false; diff --git a/src/main/java/biomesoplenty/common/world/BOPWorldSettings.java b/src/main/java/biomesoplenty/common/world/BOPWorldSettings.java index 0372d3a32..fd9e9f432 100644 --- a/src/main/java/biomesoplenty/common/world/BOPWorldSettings.java +++ b/src/main/java/biomesoplenty/common/world/BOPWorldSettings.java @@ -24,31 +24,31 @@ public class BOPWorldSettings implements IBOPWorldSettings public static Gson serializer = new GsonBuilder().create(); - public enum LandMassScheme + public static enum LandMassScheme { VANILLA, CONTINENTS, - ARCHIPELAGO + ARCHIPELAGO; } - public enum TemperatureVariationScheme + public static enum TemperatureVariationScheme { LATITUDE, SMALL_ZONES, MEDIUM_ZONES, LARGE_ZONES, - RANDOM + RANDOM; } - public enum RainfallVariationScheme + public static enum RainfallVariationScheme { SMALL_ZONES, MEDIUM_ZONES, LARGE_ZONES, - RANDOM + RANDOM; } - public enum BiomeSize + public static enum BiomeSize { TINY (2), SMALL (3), diff --git a/src/main/java/biomesoplenty/common/world/ChunkGeneratorHellBOP.java b/src/main/java/biomesoplenty/common/world/ChunkGeneratorHellBOP.java index b0cf6bda6..606c67b3b 100644 --- a/src/main/java/biomesoplenty/common/world/ChunkGeneratorHellBOP.java +++ b/src/main/java/biomesoplenty/common/world/ChunkGeneratorHellBOP.java @@ -337,7 +337,7 @@ public class ChunkGeneratorHellBOP implements IChunkGenerator this.genNetherBridge.generate(this.world, chunkX, chunkZ, chunkprimer); } - Biome[] biomes = this.world.getBiomeProvider().getBiomes(null, chunkX * 16, chunkZ * 16, 16, 16); + Biome[] biomes = this.world.getBiomeProvider().getBiomes((Biome[])null, chunkX * 16, chunkZ * 16, 16, 16); this.replaceBlocksForBiome(chunkX, chunkZ, chunkprimer, biomes); Chunk chunk = new Chunk(this.world, chunkprimer, chunkX, chunkZ); @@ -578,12 +578,12 @@ public class ChunkGeneratorHellBOP implements IChunkGenerator @Override public boolean isInsideStructure(World world, String structureName, BlockPos pos) { - return ("Fortress".equals(structureName) && this.genNetherBridge != null) && this.genNetherBridge.isInsideStructure(pos); + return "Fortress".equals(structureName) && this.genNetherBridge != null ? this.genNetherBridge.isInsideStructure(pos) : false; } @Override public void recreateStructures(Chunk chunkIn, int x, int z) { - this.genNetherBridge.generate(this.world, x, z, null); + this.genNetherBridge.generate(this.world, x, z, (ChunkPrimer)null); } } diff --git a/src/main/java/biomesoplenty/common/world/ChunkGeneratorOverworldBOP.java b/src/main/java/biomesoplenty/common/world/ChunkGeneratorOverworldBOP.java index e1b9c3acb..2a09aa5f9 100644 --- a/src/main/java/biomesoplenty/common/world/ChunkGeneratorOverworldBOP.java +++ b/src/main/java/biomesoplenty/common/world/ChunkGeneratorOverworldBOP.java @@ -645,32 +645,32 @@ public class ChunkGeneratorOverworldBOP implements IChunkGenerator { if (this.settings.useMineShafts) { - this.mineshaftGenerator.generate(this.world, chunkX, chunkZ, null); + this.mineshaftGenerator.generate(this.world, chunkX, chunkZ, (ChunkPrimer)null); } if (this.settings.useVillages) { - this.villageGenerator.generate(this.world, chunkX, chunkZ, null); + this.villageGenerator.generate(this.world, chunkX, chunkZ, (ChunkPrimer)null); } if (this.settings.useStrongholds) { - this.strongholdGenerator.generate(this.world, chunkX, chunkZ, null); + this.strongholdGenerator.generate(this.world, chunkX, chunkZ, (ChunkPrimer)null); } if (this.settings.useTemples) { - this.scatteredFeatureGenerator.generate(this.world, chunkX, chunkZ, null); + this.scatteredFeatureGenerator.generate(this.world, chunkX, chunkZ, (ChunkPrimer)null); } if (this.settings.useMonuments) { - this.oceanMonumentGenerator.generate(this.world, chunkX, chunkZ, null); + this.oceanMonumentGenerator.generate(this.world, chunkX, chunkZ, (ChunkPrimer)null); } if (this.settings.useMansions) { - this.woodlandMansionGenerator.generate(this.world, chunkX, chunkZ, null); + this.woodlandMansionGenerator.generate(this.world, chunkX, chunkZ, (ChunkPrimer)null); } } } @@ -704,7 +704,7 @@ public class ChunkGeneratorOverworldBOP implements IChunkGenerator } else { - return ("Temple".equals(structureName) && this.scatteredFeatureGenerator != null) && this.scatteredFeatureGenerator.isInsideStructure(pos); + return "Temple".equals(structureName) && this.scatteredFeatureGenerator != null ? this.scatteredFeatureGenerator.isInsideStructure(pos) : false; } } diff --git a/src/main/java/biomesoplenty/common/world/GenerationManager.java b/src/main/java/biomesoplenty/common/world/GenerationManager.java index 383acbed7..fa36a48c1 100644 --- a/src/main/java/biomesoplenty/common/world/GenerationManager.java +++ b/src/main/java/biomesoplenty/common/world/GenerationManager.java @@ -46,7 +46,7 @@ public class GenerationManager implements IGenerationManager out.add(generator); } } - return ImmutableList.copyOf(out); + return ImmutableList.copyOf(out); } public void removeGenerator(String name) diff --git a/src/main/java/biomesoplenty/common/world/NoiseGeneratorBOPByte.java b/src/main/java/biomesoplenty/common/world/NoiseGeneratorBOPByte.java index fd54801f4..29b6afc17 100644 --- a/src/main/java/biomesoplenty/common/world/NoiseGeneratorBOPByte.java +++ b/src/main/java/biomesoplenty/common/world/NoiseGeneratorBOPByte.java @@ -16,10 +16,10 @@ public class NoiseGeneratorBOPByte // TODO: get rid of the interpolater classes - there's only one sensible interpolater /*** Interpolation ***/ - public interface IIntInterpolater + public static interface IIntInterpolater { // interpolation between a and b, where t is the fraction (between 0 and 255) - int interpolate(int t, int a, int b); + public int interpolate(int t, int a, int b); } public static class IntInterpolateLinear implements IIntInterpolater diff --git a/src/main/java/biomesoplenty/common/world/TerrainSettings.java b/src/main/java/biomesoplenty/common/world/TerrainSettings.java index 2ec502f27..4491c809d 100644 --- a/src/main/java/biomesoplenty/common/world/TerrainSettings.java +++ b/src/main/java/biomesoplenty/common/world/TerrainSettings.java @@ -13,12 +13,12 @@ import net.minecraft.world.biome.Biome; public class TerrainSettings { - public enum PresetOctaveWeights + public static enum PresetOctaveWeights { DEFAULT (new double[] {1 / 24.0D, 2 / 24.0D, 4 / 24.0D, 8 / 24.0D, 6 / 24.0D, 3 / 24.0D}); private final double[] weights; - PresetOctaveWeights(double[] weights) + private PresetOctaveWeights(double[] weights) { this.weights = weights; } diff --git a/src/main/java/biomesoplenty/common/world/generator/GeneratorBigFlower.java b/src/main/java/biomesoplenty/common/world/generator/GeneratorBigFlower.java index 4c2bc03c4..97cdc3f66 100644 --- a/src/main/java/biomesoplenty/common/world/generator/GeneratorBigFlower.java +++ b/src/main/java/biomesoplenty/common/world/generator/GeneratorBigFlower.java @@ -34,9 +34,9 @@ import net.minecraft.world.World; public class GeneratorBigFlower extends BOPGeneratorBase { - public enum BigFlowerType + public static enum BigFlowerType { - RED, YELLOW + RED, YELLOW; } protected static IBlockState stem = BlockBOPLog.paging.getVariantState(BOPWoods.GIANT_FLOWER); diff --git a/src/main/java/biomesoplenty/common/world/generator/GeneratorBigMushroom.java b/src/main/java/biomesoplenty/common/world/generator/GeneratorBigMushroom.java index 9041a46c1..c502ad71c 100644 --- a/src/main/java/biomesoplenty/common/world/generator/GeneratorBigMushroom.java +++ b/src/main/java/biomesoplenty/common/world/generator/GeneratorBigMushroom.java @@ -31,7 +31,7 @@ import net.minecraft.world.World; public class GeneratorBigMushroom extends BOPGeneratorBase { - public enum BigMushroomType + public static enum BigMushroomType { BROWN, RED; public IBlockState getDefaultState() diff --git a/src/main/java/biomesoplenty/common/world/generator/GeneratorDoubleFlora.java b/src/main/java/biomesoplenty/common/world/generator/GeneratorDoubleFlora.java index e74c92c23..162b79029 100644 --- a/src/main/java/biomesoplenty/common/world/generator/GeneratorDoubleFlora.java +++ b/src/main/java/biomesoplenty/common/world/generator/GeneratorDoubleFlora.java @@ -100,7 +100,7 @@ public class GeneratorDoubleFlora extends GeneratorReplacing { canStay = ((BlockBOPDecoration)bottomBlock).canBlockStay(world, genPos, this.with); } else if (bottomBlock instanceof BlockBush) { - canStay = bottomBlock.canPlaceBlockAt(world, genPos); + canStay = ((BlockBush)bottomBlock).canPlaceBlockAt(world, genPos); } else { canStay = bottomBlock.canPlaceBlockAt(world, genPos); } diff --git a/src/main/java/biomesoplenty/common/world/generator/GeneratorFlora.java b/src/main/java/biomesoplenty/common/world/generator/GeneratorFlora.java index 2212ab224..1d4dd6699 100644 --- a/src/main/java/biomesoplenty/common/world/generator/GeneratorFlora.java +++ b/src/main/java/biomesoplenty/common/world/generator/GeneratorFlora.java @@ -124,7 +124,7 @@ public class GeneratorFlora extends GeneratorReplacing { canStay = ((BlockBOPDecoration)block).canBlockStay(world, genPos, this.with); } else if (block instanceof BlockBush) { - canStay = block.canPlaceBlockAt(world, genPos); + canStay = ((BlockBush)block).canPlaceBlockAt(world, genPos); } else { canStay = block.canPlaceBlockAt(world, genPos); } diff --git a/src/main/java/biomesoplenty/common/world/generator/GeneratorHive.java b/src/main/java/biomesoplenty/common/world/generator/GeneratorHive.java index 8cc250a82..443f49923 100644 --- a/src/main/java/biomesoplenty/common/world/generator/GeneratorHive.java +++ b/src/main/java/biomesoplenty/common/world/generator/GeneratorHive.java @@ -50,7 +50,7 @@ public class GeneratorHive extends GeneratorReplacing { // defaults this.amountPerChunk = 1.0F; - this.placeOn = BlockQuery.buildAnd().states(Blocks.NETHERRACK.getDefaultState()).withAirBelow().create(); + this.placeOn = BlockQuery.buildAnd().states(Blocks.NETHERRACK.getDefaultState()).withAirBelow().create();; this.replace = new BlockQuery.BlockQueryMaterial(Material.AIR); this.with = null; this.scatterYMethod = GeneratorUtils.ScatterYMethod.NETHER_ROOF; diff --git a/src/main/java/biomesoplenty/common/world/generator/tree/GeneratorBigTree.java b/src/main/java/biomesoplenty/common/world/generator/tree/GeneratorBigTree.java index 6b8151fd7..e9efab9ef 100644 --- a/src/main/java/biomesoplenty/common/world/generator/tree/GeneratorBigTree.java +++ b/src/main/java/biomesoplenty/common/world/generator/tree/GeneratorBigTree.java @@ -491,6 +491,7 @@ public class GeneratorBigTree extends GeneratorTreeBase makeBranches(); } catch (RuntimeException e) { // TODO: deal with this. + ; } this.world = null; //Fix vanilla Mem leak, holds latest world diff --git a/src/main/java/biomesoplenty/common/world/generator/tree/GeneratorProfileTree.java b/src/main/java/biomesoplenty/common/world/generator/tree/GeneratorProfileTree.java index bfd9b407a..8ddd9a85b 100644 --- a/src/main/java/biomesoplenty/common/world/generator/tree/GeneratorProfileTree.java +++ b/src/main/java/biomesoplenty/common/world/generator/tree/GeneratorProfileTree.java @@ -61,7 +61,7 @@ public class GeneratorProfileTree extends GeneratorTreeBase this.profile = profile; } - public enum TreeProfile + public static enum TreeProfile { POPLAR; diff --git a/src/main/java/biomesoplenty/common/world/layer/GenLayerShoreBOP.java b/src/main/java/biomesoplenty/common/world/layer/GenLayerShoreBOP.java index 1da8d2223..476fcbc67 100644 --- a/src/main/java/biomesoplenty/common/world/layer/GenLayerShoreBOP.java +++ b/src/main/java/biomesoplenty/common/world/layer/GenLayerShoreBOP.java @@ -174,7 +174,7 @@ public class GenLayerShoreBOP extends BOPGenLayer @Override public boolean apply(Integer input) { - return Biome.getBiome(input) != null && Biome.getBiome(input).getBiomeClass() == BiomeJungle.class || (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)); + 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); } }; diff --git a/src/main/java/biomesoplenty/core/ClientProxy.java b/src/main/java/biomesoplenty/core/ClientProxy.java index 061f36ae9..bd86578cd 100644 --- a/src/main/java/biomesoplenty/core/ClientProxy.java +++ b/src/main/java/biomesoplenty/core/ClientProxy.java @@ -172,7 +172,7 @@ public class ClientProxy extends CommonProxy //Register colour handlers if (item instanceof IColoredItem && ((IColoredItem)item).getItemColor() != null) { - itemsToColor.add(item); + this.itemsToColor.add(item); } } @@ -204,7 +204,7 @@ public class ClientProxy extends CommonProxy break; case MUD: int itemId = Item.getIdFromItem(BOPItems.mudball); - minecraft.world.spawnParticle(EnumParticleTypes.ITEM_CRACK, x, y, z, MathHelper.nextDouble(minecraft.world.rand, -0.08D, 0.08D), MathHelper.nextDouble(minecraft.world.rand, -0.08D, 0.08D), MathHelper.nextDouble(minecraft.world.rand, -0.08D, 0.08D), itemId); + minecraft.world.spawnParticle(EnumParticleTypes.ITEM_CRACK, x, y, z, MathHelper.nextDouble(minecraft.world.rand, -0.08D, 0.08D), MathHelper.nextDouble(minecraft.world.rand, -0.08D, 0.08D), MathHelper.nextDouble(minecraft.world.rand, -0.08D, 0.08D), new int[] {itemId}); return; case PLAYER_TRAIL: if (info.length < 1)