Minor tweaks to High Grass and High Cattail
This commit is contained in:
parent
075c34974c
commit
cfe73c2225
2 changed files with 23 additions and 18 deletions
|
@ -20,6 +20,7 @@ import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.ForgeHooks;
|
import net.minecraftforge.common.ForgeHooks;
|
||||||
import net.minecraftforge.common.IShearable;
|
import net.minecraftforge.common.IShearable;
|
||||||
import biomesoplenty.BiomesOPlenty;
|
import biomesoplenty.BiomesOPlenty;
|
||||||
|
import biomesoplenty.api.Blocks;
|
||||||
import biomesoplenty.blocks.renderers.FoliageRenderer;
|
import biomesoplenty.blocks.renderers.FoliageRenderer;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
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)
|
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);
|
world.setBlockToAir(x, y, z);
|
||||||
if (world.getBlockMetadata(x, y, z) == GRASSBOTTOM && world.getBlockId(x, y + 1, z) != this.blockID)
|
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
|
@Override
|
||||||
|
@ -208,9 +209,6 @@ public class BlockBOPFoliage extends BlockFlower implements IShearable
|
||||||
|
|
||||||
switch (meta)
|
switch (meta)
|
||||||
{
|
{
|
||||||
case GRASSTOP:
|
|
||||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ALGAE:
|
case ALGAE:
|
||||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.015625F, 1.0F);
|
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
|
@Override
|
||||||
public ArrayList<ItemStack> onSheared(ItemStack item, World world, int x, int y, int z, int fortune)
|
public ArrayList<ItemStack> onSheared(ItemStack item, World world, int x, int y, int z, int fortune)
|
||||||
{
|
{
|
||||||
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||||
ret.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z)));
|
|
||||||
return ret;
|
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
|
@Override
|
||||||
|
|
|
@ -75,10 +75,6 @@ public class BlockBOPPlant extends BlockFlower implements IShearable
|
||||||
case 6:
|
case 6:
|
||||||
case 7:
|
case 7:
|
||||||
this.setBlockBounds(0.125F, 0.0F, 0.125F, 0.875F, 1.00F, 0.875F);
|
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;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -179,8 +175,8 @@ public class BlockBOPPlant extends BlockFlower implements IShearable
|
||||||
this.checkFlowerChange(world, x, y, z);
|
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)
|
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);
|
world.setBlockToAir(x, y, z);
|
||||||
if (world.getBlockMetadata(x, y, z) == CATTAILBOTTOM && world.getBlockId(x, y + 1, z) != this.blockID)
|
//if (world.getBlockMetadata(x, y, z) == CATTAILBOTTOM && world.getBlockId(x, y + 1, z) != this.blockID)
|
||||||
world.setBlockToAir(x, y, z);
|
// world.setBlock(x, y, z, this.blockID, 7, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -212,7 +208,10 @@ public class BlockBOPPlant extends BlockFlower implements IShearable
|
||||||
@Override
|
@Override
|
||||||
public int damageDropped(int meta)
|
public int damageDropped(int meta)
|
||||||
{
|
{
|
||||||
return meta;
|
if (meta == 8)
|
||||||
|
return 7;
|
||||||
|
else
|
||||||
|
return meta;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -220,7 +219,7 @@ public class BlockBOPPlant extends BlockFlower implements IShearable
|
||||||
{
|
{
|
||||||
if (meta == 6)
|
if (meta == 6)
|
||||||
return random.nextInt(5) == 0 ? 1 : 0;
|
return random.nextInt(5) == 0 ? 1 : 0;
|
||||||
else if (meta == 7)
|
else if (meta == 7 || meta == 8)
|
||||||
return 1;
|
return 1;
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -250,9 +249,12 @@ public class BlockBOPPlant extends BlockFlower implements IShearable
|
||||||
@Override
|
@Override
|
||||||
public ArrayList<ItemStack> onSheared(ItemStack item, World world, int x, int y, int z, int fortune)
|
public ArrayList<ItemStack> onSheared(ItemStack item, World world, int x, int y, int z, int fortune)
|
||||||
{
|
{
|
||||||
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||||
ret.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z)));
|
|
||||||
return ret;
|
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
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue