References to block IDs in constructors removed, removed old quicksand class, references to the BOP creative tab fixed

This commit is contained in:
Adubbz 2013-12-25 20:31:51 +11:00
parent 0b572d0de7
commit 142155f604
29 changed files with 436 additions and 441 deletions

View file

@ -33,18 +33,15 @@ public class BlockBOPFlower extends BlockFlower
private static final int SUNFLOWERTOP = 14;
private static final int SUNFLOWERBOTTOM = 13;
protected BlockBOPFlower(int blockID, Material material)
protected BlockBOPFlower()
{
super(blockID, material);
super(material);
this.setTickRandomly(true);
float var4 = 0.2F;
this.setBlockBounds(0.5F - var4, 0.0F, 0.5F - var4, 0.5F + var4, var4 * 3.0F, 0.5F + var4);
this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
}
public BlockBOPFlower(int blockID)
{
this(blockID, Material.plants);
//TODO: this.setCreativeTab()
this.func_149647_a(BiomesOPlenty.tabBiomesOPlenty);
}
@Override

View file

@ -44,15 +44,16 @@ public class BlockBOPFoliage extends BlockTallGrass implements IShearable
private static final int ALGAE = 0;
public BlockBOPFoliage(int blockID)
public BlockBOPFoliage()
{
super(blockID);
float f = 0.4F;
setBurnProperties(this.blockID, 60, 100);
setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.8F, 0.5F + f);
setHardness(0.0F);
setStepSound(Block.soundGrassFootstep);
this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
//TODO: this.setCreativeTab()
this.func_149647_a(BiomesOPlenty.tabBiomesOPlenty);
}
@Override

View file

@ -11,6 +11,8 @@ import biomesoplenty.api.Items;
public class BlockBOPGeneric extends Block
{
//TODO: FEATURE KILL THIS AWFUL CLASS
public enum BlockType
{
ASH_STONE, HARD_SAND, HARD_DIRT, HARD_ICE, DRIED_DIRT, CRAG_ROCK, MUD_BRICK, HOLY_DIRT, CRYSTAL;
@ -19,10 +21,11 @@ public class BlockBOPGeneric extends Block
private Icon texture;
private BlockType type;
public BlockBOPGeneric(int id, Material material, BlockType type)
public BlockBOPGeneric(BlockType type)
{
super(id, material);
super(material);
this.type = type;
this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
switch (type)

View file

@ -23,14 +23,16 @@ public class BlockBOPGrass extends Block
{
private Icon[][] blockIcon = new Icon[2][6];
public BlockBOPGrass(int par1)
public BlockBOPGrass()
{
super(par1, Material.grass);
super(Material.grass);
this.setTickRandomly(true);
this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
setStepSound(Block.soundGrassFootstep);
setHardness(0.6F);
//setLightValue(0.25F);
//TODO: this.setCreativeTab()
this.func_149647_a(BiomesOPlenty.tabBiomesOPlenty);
}
@Override

View file

@ -59,15 +59,17 @@ public class BlockBOPLeaves extends BlockLeavesBase implements IShearable
private final LeafCategory category;
int[] adjacentTreeBlocks;
public BlockBOPLeaves(int blockID, LeafCategory cat)
public BlockBOPLeaves(LeafCategory cat)
{
super(blockID, Material.leaves, false);
super(Material.leaves, false);
category = cat;
this.setTickRandomly(true);
setHardness(0.2F);
setLightOpacity(1);
setStepSound(Block.soundGrassFootstep);
this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
//TODO: this.setCreativeTab()
this.func_149647_a(BiomesOPlenty.tabBiomesOPlenty);
}
@Override

View file

@ -4,41 +4,40 @@ import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFlower;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import biomesoplenty.BiomesOPlenty;
import biomesoplenty.api.Blocks;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockBOPMushroom extends BlockFlower
{
private static final String[] plants = new String[] {"toadstool", "portobello", "bluemilk", "glowshroom", "flatmushroom"};
private Icon[] textures;
private IIcon[] textures;
protected BlockBOPMushroom(int blockID, Material material)
protected BlockBOPMushroom()
{
super(blockID, material);
this.setTickRandomly(true);
super(bmaterial);
//TODO: setTickRandomly()
this.func_149675_a(true);
float var4 = 0.2F;
this.setBlockBounds(0.3F, 0.0F, 0.3F, 0.7F, 0.4F, 0.7F);
this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
}
public BlockBOPMushroom(int blockID)
{
this(blockID, Material.plants);
this.setBlockBounds(0.3F, 0.0F, 0.3F, 0.7F, 0.4F, 0.7F);
//TODO: this.setCreativeTab()
this.func_149647_a(BiomesOPlenty.tabBiomesOPlenty);
}
@Override
public void registerIcons(IconRegister iconRegister)
public void registerIcons(IIconRegister iconRegister)
{
textures = new Icon[plants.length];
textures = new IIcon[plants.length];
for (int i = 0; i < plants.length; ++i) {
textures[i] = iconRegister.registerIcon("biomesoplenty:" + plants[i]);
@ -46,9 +45,10 @@ public class BlockBOPMushroom extends BlockFlower
}
@Override
public Icon getIcon(int side, int meta)
public IIcon getIcon(int side, int meta)
{
if (meta < 0 || meta >= textures.length) {
if (meta < 0 || meta >= textures.length)
{
meta = 0;
}
@ -56,7 +56,7 @@ public class BlockBOPMushroom extends BlockFlower
}
@Override
public int getRenderType ()
public int getRenderType()
{
return 1;
}
@ -91,7 +91,8 @@ public class BlockBOPMushroom extends BlockFlower
@Override
@SideOnly(Side.CLIENT)
@SuppressWarnings({ "rawtypes", "unchecked" })
public void getSubBlocks(int blockID, CreativeTabs creativeTabs, List list) {
public void getSubBlocks(int blockID, CreativeTabs creativeTabs, List list)
{
for (int i = 0; i < plants.length; ++i) {
list.add(new ItemStack(blockID, 1, i));
}
@ -124,7 +125,8 @@ public class BlockBOPMushroom extends BlockFlower
int meta = itemStack.getItemDamage();
//boolean sky = world.getFullBlockLightValue(x, y, z) >= 8 || world.canBlockSeeTheSky(x, y, z);
if (itemStack.itemID == blockID) {
if (itemStack.itemID == blockID)
{
switch (meta)
{
case 0: // Toadstool

View file

@ -26,328 +26,330 @@ import cpw.mods.fml.relauncher.SideOnly;
public class BlockBOPPersimmonLeaves extends BlockLeavesBase implements IShearable
{
private Icon[][] textures;
private Icon[] betterTextures;
int[] adjacentTreeBlocks;
private Icon[][] textures;
private Icon[] betterTextures;
int[] adjacentTreeBlocks;
public BlockBOPPersimmonLeaves(int blockID)
{
super(blockID, Material.leaves, false);
setBurnProperties(this.blockID, 30, 60);
this.setTickRandomly(true);
setHardness(0.2F);
setLightOpacity(1);
setStepSound(Block.soundGrassFootstep);
this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
}
public BlockBOPPersimmonLeaves()
{
super(Material.leaves, false);
setBurnProperties(this.blockID, 30, 60);
this.setTickRandomly(true);
setHardness(0.2F);
setLightOpacity(1);
setStepSound(Block.soundGrassFootstep);
@Override
public void registerIcons(IconRegister iconRegister)
{
textures = new Icon[3][4];
if(Loader.isModLoaded("BetterGrassAndLeavesMod"))
for (int i = 0; i < 4; ++i)
{
textures[0][i] = iconRegister.registerIcon("biomesoplenty:leaves_persimmon" + i + "_round");
textures[1][i] = iconRegister.registerIcon("biomesoplenty:leaves_persimmon" + i + "_fast");
textures[2][i] = iconRegister.registerIcon("biomesoplenty:better_leaves_persimmon" + i);
}
else
for (int i = 0; i < 4; ++i)
{
textures[0][i] = iconRegister.registerIcon("biomesoplenty:leaves_persimmon" + i + "_fancy");
textures[1][i] = iconRegister.registerIcon("biomesoplenty:leaves_persimmon" + i + "_fast");
}
}
//TODO: this.setCreativeTab()
this.func_149647_a(BiomesOPlenty.tabBiomesOPlenty);
}
public Icon getIconBetterLeaves(int metadata, float randomIndex)
{
return textures[2][metadata & 3];
}
@Override
public void registerIcons(IconRegister iconRegister)
{
textures = new Icon[3][4];
if(Loader.isModLoaded("BetterGrassAndLeavesMod"))
for (int i = 0; i < 4; ++i)
{
textures[0][i] = iconRegister.registerIcon("biomesoplenty:leaves_persimmon" + i + "_round");
textures[1][i] = iconRegister.registerIcon("biomesoplenty:leaves_persimmon" + i + "_fast");
textures[2][i] = iconRegister.registerIcon("biomesoplenty:better_leaves_persimmon" + i);
}
else
for (int i = 0; i < 4; ++i)
{
textures[0][i] = iconRegister.registerIcon("biomesoplenty:leaves_persimmon" + i + "_fancy");
textures[1][i] = iconRegister.registerIcon("biomesoplenty:leaves_persimmon" + i + "_fast");
}
}
public Icon getIconFallingLeaves(int metadata)
{
return textures[1][metadata & 3];
}
public Icon getIconBetterLeaves(int metadata, float randomIndex)
{
return textures[2][metadata & 3];
}
public Icon getIconFallingLeaves(int metadata)
{
return textures[1][metadata & 3];
}
@Override
public Icon getIcon(int side, int meta)
{
return textures[(!isOpaqueCube() ? 0 : 1)][meta & 3];
}
@Override
public Icon getIcon(int side, int meta)
{
return textures[(!isOpaqueCube() ? 0 : 1)][meta & 3];
}
@Override
public boolean isOpaqueCube()
{
return Block.leaves.isOpaqueCube();
}
@Override
public boolean isOpaqueCube()
{
return Block.leaves.isOpaqueCube();
}
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
public void getSubBlocks(int blockID, CreativeTabs creativeTabs, List list) {
list.add(new ItemStack(blockID, 1, 0));
}
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
public void getSubBlocks(int blockID, CreativeTabs creativeTabs, List list) {
list.add(new ItemStack(blockID, 1, 0));
}
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World world, int x, int y, int z, Random random)
{
if (world.canLightningStrikeAt(x, y + 1, z) && !world.doesBlockHaveSolidTopSurface(x, y - 1, z) && random.nextInt(15) == 1)
{
double d0 = x + random.nextFloat();
double d1 = y - 0.05D;
double d2 = z + random.nextFloat();
world.spawnParticle("dripWater", d0, d1, d2, 0.0D, 0.0D, 0.0D);
}
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World world, int x, int y, int z, Random random)
{
if (world.canLightningStrikeAt(x, y + 1, z) && !world.doesBlockHaveSolidTopSurface(x, y - 1, z) && random.nextInt(15) == 1)
{
double d0 = x + random.nextFloat();
double d1 = y - 0.05D;
double d2 = z + random.nextFloat();
world.spawnParticle("dripWater", d0, d1, d2, 0.0D, 0.0D, 0.0D);
}
super.randomDisplayTick(world, x, y, z, random);
super.randomDisplayTick(world, x, y, z, random);
}
}
@Override
public void breakBlock(World world, int x, int y, int z, int par5, int par6)
{
byte radius = 1;
int bounds = radius + 1;
@Override
public void breakBlock(World world, int x, int y, int z, int par5, int par6)
{
byte radius = 1;
int bounds = radius + 1;
if (world.checkChunksExist(x - bounds, y - bounds, z - bounds, x + bounds, y + bounds, z + bounds)) {
for (int i = -radius; i <= radius; ++i) {
for (int j = -radius; j <= radius; ++j) {
for (int k = -radius; k <= radius; ++k)
{
int blockID = world.getBlockId(x + i, y + j, z + k);
if (world.checkChunksExist(x - bounds, y - bounds, z - bounds, x + bounds, y + bounds, z + bounds)) {
for (int i = -radius; i <= radius; ++i) {
for (int j = -radius; j <= radius; ++j) {
for (int k = -radius; k <= radius; ++k)
{
int blockID = world.getBlockId(x + i, y + j, z + k);
if (Block.blocksList[blockID] != null) {
Block.blocksList[blockID].beginLeavesDecay(world, x + i, y + j, z + k);
}
}
}
}
}
}
if (Block.blocksList[blockID] != null) {
Block.blocksList[blockID].beginLeavesDecay(world, x + i, y + j, z + k);
}
}
}
}
}
}
@Override
public void updateTick(World world, int x, int y, int z, Random random)
{
if (world.isRemote)
return;
@Override
public void updateTick(World world, int x, int y, int z, Random random)
{
if (world.isRemote)
return;
int meta = world.getBlockMetadata(x, y, z);
if (random.nextInt(25) == 0)
if (meta > 0)
if ((meta & 3) < 3) {
world.setBlock(x, y, z, blockID, ++meta, 3);
}
int meta = world.getBlockMetadata(x, y, z);
if (random.nextInt(25) == 0)
if (meta > 0)
if ((meta & 3) < 3) {
world.setBlock(x, y, z, blockID, ++meta, 3);
}
if ((meta & 8) != 0/* && (meta & 4) == 0*/)
{
byte b0 = 4;
int i1 = b0 + 1;
byte b1 = 32;
int j1 = b1 * b1;
int k1 = b1 / 2;
if ((meta & 8) != 0/* && (meta & 4) == 0*/)
{
byte b0 = 4;
int i1 = b0 + 1;
byte b1 = 32;
int j1 = b1 * b1;
int k1 = b1 / 2;
if (adjacentTreeBlocks == null)
{
adjacentTreeBlocks = new int[b1 * b1 * b1];
}
if (adjacentTreeBlocks == null)
{
adjacentTreeBlocks = new int[b1 * b1 * b1];
}
int l1;
int l1;
if (world.checkChunksExist(x - i1, y - i1, z - i1, x + i1, y + i1, z + i1))
{
int i2;
int j2;
int k2;
if (world.checkChunksExist(x - i1, y - i1, z - i1, x + i1, y + i1, z + i1))
{
int i2;
int j2;
int k2;
for (l1 = -b0; l1 <= b0; ++l1)
{
for (i2 = -b0; i2 <= b0; ++i2)
{
for (j2 = -b0; j2 <= b0; ++j2)
{
k2 = world.getBlockId(x + l1, y + i2, z + j2);
for (l1 = -b0; l1 <= b0; ++l1)
{
for (i2 = -b0; i2 <= b0; ++i2)
{
for (j2 = -b0; j2 <= b0; ++j2)
{
k2 = world.getBlockId(x + l1, y + i2, z + j2);
Block block = Block.blocksList[k2];
Block block = Block.blocksList[k2];
if (block != null && block.canSustainLeaves(world, x + l1, y + i2, z + j2))
{
adjacentTreeBlocks[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = 0;
}
else if (block != null && block.isLeaves(world, x + l1, y + i2, z + j2))
{
adjacentTreeBlocks[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = -2;
}
else
{
adjacentTreeBlocks[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = -1;
}
}
}
}
if (block != null && block.canSustainLeaves(world, x + l1, y + i2, z + j2))
{
adjacentTreeBlocks[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = 0;
}
else if (block != null && block.isLeaves(world, x + l1, y + i2, z + j2))
{
adjacentTreeBlocks[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = -2;
}
else
{
adjacentTreeBlocks[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = -1;
}
}
}
}
for (l1 = 1; l1 <= 4; ++l1)
{
for (i2 = -b0; i2 <= b0; ++i2)
{
for (j2 = -b0; j2 <= b0; ++j2)
{
for (k2 = -b0; k2 <= b0; ++k2)
{
if (adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1) * b1 + k2 + k1] == l1 - 1)
{
if (adjacentTreeBlocks[(i2 + k1 - 1) * j1 + (j2 + k1) * b1 + k2 + k1] == -2)
{
adjacentTreeBlocks[(i2 + k1 - 1) * j1 + (j2 + k1) * b1 + k2 + k1] = l1;
}
for (l1 = 1; l1 <= 4; ++l1)
{
for (i2 = -b0; i2 <= b0; ++i2)
{
for (j2 = -b0; j2 <= b0; ++j2)
{
for (k2 = -b0; k2 <= b0; ++k2)
{
if (adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1) * b1 + k2 + k1] == l1 - 1)
{
if (adjacentTreeBlocks[(i2 + k1 - 1) * j1 + (j2 + k1) * b1 + k2 + k1] == -2)
{
adjacentTreeBlocks[(i2 + k1 - 1) * j1 + (j2 + k1) * b1 + k2 + k1] = l1;
}
if (adjacentTreeBlocks[(i2 + k1 + 1) * j1 + (j2 + k1) * b1 + k2 + k1] == -2)
{
adjacentTreeBlocks[(i2 + k1 + 1) * j1 + (j2 + k1) * b1 + k2 + k1] = l1;
}
if (adjacentTreeBlocks[(i2 + k1 + 1) * j1 + (j2 + k1) * b1 + k2 + k1] == -2)
{
adjacentTreeBlocks[(i2 + k1 + 1) * j1 + (j2 + k1) * b1 + k2 + k1] = l1;
}
if (adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1 - 1) * b1 + k2 + k1] == -2)
{
adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1 - 1) * b1 + k2 + k1] = l1;
}
if (adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1 - 1) * b1 + k2 + k1] == -2)
{
adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1 - 1) * b1 + k2 + k1] = l1;
}
if (adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1 + 1) * b1 + k2 + k1] == -2)
{
adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1 + 1) * b1 + k2 + k1] = l1;
}
if (adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1 + 1) * b1 + k2 + k1] == -2)
{
adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1 + 1) * b1 + k2 + k1] = l1;
}
if (adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1) * b1 + (k2 + k1 - 1)] == -2)
{
adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1) * b1 + (k2 + k1 - 1)] = l1;
}
if (adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1) * b1 + (k2 + k1 - 1)] == -2)
{
adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1) * b1 + (k2 + k1 - 1)] = l1;
}
if (adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1) * b1 + k2 + k1 + 1] == -2)
{
adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1) * b1 + k2 + k1 + 1] = l1;
}
}
}
}
}
}
}
if (adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1) * b1 + k2 + k1 + 1] == -2)
{
adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1) * b1 + k2 + k1 + 1] = l1;
}
}
}
}
}
}
}
l1 = adjacentTreeBlocks[k1 * j1 + k1 * b1 + k1];
l1 = adjacentTreeBlocks[k1 * j1 + k1 * b1 + k1];
if (l1 >= 0)
{
world.setBlockMetadataWithNotify(x, y, z, meta & -9, 4);
}
else
{
this.removeLeaves(world, x, y, z);
}
}
}
if (l1 >= 0)
{
world.setBlockMetadataWithNotify(x, y, z, meta & -9, 4);
}
else
{
this.removeLeaves(world, x, y, z);
}
}
}
private void removeLeaves(World world, int x, int y, int z)
{
this.dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
world.setBlockToAir(x, y, z);
}
private void removeLeaves(World world, int x, int y, int z)
{
this.dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
world.setBlockToAir(x, y, z);
}
@Override
public boolean onBlockActivated (World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9)
{
int meta = world.getBlockMetadata(x, y, z);
if ((meta & 3) == 3)
{
world.setBlock(x, y, z, blockID, meta - 3, 3);
EntityItem entityitem = new EntityItem(world, x, y, z, new ItemStack(Items.food.get(), 1, 8));
@Override
public boolean onBlockActivated (World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9)
{
int meta = world.getBlockMetadata(x, y, z);
if ((meta & 3) == 3)
{
world.setBlock(x, y, z, blockID, meta - 3, 3);
EntityItem entityitem = new EntityItem(world, x, y, z, new ItemStack(Items.food.get(), 1, 8));
if (!world.isRemote) {
world.spawnEntityInWorld(entityitem);
if (!(player instanceof FakePlayer))
entityitem.onCollideWithPlayer(player);
}
return true;
}
else
return false;
}
if (!world.isRemote) {
world.spawnEntityInWorld(entityitem);
if (!(player instanceof FakePlayer))
entityitem.onCollideWithPlayer(player);
}
return true;
}
else
return false;
}
@Override
public int idDropped(int par1, Random par2Random, int par3)
{
return Blocks.saplings.get().blockID;
}
@Override
public int idDropped(int par1, Random par2Random, int par3)
{
return Blocks.saplings.get().blockID;
}
@Override
public int damageDropped(int meta)
{
return 15;
}
@Override
public int damageDropped(int meta)
{
return 15;
}
@Override
public int quantityDropped(Random random)
{
return random.nextInt(20) == 0 ? 1 : 0;
}
@Override
public int quantityDropped(Random random)
{
return random.nextInt(20) == 0 ? 1 : 0;
}
@Override
public void dropBlockAsItemWithChance(World world, int x, int y, int z, int meta, float chance, int par7)
{
if (world.isRemote)
return;
@Override
public void dropBlockAsItemWithChance(World world, int x, int y, int z, int meta, float chance, int par7)
{
if (world.isRemote)
return;
if (world.rand.nextInt(20) == 0)
{
int var9 = this.idDropped(meta, world.rand, par7);
this.dropBlockAsItem_do(world, x, y, z, new ItemStack(var9, 1, this.damageDropped(meta)));
}
if (world.rand.nextInt(20) == 0)
{
int var9 = this.idDropped(meta, world.rand, par7);
this.dropBlockAsItem_do(world, x, y, z, new ItemStack(var9, 1, this.damageDropped(meta)));
}
if ((meta & 3) == 3) {
this.dropBlockAsItem_do(world, x, y, z, new ItemStack(Items.food.get(), 1, 8));
} else if ((meta & 3) == 2 && world.rand.nextInt(8) == 0) {
this.dropBlockAsItem_do(world, x, y, z, new ItemStack(Items.food.get(), 1, 8));
} else if ((meta & 3) == 1 && world.rand.nextInt(16) == 0) {
this.dropBlockAsItem_do(world, x, y, z, new ItemStack(Items.food.get(), 1, 8));
} else if ((meta & 3) == 0 && world.rand.nextInt(32) == 0) {
this.dropBlockAsItem_do(world, x, y, z, new ItemStack(Items.food.get(), 1, 8));
}
}
if ((meta & 3) == 3) {
this.dropBlockAsItem_do(world, x, y, z, new ItemStack(Items.food.get(), 1, 8));
} else if ((meta & 3) == 2 && world.rand.nextInt(8) == 0) {
this.dropBlockAsItem_do(world, x, y, z, new ItemStack(Items.food.get(), 1, 8));
} else if ((meta & 3) == 1 && world.rand.nextInt(16) == 0) {
this.dropBlockAsItem_do(world, x, y, z, new ItemStack(Items.food.get(), 1, 8));
} else if ((meta & 3) == 0 && world.rand.nextInt(32) == 0) {
this.dropBlockAsItem_do(world, x, y, z, new ItemStack(Items.food.get(), 1, 8));
}
}
@Override
public boolean isShearable(ItemStack item, World world, int x, int y, int z)
{
return true;
}
@Override
public boolean isShearable(ItemStack item, World world, int x, int y, int z)
{
return true;
}
@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, 0));
return ret;
}
@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, 0));
return ret;
}
@SideOnly(Side.CLIENT)
public void setGraphicsLevel(boolean par1)
{
graphicsLevel = par1;
}
@SideOnly(Side.CLIENT)
public void setGraphicsLevel(boolean par1)
{
graphicsLevel = par1;
}
@Override
public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
{
return true;
}
@Override
public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
{
return true;
}
@Override
public void beginLeavesDecay(World world, int x, int y, int z)
{
world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z) | 8, 4);
}
@Override
public void beginLeavesDecay(World world, int x, int y, int z)
{
world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z) | 8, 4);
}
@Override
public boolean isLeaves(World world, int x, int y, int z)
{
return true;
}
@Override
public boolean isLeaves(World world, int x, int y, int z)
{
return true;
}
}

View file

@ -20,15 +20,17 @@ public class BlockBOPPetals extends BlockLeavesBase implements IShearable
private static final String[] petals = new String[] {"bigflowerred", "bigfloweryellow"};
private Icon[][] textures;
public BlockBOPPetals(int blockID)
public BlockBOPPetals()
{
super(blockID, Material.leaves, false);
super(Material.leaves, false);
setBurnProperties(this.blockID, 30, 60);
this.setTickRandomly(true);
setHardness(0.2F);
setLightOpacity(1);
setStepSound(Block.soundGrassFootstep);
this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
//TODO: this.setCreativeTab()
this.func_149647_a(BiomesOPlenty.tabBiomesOPlenty);
}
@Override

View file

@ -15,12 +15,14 @@ public class BlockBOPPlank extends Block
private static final String[] woodTypes = new String[] {"plank_acacia", "plank_cherry", "plank_dark", "plank_fir", "plank_holy", "plank_magic", "plank_mangrove", "plank_palm", "plank_redwood", "plank_willow", "bamboothatching", "plank_pine", "plank_hell_bark", "plank_jacaranda"};
private Icon[] textures;
public BlockBOPPlank(int blockID)
public BlockBOPPlank()
{
super(blockID, Material.wood);
super(Material.wood);
setBurnProperties(this.blockID, 5, 20);
setHardness(2.0F);
this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
//TODO: this.setCreativeTab()
this.func_149647_a(BiomesOPlenty.tabBiomesOPlenty);
}
@Override

View file

@ -38,16 +38,18 @@ public class BlockBOPPlant extends BlockFlower implements IShearable
private static final int CATTAILTOP = 9;
private static final int CATTAILBOTTOM = 10;
public BlockBOPPlant(int par1)
public BlockBOPPlant()
{
super(par1, Material.vine);
super(Material.vine);
setTickRandomly(true);
float var3 = 0.4F;
setBurnProperties(blockID, 60, 100);
setHardness(0.0F);
setStepSound(Block.soundGrassFootstep);
setBlockBounds(0.5F - var3, 0.0F, 0.5F - var3, 0.5F + var3, 0.8F, 0.5F + var3);
setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
//TODO: this.setCreativeTab()
this.func_149647_a(BiomesOPlenty.tabBiomesOPlenty);
}
@Override

View file

@ -17,11 +17,13 @@ public class BlockBOPRedRock extends Block
private static final String[] types = new String[] {"redrock", "redcobble", "redbrick"};
private Icon[] textures = {null, null, null};
public BlockBOPRedRock(int par1)
public BlockBOPRedRock()
{
super(par1, Material.rock);
this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
super(Material.rock);
setStepSound(Block.soundStoneFootstep);
//TODO: this.setCreativeTab()
this.func_149647_a(BiomesOPlenty.tabBiomesOPlenty);
}
@Override

View file

@ -39,12 +39,13 @@ public class BlockBOPSapling extends BlockSapling
private Icon[] textures;
private static final int TYPES = 15;
public BlockBOPSapling(int par1)
public BlockBOPSapling()
{
super(par1);
setHardness(0.0F);
setStepSound(Block.soundGrassFootstep);
this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
//TODO: this.setCreativeTab()
this.func_149647_a(BiomesOPlenty.tabBiomesOPlenty);
}
@Override

View file

@ -17,11 +17,13 @@ public class BlockBOPSkystone extends Block
private static final String[] types = new String[] {"holystone", "holycobble", "holybrick", "holystonemossy"};
private Icon[] textures = {null, null, null};
public BlockBOPSkystone(int par1)
public BlockBOPSkystone()
{
super(par1, Material.rock);
this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
super(Material.rock);
setStepSound(Block.soundStoneFootstep);
//TODO: this.setCreativeTab()
this.func_149647_a(BiomesOPlenty.tabBiomesOPlenty);
}
@Override

View file

@ -3,17 +3,16 @@ package biomesoplenty.common.blocks;
import java.util.List;
import java.util.Random;
import javax.swing.Icon;
import net.minecraft.block.Block;
import net.minecraft.block.BlockHalfSlab;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.world.World;
import biomesoplenty.BiomesOPlenty;
import biomesoplenty.api.Blocks;
public class BlockBOPSlab extends BlockHalfSlab
{
@ -28,9 +27,9 @@ public class BlockBOPSlab extends BlockHalfSlab
private final SlabCategory category;
public BlockBOPSlab(int par1, boolean par2, Material material, SlabCategory cat)
public BlockBOPSlab(boolean par2, Material material, SlabCategory cat)
{
super(par1, par2, material);
super(par2, material);
isDoubleSlab = par2;
category = cat;
if (material == Material.wood)
@ -44,8 +43,10 @@ public class BlockBOPSlab extends BlockHalfSlab
setStepSound(Block.soundStoneFootstep);
}
if (!par2) {
this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
if (!par2)
{
//TODO: this.setCreativeTab()
this.func_149647_a(BiomesOPlenty.tabBiomesOPlenty);
}
useNeighborBrightness[blockID] = true;

View file

@ -31,15 +31,17 @@ public class BlockBOPStairs extends BlockStairs
private final Category category;
public BlockBOPStairs(int blockID, Block model, Category cat)
public BlockBOPStairs(Block model, Category cat)
{
super(blockID, model, 0);
super(model, 0);
category = cat;
setBurnProperties(this.blockID, 5, 20);
this.setLightOpacity(0);
this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
this.setHardness(model.blockHardness);
this.setResistance(model.blockResistance / 3.0F);
//TODO: this.setCreativeTab()
this.func_149647_a(BiomesOPlenty.tabBiomesOPlenty);
}
@Override

View file

@ -22,7 +22,7 @@ public class BlockBamboo extends Block
{
super(Material.plants);
setBurnProperties(blockID, 5, 5);
this.setBurnProperties(this, 5, 5);
this.setTickRandomly(true);
//TODO: this.setCreativeTab()
@ -30,23 +30,23 @@ public class BlockBamboo extends Block
}
@Override
public void registerIcons(IconRegister iconRegister)
public void registerIcons(IIconRegister iconRegister)
{
blockIcon = iconRegister.registerIcon("biomesoplenty:bamboo");
bambooSide = iconRegister.registerIcon("biomesoplenty:bamboo");
bambooTop = iconRegister.registerIcon("biomesoplenty:bambootop");
}
@Override
public Icon getIcon(int side, int meta)
public IIcon getIcon(int side, int meta)
{
if (side > 1)
return blockIcon;
return bambooSide;
else
return bambooTop;
}
@Override
public void updateTick(World world, int x, int y, int z, Random par5Random)
public void updateTick(World world, int x, int y, int z, Random random)
{
if (world.isAirBlock(x, y + 1, z))
{

View file

@ -21,8 +21,10 @@ public class BlockFlesh extends Block
{
public BlockFlesh(int par1)
{
super(par1, Material.sponge);
this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
super(Material.sponge);
//TODO: this.setCreativeTab()
this.func_149647_a(BiomesOPlenty.tabBiomesOPlenty);
}
@Override

View file

@ -4,22 +4,22 @@ import java.util.ArrayList;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import biomesoplenty.BiomesOPlenty;
import biomesoplenty.api.Blocks;
import biomesoplenty.blocks.renderers.RenderUtils;
public class BlockGrave extends Block
{
public BlockGrave(int id)
public BlockGrave()
{
super(id, Material.rock);
super(Material.rock);
setHardness(5f);
setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
//TODO: this.setCreativeTab()
this.func_149647_a(BiomesOPlenty.tabBiomesOPlenty);
}
@Override

View file

@ -21,10 +21,12 @@ public class BlockHive extends Block
private static final String[] hiveTypes = new String[] {"honeycomb", "hive", "honeycombempty", "honeycombfilled"};
private Icon[] textures;
public BlockHive(int par1)
public BlockHive()
{
super(par1, Material.wood);
this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
super(Material.wood);
//TODO: this.setCreativeTab()
this.func_149647_a(BiomesOPlenty.tabBiomesOPlenty);
}
@Override

View file

@ -14,10 +14,12 @@ import cpw.mods.fml.relauncher.SideOnly;
public class BlockHoney extends Block
{
public BlockHoney(int par1)
public BlockHoney()
{
super(par1, Material.glass);
this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
super(Material.glass);
//TODO: this.setCreativeTab()
this.func_149647_a(BiomesOPlenty.tabBiomesOPlenty);
}
@Override

View file

@ -19,11 +19,13 @@ import biomesoplenty.BiomesOPlenty;
public class BlockIvy extends Block implements IShearable
{
public BlockIvy(int par1)
public BlockIvy()
{
super(par1, Material.vine);
super(Material.vine);
this.setTickRandomly(true);
this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
//TODO: this.setCreativeTab()
this.func_149647_a(BiomesOPlenty.tabBiomesOPlenty);
}
@Override

View file

@ -17,11 +17,13 @@ public class BlockLongGrass extends Block
{
private Icon[] blockIcon = new Icon[6];
public BlockLongGrass(int par1)
public BlockLongGrass()
{
super(par1, Material.grass);
super(Material.grass);
this.setTickRandomly(true);
this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
//TODO: this.setCreativeTab()
this.func_149647_a(BiomesOPlenty.tabBiomesOPlenty);
}
@Override

View file

@ -15,12 +15,14 @@ import biomesoplenty.api.Blocks;
public class BlockMoss extends Block
{
public BlockMoss(int par1)
public BlockMoss()
{
super(par1, Material.vine);
super(Material.vine);
setBurnProperties(blockID, 15, 100);
this.setTickRandomly(true);
this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
//TODO: this.setCreativeTab()
this.func_149647_a(BiomesOPlenty.tabBiomesOPlenty);
}
@Override

View file

@ -17,11 +17,13 @@ public class BlockOriginGrass extends Block
{
private Icon[] blockIcon = new Icon[6];
public BlockOriginGrass(int par1)
public BlockOriginGrass()
{
super(par1, Material.grass);
super(Material.grass);
this.setTickRandomly(true);
this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
//TODO: this.setCreativeTab()
this.func_149647_a(BiomesOPlenty.tabBiomesOPlenty);
}
@Override

View file

@ -17,11 +17,13 @@ public class BlockOvergrownNetherrack extends Block
{
private Icon[] blockIcon = new Icon[6];
public BlockOvergrownNetherrack(int par1)
public BlockOvergrownNetherrack()
{
super(par1, Material.rock);
super(Material.rock);
this.setTickRandomly(true);
this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
//TODO: this.setCreativeTab()
this.func_149647_a(BiomesOPlenty.tabBiomesOPlenty);
}
@Override

View file

@ -1,50 +0,0 @@
package biomesoplenty.common.blocks;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import biomesoplenty.BiomesOPlenty;
public class BlockQuicksand extends Block
{
public BlockQuicksand(int par1)
{
super(par1, Material.sand);
this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
}
@Override
public void registerIcons(IconRegister par1IconRegister)
{
blockIcon = par1IconRegister.registerIcon("biomesoplenty:quicksand");
}
@Override
public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
{
return true;
}
/**
* Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity
*/
@Override
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity)
{
par5Entity.setInWeb();
}
/**
* Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been
* cleared to be reused)
*/
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
{
return null;
}
}

View file

@ -26,13 +26,15 @@ public class BlockStoneFormations extends BlockFlower
private static final String[] forms = new String[] {"stalagmite", "stalactite"};
private Icon[] textures;
protected BlockStoneFormations(int blockID, Material material)
protected BlockStoneFormations(Material material)
{
super(blockID, material);
super(material);
this.setTickRandomly(true);
float var4 = 0.2F;
this.setBlockBounds(0.5F - var4, 0.0F, 0.5F - var4, 0.5F + var4, var4 * 3.0F, 0.5F + var4);
this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
//TODO: this.setCreativeTab()
this.func_149647_a(BiomesOPlenty.tabBiomesOPlenty);
}
public BlockStoneFormations(int blockID)

View file

@ -17,12 +17,14 @@ import biomesoplenty.BiomesOPlenty;
public class BlockTreeMoss extends Block implements IShearable
{
public BlockTreeMoss(int par1)
public BlockTreeMoss()
{
super(par1, Material.vine);
this.setTickRandomly(true);
setBurnProperties(blockID, 15, 100);
this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
//TODO: this.setCreativeTab()
this.func_149647_a(BiomesOPlenty.tabBiomesOPlenty);
}
@Override

View file

@ -18,12 +18,14 @@ import biomesoplenty.BiomesOPlenty;
public class BlockWillow extends Block implements IShearable
{
public BlockWillow(int par1)
public BlockWillow()
{
super(par1, Material.vine);
setBurnProperties(blockID, 15, 100);
this.setTickRandomly(true);
this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
//TODO: this.setCreativeTab()
this.func_149647_a(BiomesOPlenty.tabBiomesOPlenty);
}
@Override