Added Antiwart

This commit is contained in:
Matt Caughey 2013-09-06 19:27:44 -04:00
parent 61a9b97667
commit b843eeb1d2
9 changed files with 52 additions and 5 deletions

View file

@ -35,6 +35,7 @@
<entry key="tile.bop.plants.cattailbottom.name">Cattail</entry> <entry key="tile.bop.plants.cattailbottom.name">Cattail</entry>
<entry key="tile.bop.plants.reed.name">Reed</entry> <entry key="tile.bop.plants.reed.name">Reed</entry>
<entry key="tile.bop.plants.cactus.name">Tiny Cactus</entry> <entry key="tile.bop.plants.cactus.name">Tiny Cactus</entry>
<entry key="tile.bop.plants.antiwart.name">Antiwart</entry>
<entry key="tile.bop.flowers.clover.name">Clover</entry> <entry key="tile.bop.flowers.clover.name">Clover</entry>
<entry key="tile.bop.flowers.swampflower.name">Swampflower</entry> <entry key="tile.bop.flowers.swampflower.name">Swampflower</entry>

Binary file not shown.

After

Width:  |  Height:  |  Size: 400 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 311 B

View file

@ -156,6 +156,7 @@ public class BlockReferences {
cattail (Blocks.plants, 7), cattail (Blocks.plants, 7),
reed (Blocks.plants, 8), reed (Blocks.plants, 8),
tinyCactus (Blocks.plants, 12), tinyCactus (Blocks.plants, 12),
antiwart (Blocks.plants, 13),
treeMoss (Blocks.treeMoss, 0), treeMoss (Blocks.treeMoss, 0),
moss (Blocks.moss, 0), moss (Blocks.moss, 0),

View file

@ -26,7 +26,7 @@ public class BiomeGenNetherGarden extends BiomeGenBase
customBiomeDecorator.netherVinesPerChunk = 60; customBiomeDecorator.netherVinesPerChunk = 60;
customBiomeDecorator.mushroomsPerChunk = 30; customBiomeDecorator.mushroomsPerChunk = 30;
customBiomeDecorator.bigMushroomsPerChunk = 30; customBiomeDecorator.bigMushroomsPerChunk = 30;
customBiomeDecorator.netherWartPerChunk = 3; customBiomeDecorator.netherWartPerChunk = 8;
customBiomeDecorator.netherGrassPerChunk = 10; customBiomeDecorator.netherGrassPerChunk = 10;
customBiomeDecorator.glowshroomsPerChunk = 3; customBiomeDecorator.glowshroomsPerChunk = 3;
customBiomeDecorator.toadstoolsPerChunk = 5; customBiomeDecorator.toadstoolsPerChunk = 5;

View file

@ -10,7 +10,10 @@ import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemPickaxe;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.util.Icon; import net.minecraft.util.Icon;
@ -24,7 +27,7 @@ import biomesoplenty.blocks.renderers.RenderUtils;
public class BlockBOPPlant extends BlockFlower implements IShearable public class BlockBOPPlant extends BlockFlower implements IShearable
{ {
private static final String[] plants = new String[] {"deadgrass", "desertgrass", "desertsprouts", "dunegrass", "holytallgrass", "thorn", "barley", "cattail", "reed", "cattailtop", "cattailbottom", "wildcarrot", "cactus"}; private static final String[] plants = new String[] {"deadgrass", "desertgrass", "desertsprouts", "dunegrass", "holytallgrass", "thorn", "barley", "cattail", "reed", "cattailtop", "cattailbottom", "wildcarrot", "cactus", "antiwart"};
private Icon[] textures; private Icon[] textures;
private static final int CATTAILTOP = 9; private static final int CATTAILTOP = 9;
@ -122,6 +125,8 @@ public class BlockBOPPlant extends BlockFlower implements IShearable
return blockID == this.blockID; return blockID == this.blockID;
else if (metadata == 12) else if (metadata == 12)
return blockID == Block.sand.blockID || blockID == Blocks.redRock.get().blockID || blockID == Block.slowSand.blockID; return blockID == Block.sand.blockID || blockID == Blocks.redRock.get().blockID || blockID == Block.slowSand.blockID;
else if (metadata == 13)
return blockID == Block.slowSand.blockID;
else else
return blockID == Block.grass.blockID || blockID == Block.dirt.blockID || blockID == Block.tilledField.blockID || blockID == Blocks.longGrass.get().blockID; return blockID == Block.grass.blockID || blockID == Block.dirt.blockID || blockID == Block.tilledField.blockID || blockID == Blocks.longGrass.get().blockID;
} }
@ -173,6 +178,9 @@ public class BlockBOPPlant extends BlockFlower implements IShearable
case 12: // Tiny Cactus case 12: // Tiny Cactus
return id == Block.sand.blockID || id == Blocks.redRock.get().blockID || id == Block.slowSand.blockID; return id == Block.sand.blockID || id == Blocks.redRock.get().blockID || id == Block.slowSand.blockID;
case 13: // Antiwart
return id == Block.slowSand.blockID;
default: default:
return id == Block.grass.blockID || id == Block.dirt.blockID || id == Block.tilledField.blockID; return id == Block.grass.blockID || id == Block.dirt.blockID || id == Block.tilledField.blockID;
} }
@ -321,6 +329,8 @@ public class BlockBOPPlant extends BlockFlower implements IShearable
return 1; return 1;
else if (meta == 11) else if (meta == 11)
return random.nextInt(7) == 0 ? 2 : 1; return random.nextInt(7) == 0 ? 2 : 1;
else if (meta == 13)
return 1;
else else
return 0; return 0;
} }
@ -329,6 +339,14 @@ public class BlockBOPPlant extends BlockFlower implements IShearable
public void harvestBlock(World world, EntityPlayer player, int x, int y, int z, int meta) public void harvestBlock(World world, EntityPlayer player, int x, int y, int z, int meta)
{ {
super.harvestBlock(world, player, x, y, z, meta); super.harvestBlock(world, player, x, y, z, meta);
if (meta == 13)
{
for (int i = 0; i < 10; i++)
{
world.spawnParticle("smoke", x + 0.5, y + 0.5F, z + 0.5, 0.0D, 0.0D, 0.0D);
}
}
} }
@Override @Override

View file

@ -39,6 +39,8 @@ public class PlantsRenderer implements ISimpleBlockRenderingHandler
return renderer.renderBlockCrops(block, x, y, z); return renderer.renderBlockCrops(block, x, y, z);
if (meta == 12) if (meta == 12)
return renderer.renderCrossedSquares(block, x, y, z); return renderer.renderCrossedSquares(block, x, y, z);
if (meta == 13)
return renderer.renderBlockCrops(block, x, y, z);
} }
return true; return true;
} }

View file

@ -13,7 +13,7 @@ import cpw.mods.fml.relauncher.SideOnly;
public class ItemBlockPlant extends ItemBlock public class ItemBlockPlant extends ItemBlock
{ {
private static final String[] plants = new String[] {"deadgrass", "desertgrass", "desertsprouts", "dunegrass", "holytallgrass", "thorn", "barley", "cattail", "reed", "cattailtop", "cattailbottom", "wildcarrot", "cactus"}; private static final String[] plants = new String[] {"deadgrass", "desertgrass", "desertsprouts", "dunegrass", "holytallgrass", "thorn", "barley", "cattail", "reed", "cattailtop", "cattailbottom", "wildcarrot", "cactus", "antiwart"};
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
private Icon[] textures; private Icon[] textures;
@ -34,11 +34,12 @@ public class ItemBlockPlant extends ItemBlock
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister) public void registerIcons(IconRegister iconRegister)
{ {
textures = new Icon[3]; textures = new Icon[4];
textures[0] = iconRegister.registerIcon("biomesoplenty:item_barley"); textures[0] = iconRegister.registerIcon("biomesoplenty:item_barley");
textures[1] = iconRegister.registerIcon("biomesoplenty:item_cattail"); textures[1] = iconRegister.registerIcon("biomesoplenty:item_cattail");
textures[2] = iconRegister.registerIcon("biomesoplenty:item_reed"); textures[2] = iconRegister.registerIcon("biomesoplenty:item_reed");
textures[3] = iconRegister.registerIcon("biomesoplenty:item_antiwart");
} }
@Override @Override
@ -61,6 +62,8 @@ public class ItemBlockPlant extends ItemBlock
return textures[1]; return textures[1];
else if (meta == 8) else if (meta == 8)
return textures[2]; return textures[2];
else if (meta == 13)
return textures[3];
else else
return Block.blocksList[itemID].getIcon(0, meta); return Block.blocksList[itemID].getIcon(0, meta);
} }

View file

@ -5,6 +5,7 @@ import java.util.Random;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenerator; import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.Blocks;
public class WorldGenNetherWart extends WorldGenerator public class WorldGenNetherWart extends WorldGenerator
{ {
@ -33,11 +34,32 @@ public class WorldGenNetherWart extends WorldGenerator
int var8 = par3 + par2Random.nextInt(8) - par2Random.nextInt(8); int var8 = par3 + par2Random.nextInt(8) - par2Random.nextInt(8);
int var9 = par4 + par2Random.nextInt(4) - par2Random.nextInt(4); int var9 = par4 + par2Random.nextInt(4) - par2Random.nextInt(4);
int var10 = par5 + par2Random.nextInt(8) - par2Random.nextInt(8); int var10 = par5 + par2Random.nextInt(8) - par2Random.nextInt(8);
int var999 = par2Random.nextInt(12);
if (par1World.isAirBlock(var8, var9, var10) && par1World.getBlockId(var8, var9 - 1, var10) == Block.netherrack.blockID) if (par1World.isAirBlock(var8, var9, var10) && par1World.getBlockId(var8, var9 - 1, var10) == Block.netherrack.blockID)
{ {
par1World.setBlock(var8, var9 - 1, var10, Block.slowSand.blockID, 0, 2); par1World.setBlock(var8, var9 - 1, var10, Block.slowSand.blockID, 0, 2);
par1World.setBlock(var8, var9, var10, Block.netherStalk.blockID, 0, 2);
if (var999 == 0 || var999 == 1)
{
par1World.setBlock(var8, var9, var10, Block.netherStalk.blockID, 0, 2);
}
else if (var999 == 2)
{
par1World.setBlock(var8, var9, var10, Block.netherStalk.blockID, 1, 2);
}
else if (var999 == 3)
{
par1World.setBlock(var8, var9, var10, Block.netherStalk.blockID, 2, 2);
}
else if (var999 == 4 || var999 == 5)
{
par1World.setBlock(var8, var9, var10, Block.netherStalk.blockID, 3, 2);
}
else
{
par1World.setBlock(var8, var9, var10, Blocks.plants.get().blockID, 13, 2);
}
} }
} }