Cleaned up the code formatting

This commit is contained in:
Adubbz 2015-01-21 17:09:12 +11:00
parent 19180562fc
commit 8a5ef81dcd
54 changed files with 1809 additions and 1861 deletions

View file

@ -10,6 +10,5 @@ package biomesoplenty.api.biome;
public enum BiomeOwner
{
BIOMESOPLENTY,
OTHER;
BIOMESOPLENTY, OTHER;
}

View file

@ -13,6 +13,8 @@ import java.util.Map;
public interface IExtendedDecorator
{
public void addGenerator(String key, IGenerator<?> generator);
public void configureGenerators(Map<String, IGenerator<?>> generatorMap);
public Map<String, IGenerator<?>> getGeneratorMap();
}

View file

@ -13,5 +13,6 @@ import com.google.gson.JsonElement;
public interface IGenerator<T>
{
public JsonElement serialize(IGenerator<T> src);
public IGenerator<T> deserialize(JsonElement json);
}

View file

@ -25,6 +25,7 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public abstract class BOPBlock extends Block
{
public ImmutableSet<IBlockState> presetStates;
@ -53,7 +54,6 @@ public abstract class BOPBlock extends Block
}
}
@Override
public int damageDropped(IBlockState state)
{

View file

@ -46,7 +46,9 @@ public class BOPLoadingPlugin implements IFMLLoadingPlugin
}
@Override
public void injectData(Map<String, Object> data) {}
public void injectData(Map<String, Object> data)
{
}
@Override
public String getAccessTransformerClass()

View file

@ -32,7 +32,7 @@ public class BlockAsh extends BOPBlock
super(Material.sand);
this.setHardness(0.4F);
//this.setHarvestLevel("shovel", 0);
// this.setHarvestLevel("shovel", 0);
this.setStepSound(Block.soundTypeSand);
}
@ -40,21 +40,20 @@ public class BlockAsh extends BOPBlock
public AxisAlignedBB getCollisionBoundingBox(World world, BlockPos pos, IBlockState state)
{
float heightOffset = 0.125F;
return new AxisAlignedBB((double)pos.getX(), (double)pos.getY(), (double)pos.getZ(), (double)(pos.getX() + 1), (double)((float)(pos.getY() + 1) - heightOffset), (double)(pos.getZ() + 1));
return new AxisAlignedBB((double) pos.getX(), (double) pos.getY(), (double) pos.getZ(), (double) (pos.getX() + 1), (double) ((float) (pos.getY() + 1) - heightOffset), (double) (pos.getZ() + 1));
}
@Override
public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity entity)
{
/*if (entity instanceof EntityPlayer)
{
InventoryPlayer inventory = ((EntityPlayer)entity).inventory;
if (inventory.armorInventory[0] != null && inventory.armorInventory[0].getItem() == BOPCItems.wadingBoots)
{
return;
}
}*/
/*
* if (entity instanceof EntityPlayer) { InventoryPlayer inventory =
* ((EntityPlayer)entity).inventory;
*
* if (inventory.armorInventory[0] != null &&
* inventory.armorInventory[0].getItem() == BOPCItems.wadingBoots) {
* return; } }
*/
entity.motionX *= 0.4D;
entity.motionZ *= 0.4D;
@ -70,17 +69,12 @@ public class BlockAsh extends BOPBlock
return false;
}
/*@Override
public Item getItemDropped(int metadata, Random random, int fortune)
{
return BOPCItems.misc;
}
@Override
public int damageDropped(int meta)
{
return 1;
}*/
/*
* @Override public Item getItemDropped(int metadata, Random random, int
* fortune) { return BOPCItems.misc; }
*
* @Override public int damageDropped(int meta) { return 1; }
*/
@Override
public int quantityDropped(Random random)

View file

@ -45,7 +45,7 @@ public class BlockBOPFlower extends BOPPlant
public int getLightValue(IBlockAccess world, BlockPos pos)
{
IBlockState state = world.getBlockState(pos);
FlowerType type = (FlowerType)state.getValue(VARIANT_PROP);
FlowerType type = (FlowerType) state.getValue(VARIANT_PROP);
switch (type)
{
@ -63,16 +63,16 @@ public class BlockBOPFlower extends BOPPlant
}
}
//TODO: Make enderlotus require spectral moss
//TODO: Make bromeliads require hard dirt, hardened clay or sand
//TODO: Make the burning blossom require netherrack or overgrown netherrack
// TODO: Make enderlotus require spectral moss
// TODO: Make bromeliads require hard dirt, hardened clay or sand
// TODO: Make the burning blossom require netherrack or overgrown netherrack
@Override
public void harvestBlock(World world, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity tileentity)
{
super.harvestBlock(world, player, pos, state, tileentity);
FlowerType type = (FlowerType)state.getValue(VARIANT_PROP);
FlowerType type = (FlowerType) state.getValue(VARIANT_PROP);
if (player.getCurrentEquippedItem() == null || !(player.getCurrentEquippedItem().getItem() instanceof ItemShears))
{
@ -92,15 +92,16 @@ public class BlockBOPFlower extends BOPPlant
@Override
public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity entity)
{
FlowerType type = (FlowerType)state.getValue(VARIANT_PROP);
FlowerType type = (FlowerType) state.getValue(VARIANT_PROP);
if (type == FlowerType.BURNING_BLOSSOM)
{
entity.setFire(1);
}
else if (entity instanceof EntityLivingBase && type == FlowerType.DEATHBLOOM)
else
if (entity instanceof EntityLivingBase && type == FlowerType.DEATHBLOOM)
{
((EntityLivingBase)entity).addPotionEffect(new PotionEffect(Potion.wither.id, 200));
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.wither.id, 200));
}
}
@ -113,7 +114,7 @@ public class BlockBOPFlower extends BOPPlant
@Override
public int getMetaFromState(IBlockState state)
{
int meta = ((FlowerType)state.getValue(VARIANT_PROP)).ordinal();
int meta = ((FlowerType) state.getValue(VARIANT_PROP)).ordinal();
return meta;
}
@ -133,7 +134,7 @@ public class BlockBOPFlower extends BOPPlant
@Override
public String getStateName(IBlockState state, boolean fullName)
{
return ((FlowerType)state.getValue(VARIANT_PROP)).getName();
return ((FlowerType) state.getValue(VARIANT_PROP)).getName();
}
@Override
@ -141,7 +142,7 @@ public class BlockBOPFlower extends BOPPlant
{
IBlockState state = world.getBlockState(pos);
switch ((FlowerType)state.getValue(VARIANT_PROP))
switch ((FlowerType) state.getValue(VARIANT_PROP))
{
case CLOVER:
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.015625F, 1.0F);
@ -173,40 +174,30 @@ public class BlockBOPFlower extends BOPPlant
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World world, BlockPos pos, IBlockState state, Random rand)
{
FlowerType type = (FlowerType)state.getValue(VARIANT_PROP);
FlowerType type = (FlowerType) state.getValue(VARIANT_PROP);
if (type == FlowerType.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]);
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]);
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]);
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]);
}
else if (type == FlowerType.BURNING_BLOSSOM)
else
if (type == FlowerType.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]);
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]);
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]);
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]);
}
}
//TODO: Readd eyebulb in as a seperate block
//TODO: Readd dandelion blowing
// TODO: Readd eyebulb in as a seperate block
// TODO: Readd dandelion blowing
public static enum FlowerType implements IStringSerializable
{
CLOVER,
SWAMPFLOWER,
DEATHBLOOM,
GLOWFLOWER,
BLUE_HYDRANGEA,
ORANGE_COSMOS,
PINK_DAFFODIL,
WILDFLOWER,
VIOLET,
WHITE_ANEMONE,
ENDERLOTUS,
BROMELIAD,
DANDELION,
PINK_HIBISCUS,
LILY_OF_THE_VALLEY,
BURNING_BLOSSOM;
CLOVER, SWAMPFLOWER, DEATHBLOOM, GLOWFLOWER, BLUE_HYDRANGEA, ORANGE_COSMOS, PINK_DAFFODIL, WILDFLOWER, VIOLET, WHITE_ANEMONE, ENDERLOTUS, BROMELIAD, DANDELION, PINK_HIBISCUS, LILY_OF_THE_VALLEY, BURNING_BLOSSOM;
@Override
public String getName()

View file

@ -33,7 +33,7 @@ public class BlockBOPFlower2 extends BOPPlant
public boolean canBlockStay(World world, BlockPos pos, IBlockState state)
{
Block ground = world.getBlockState(pos.offsetDown()).getBlock();
FlowerType type = (FlowerType)state.getValue(VARIANT_PROP);
FlowerType type = (FlowerType) state.getValue(VARIANT_PROP);
switch (type)
{
@ -54,7 +54,7 @@ public class BlockBOPFlower2 extends BOPPlant
@Override
public int getMetaFromState(IBlockState state)
{
int meta = ((FlowerType)state.getValue(VARIANT_PROP)).ordinal();
int meta = ((FlowerType) state.getValue(VARIANT_PROP)).ordinal();
return meta;
}
@ -74,7 +74,7 @@ public class BlockBOPFlower2 extends BOPPlant
@Override
public String getStateName(IBlockState state, boolean fullName)
{
return ((FlowerType)state.getValue(VARIANT_PROP)).getName();
return ((FlowerType) state.getValue(VARIANT_PROP)).getName();
}
@Override
@ -85,12 +85,7 @@ public class BlockBOPFlower2 extends BOPPlant
public static enum FlowerType implements IStringSerializable
{
LAVENDER,
GOLDENROD,
BLUEBELLS,
MINERS_DELIGHT,
ICY_IRIS,
ROSE;
LAVENDER, GOLDENROD, BLUEBELLS, MINERS_DELIGHT, ICY_IRIS, ROSE;
public String getName()
{

View file

@ -42,9 +42,9 @@ public class BlockBOPLog extends BlockBOPLogBase
@Override
public int getMetaFromState(IBlockState state)
{
int baseMeta = ((LogType)state.getValue(VARIANT_PROP)).ordinal();
int baseMeta = ((LogType) state.getValue(VARIANT_PROP)).ordinal();
return baseMeta * 3 + ((EnumFacing.Axis)state.getValue(AXIS_PROP)).ordinal();
return baseMeta * 3 + ((EnumFacing.Axis) state.getValue(AXIS_PROP)).ordinal();
}
@Override
@ -62,16 +62,12 @@ public class BlockBOPLog extends BlockBOPLogBase
@Override
public String getStateName(IBlockState state, boolean fullName)
{
return ((LogType)state.getValue(VARIANT_PROP)).getName() + (fullName ? "_log" : "");
return ((LogType) state.getValue(VARIANT_PROP)).getName() + (fullName ? "_log" : "");
}
public static enum LogType implements IStringSerializable
{
SACRED_OAK,
CHERRY,
DARK,
FIR,
ETHEREAL;
SACRED_OAK, CHERRY, DARK, FIR, ETHEREAL;
@Override
public String getName()

View file

@ -42,9 +42,9 @@ public class BlockBOPLog2 extends BlockBOPLogBase
@Override
public int getMetaFromState(IBlockState state)
{
int baseMeta = ((LogType)state.getValue(VARIANT_PROP)).ordinal();
int baseMeta = ((LogType) state.getValue(VARIANT_PROP)).ordinal();
return baseMeta * 3 + ((EnumFacing.Axis)state.getValue(AXIS_PROP)).ordinal();
return baseMeta * 3 + ((EnumFacing.Axis) state.getValue(AXIS_PROP)).ordinal();
}
@Override
@ -62,16 +62,12 @@ public class BlockBOPLog2 extends BlockBOPLogBase
@Override
public String getStateName(IBlockState state, boolean fullName)
{
return ((LogType)state.getValue(VARIANT_PROP)).getName() + (fullName ? "_log" : "");
return ((LogType) state.getValue(VARIANT_PROP)).getName() + (fullName ? "_log" : "");
}
public static enum LogType implements IStringSerializable
{
MAGIC,
MANGROVE,
PALM,
REDWOOD,
WILLOW;
MAGIC, MANGROVE, PALM, REDWOOD, WILLOW;
@Override
public String getName()

View file

@ -42,9 +42,9 @@ public class BlockBOPLog3 extends BlockBOPLogBase
@Override
public int getMetaFromState(IBlockState state)
{
int baseMeta = ((LogType)state.getValue(VARIANT_PROP)).ordinal();
int baseMeta = ((LogType) state.getValue(VARIANT_PROP)).ordinal();
return baseMeta * 3 + ((EnumFacing.Axis)state.getValue(AXIS_PROP)).ordinal();
return baseMeta * 3 + ((EnumFacing.Axis) state.getValue(AXIS_PROP)).ordinal();
}
@Override
@ -62,18 +62,14 @@ public class BlockBOPLog3 extends BlockBOPLogBase
@Override
public String getStateName(IBlockState state, boolean fullName)
{
LogType type = (LogType)state.getValue(VARIANT_PROP);
LogType type = (LogType) state.getValue(VARIANT_PROP);
return type.getName() + (fullName && type != LogType.GIANT_FLOWER_STEM ? "_log" : "");
}
public static enum LogType implements IStringSerializable
{
DEAD,
GIANT_FLOWER_STEM,
PINE,
HELL_BARK,
JACARANDA;
DEAD, GIANT_FLOWER_STEM, PINE, HELL_BARK, JACARANDA;
@Override
public String getName()

View file

@ -43,9 +43,9 @@ public class BlockBOPLog4 extends BlockBOPLogBase
@Override
public int getMetaFromState(IBlockState state)
{
int baseMeta = ((LogType)state.getValue(VARIANT_PROP)).ordinal();
int baseMeta = ((LogType) state.getValue(VARIANT_PROP)).ordinal();
return baseMeta * 3 + ((EnumFacing.Axis)state.getValue(AXIS_PROP)).ordinal();
return baseMeta * 3 + ((EnumFacing.Axis) state.getValue(AXIS_PROP)).ordinal();
}
@Override
@ -63,7 +63,7 @@ public class BlockBOPLog4 extends BlockBOPLogBase
@Override
public String getStateName(IBlockState state, boolean fullName)
{
return ((LogType)state.getValue(VARIANT_PROP)).getName() + (fullName ? "_log" : "");
return ((LogType) state.getValue(VARIANT_PROP)).getName() + (fullName ? "_log" : "");
}
public static enum LogType implements IStringSerializable

View file

@ -34,7 +34,7 @@ public class BlockBOPMushroom extends BOPPlant
{
IBlockState blockState = world.getBlockState(pos);
if ((MushroomType)blockState.getValue(VARIANT_PROP) == MushroomType.GLOWSHROOM)
if ((MushroomType) blockState.getValue(VARIANT_PROP) == MushroomType.GLOWSHROOM)
{
return 6;
}
@ -46,12 +46,13 @@ public class BlockBOPMushroom extends BOPPlant
public boolean canBlockStay(World world, BlockPos pos, IBlockState state)
{
Block ground = world.getBlockState(pos.offsetDown()).getBlock();
MushroomType type = (MushroomType)state.getValue(VARIANT_PROP);
MushroomType type = (MushroomType) state.getValue(VARIANT_PROP);
switch (type)
{
//TODO: Make the toadstool, glowshroom, flat mushroom require overgrown netherrack
//TODO: Make flat mushroom, shadow shroom require bopgrass
// TODO: Make the toadstool, glowshroom, flat mushroom require overgrown
// netherrack
// TODO: Make flat mushroom, shadow shroom require bopgrass
case TOADSTOOL:
return ground == Blocks.grass || ground == Blocks.dirt || ground == Blocks.mycelium || ground == Blocks.grass;
@ -78,7 +79,7 @@ public class BlockBOPMushroom extends BOPPlant
@Override
public int getMetaFromState(IBlockState state)
{
int meta = ((MushroomType)state.getValue(VARIANT_PROP)).ordinal();
int meta = ((MushroomType) state.getValue(VARIANT_PROP)).ordinal();
return meta;
}
@ -98,7 +99,7 @@ public class BlockBOPMushroom extends BOPPlant
@Override
public String getStateName(IBlockState state, boolean fullName)
{
return ((MushroomType)state.getValue(VARIANT_PROP)).getName();
return ((MushroomType) state.getValue(VARIANT_PROP)).getName();
}
@Override
@ -109,12 +110,7 @@ public class BlockBOPMushroom extends BOPPlant
public static enum MushroomType implements IStringSerializable
{
TOADSTOOL,
PORTOBELLO,
BLUE_MILK_CAP,
GLOWSHROOM,
FLAT_MUSHROOM,
SHADOW_SHROOM;
TOADSTOOL, PORTOBELLO, BLUE_MILK_CAP, GLOWSHROOM, FLAT_MUSHROOM, SHADOW_SHROOM;
@Override
public String getName()

View file

@ -42,7 +42,7 @@ public class BlockBOPPlanks extends BOPBlock
@Override
public int getMetaFromState(IBlockState state)
{
int meta = ((PlankType)state.getValue(VARIANT_PROP)).ordinal();
int meta = ((PlankType) state.getValue(VARIANT_PROP)).ordinal();
return meta;
}
@ -62,28 +62,14 @@ public class BlockBOPPlanks extends BOPBlock
@Override
public String getStateName(IBlockState state, boolean fullName)
{
PlankType type = (PlankType)state.getValue(VARIANT_PROP);
PlankType type = (PlankType) state.getValue(VARIANT_PROP);
return type.getName() + (fullName && type != PlankType.BAMBOO_THATCHING ? "_planks" : "");
}
public static enum PlankType implements IStringSerializable
{
SACRED_OAK,
CHERRY,
DARK,
FIR,
ETHEREAL,
MAGIC,
MANGROVE,
PALM,
REDWOOD,
WILLOW,
BAMBOO_THATCHING,
PINE,
HELL_BARK,
JACARANDA,
MAHOGANY;
SACRED_OAK, CHERRY, DARK, FIR, ETHEREAL, MAGIC, MANGROVE, PALM, REDWOOD, WILLOW, BAMBOO_THATCHING, PINE, HELL_BARK, JACARANDA, MAHOGANY;
@Override
public String getName()

View file

@ -44,9 +44,10 @@ public class BlockBOPStone extends BOPBlock
if (state.getBlock() == this)
{
boolean polished = (Boolean)state.getValue(POLISHED_PROP);
boolean polished = (Boolean) state.getValue(POLISHED_PROP);
if (polished) return 1.5F;
if (polished)
return 1.5F;
return 3.0F;
}
@ -60,9 +61,10 @@ public class BlockBOPStone extends BOPBlock
if (state.getBlock() == this)
{
boolean polished = (Boolean)state.getValue(POLISHED_PROP);
boolean polished = (Boolean) state.getValue(POLISHED_PROP);
if (polished) return 7.0F;
if (polished)
return 7.0F;
return 5.0F;
}
@ -81,8 +83,8 @@ public class BlockBOPStone extends BOPBlock
@Override
public int getMetaFromState(IBlockState state)
{
int baseMeta = ((StoneType)state.getValue(VARIANT_PROP)).ordinal();
boolean polished = (Boolean)state.getValue(POLISHED_PROP);
int baseMeta = ((StoneType) state.getValue(VARIANT_PROP)).ordinal();
boolean polished = (Boolean) state.getValue(POLISHED_PROP);
return polished ? baseMeta | 8 : baseMeta;
}
@ -102,16 +104,14 @@ public class BlockBOPStone extends BOPBlock
@Override
public String getStateName(IBlockState state, boolean fullName)
{
boolean polished = (Boolean)state.getValue(POLISHED_PROP);
boolean polished = (Boolean) state.getValue(POLISHED_PROP);
return (fullName && polished ? "polished_" : "") + ((StoneType)state.getValue(VARIANT_PROP)).getName();
return (fullName && polished ? "polished_" : "") + ((StoneType) state.getValue(VARIANT_PROP)).getName();
}
public static enum StoneType implements IStringSerializable
{
LIMESTONE,
SILTSTONE,
SHALE;
LIMESTONE, SILTSTONE, SHALE;
public String getName()
{

View file

@ -40,7 +40,7 @@ public class BlockBamboo extends BOPPlant
@Override
public AxisAlignedBB getCollisionBoundingBox(World world, BlockPos pos, IBlockState state)
{
return new AxisAlignedBB((double)pos.getX() + this.minX, (double)pos.getY() + this.minY, (double)pos.getZ() + this.minZ, (double)pos.getX() + this.maxX, (double)pos.getY() + this.maxY, (double)pos.getZ() + this.maxZ);
return new AxisAlignedBB((double) pos.getX() + this.minX, (double) pos.getY() + this.minY, (double) pos.getZ() + this.minZ, (double) pos.getX() + this.maxX, (double) pos.getY() + this.maxY, (double) pos.getZ() + this.maxZ);
}
@Override

View file

@ -65,9 +65,9 @@ public class BlockBones extends BOPBlock
@Override
public int getMetaFromState(IBlockState state)
{
int baseMeta = ((BoneType)state.getValue(VARIANT_PROP)).ordinal();
int baseMeta = ((BoneType) state.getValue(VARIANT_PROP)).ordinal();
return baseMeta * 3 + ((EnumFacing.Axis)state.getValue(AXIS_PROP)).ordinal();
return baseMeta * 3 + ((EnumFacing.Axis) state.getValue(AXIS_PROP)).ordinal();
}
@Override
@ -85,7 +85,7 @@ public class BlockBones extends BOPBlock
@Override
public String getStateName(IBlockState state, boolean fullName)
{
return ((BoneType)state.getValue(VARIANT_PROP)).getName() + (fullName ? "_bone_segment" : "");
return ((BoneType) state.getValue(VARIANT_PROP)).getName() + (fullName ? "_bone_segment" : "");
}
@Override
@ -108,11 +108,12 @@ public class BlockBones extends BOPBlock
{
IBlockState state = world.getBlockState(pos);
if (state.getBlock() != this) return;
if (state.getBlock() != this)
return;
float width;
switch ((BoneType)state.getValue(VARIANT_PROP))
switch ((BoneType) state.getValue(VARIANT_PROP))
{
case SMALL:
width = 0.25F;
@ -134,7 +135,7 @@ public class BlockBones extends BOPBlock
float min = (1.0F - width) / 2F;
float max = 1.0F - min;
switch ((EnumFacing.Axis)state.getValue(AXIS_PROP))
switch ((EnumFacing.Axis) state.getValue(AXIS_PROP))
{
case X:
this.setBlockBounds(0F, min, min, 1.0F, max, max);
@ -164,9 +165,7 @@ public class BlockBones extends BOPBlock
public static enum BoneType implements IStringSerializable
{
SMALL,
MEDIUM,
LARGE;
SMALL, MEDIUM, LARGE;
@Override
public String getName()

View file

@ -41,7 +41,7 @@ public class BlockCoral extends BOPPlant
{
IBlockState state = world.getBlockState(pos);
if ((CoralType)state.getValue(VARIANT_PROP) == CoralType.GLOWING)
if ((CoralType) state.getValue(VARIANT_PROP) == CoralType.GLOWING)
{
return 10;
}
@ -56,9 +56,8 @@ public class BlockCoral extends BOPPlant
Block cover = world.getBlockState(pos.offsetUp()).getBlock();
boolean hasWater = cover == Blocks.water || cover == Blocks.flowing_water;
//TODO: Make all types depend on mud
return hasWater &&
(ground == Blocks.dirt || ground == Blocks.sand || ground == Blocks.sponge || ground == Blocks.stone || ground == Blocks.clay || ground == Blocks.gravel || ground == Blocks.grass);
// TODO: Make all types depend on mud
return hasWater && (ground == Blocks.dirt || ground == Blocks.sand || ground == Blocks.sponge || ground == Blocks.stone || ground == Blocks.clay || ground == Blocks.gravel || ground == Blocks.grass);
}
@Override
@ -70,7 +69,7 @@ public class BlockCoral extends BOPPlant
@Override
public int getMetaFromState(IBlockState state)
{
int meta = ((CoralType)state.getValue(VARIANT_PROP)).ordinal();
int meta = ((CoralType) state.getValue(VARIANT_PROP)).ordinal();
return meta;
}
@ -96,19 +95,15 @@ public class BlockCoral extends BOPPlant
@Override
public String getStateName(IBlockState state, boolean fullName)
{
CoralType type = (CoralType)state.getValue(VARIANT_PROP);
CoralType type = (CoralType) state.getValue(VARIANT_PROP);
return type.getName() + (fullName && type != CoralType.ALGAE ? "_coral" : "");
}
//TODO: Readd kelp
// TODO: Readd kelp
public static enum CoralType implements IStringSerializable
{
PINK,
ORANGE,
BLUE,
GLOWING,
ALGAE;
PINK, ORANGE, BLUE, GLOWING, ALGAE;
@Override
public String getName()

View file

@ -52,7 +52,7 @@ public class BlockGem extends BOPBlock
@Override
public int getMetaFromState(IBlockState state)
{
int meta = ((GemType)state.getValue(VARIANT_PROP)).ordinal();
int meta = ((GemType) state.getValue(VARIANT_PROP)).ordinal();
return meta;
}
@ -72,19 +72,12 @@ public class BlockGem extends BOPBlock
@Override
public String getStateName(IBlockState state, boolean fullName)
{
return ((GemType)state.getValue(VARIANT_PROP)).getName() + (fullName ? "_block" : "");
return ((GemType) state.getValue(VARIANT_PROP)).getName() + (fullName ? "_block" : "");
}
public static enum GemType implements IStringSerializable
{
AMETHYST,
RUBY,
PERIDOT,
TOPAZ,
TANZANITE,
MALACHITE,
SAPPHIRE,
AMBER;
AMETHYST, RUBY, PERIDOT, TOPAZ, TANZANITE, MALACHITE, SAPPHIRE, AMBER;
public String getName()
{

View file

@ -47,7 +47,7 @@ public class BlockGemOre extends BOPBlock
@Override
public int getMetaFromState(IBlockState state)
{
int meta = ((GemType)state.getValue(VARIANT_PROP)).ordinal();
int meta = ((GemType) state.getValue(VARIANT_PROP)).ordinal();
return meta;
}
@ -67,6 +67,6 @@ public class BlockGemOre extends BOPBlock
@Override
public String getStateName(IBlockState state, boolean fullName)
{
return ((GemType)state.getValue(VARIANT_PROP)).getName() + (fullName ? "_ore" : "");
return ((GemType) state.getValue(VARIANT_PROP)).getName() + (fullName ? "_ore" : "");
}
}

View file

@ -41,7 +41,7 @@ public class BlockHive extends BOPBlock
@Override
public int getMetaFromState(IBlockState state)
{
int meta = ((HiveType)state.getValue(VARIANT_PROP)).ordinal();
int meta = ((HiveType) state.getValue(VARIANT_PROP)).ordinal();
return meta;
}
@ -61,15 +61,12 @@ public class BlockHive extends BOPBlock
@Override
public String getStateName(IBlockState state, boolean fullName)
{
return ((HiveType)state.getValue(VARIANT_PROP)).getName() + (fullName ? "_block" : "");
return ((HiveType) state.getValue(VARIANT_PROP)).getName() + (fullName ? "_block" : "");
}
public static enum HiveType implements IStringSerializable
{
HIVE,
HONEYCOMB,
EMPTY_HONEYCOMB,
FILLED_HONEYCOMB;
HIVE, HONEYCOMB, EMPTY_HONEYCOMB, FILLED_HONEYCOMB;
public String getName()
{

View file

@ -8,6 +8,7 @@
package biomesoplenty.common.block;
public class BlockSegmentedCoral {
public class BlockSegmentedCoral
{
}

View file

@ -129,15 +129,15 @@ public class BiomeConfigurationHandler
private static void translateVanillaValues(BiomeGenBase biome)
{
IExtendedBiome extendedBiome = (IExtendedBiome)biome;
IExtendedDecorator extendedDecorator = (IExtendedDecorator)biome.theBiomeDecorator;
IExtendedBiome extendedBiome = (IExtendedBiome) biome;
IExtendedDecorator extendedDecorator = (IExtendedDecorator) biome.theBiomeDecorator;
if (extendedBiome.getBiomeOwner() == BiomeOwner.OTHER)
{
if (biome.theBiomeDecorator.cactiPerChunk > 0)
{
WorldGenCactus cactusGen = new WorldGenCactus();
IExtendedCactusGen extendedCactusGen = (IExtendedCactusGen)cactusGen;
IExtendedCactusGen extendedCactusGen = (IExtendedCactusGen) cactusGen;
extendedCactusGen.setCactiPerChunk(biome.theBiomeDecorator.cactiPerChunk);
extendedDecorator.addGenerator("cactus", extendedCactusGen);
@ -147,19 +147,19 @@ public class BiomeConfigurationHandler
private static void configureBiomeWithJson(BiomeGenBase biome, JsonBiome jsonBiome)
{
//TODO: Reflect and modify biome id biome.biomeId = jsonBiome.biomeID;
// TODO: Reflect and modify biome id biome.biomeId = jsonBiome.biomeID;
biome.biomeName = jsonBiome.biomeName;
biome.topBlock = jsonBiome.topBlock;
biome.fillerBlock = jsonBiome.fillerBlock;
biome.setHeight(new BiomeGenBase.Height(jsonBiome.rootHeight, jsonBiome.rootVariation));
biome.temperature = jsonBiome.temperature;
biome.rainfall = jsonBiome.rainfall;
//TODO: Reflect and modify enableRain and enableSnow
// TODO: Reflect and modify enableRain and enableSnow
biome.color = jsonBiome.color;
biome.waterColorMultiplier = jsonBiome.waterColorMultiplier;
JsonEntitySpawn.addBiomeEntitySpawns(biome, jsonBiome);
IExtendedDecorator extendedDecorator = (IExtendedDecorator)biome.theBiomeDecorator;
IExtendedDecorator extendedDecorator = (IExtendedDecorator) biome.theBiomeDecorator;
extendedDecorator.configureGenerators(jsonBiome.decoration);
}

View file

@ -14,5 +14,6 @@ import biomesoplenty.api.biome.IGenerator;
public interface IExtendedCactusGen extends IGenerator<WorldGenCactus>
{
public void setCactiPerChunk(int amount);
public int getCactiPerChunk();
}

View file

@ -12,9 +12,9 @@ import net.minecraft.client.renderer.BlockModelShapes;
import net.minecraftforge.fml.common.eventhandler.Event;
/**
* Called upon the construction of BlockModelShapes after the registration
* of Vanilla blocks. This event should be used as an opportunity to register
* any custom state mappings for modded blocks.
* Called upon the construction of BlockModelShapes after the registration of
* Vanilla blocks. This event should be used as an opportunity to register any
* custom state mappings for modded blocks.
*/
public class BlockModelRegisterEvent extends Event
{

View file

@ -31,7 +31,7 @@ public class DrawScreenEventHandler
if (screenGui instanceof GuiCreateWorld)
{
GuiCreateWorld createWorldGui = (GuiCreateWorld)screenGui;
GuiCreateWorld createWorldGui = (GuiCreateWorld) screenGui;
GuiButton mapTypeButton = createWorldGui.field_146320_D;
int worldTypeIndex = createWorldGui.field_146331_K;

View file

@ -64,7 +64,8 @@ public class ModBlocks
private static Block registerBlock(BOPBlock block, String name)
{
if (block.presetStates == null) block.presetStates = BlockStateUtils.getValidStatesForProperties(block.getDefaultState(), block.getPresetProperties());
if (block.presetStates == null)
block.presetStates = BlockStateUtils.getValidStatesForProperties(block.getDefaultState(), block.getPresetProperties());
block.setUnlocalizedName(name);
@ -92,7 +93,8 @@ public class ModBlocks
DrawScreenEventHandler.blockCount++;
}
if (block.hasHiddenProperties()) BlockModelRegisterEventHandler.addHiddenProperties(block, block.getHiddenProperties());
if (block.hasHiddenProperties())
BlockModelRegisterEventHandler.addHiddenProperties(block, block.getHiddenProperties());
return block;
}

View file

@ -32,13 +32,14 @@ public class ItemBlockWithVariants extends ItemBlock
@Override
public String getUnlocalizedName(ItemStack stack)
{
BOPBlock block = (BOPBlock)this.block;
BOPBlock block = (BOPBlock) this.block;
if (block.hasPresetProperties())
{
return super.getUnlocalizedName() + "." + block.getStateName(block.getStateFromMeta(stack.getMetadata()), false);
}
else return super.getUnlocalizedName();
else
return super.getUnlocalizedName();
}
}

View file

@ -51,5 +51,3 @@ public class MixinBiomeDecorator implements IExtendedDecorator
return Collections.unmodifiableMap(this.generatorMap);
}
}

View file

@ -41,7 +41,7 @@ public abstract class MixinWorldGenCactus extends WorldGenerator implements IExt
{
JsonObject jsonCactusGen = new JsonObject();
jsonCactusGen.addProperty("cacti_per_chunk", ((IExtendedCactusGen)src).getCactiPerChunk());
jsonCactusGen.addProperty("cacti_per_chunk", ((IExtendedCactusGen) src).getCactiPerChunk());
return jsonCactusGen;
}
@ -51,10 +51,10 @@ public abstract class MixinWorldGenCactus extends WorldGenerator implements IExt
{
JsonObject jsonCactusGen = json.getAsJsonObject();
WorldGenCactus cactusGen = new WorldGenCactus();
IExtendedCactusGen extendedCactusGen = (IExtendedCactusGen)cactusGen;
IExtendedCactusGen extendedCactusGen = (IExtendedCactusGen) cactusGen;
extendedCactusGen.setCactiPerChunk(jsonCactusGen.get("cacti_per_chunk").getAsInt());
return (IGenerator<WorldGenCactus>)new WorldGenCactus();
return (IGenerator<WorldGenCactus>) new WorldGenCactus();
}
}

View file

@ -25,8 +25,8 @@ public abstract class MixinBlockModelShapes
@Inject(method = "<init>", at = @At("RETURN"))
private void onConstructed(ModelManager modelManager, CallbackInfo callbackInfo)
{
Object obj = (Object)this;
Object obj = (Object) this;
MinecraftForge.EVENT_BUS.post(new BlockModelRegisterEvent((BlockModelShapes)obj));
MinecraftForge.EVENT_BUS.post(new BlockModelRegisterEvent((BlockModelShapes) obj));
}
}

View file

@ -10,5 +10,6 @@ package biomesoplenty.common.util;
public class ReflectionHelper
{
//Various fields used in Reflection. These should be checked with every update.
// Various fields used in Reflection. These should be checked with every
// update.
}

View file

@ -25,9 +25,10 @@ public class BlockStateUtils
{
public static IProperty getPropertyByName(IBlockState blockState, String propertyName)
{
for (IProperty property : (ImmutableSet<IProperty>)blockState.getProperties().keySet())
for (IProperty property : (ImmutableSet<IProperty>) blockState.getProperties().keySet())
{
if (property.getName().equals(propertyName)) return property;
if (property.getName().equals(propertyName))
return property;
}
return null;
@ -40,9 +41,10 @@ public class BlockStateUtils
public static Comparable getPropertyValueByName(IBlockState blockState, IProperty property, String valueName)
{
for (Comparable value : (ImmutableSet<Comparable>)property.getAllowedValues())
for (Comparable value : (ImmutableSet<Comparable>) property.getAllowedValues())
{
if (value.toString().equals(valueName)) return value;
if (value.toString().equals(valueName))
return value;
}
return null;
@ -50,7 +52,8 @@ public class BlockStateUtils
public static ImmutableSet<IBlockState> getValidStatesForProperties(IBlockState baseState, IProperty... properties)
{
if (properties == null) return null;
if (properties == null)
return null;
Set<IBlockState> validStates = Sets.newHashSet();
PropertyIndexer propertyIndexer = new PropertyIndexer(properties);
@ -129,7 +132,8 @@ public class BlockStateUtils
public boolean increment()
{
if (counter < maxCount) counter++;
if (counter < maxCount)
counter++;
else
{
if (hasParent())
@ -137,7 +141,8 @@ public class BlockStateUtils
resetSelfAndChildren();
return this.parent.increment();
}
else return false;
else
return false;
}
return true;
@ -146,7 +151,8 @@ public class BlockStateUtils
public void resetSelfAndChildren()
{
counter = 0;
if (this.hasChild()) this.child.resetSelfAndChildren();
if (this.hasChild())
this.child.resetSelfAndChildren();
}
public boolean hasParent()

View file

@ -25,7 +25,7 @@ public class GeneratorTypeAdaptor implements JsonSerializer<IGenerator<?>>, Json
@Override
public JsonElement serialize(IGenerator<?> src, Type typeOfSrc, JsonSerializationContext context)
{
JsonObject jsonObject = src.serialize((IGenerator)src).getAsJsonObject();
JsonObject jsonObject = src.serialize((IGenerator) src).getAsJsonObject();
jsonObject.addProperty("class", src.getClass().getCanonicalName());
@ -45,7 +45,7 @@ public class GeneratorTypeAdaptor implements JsonSerializer<IGenerator<?>>, Json
if (IGenerator.class.isAssignableFrom(generatorClass))
{
IGenerator<?> generator = (IGenerator<?>)generatorClass.newInstance();
IGenerator<?> generator = (IGenerator<?>) generatorClass.newInstance();
return generator.deserialize(json);
}

View file

@ -22,11 +22,7 @@ import com.google.gson.GsonBuilder;
public class JsonBiome
{
public static final Gson serializer = new GsonBuilder()
.setPrettyPrinting().setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES)
.registerTypeAdapter(IBlockState.class, new JsonBlockState())
.registerTypeAdapter(IGenerator.class, new GeneratorTypeAdaptor())
.create();
public static final Gson serializer = new GsonBuilder().setPrettyPrinting().setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES).registerTypeAdapter(IBlockState.class, new JsonBlockState()).registerTypeAdapter(IGenerator.class, new GeneratorTypeAdaptor()).create();
public String biomeName;
public int biomeId;
@ -57,7 +53,7 @@ public class JsonBiome
biome.waterColorMultiplier = baseBiome.waterColorMultiplier;
biome.entities = JsonEntitySpawn.getBiomeEntitySpawns(baseBiome);
IExtendedDecorator extendedDecorator = (IExtendedDecorator)baseBiome.theBiomeDecorator;
IExtendedDecorator extendedDecorator = (IExtendedDecorator) baseBiome.theBiomeDecorator;
biome.decoration = extendedDecorator.getGeneratorMap();

View file

@ -39,7 +39,7 @@ public class JsonBlockState implements JsonDeserializer<IBlockState>, JsonSerial
jsonBlockState.addProperty("block", GameRegistry.findUniqueIdentifierFor(blockState.getBlock()).toString());
for (Entry<IProperty, Comparable> entry : (ImmutableSet<Entry<IProperty, Comparable>>)blockState.getProperties().entrySet())
for (Entry<IProperty, Comparable> entry : (ImmutableSet<Entry<IProperty, Comparable>>) blockState.getProperties().entrySet())
{
IProperty property = entry.getKey();
Comparable value = entry.getValue();

View file

@ -14,7 +14,11 @@ import net.minecraft.item.Item;
public class CommonProxy
{
public void registerRenderers() {}
public void registerRenderers()
{
}
public void registerBlockForMeshing(BOPBlock block, int metadata, String name) {}
public void registerBlockForMeshing(BOPBlock block, int metadata, String name)
{
}
}