Hopefully switched tree leaves to separate IDS
This commit is contained in:
parent
d3bef87c36
commit
455d36e788
3 changed files with 350 additions and 340 deletions
|
@ -70,6 +70,8 @@ public class Blocks
|
|||
public static Optional<? extends Block> coral = Optional.absent();
|
||||
public static Optional<? extends Block> leaves1 = Optional.absent();
|
||||
public static Optional<? extends Block> leaves2 = Optional.absent();
|
||||
public static Optional<? extends Block> leaves3 = Optional.absent();
|
||||
public static Optional<? extends Block> leaves4 = Optional.absent();
|
||||
public static Optional<? extends Block> leavesColorized = Optional.absent();
|
||||
public static Optional<? extends Block> leavesFruit = Optional.absent();
|
||||
public static Optional<? extends Block> leavesFruit2 = Optional.absent();
|
||||
|
|
|
@ -26,10 +26,10 @@ public class BlockBOPLeaves extends BlockLeavesBase implements IShearable
|
|||
{
|
||||
public static enum LeafCategory
|
||||
{
|
||||
CAT1, CAT2;
|
||||
CAT1, CAT2, CAT3, CAT4;
|
||||
}
|
||||
|
||||
//Autumn - Orange = Leaves 1, Origin - White = Leaves 2
|
||||
//Yellow Autumn - Dark = Leaves 1, Dead - Orange Autumn = Leaves 2, Origin - White Cherry = Leaves 3, Hellbark - Jacaranda = Leaves 4
|
||||
private static final String[] leaves = new String[] {"yellowautumn", "bamboo", "magic", "dark", "dead", "fir", "holy", "orangeautumn", "origin", "pinkcherry", "maple", "whitecherry", "hellbark", "jacaranda"};
|
||||
|
||||
private static final float[] fallingLeavesChance = new float[] {0.1F, 0.008F, 0.016F, 0.008F, 0.0F, 0.008F, 0.016F, 0.1F, 0.008F, 0.1F, 0.008F, 0.1F, 0.008F, 0.008F};
|
||||
|
@ -70,26 +70,26 @@ public class BlockBOPLeaves extends BlockLeavesBase implements IShearable
|
|||
|
||||
public Icon getIconBetterLeaves(int metadata, float randomIndex)
|
||||
{
|
||||
int type = getTypeFromMeta(metadata) + (category.ordinal() * 8);
|
||||
int type = getTypeFromMeta(metadata) + (category.ordinal() * 4);
|
||||
return textures[2][type >= leaves.length ? 0 : type];
|
||||
}
|
||||
|
||||
public Icon getIconFallingLeaves(int metadata)
|
||||
{
|
||||
int type = getTypeFromMeta(metadata) + (category.ordinal() * 8);
|
||||
int type = getTypeFromMeta(metadata) + (category.ordinal() * 4);
|
||||
return textures[1][type >= leaves.length ? 0 : type];
|
||||
}
|
||||
|
||||
public float getSpawnChanceFallingLeaves(int metadata)
|
||||
{
|
||||
int type = getTypeFromMeta(metadata) + (category.ordinal() * 8);
|
||||
int type = getTypeFromMeta(metadata) + (category.ordinal() * 4);
|
||||
return fallingLeavesChance[type >= leaves.length ? 0 : type];
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon(int side, int metadata)
|
||||
{
|
||||
int type = getTypeFromMeta(metadata) + (category.ordinal() * 8);
|
||||
int type = getTypeFromMeta(metadata) + (category.ordinal() * 4);
|
||||
return textures[(!isOpaqueCube() ? 0 : 1)][type >= leaves.length ? 0 : type];
|
||||
}
|
||||
|
||||
|
@ -101,12 +101,16 @@ public class BlockBOPLeaves extends BlockLeavesBase implements IShearable
|
|||
|
||||
@Override
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
public void getSubBlocks(int blockID, CreativeTabs creativeTabs, List list) {
|
||||
for (int i = 0; i < 8; ++i)
|
||||
if (category != LeafCategory.CAT2 || i < 6) {
|
||||
public void getSubBlocks(int blockID, CreativeTabs creativeTabs, List list)
|
||||
{
|
||||
for (int i = 0; i < 4; ++i)
|
||||
{
|
||||
if (category != LeafCategory.CAT4 || i < 2)
|
||||
{
|
||||
list.add(new ItemStack(blockID, 1, i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
@ -154,7 +158,7 @@ public class BlockBOPLeaves extends BlockLeavesBase implements IShearable
|
|||
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
if ((meta & 8) != 0/* && (meta & 4) == 0*/)
|
||||
if ((meta & 4) != 0/* && (meta & 4) == 0*/)
|
||||
{
|
||||
byte b0 = 4;
|
||||
int i1 = b0 + 1;
|
||||
|
@ -269,7 +273,7 @@ public class BlockBOPLeaves extends BlockLeavesBase implements IShearable
|
|||
@Override
|
||||
public int getFlammability(IBlockAccess world, int x, int y, int z, int metadata, ForgeDirection face)
|
||||
{
|
||||
if (category == LeafCategory.CAT2 && metadata == 4)
|
||||
if (category == LeafCategory.CAT4 && metadata == 0)
|
||||
return 0;
|
||||
else
|
||||
{
|
||||
|
@ -281,7 +285,7 @@ public class BlockBOPLeaves extends BlockLeavesBase implements IShearable
|
|||
@Override
|
||||
public int getFireSpreadSpeed(World world, int x, int y, int z, int metadata, ForgeDirection face)
|
||||
{
|
||||
if (category == LeafCategory.CAT2 && metadata == 4)
|
||||
if (category == LeafCategory.CAT4 && metadata == 0)
|
||||
return 0;
|
||||
else
|
||||
return blockFireSpreadSpeed[blockID];
|
||||
|
@ -290,7 +294,7 @@ public class BlockBOPLeaves extends BlockLeavesBase implements IShearable
|
|||
@Override
|
||||
public boolean isFlammable(IBlockAccess world, int x, int y, int z, int metadata, ForgeDirection face)
|
||||
{
|
||||
if (category == LeafCategory.CAT2 && metadata == 4)
|
||||
if (category == LeafCategory.CAT4 && metadata == 0)
|
||||
return false;
|
||||
else
|
||||
return getFlammability(world, x, y, z, metadata, face) > 0;
|
||||
|
@ -315,7 +319,7 @@ public class BlockBOPLeaves extends BlockLeavesBase implements IShearable
|
|||
this.dropBlockAsItem_do(world, x, y, z, new ItemStack(var9, 1, this.damageDropped(meta)));
|
||||
}
|
||||
|
||||
if (((meta & 7) == 0 || (meta & 7) == 4 || (meta & 7) == 7) && (world.rand.nextInt(50) == 0)) {
|
||||
if (((meta & 3) == 0 || (meta & 3) == 4 || (meta & 3) == 7) && (world.rand.nextInt(50) == 0)) {
|
||||
this.dropBlockAsItem_do(world, x, y, z, new ItemStack(Items.food.get(), 1, 8));
|
||||
}
|
||||
}
|
||||
|
@ -323,7 +327,7 @@ public class BlockBOPLeaves extends BlockLeavesBase implements IShearable
|
|||
@Override
|
||||
public int damageDropped(int meta)
|
||||
{
|
||||
return (getTypeFromMeta(meta) + category.ordinal() * 8) + 1;
|
||||
return (getTypeFromMeta(meta) + category.ordinal() * 4) + 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -354,7 +358,7 @@ public class BlockBOPLeaves extends BlockLeavesBase implements IShearable
|
|||
|
||||
public String getLeafType(int metadata)
|
||||
{
|
||||
int type = getTypeFromMeta(metadata) + (category.ordinal() * 8);
|
||||
int type = getTypeFromMeta(metadata) + (category.ordinal() * 4);
|
||||
return leaves[type >= leaves.length ? 0 : type];
|
||||
}
|
||||
|
||||
|
|
|
@ -140,6 +140,8 @@ public class BOPBlocks
|
|||
Blocks.ivy = Optional.of((new BlockIvy(BOPConfigurationIDs.ivyID)).setHardness(0.2F).setStepSound(Block.soundGrassFootstep).setUnlocalizedName("bop.ivy"));
|
||||
Blocks.leaves1 = Optional.of((new BlockBOPLeaves(BOPConfigurationIDs.leaves1ID, LeafCategory.CAT1)).setUnlocalizedName("bop.leaves1"));
|
||||
Blocks.leaves2 = Optional.of((new BlockBOPLeaves(BOPConfigurationIDs.leaves2ID, LeafCategory.CAT2)).setUnlocalizedName("bop.leaves2"));
|
||||
Blocks.leaves3 = Optional.of((new BlockBOPLeaves(BOPConfigurationIDs.leaves3ID, LeafCategory.CAT3)).setUnlocalizedName("bop.leaves3"));
|
||||
Blocks.leaves4 = Optional.of((new BlockBOPLeaves(BOPConfigurationIDs.leaves4ID, LeafCategory.CAT4)).setUnlocalizedName("bop.leaves4"));
|
||||
Blocks.foliage = Optional.of((new BlockBOPFoliage(BOPConfigurationIDs.foliageID)).setUnlocalizedName("bop.foliage"));
|
||||
Blocks.ashStone = Optional.of(new BlockBOPGeneric(BOPConfigurationIDs.ashStoneID, Material.rock, BlockType.ASH_STONE));
|
||||
Blocks.hardIce = Optional.of(new BlockBOPGeneric(BOPConfigurationIDs.hardIceID, Material.rock, BlockType.HARD_ICE));
|
||||
|
@ -229,6 +231,8 @@ public class BOPBlocks
|
|||
registerBlock(Blocks.ivy.get(), ItemBOPIvy.class);
|
||||
registerBlock(Blocks.leaves1.get(), ItemBlockLeaves.class);
|
||||
registerBlock(Blocks.leaves2.get(), ItemBlockLeaves.class);
|
||||
registerBlock(Blocks.leaves3.get(), ItemBlockLeaves.class);
|
||||
registerBlock(Blocks.leaves4.get(), ItemBlockLeaves.class);
|
||||
registerBlock(Blocks.foliage.get(), ItemBlockFoliage.class);
|
||||
registerBlock(Blocks.ashStone.get());
|
||||
registerBlock(Blocks.hardIce.get());
|
||||
|
|
Loading…
Reference in a new issue