Replaced sunflowers and high grass with different blocks

This commit is contained in:
Matt Caughey 2014-03-16 21:49:18 -04:00
parent d78c8b09d9
commit 91e6c69737
17 changed files with 63 additions and 34 deletions

View File

@ -13,7 +13,7 @@ import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
public class FoliageRenderer implements ISimpleBlockRenderingHandler
{
private final int GRASSTOP = 6;
private final int HEDGETOP = 6;
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer)
@ -344,7 +344,7 @@ public class FoliageRenderer implements ISimpleBlockRenderingHandler
if (par1Block == BOPBlockHelper.get("foliage"))
{
long i1;
if (world.getBlockMetadata(par2, par3, par4) == GRASSTOP) {
if (world.getBlockMetadata(par2, par3, par4) == HEDGETOP) {
i1 = par2 * 3129871 ^ par4 * 116129781L ^ par3 - 1;
} else {
i1 = par2 * 3129871 ^ par4 * 116129781L ^ par3;
@ -362,6 +362,10 @@ public class FoliageRenderer implements ISimpleBlockRenderingHandler
//TODO: drawCrossedSquares() getIcon()
renderer.drawCrossedSquares(par1Block.getIcon(0, world.getBlockMetadata(par2, par3, par4)), d0, d1 - 1, d2, 1.0F);
}
else if (world.getBlockMetadata(par2, par3, par4) == 3 && world.getBlock(par2, par3, par4) == BOPBlockHelper.get("foliage"))
{
renderHedge(d0, d1, d2, 1.0F, f1, f2, f3, renderer);
}
//TODO: getBlock()
else if (world.getBlockMetadata(par2, par3, par4) == 8 && world.getBlock(par2, par3, par4) == BOPBlockHelper.get("foliage"))
{
@ -410,4 +414,19 @@ public class FoliageRenderer implements ISimpleBlockRenderingHandler
//TODO: drawCrossedSquares()
renderer.drawCrossedSquares(shrubBranch, par1, par2, par3, par4);
}
private static void renderHedge(double par1, double par2, double par3, float par4, float par5, float par6, float par7, RenderBlocks renderer)
{
Tessellator tessellator = Tessellator.instance;
//TODO: getBlockIconFromSideAndMetadata()
IIcon hedgeLeaf = renderer.getBlockIconFromSideAndMetadata(BOPBlockHelper.get("foliage"), 0, 3);
IIcon hedgeTrunk = ((BlockBOPFoliage)BOPBlockHelper.get("foliage")).hedgeTrunk;
tessellator.setColorOpaque_F(par4 * par5, par4 * par6, par4 * par7);
//TODO: drawCrossedSquares()
renderer.drawCrossedSquares(hedgeLeaf, par1, par2, par3, par4);
tessellator.setColorOpaque_F(par4, par4, par4);
//TODO: drawCrossedSquares()
renderer.drawCrossedSquares(hedgeTrunk, par1, par2, par3, par4);
}
}

View File

@ -29,11 +29,11 @@ import cpw.mods.fml.relauncher.SideOnly;
public class BlockBOPFlower extends BOPBlockWorldDecor
{
private static final String[] plants = new String[] {"clover", "swampflower", "deadbloom", "glowflower", "hydrangea", "cosmos", "daffodil", "wildflower", "violet", "anemone", "lilyflower", "rainbowflower", "bromeliad", "sunflowerbottom", "sunflowertop", "dandelion"};
private static final String[] plants = new String[] {"clover", "swampflower", "deadbloom", "glowflower", "hydrangea", "cosmos", "daffodil", "wildflower", "violet", "anemone", "lilyflower", "rainbowflower", "bromeliad", "eyebulbbottom", "eyebulbtop", "dandelion"};
private IIcon[] textures;
private static final int SUNFLOWERTOP = 14;
private static final int SUNFLOWERBOTTOM = 13;
private static final int EYEBULBTOP = 14;
private static final int EYEBULBBOTTOM = 13;
public BlockBOPFlower()
{
@ -227,8 +227,11 @@ public class BlockBOPFlower extends BOPBlockWorldDecor
case 12: // Bromeliad
return block == BOPBlockHelper.get("hardDirt") || block == Blocks.hardened_clay || block == Blocks.sand;
case 13: // Eyebulb Bottom
return block == Blocks.netherrack || block == BOPBlockHelper.get("overgrownNetherrack") || block == BOPBlockHelper.get("flesh");
case 14: // Sunflower Top
case 14: // Eyebulb Top
return block == this;
default:
@ -243,13 +246,13 @@ public class BlockBOPFlower extends BOPBlockWorldDecor
super.onNeighborBlockChange(world, x, y, z, neighborBlock);
//TODO: getBlock()
if (world.getBlockMetadata(x, y, z) == SUNFLOWERTOP && world.getBlock(x, y - 1, z) == this && world.getBlockMetadata(x, y - 1, z) != SUNFLOWERBOTTOM)
if (world.getBlockMetadata(x, y, z) == EYEBULBTOP && world.getBlock(x, y - 1, z) == this && world.getBlockMetadata(x, y - 1, z) != EYEBULBBOTTOM)
{
//TODO: setBlockToAir()
world.setBlockToAir(x, y, z);
}
//TODO: getBlock()
if (world.getBlockMetadata(x, y, z) == SUNFLOWERBOTTOM && world.getBlock(x, y + 1, z) != this)
if (world.getBlockMetadata(x, y, z) == EYEBULBBOTTOM && world.getBlock(x, y + 1, z) != this)
{
//TODO: setBlockToAir()
world.setBlockToAir(x, y, z);
@ -261,7 +264,7 @@ public class BlockBOPFlower extends BOPBlockWorldDecor
public int getDamageValue(World world, int x, int y, int z)
{
int meta = world.getBlockMetadata(x, y, z);
if (meta == SUNFLOWERTOP) {
if (meta == EYEBULBTOP) {
meta = 13;
}
return meta;

View File

@ -39,15 +39,16 @@ import cpw.mods.fml.relauncher.SideOnly;
public class BlockBOPFoliage extends BlockTallGrass implements IShearable
{
private static final String[] foliageTypes = new String[] {"algae", "shortgrass", "mediumgrass", "highgrassbottom", "bush", "sprout", "highgrasstop", "poisonivy", "berrybush", "shrub", "wheatgrass", "dampgrass", "koru", "cloverpatch", "leafpile", "deadleafpile"};
private static final String[] foliageTypes = new String[] {"algae", "shortgrass", "mediumgrass", "hedgebottom", "bush", "sprout", "hedgetop", "poisonivy", "berrybush", "shrub", "wheatgrass", "dampgrass", "koru", "cloverpatch", "leafpile", "deadleafpile"};
private IIcon[] textures;
public IIcon hedgeTrunk;
public IIcon shrubBranch;
public IIcon berryBushBerry;
private static final int GRASSTOP = 6;
private static final int HEDGETOP = 6;
private static final int ALGAE = 0;
private static final int GRASSBOTTOM = 3;
private static final int HEDGEBOTTOM = 3;
public BlockBOPFoliage()
{
@ -76,6 +77,7 @@ public class BlockBOPFoliage extends BlockTallGrass implements IShearable
textures[i] = iconRegister.registerIcon("biomesoplenty:"+foliageTypes[i]);
}
hedgeTrunk = iconRegister.registerIcon("biomesoplenty:" + "hedge_trunk");
shrubBranch = iconRegister.registerIcon("biomesoplenty:" + "shrub_branch");
berryBushBerry = iconRegister.registerIcon("biomesoplenty:" + "berrybush_berry");
}
@ -97,7 +99,7 @@ public class BlockBOPFoliage extends BlockTallGrass implements IShearable
{
for (int i = 0; i < foliageTypes.length; ++i)
{
if (i != GRASSTOP)
if (i != HEDGETOP)
{
list.add(new ItemStack(block, 1, i));
}
@ -159,17 +161,22 @@ public class BlockBOPFoliage extends BlockTallGrass implements IShearable
{
//TODO: getBlock()
Block block = world.getBlock(x, y - 1, z);
boolean solid = block.isOpaqueCube();
if (block == Blocks.air) return false;
switch (metadata)
{
case GRASSTOP:
case HEDGETOP:
return block == this;
case ALGAE: // Algae
return block == Blocks.water;
case 14: // Leaf Pile
return block == Blocks.grass || block == Blocks.dirt || block == Blocks.farmland || block == Blocks.stone || block == Blocks.sand || block == Blocks.gravel || block == BOPBlockHelper.get("longGrass") || block == BOPBlockHelper.get("overgrownNetherrack");
case 15: // Dead Leaf Pile
return block == Blocks.grass || block == Blocks.dirt || block == Blocks.farmland || block == Blocks.stone || block == Blocks.sand || block == Blocks.gravel || block == BOPBlockHelper.get("longGrass") || block == BOPBlockHelper.get("overgrownNetherrack");
default:
return block == Blocks.grass || block == Blocks.dirt || block == Blocks.farmland || block == BOPBlockHelper.get("longGrass") || block == BOPBlockHelper.get("overgrownNetherrack");
@ -240,7 +247,7 @@ public class BlockBOPFoliage extends BlockTallGrass implements IShearable
int metadata = world.getBlockMetadata(x, y, z);
if (world.getBlockMetadata(x, y, z) == GRASSBOTTOM)
if (world.getBlockMetadata(x, y, z) == HEDGEBOTTOM)
{
//TODO: getBlock()
if (world.getBlock(x, y + 1, z) != this)
@ -316,7 +323,7 @@ public class BlockBOPFoliage extends BlockTallGrass implements IShearable
@Override
public int colorMultiplier(IBlockAccess world, int x, int y, int z)
{
if (world.getBlockMetadata(x, y, z) == 9 || world.getBlockMetadata(x, y, z) == 14)
if (world.getBlockMetadata(x, y, z) == 3 || world.getBlockMetadata(x, y, z) == 6 || world.getBlockMetadata(x, y, z) == 9 || world.getBlockMetadata(x, y, z) == 14)
{
return world.getBiomeGenForCoords(x, z).getBiomeFoliageColor(x, y, z);
}
@ -334,8 +341,8 @@ public class BlockBOPFoliage extends BlockTallGrass implements IShearable
public int getDamageValue(World world, int x, int y, int z)
{
int meta = world.getBlockMetadata(x, y, z);
if (meta == GRASSTOP) {
meta = GRASSBOTTOM;
if (meta == HEDGETOP) {
meta = HEDGEBOTTOM;
}
return meta;
}
@ -467,7 +474,7 @@ public class BlockBOPFoliage extends BlockTallGrass implements IShearable
{
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
if (world.getBlockMetadata(x, y, z) == GRASSTOP)
if (world.getBlockMetadata(x, y, z) == HEDGETOP)
{
ret.add(new ItemStack(Blocks.tallgrass, 1, 1));
}

View File

@ -19,10 +19,10 @@ import cpw.mods.fml.relauncher.SideOnly;
public class ItemBlockFlower extends ItemBlock
{
private static final String[] plants = new String[] {"clover", "swampflower", "deadbloom", "glowflower", "hydrangea", "cosmos", "daffodil", "wildflower", "violet", "anemone", "lilyflower", "rainbowflower", "bromeliad", "sunflowerbottom", "sunflowertop", "dandelion"};
private static final String[] plants = new String[] {"clover", "swampflower", "deadbloom", "glowflower", "hydrangea", "cosmos", "daffodil", "wildflower", "violet", "anemone", "lilyflower", "rainbowflower", "bromeliad", "eyebulbbottom", "eyebulbtop", "dandelion"};
@SideOnly(Side.CLIENT)
private IIcon[] textures;
private static final int SUNFLOWERTOP = 14;
private static final int EYEBULBTOP = 14;
public ItemBlockFlower(Block block)
{
@ -44,7 +44,7 @@ public class ItemBlockFlower extends ItemBlock
{
textures = new IIcon[2];
textures[0] = iconRegister.registerIcon("biomesoplenty:item_sunflower");
textures[0] = iconRegister.registerIcon("biomesoplenty:eyebulbtop");
textures[1] = iconRegister.registerIcon("biomesoplenty:item_rainbowflower");
}
@ -136,7 +136,7 @@ public class ItemBlockFlower extends ItemBlock
{
if (metadata == 13)
{
if (!placeBlockAt(stack, player, world, x, y + 1, z, side, hitX, hitY + 1, hitZ, SUNFLOWERTOP)) return false;
if (!placeBlockAt(stack, player, world, x, y + 1, z, side, hitX, hitY + 1, hitZ, EYEBULBTOP)) return false;
}
return super.placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ, metadata);

View File

@ -17,10 +17,10 @@ import cpw.mods.fml.relauncher.SideOnly;
public class ItemBlockFoliage extends ItemColored
{
private static final String[] foliageTypes = new String[] {"algae", "shortgrass", "mediumgrass", "highgrassbottom", "bush", "sprout", "highgrasstop", "poisonivy", "berrybush", "shrub", "wheatgrass", "dampgrass", "koru", "cloverpatch", "leafpile", "deadleafpile"};
private static final String[] foliageTypes = new String[] {"algae", "shortgrass", "mediumgrass", "hedgebottom", "bush", "sprout", "hedgetop", "poisonivy", "berrybush", "shrub", "wheatgrass", "dampgrass", "koru", "cloverpatch", "leafpile", "deadleafpile"};
@SideOnly(Side.CLIENT)
private IIcon[] textures;
private static final int GRASSTOP = 6;
private static final int HEDGETOP = 6;
public ItemBlockFoliage(Block block)
{
@ -40,7 +40,7 @@ public class ItemBlockFoliage extends ItemColored
textures[i] = iconRegister.registerIcon("biomesoplenty:" + foliageTypes[i]);
}
textures[3] = iconRegister.registerIcon("biomesoplenty:item_highgrass");
textures[3] = iconRegister.registerIcon("biomesoplenty:hedgetop");
textures[8] = iconRegister.registerIcon("biomesoplenty:item_berrybush");
textures[9] = iconRegister.registerIcon("biomesoplenty:item_shrub");
textures[15] = iconRegister.registerIcon("biomesoplenty:deadleafpile");
@ -50,7 +50,7 @@ public class ItemBlockFoliage extends ItemColored
@SideOnly(Side.CLIENT)
public int getColorFromItemStack(ItemStack itemStack, int par2)
{
if (itemStack.getItemDamage() == 3 || itemStack.getItemDamage() == 8 || itemStack.getItemDamage() == 9 || itemStack.getItemDamage() == 15)
if (itemStack.getItemDamage() == 8 || itemStack.getItemDamage() == 9 || itemStack.getItemDamage() == 15)
return 16777215;
else
//TODO: getRenderColor()
@ -77,7 +77,7 @@ public class ItemBlockFoliage extends ItemColored
@Override
public IIcon getIconFromDamage(int meta)
{
if (meta == GRASSTOP) {
if (meta == HEDGETOP) {
meta = 3;
}
@ -130,7 +130,7 @@ public class ItemBlockFoliage extends ItemColored
{
if (metadata == 3)
{
if (!placeBlockAt(stack, player, world, x, y + 1, z, side, hitX, hitY + 1, hitZ, GRASSTOP)) return false;
if (!placeBlockAt(stack, player, world, x, y + 1, z, side, hitX, hitY + 1, hitZ, HEDGETOP)) return false;
}
return super.placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ, metadata);

View File

@ -47,8 +47,8 @@ tile.flowers.anemone.name=White Anemone
tile.flowers.lilyflower.name=Waterlily
tile.flowers.rainbowflower.name=Chromaflora
tile.flowers.bromeliad.name=Bromeliad
tile.flowers.sunflowerbottom.name=Sunflower
tile.flowers.sunflowertop.name=Sunflower
tile.flowers.eyebulbbottom.name=Eyebulb
tile.flowers.eyebulbtop.name=Eyebulb
tile.flowers.dandelion.name=Dandelion Puff
tile.flowers2.hibiscus.name=Pink Hibiscus
@ -67,10 +67,10 @@ tile.stoneFormations.stalactite.name=Stalactite
tile.foliage.algae.name=Algae
tile.foliage.shortgrass.name=Short Grass
tile.foliage.mediumgrass.name=Medium Grass
tile.foliage.highgrassbottom.name=High Grass
tile.foliage.hedgebottom.name=Hedge
tile.foliage.bush.name=Bush
tile.foliage.sprout.name=Sprout
tile.foliage.highgrasstop.name=High Grass
tile.foliage.hedgetop.name=Hedge
tile.foliage.poisonivy.name=Poison Ivy
tile.foliage.berrybush.name=Berry Bush
tile.foliage.shrub.name=Shrub

Binary file not shown.

After

Width:  |  Height:  |  Size: 630 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 584 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 457 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 463 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 368 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 702 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 804 B