Minor tweaks to High Grass and High Cattail

This commit is contained in:
Adubbz 2013-05-04 20:09:29 +10:00
parent 075c34974c
commit cfe73c2225
2 changed files with 23 additions and 18 deletions

View file

@ -20,6 +20,7 @@ import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.common.IShearable;
import biomesoplenty.BiomesOPlenty;
import biomesoplenty.api.Blocks;
import biomesoplenty.blocks.renderers.FoliageRenderer;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -156,7 +157,7 @@ public class BlockBOPFoliage extends BlockFlower implements IShearable
if (world.getBlockMetadata(x, y, z) == GRASSTOP && world.getBlockId(x, y - 1, z) == this.blockID && world.getBlockMetadata(x, y - 1, z) != GRASSBOTTOM)
world.setBlockToAir(x, y, z);
if (world.getBlockMetadata(x, y, z) == GRASSBOTTOM && world.getBlockId(x, y + 1, z) != this.blockID)
world.setBlockToAir(x, y, z);
world.setBlock(x, y, z, Block.tallGrass.blockID, 1, 2);
}
@Override
@ -208,9 +209,6 @@ public class BlockBOPFoliage extends BlockFlower implements IShearable
switch (meta)
{
case GRASSTOP:
this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F);
break;
case ALGAE:
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.015625F, 1.0F);
@ -243,9 +241,14 @@ public class BlockBOPFoliage extends BlockFlower implements IShearable
@Override
public ArrayList<ItemStack> onSheared(ItemStack item, World world, int x, int y, int z, int fortune)
{
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
ret.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z)));
return ret;
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
if (world.getBlockMetadata(x, y, z) != 6)
ret.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z)));
else
ret.add(new ItemStack(Block.tallGrass, 1, 1));
return ret;
}
@Override

View file

@ -75,10 +75,6 @@ public class BlockBOPPlant extends BlockFlower implements IShearable
case 6:
case 7:
this.setBlockBounds(0.125F, 0.0F, 0.125F, 0.875F, 1.00F, 0.875F);
break;
case 8:
this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F);
break;
default:
@ -179,8 +175,8 @@ public class BlockBOPPlant extends BlockFlower implements IShearable
this.checkFlowerChange(world, x, y, z);
if (world.getBlockMetadata(x, y, z) == CATTAILTOP && world.getBlockId(x, y - 1, z) == this.blockID && world.getBlockMetadata(x, y - 1, z) != CATTAILBOTTOM)
world.setBlockToAir(x, y, z);
if (world.getBlockMetadata(x, y, z) == CATTAILBOTTOM && world.getBlockId(x, y + 1, z) != this.blockID)
world.setBlockToAir(x, y, z);
//if (world.getBlockMetadata(x, y, z) == CATTAILBOTTOM && world.getBlockId(x, y + 1, z) != this.blockID)
// world.setBlock(x, y, z, this.blockID, 7, 2);
}
@Override
@ -212,7 +208,10 @@ public class BlockBOPPlant extends BlockFlower implements IShearable
@Override
public int damageDropped(int meta)
{
return meta;
if (meta == 8)
return 7;
else
return meta;
}
@Override
@ -220,7 +219,7 @@ public class BlockBOPPlant extends BlockFlower implements IShearable
{
if (meta == 6)
return random.nextInt(5) == 0 ? 1 : 0;
else if (meta == 7)
else if (meta == 7 || meta == 8)
return 1;
else
return 0;
@ -250,9 +249,12 @@ public class BlockBOPPlant extends BlockFlower implements IShearable
@Override
public ArrayList<ItemStack> onSheared(ItemStack item, World world, int x, int y, int z, int fortune)
{
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
ret.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z)));
return ret;
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
if (world.getBlockMetadata(x, y, z) != 8 && world.getBlockMetadata(x, y, z) != 9)
ret.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z)));
return ret;
}
@Override