Rough update to Forge 656, only thing that needs work is crashes due to block textures

This commit is contained in:
Adubbz 2013-04-17 09:34:18 +10:00
parent b4200c9a4d
commit 5d568b5a83
53 changed files with 702 additions and 700 deletions

View file

@ -28,12 +28,12 @@ public class ArmorAmethyst extends ItemArmor implements IArmorTextureProvider
return null; return null;
} }
public void updateIcons(IconRegister iconRegister) public void registerIcons(IconRegister iconRegister)
{ {
if(textureID==0){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:amethysthelmet"); } if(textureID==0){ itemIcon = iconRegister.registerIcon("BiomesOPlenty:amethysthelmet"); }
else if(textureID==1){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:amethystchestplate"); } else if(textureID==1){ itemIcon = iconRegister.registerIcon("BiomesOPlenty:amethystchestplate"); }
else if(textureID==2){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:amethystleggings"); } else if(textureID==2){ itemIcon = iconRegister.registerIcon("BiomesOPlenty:amethystleggings"); }
else if(textureID==3){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:amethystboots"); } else if(textureID==3){ itemIcon = iconRegister.registerIcon("BiomesOPlenty:amethystboots"); }
else { iconIndex = iconRegister.registerIcon("BiomesOPlenty:mudball"); } else { itemIcon = iconRegister.registerIcon("BiomesOPlenty:mudball"); }
} }
} }

View file

@ -28,12 +28,12 @@ public class ArmorMuddy extends ItemArmor implements IArmorTextureProvider
return null; return null;
} }
public void updateIcons(IconRegister iconRegister) public void registerIcons(IconRegister iconRegister)
{ {
if(textureID==0){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:mudhelmet"); } if(textureID==0){ itemIcon = iconRegister.registerIcon("BiomesOPlenty:mudhelmet"); }
else if(textureID==1){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:mudchestplate"); } else if(textureID==1){ itemIcon = iconRegister.registerIcon("BiomesOPlenty:mudchestplate"); }
else if(textureID==2){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:mudleggings"); } else if(textureID==2){ itemIcon = iconRegister.registerIcon("BiomesOPlenty:mudleggings"); }
else if(textureID==3){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:mudboots"); } else if(textureID==3){ itemIcon = iconRegister.registerIcon("BiomesOPlenty:mudboots"); }
else { iconIndex = iconRegister.registerIcon("BiomesOPlenty:mudball"); } else { itemIcon = iconRegister.registerIcon("BiomesOPlenty:mudball"); }
} }
} }

View file

@ -48,8 +48,9 @@ public class BlockAcaciaLeaves extends BlockLeavesBase implements IShearable
this.blockIcon[1] = par1IconRegister.registerIcon("BiomesOPlenty:acacialeaves2"); this.blockIcon[1] = par1IconRegister.registerIcon("BiomesOPlenty:acacialeaves2");
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public Icon getBlockTextureFromSideAndMetadata(int par1, int par2) public Icon getIcon(int par1, int par2)
{ {
return blockIcon[(!isOpaqueCube() ? 0 : 1)]; return blockIcon[(!isOpaqueCube() ? 0 : 1)];
} }

View file

@ -91,7 +91,7 @@ public class BlockBOPColorizedLeaves extends BlockLeavesBase implements IShearab
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public Icon getBlockTextureFromSideAndMetadata(int side, int meta) public Icon getIcon(int side, int meta)
{ {
if (meta < 0 || meta >= textures[0].length) if (meta < 0 || meta >= textures[0].length)
meta = 0; meta = 0;

View file

@ -1,139 +1,139 @@
package biomesoplenty.blocks; package biomesoplenty.blocks;
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Random;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockSapling; import net.minecraft.block.BlockSapling;
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.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon; import net.minecraft.util.Icon;
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.mod_BiomesOPlenty; import biomesoplenty.mod_BiomesOPlenty;
import biomesoplenty.worldgen.WorldGenAcacia; import biomesoplenty.worldgen.WorldGenAcacia;
import biomesoplenty.worldgen.WorldGenAutumn; import biomesoplenty.worldgen.WorldGenAutumn;
import biomesoplenty.worldgen.WorldGenAutumn2; import biomesoplenty.worldgen.WorldGenAutumn2;
import biomesoplenty.worldgen.WorldGenBambooTree; import biomesoplenty.worldgen.WorldGenBambooTree;
import biomesoplenty.worldgen.WorldGenBambooTree2; import biomesoplenty.worldgen.WorldGenBambooTree2;
import biomesoplenty.worldgen.WorldGenCherry1; import biomesoplenty.worldgen.WorldGenCherry1;
import biomesoplenty.worldgen.WorldGenCherry2; import biomesoplenty.worldgen.WorldGenCherry2;
import biomesoplenty.worldgen.WorldGenDeadTree2; import biomesoplenty.worldgen.WorldGenDeadTree2;
import biomesoplenty.worldgen.WorldGenMangrove; import biomesoplenty.worldgen.WorldGenMangrove;
import biomesoplenty.worldgen.WorldGenMaple; import biomesoplenty.worldgen.WorldGenMaple;
import biomesoplenty.worldgen.WorldGenMystic2; import biomesoplenty.worldgen.WorldGenMystic2;
import biomesoplenty.worldgen.WorldGenOminous1; import biomesoplenty.worldgen.WorldGenOminous1;
import biomesoplenty.worldgen.WorldGenOminous2; import biomesoplenty.worldgen.WorldGenOminous2;
import biomesoplenty.worldgen.WorldGenOriginTree; import biomesoplenty.worldgen.WorldGenOriginTree;
import biomesoplenty.worldgen.WorldGenPalmTree1; import biomesoplenty.worldgen.WorldGenPalmTree1;
import biomesoplenty.worldgen.WorldGenPalmTree3; import biomesoplenty.worldgen.WorldGenPalmTree3;
import biomesoplenty.worldgen.WorldGenPromisedTree; import biomesoplenty.worldgen.WorldGenPromisedTree;
import biomesoplenty.worldgen.WorldGenRedwoodTree2; import biomesoplenty.worldgen.WorldGenRedwoodTree2;
import biomesoplenty.worldgen.WorldGenTaiga9; import biomesoplenty.worldgen.WorldGenTaiga9;
import biomesoplenty.worldgen.WorldGenWillow; import biomesoplenty.worldgen.WorldGenWillow;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
public class BlockBOPColorizedSapling extends BlockSapling public class BlockBOPColorizedSapling extends BlockSapling
{ {
private static final String[] saplings = new String[] {"acacia", "mangrove", "palm", "redwood", "willow"}; private static final String[] saplings = new String[] {"acacia", "mangrove", "palm", "redwood", "willow"};
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
private Icon[] textures; private Icon[] textures;
private static final int TYPES = 15; private static final int TYPES = 15;
public BlockBOPColorizedSapling(int par1) public BlockBOPColorizedSapling(int par1)
{ {
super(par1); super(par1);
setHardness(0.0F); setHardness(0.0F);
setStepSound(Block.soundGrassFootstep); setStepSound(Block.soundGrassFootstep);
this.setCreativeTab(mod_BiomesOPlenty.tabBiomesOPlenty); this.setCreativeTab(mod_BiomesOPlenty.tabBiomesOPlenty);
} }
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister) public void registerIcons(IconRegister iconRegister)
{ {
textures = new Icon[saplings.length]; textures = new Icon[saplings.length];
for (int i = 0; i < saplings.length; ++i) for (int i = 0; i < saplings.length; ++i)
textures[i] = iconRegister.registerIcon("BiomesOPlenty:" + saplings[i] + "sapling"); textures[i] = iconRegister.registerIcon("BiomesOPlenty:" + saplings[i] + "sapling");
} }
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public Icon getBlockTextureFromSideAndMetadata(int side, int meta) public Icon getIcon(int side, int meta)
{ {
if (meta < 0 || meta >= saplings.length) if (meta < 0 || meta >= saplings.length)
meta = 0; meta = 0;
return textures[meta]; return textures[meta];
} }
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void getSubBlocks(int blockID, CreativeTabs creativeTabs, List list) { public void getSubBlocks(int blockID, CreativeTabs creativeTabs, List list) {
for (int i = 0; i < saplings.length; ++i) for (int i = 0; i < saplings.length; ++i)
list.add(new ItemStack(blockID, 1, i)); list.add(new ItemStack(blockID, 1, i));
} }
@Override @Override
public void growTree(World world, int x, int y, int z, Random random) public void growTree(World world, int x, int y, int z, Random random)
{ {
int meta = world.getBlockMetadata(x, y, z) & TYPES; int meta = world.getBlockMetadata(x, y, z) & TYPES;
Object obj = null; Object obj = null;
int rnd = random.nextInt(8); int rnd = random.nextInt(8);
if (obj == null) if (obj == null)
{ {
switch (meta) switch (meta)
{ {
case 0: // Acacia Tree case 0: // Acacia Tree
obj = new WorldGenAcacia(false); obj = new WorldGenAcacia(false);
break; break;
case 1: // Mangrove Tree case 1: // Mangrove Tree
obj = new WorldGenMangrove(false); obj = new WorldGenMangrove(false);
break; break;
case 2: // Palm Tree case 2: // Palm Tree
rnd = random.nextInt(4); rnd = random.nextInt(4);
if (rnd == 0) if (rnd == 0)
obj = new WorldGenPalmTree1(); obj = new WorldGenPalmTree1();
else else
obj = new WorldGenPalmTree3(); obj = new WorldGenPalmTree3();
break; break;
case 3: // Redwood Tree case 3: // Redwood Tree
obj = new WorldGenRedwoodTree2(false); obj = new WorldGenRedwoodTree2(false);
break; break;
case 4: // Willow Tree case 4: // Willow Tree
obj = new WorldGenWillow(); obj = new WorldGenWillow();
break; break;
} }
} }
if (obj != null) if (obj != null)
{ {
world.setBlockToAir(x, y, z); world.setBlockToAir(x, y, z);
if (!((WorldGenerator)obj).generate(world, random, x, y, z)) if (!((WorldGenerator)obj).generate(world, random, x, y, z))
world.setBlock(x, y, z, this.blockID, meta, 2); world.setBlock(x, y, z, this.blockID, meta, 2);
} }
} }
@Override @Override
public int damageDropped(int meta) public int damageDropped(int meta)
{ {
return meta & TYPES; return meta & TYPES;
} }
@Override @Override
public int getDamageValue(World world, int x, int y, int z) public int getDamageValue(World world, int x, int y, int z)
{ {
return world.getBlockMetadata(x, y, z) & TYPES; return world.getBlockMetadata(x, y, z) & TYPES;
} }
} }

View file

@ -51,7 +51,7 @@ public class BlockBOPFlower extends BlockFlower
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public Icon getBlockTextureFromSideAndMetadata(int side, int meta) public Icon getIcon(int side, int meta)
{ {
if (meta < 0 || meta >= textures.length) if (meta < 0 || meta >= textures.length)
meta = 0; meta = 0;

View file

@ -57,7 +57,7 @@ public class BlockBOPFoliage extends BlockFlower implements IShearable
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public Icon getBlockTextureFromSideAndMetadata(int side, int meta) public Icon getIcon(int side, int meta)
{ {
if (meta >= textures.length) if (meta >= textures.length)
meta = 0; meta = 0;

View file

@ -54,7 +54,7 @@ public class BlockBOPLeaves extends BlockLeavesBase implements IShearable
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public Icon getBlockTextureFromSideAndMetadata(int side, int meta) public Icon getIcon(int side, int meta)
{ {
if (meta < 0 || meta >= textures[0].length) if (meta < 0 || meta >= textures[0].length)
meta = 0; meta = 0;

View file

@ -55,7 +55,7 @@ public class BlockBOPLog extends Block
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public Icon getBlockTextureFromSideAndMetadata(int side, int meta) public Icon getIcon(int side, int meta)
{ {
int pos = meta & 12; int pos = meta & 12;
if (pos == 0 && (side == 1 || side == 0) || pos == 4 && (side == 5 || side == 4) || pos == 8 && (side == 2 || side == 3)) if (pos == 0 && (side == 1 || side == 0) || pos == 4 && (side == 5 || side == 4) || pos == 8 && (side == 2 || side == 3))

View file

@ -1,99 +1,99 @@
package biomesoplenty.blocks; package biomesoplenty.blocks;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Random;
import biomesoplenty.mod_BiomesOPlenty; import biomesoplenty.mod_BiomesOPlenty;
import biomesoplenty.api.Blocks; import biomesoplenty.api.Blocks;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockLeavesBase; import net.minecraft.block.BlockLeavesBase;
import net.minecraft.block.material.Material; 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.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon; import net.minecraft.util.Icon;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.IShearable; import net.minecraftforge.common.IShearable;
public class BlockBOPPetals extends BlockLeavesBase implements IShearable public class BlockBOPPetals extends BlockLeavesBase implements IShearable
{ {
private static final String[] petals = new String[] {"bigflowerred", "bigfloweryellow"}; private static final String[] petals = new String[] {"bigflowerred", "bigfloweryellow"};
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
private Icon[] textures; private Icon[] textures;
public BlockBOPPetals(int blockID) public BlockBOPPetals(int blockID)
{ {
super(blockID, Material.leaves, false); super(blockID, Material.leaves, false);
setBurnProperties(this.blockID, 30, 60); setBurnProperties(this.blockID, 30, 60);
this.setTickRandomly(true); this.setTickRandomly(true);
setHardness(0.2F); setHardness(0.2F);
setLightOpacity(1); setLightOpacity(1);
setStepSound(Block.soundGrassFootstep); setStepSound(Block.soundGrassFootstep);
this.setCreativeTab(mod_BiomesOPlenty.tabBiomesOPlenty); this.setCreativeTab(mod_BiomesOPlenty.tabBiomesOPlenty);
} }
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister) public void registerIcons(IconRegister iconRegister)
{ {
textures = new Icon[petals.length]; textures = new Icon[petals.length];
for (int i = 0; i < petals.length; ++i) for (int i = 0; i < petals.length; ++i)
textures[i] = iconRegister.registerIcon("BiomesOPlenty:" + petals[i]); textures[i] = iconRegister.registerIcon("BiomesOPlenty:" + petals[i]);
} }
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public Icon getBlockTextureFromSideAndMetadata(int side, int meta) public Icon getIcon(int side, int meta)
{ {
if (meta < 0 || meta >= textures.length) if (meta < 0 || meta >= textures.length)
meta = 0; meta = 0;
return textures[meta]; return textures[meta];
} }
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void getSubBlocks(int blockID, CreativeTabs creativeTabs, List list) { public void getSubBlocks(int blockID, CreativeTabs creativeTabs, List list) {
for (int i = 0; i < textures.length; ++i) for (int i = 0; i < textures.length; ++i)
list.add(new ItemStack(blockID, 1, i)); list.add(new ItemStack(blockID, 1, i));
} }
@Override @Override
public int idDropped(int par1, Random par2Random, int par3) public int idDropped(int par1, Random par2Random, int par3)
{ {
if (par1 == 0) if (par1 == 0)
return Block.plantRed.blockID; return Block.plantRed.blockID;
else else
return Block.plantYellow.blockID; return Block.plantYellow.blockID;
} }
@Override @Override
public int damageDropped(int meta) public int damageDropped(int meta)
{ {
return meta & 15; return meta & 15;
} }
@Override @Override
public int quantityDropped(Random random) public int quantityDropped(Random random)
{ {
return random.nextInt(20) == 0 ? 1 : 0; return random.nextInt(20) == 0 ? 1 : 0;
} }
@Override @Override
public boolean isShearable(ItemStack item, World world, int x, int y, int z) public boolean isShearable(ItemStack item, World world, int x, int y, int z)
{ {
return true; return true;
} }
@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) & 15)); ret.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z) & 15));
return ret; return ret;
} }
} }

View file

@ -39,7 +39,7 @@ public class BlockBOPPlank extends Block
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public Icon getBlockTextureFromSideAndMetadata(int side, int meta) public Icon getIcon(int side, int meta)
{ {
if (meta < 0 || meta >= textures.length) if (meta < 0 || meta >= textures.length)
meta = 0; meta = 0;

View file

@ -53,7 +53,7 @@ public class BlockBOPPlant extends BlockFlower implements IShearable
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public Icon getBlockTextureFromSideAndMetadata(int side, int meta) public Icon getIcon(int side, int meta)
{ {
if (meta < 0 || meta >= textures.length) if (meta < 0 || meta >= textures.length)
meta = 0; meta = 0;

View file

@ -1,166 +1,166 @@
package biomesoplenty.blocks; package biomesoplenty.blocks;
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Random;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockSapling; import net.minecraft.block.BlockSapling;
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.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon; import net.minecraft.util.Icon;
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.mod_BiomesOPlenty; import biomesoplenty.mod_BiomesOPlenty;
import biomesoplenty.worldgen.WorldGenAutumn; import biomesoplenty.worldgen.WorldGenAutumn;
import biomesoplenty.worldgen.WorldGenAutumn2; import biomesoplenty.worldgen.WorldGenAutumn2;
import biomesoplenty.worldgen.WorldGenBambooTree; import biomesoplenty.worldgen.WorldGenBambooTree;
import biomesoplenty.worldgen.WorldGenBambooTree2; import biomesoplenty.worldgen.WorldGenBambooTree2;
import biomesoplenty.worldgen.WorldGenCherry1; import biomesoplenty.worldgen.WorldGenCherry1;
import biomesoplenty.worldgen.WorldGenCherry2; import biomesoplenty.worldgen.WorldGenCherry2;
import biomesoplenty.worldgen.WorldGenDeadTree2; import biomesoplenty.worldgen.WorldGenDeadTree2;
import biomesoplenty.worldgen.WorldGenMaple; import biomesoplenty.worldgen.WorldGenMaple;
import biomesoplenty.worldgen.WorldGenMystic2; import biomesoplenty.worldgen.WorldGenMystic2;
import biomesoplenty.worldgen.WorldGenOminous1; import biomesoplenty.worldgen.WorldGenOminous1;
import biomesoplenty.worldgen.WorldGenOminous2; import biomesoplenty.worldgen.WorldGenOminous2;
import biomesoplenty.worldgen.WorldGenOriginTree; import biomesoplenty.worldgen.WorldGenOriginTree;
import biomesoplenty.worldgen.WorldGenPromisedTree; import biomesoplenty.worldgen.WorldGenPromisedTree;
import biomesoplenty.worldgen.WorldGenTaiga9; import biomesoplenty.worldgen.WorldGenTaiga9;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
public class BlockBOPSapling extends BlockSapling public class BlockBOPSapling extends BlockSapling
{ {
private static final String[] saplings = new String[] {"yellow", "bamboo", "magic", "dark", "brown", "fir", "holy", "orange", "origin", "pink", "red", "white"}; private static final String[] saplings = new String[] {"yellow", "bamboo", "magic", "dark", "brown", "fir", "holy", "orange", "origin", "pink", "red", "white"};
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
private Icon[] textures; private Icon[] textures;
private static final int TYPES = 15; private static final int TYPES = 15;
public BlockBOPSapling(int par1) public BlockBOPSapling(int par1)
{ {
super(par1); super(par1);
setHardness(0.0F); setHardness(0.0F);
setStepSound(Block.soundGrassFootstep); setStepSound(Block.soundGrassFootstep);
this.setCreativeTab(mod_BiomesOPlenty.tabBiomesOPlenty); this.setCreativeTab(mod_BiomesOPlenty.tabBiomesOPlenty);
} }
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister) public void registerIcons(IconRegister iconRegister)
{ {
textures = new Icon[saplings.length]; textures = new Icon[saplings.length];
for (int i = 0; i < saplings.length; ++i) for (int i = 0; i < saplings.length; ++i)
textures[i] = iconRegister.registerIcon("BiomesOPlenty:" + saplings[i] + "sapling"); textures[i] = iconRegister.registerIcon("BiomesOPlenty:" + saplings[i] + "sapling");
} }
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public Icon getBlockTextureFromSideAndMetadata(int side, int meta) public Icon getIcon(int side, int meta)
{ {
if (meta < 0 || meta >= saplings.length) if (meta < 0 || meta >= saplings.length)
meta = 0; meta = 0;
return textures[meta]; return textures[meta];
} }
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void getSubBlocks(int blockID, CreativeTabs creativeTabs, List list) { public void getSubBlocks(int blockID, CreativeTabs creativeTabs, List list) {
for (int i = 0; i < saplings.length; ++i) for (int i = 0; i < saplings.length; ++i)
list.add(new ItemStack(blockID, 1, i)); list.add(new ItemStack(blockID, 1, i));
} }
@Override @Override
public void growTree(World world, int x, int y, int z, Random random) public void growTree(World world, int x, int y, int z, Random random)
{ {
int meta = world.getBlockMetadata(x, y, z) & TYPES; int meta = world.getBlockMetadata(x, y, z) & TYPES;
Object obj = null; Object obj = null;
int rnd = random.nextInt(8); int rnd = random.nextInt(8);
if (obj == null) if (obj == null)
{ {
switch (meta) switch (meta)
{ {
case 0: // Autumn Tree case 0: // Autumn Tree
obj = new WorldGenAutumn(false); obj = new WorldGenAutumn(false);
break; break;
case 1: // Bamboo Tree case 1: // Bamboo Tree
rnd = random.nextInt(8); rnd = random.nextInt(8);
if (rnd == 0) if (rnd == 0)
obj = new WorldGenBambooTree(false); obj = new WorldGenBambooTree(false);
else else
obj = new WorldGenBambooTree2(false); obj = new WorldGenBambooTree2(false);
break; break;
case 2: // Magic Tree case 2: // Magic Tree
obj = new WorldGenMystic2(false); obj = new WorldGenMystic2(false);
break; break;
case 3: // Dark Tree case 3: // Dark Tree
rnd = random.nextInt(8); rnd = random.nextInt(8);
if (rnd == 0) if (rnd == 0)
obj = new WorldGenOminous2(); obj = new WorldGenOminous2();
else else
obj = new WorldGenOminous1(false); obj = new WorldGenOminous1(false);
break; break;
case 4: // Dead Tree case 4: // Dead Tree
obj = new WorldGenDeadTree2(false); obj = new WorldGenDeadTree2(false);
break; break;
case 5: // Fir Tree case 5: // Fir Tree
obj = new WorldGenTaiga9(false); obj = new WorldGenTaiga9(false);
break; break;
case 6: // Holy Tree case 6: // Holy Tree
obj = new WorldGenPromisedTree(false); obj = new WorldGenPromisedTree(false);
break; break;
case 7: // Autumn Tree case 7: // Autumn Tree
obj = new WorldGenAutumn2(false); obj = new WorldGenAutumn2(false);
break; break;
case 8: // Origin Tree case 8: // Origin Tree
obj = new WorldGenOriginTree(false); obj = new WorldGenOriginTree(false);
break; break;
case 9: // Pink Cherry Tree case 9: // Pink Cherry Tree
obj = new WorldGenCherry1(false); obj = new WorldGenCherry1(false);
break; break;
case 10: // Maple Tree case 10: // Maple Tree
obj = new WorldGenMaple(false); obj = new WorldGenMaple(false);
break; break;
case 11: // White Cherry Tree case 11: // White Cherry Tree
obj = new WorldGenCherry2(false); obj = new WorldGenCherry2(false);
break; break;
} }
} }
if (obj != null) if (obj != null)
{ {
world.setBlockToAir(x, y, z); world.setBlockToAir(x, y, z);
if (!((WorldGenerator)obj).generate(world, random, x, y, z)) if (!((WorldGenerator)obj).generate(world, random, x, y, z))
world.setBlock(x, y, z, this.blockID, meta, 2); world.setBlock(x, y, z, this.blockID, meta, 2);
} }
} }
@Override @Override
public int damageDropped(int meta) public int damageDropped(int meta)
{ {
return meta & TYPES; return meta & TYPES;
} }
@Override @Override
public int getDamageValue(World world, int x, int y, int z) public int getDamageValue(World world, int x, int y, int z)
{ {
return world.getBlockMetadata(x, y, z) & TYPES; return world.getBlockMetadata(x, y, z) & TYPES;
} }
} }

View file

@ -69,7 +69,7 @@ public class BlockBOPSlab extends BlockHalfSlab
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public Icon getBlockTextureFromSideAndMetadata(int side, int meta) public Icon getIcon(int side, int meta)
{ {
if (category == SlabCategory.STONE) if (category == SlabCategory.STONE)
return textures[getTypeFromMeta(meta)]; return textures[getTypeFromMeta(meta)];

View file

@ -42,7 +42,7 @@ public class BlockBOPStairs extends BlockStairs
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public Icon getBlockTextureFromSideAndMetadata(int side, int meta) public Icon getIcon(int side, int meta)
{ {
return textures[category.ordinal()]; return textures[category.ordinal()];
} }

View file

@ -1,6 +1,6 @@
package biomesoplenty.blocks; package biomesoplenty.blocks;
public class BlockBOPVines public class BlockBOPVines
{ {
} }

View file

@ -292,7 +292,7 @@ public class BlockMoss extends Block
var9 = par1World.getBlockMetadata(par2, par3, par4); var9 = par1World.getBlockMetadata(par2, par3, par4);
var10 = par1World.rand.nextInt(6); var10 = par1World.rand.nextInt(6);
var11 = Direction.vineGrowth[var10]; var11 = Direction.facingToDirection[var10];
int var12; int var12;
int var13; int var13;

View file

@ -1,44 +1,44 @@
package biomesoplenty.blocks.renderers; package biomesoplenty.blocks.renderers;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.client.registry.RenderingRegistry;
public class FoliageRenderer implements ISimpleBlockRenderingHandler public class FoliageRenderer implements ISimpleBlockRenderingHandler
{ {
public static int render = RenderingRegistry.getNextAvailableRenderId(); public static int render = RenderingRegistry.getNextAvailableRenderId();
@Override @Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer)
{ {
// Doesn't render in inventory // Doesn't render in inventory
} }
@Override @Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer)
{ {
if (modelId == render) if (modelId == render)
{ {
int meta = world.getBlockMetadata(x, y, z); int meta = world.getBlockMetadata(x, y, z);
if (meta == 0) if (meta == 0)
return renderer.renderBlockLilyPad(block, x, y, z); return renderer.renderBlockLilyPad(block, x, y, z);
else else
return renderer.renderCrossedSquares(block, x, y, z); return renderer.renderCrossedSquares(block, x, y, z);
} }
return true; return true;
} }
@Override @Override
public boolean shouldRender3DInInventory() public boolean shouldRender3DInInventory()
{ {
return false; return false;
} }
@Override @Override
public int getRenderId() public int getRenderId()
{ {
return render; return render;
} }
} }

View file

@ -1,44 +1,44 @@
package biomesoplenty.blocks.renderers; package biomesoplenty.blocks.renderers;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.client.registry.RenderingRegistry;
public class PlantsRenderer implements ISimpleBlockRenderingHandler public class PlantsRenderer implements ISimpleBlockRenderingHandler
{ {
public static int render = RenderingRegistry.getNextAvailableRenderId(); public static int render = RenderingRegistry.getNextAvailableRenderId();
@Override @Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer)
{ {
// Doesn't render in inventory // Doesn't render in inventory
} }
@Override @Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer)
{ {
if (modelId == render) if (modelId == render)
{ {
int meta = world.getBlockMetadata(x, y, z); int meta = world.getBlockMetadata(x, y, z);
if (meta > 5) if (meta > 5)
return renderer.renderBlockCrops(block, x, y, z); return renderer.renderBlockCrops(block, x, y, z);
else else
return renderer.renderCrossedSquares(block, x, y, z); return renderer.renderCrossedSquares(block, x, y, z);
} }
return true; return true;
} }
@Override @Override
public boolean shouldRender3DInInventory() public boolean shouldRender3DInInventory()
{ {
return false; return false;
} }
@Override @Override
public int getRenderId() public int getRenderId()
{ {
return render; return render;
} }
} }

View file

@ -193,7 +193,7 @@ public class TeleporterPromised extends Teleporter
var12 = 1; var12 = 1;
var13 = 31; var13 = 31;
var14 = 0; var14 = 0;
var20.field_85087_d = this.worldServerInstance.getTotalWorldTime(); var20.lastUpdateTime = this.worldServerInstance.getTotalWorldTime();
var19 = false; var19 = false;
} }
else else
@ -264,11 +264,11 @@ public class TeleporterPromised extends Teleporter
var50 = 1; var50 = 1;
} }
int var30 = par1Entity.func_82148_at(); int var30 = par1Entity.getTeleportDirection();
if (var50 > -1) if (var50 > -1)
{ {
int var31 = Direction.field_71578_g[var50]; int var31 = Direction.rotateLeft[var50];
int var32 = Direction.offsetX[var50]; int var32 = Direction.offsetX[var50];
int var33 = Direction.offsetZ[var50]; int var33 = Direction.offsetZ[var50];
int var34 = Direction.offsetX[var31]; int var34 = Direction.offsetX[var31];
@ -278,8 +278,8 @@ public class TeleporterPromised extends Teleporter
if (var36 && var37) if (var36 && var37)
{ {
var50 = Direction.footInvisibleFaceRemap[var50]; var50 = Direction.rotateOpposite[var50];
var31 = Direction.footInvisibleFaceRemap[var31]; var31 = Direction.rotateOpposite[var31];
var32 = Direction.offsetX[var50]; var32 = Direction.offsetX[var50];
var33 = Direction.offsetZ[var50]; var33 = Direction.offsetZ[var50];
var34 = Direction.offsetX[var31]; var34 = Direction.offsetX[var31];
@ -320,12 +320,12 @@ public class TeleporterPromised extends Teleporter
var40 = 1.0F; var40 = 1.0F;
var41 = 1.0F; var41 = 1.0F;
} }
else if (var50 == Direction.footInvisibleFaceRemap[var30]) else if (var50 == Direction.rotateOpposite[var30])
{ {
var40 = -1.0F; var40 = -1.0F;
var41 = -1.0F; var41 = -1.0F;
} }
else if (var50 == Direction.enderEyeMetaToDirection[var30]) else if (var50 == Direction.rotateRight[var30])
{ {
var42 = 1.0F; var42 = 1.0F;
var43 = -1.0F; var43 = -1.0F;
@ -783,7 +783,7 @@ public class TeleporterPromised extends Teleporter
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
@Override @Override
public void func_85189_a(long par1) public void removeStalePortalLocations(long par1)
{ {
if (par1 % 100L == 0L) if (par1 % 100L == 0L)
{ {
@ -795,7 +795,7 @@ public class TeleporterPromised extends Teleporter
Long var6 = (Long) var3.next(); Long var6 = (Long) var3.next();
PortalPosition var7 = (PortalPosition) this.field_85191_c.getValueByKey(var6.longValue()); PortalPosition var7 = (PortalPosition) this.field_85191_c.getValueByKey(var6.longValue());
if (var7 == null || var7.field_85087_d < var4) if (var7 == null || var7.lastUpdateTime < var4)
{ {
var3.remove(); var3.remove();
this.field_85191_c.remove(var6.longValue()); this.field_85191_c.remove(var6.longValue());

View file

@ -22,9 +22,9 @@ public class ItemAncientStaff extends Item
return true; return true;
} }
public void updateIcons(IconRegister iconRegister) public void registerIcons(IconRegister iconRegister)
{ {
iconIndex = iconRegister.registerIcon("BiomesOPlenty:ancientstaff"); itemIcon = iconRegister.registerIcon("BiomesOPlenty:ancientstaff");
} }
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)

View file

@ -19,17 +19,17 @@ public class ItemBOP extends Item
boptextureid = texture; boptextureid = texture;
} }
public void updateIcons(IconRegister iconRegister) public void registerIcons(IconRegister iconRegister)
{ {
if(boptextureid==0){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:mudball"); } if(boptextureid==0){ itemIcon = iconRegister.registerIcon("BiomesOPlenty:mudball"); }
else if(boptextureid==1){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:mudbrick"); } else if(boptextureid==1){ itemIcon = iconRegister.registerIcon("BiomesOPlenty:mudbrick"); }
else if(boptextureid==2){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:moss"); } else if(boptextureid==2){ itemIcon = iconRegister.registerIcon("BiomesOPlenty:moss"); }
else if(boptextureid==3){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:ash"); } else if(boptextureid==3){ itemIcon = iconRegister.registerIcon("BiomesOPlenty:ash"); }
else if(boptextureid==4){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:amethyst"); } else if(boptextureid==4){ itemIcon = iconRegister.registerIcon("BiomesOPlenty:amethyst"); }
else if(boptextureid==5){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:staffhandle"); } else if(boptextureid==5){ itemIcon = iconRegister.registerIcon("BiomesOPlenty:staffhandle"); }
else if(boptextureid==6){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:staffpole"); } else if(boptextureid==6){ itemIcon = iconRegister.registerIcon("BiomesOPlenty:staffpole"); }
else if(boptextureid==7){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:stafftopper"); } else if(boptextureid==7){ itemIcon = iconRegister.registerIcon("BiomesOPlenty:stafftopper"); }
else { iconIndex = iconRegister.registerIcon("BiomesOPlenty:mudball"); } else { itemIcon = iconRegister.registerIcon("BiomesOPlenty:mudball"); }
} }
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)

View file

@ -14,10 +14,10 @@ public class ItemBOPAxe extends ItemAxe
TextureID = texture; TextureID = texture;
} }
public void updateIcons(IconRegister iconRegister) public void registerIcons(IconRegister iconRegister)
{ {
if(TextureID==0){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:mudaxe"); } if(TextureID==0){ itemIcon = iconRegister.registerIcon("BiomesOPlenty:mudaxe"); }
else if(TextureID==1){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:amethystaxe"); } else if(TextureID==1){ itemIcon = iconRegister.registerIcon("BiomesOPlenty:amethystaxe"); }
else { iconIndex = iconRegister.registerIcon("BiomesOPlenty:mudball"); } else { itemIcon = iconRegister.registerIcon("BiomesOPlenty:mudball"); }
} }
} }

View file

@ -1,38 +1,38 @@
package biomesoplenty.items; package biomesoplenty.items;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon; import net.minecraft.util.Icon;
public class ItemBOPColorizedSapling extends ItemBlock public class ItemBOPColorizedSapling extends ItemBlock
{ {
private static final String[] saplings = new String[] {"acacia", "mangrove", "palm", "redwood", "willow"}; private static final String[] saplings = new String[] {"acacia", "mangrove", "palm", "redwood", "willow"};
public ItemBOPColorizedSapling(int par1) public ItemBOPColorizedSapling(int par1)
{ {
super(par1); super(par1);
setMaxDamage(0); setMaxDamage(0);
setHasSubtypes(true); setHasSubtypes(true);
} }
@Override @Override
public int getMetadata(int meta) public int getMetadata(int meta)
{ {
return meta & 15; return meta & 15;
} }
@Override @Override
public String getUnlocalizedName(ItemStack itemStack) public String getUnlocalizedName(ItemStack itemStack)
{ {
return (new StringBuilder()).append(saplings[itemStack.getItemDamage()]).append("Sapling").toString(); return (new StringBuilder()).append(saplings[itemStack.getItemDamage()]).append("Sapling").toString();
} }
@Override @Override
public Icon getIconFromDamage(int meta) public Icon getIconFromDamage(int meta)
{ {
return Block.blocksList[this.itemID].getBlockTextureFromSideAndMetadata(0, meta); return Block.blocksList[this.itemID].getIcon(0, meta);
} }
} }

View file

@ -31,6 +31,6 @@ public class ItemBOPFlower extends ItemBlock
@Override @Override
public Icon getIconFromDamage(int meta) public Icon getIconFromDamage(int meta)
{ {
return Block.blocksList[this.itemID].getBlockTextureFromSideAndMetadata(0, meta); return Block.blocksList[this.itemID].getIcon(0, meta);
} }
} }

View file

@ -24,7 +24,7 @@ public class ItemBOPFoliage extends ItemBlock
} }
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void updateIcons(IconRegister iconRegister) public void registerIcons(IconRegister iconRegister)
{ {
textures = new Icon[foliageTypes.length - 1]; textures = new Icon[foliageTypes.length - 1];

View file

@ -14,10 +14,10 @@ public class ItemBOPHoe extends ItemHoe
TextureID = texture; TextureID = texture;
} }
public void updateIcons(IconRegister iconRegister) public void registerIcons(IconRegister iconRegister)
{ {
if(TextureID==0){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:mudhoe"); } if(TextureID==0){ itemIcon = iconRegister.registerIcon("BiomesOPlenty:mudhoe"); }
else if(TextureID==1){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:amethysthoe"); } else if(TextureID==1){ itemIcon = iconRegister.registerIcon("BiomesOPlenty:amethysthoe"); }
else { iconIndex = iconRegister.registerIcon("BiomesOPlenty:mudball"); } else { itemIcon = iconRegister.registerIcon("BiomesOPlenty:mudball"); }
} }
} }

View file

@ -1,28 +1,28 @@
package biomesoplenty.items; package biomesoplenty.items;
import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
public class ItemBOPPetals extends ItemBlock public class ItemBOPPetals extends ItemBlock
{ {
private static final String[] petals = new String[] {"bigflowerred", "bigfloweryellow"}; private static final String[] petals = new String[] {"bigflowerred", "bigfloweryellow"};
public ItemBOPPetals(int par1) public ItemBOPPetals(int par1)
{ {
super(par1); super(par1);
setMaxDamage(0); setMaxDamage(0);
setHasSubtypes(true); setHasSubtypes(true);
} }
@Override @Override
public int getMetadata(int meta) public int getMetadata(int meta)
{ {
return meta & 15; return meta & 15;
} }
@Override @Override
public String getUnlocalizedName(ItemStack itemStack) public String getUnlocalizedName(ItemStack itemStack)
{ {
return (new StringBuilder()).append(petals[itemStack.getItemDamage()]).toString(); return (new StringBuilder()).append(petals[itemStack.getItemDamage()]).toString();
} }
} }

View file

@ -14,10 +14,10 @@ public class ItemBOPPickaxe extends ItemPickaxe
TextureID = texture; TextureID = texture;
} }
public void updateIcons(IconRegister iconRegister) public void registerIcons(IconRegister iconRegister)
{ {
if(TextureID==0){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:mudpickaxe"); } if(TextureID==0){ itemIcon = iconRegister.registerIcon("BiomesOPlenty:mudpickaxe"); }
else if(TextureID==1){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:amethystpickaxe"); } else if(TextureID==1){ itemIcon = iconRegister.registerIcon("BiomesOPlenty:amethystpickaxe"); }
else { iconIndex = iconRegister.registerIcon("BiomesOPlenty:mudball"); } else { itemIcon = iconRegister.registerIcon("BiomesOPlenty:mudball"); }
} }
} }

View file

@ -31,6 +31,6 @@ public class ItemBOPPlant extends ItemBlock
@Override @Override
public Icon getIconFromDamage(int meta) public Icon getIconFromDamage(int meta)
{ {
return Block.blocksList[this.itemID].getBlockTextureFromSideAndMetadata(0, meta); return Block.blocksList[this.itemID].getIcon(0, meta);
} }
} }

View file

@ -36,9 +36,9 @@ public class ItemBOPRecord extends ItemRecord
records.put(par2Str, this); records.put(par2Str, this);
} }
public void updateIcons(IconRegister iconRegister) public void registerIcons(IconRegister iconRegister)
{ {
iconIndex = iconRegister.registerIcon("BiomesOPlenty:boprecord"); itemIcon = iconRegister.registerIcon("BiomesOPlenty:boprecord");
} }
/** /**

View file

@ -36,9 +36,9 @@ public class ItemBOPRecordMud extends ItemRecord
records.put(par2Str, this); records.put(par2Str, this);
} }
public void updateIcons(IconRegister iconRegister) public void registerIcons(IconRegister iconRegister)
{ {
iconIndex = iconRegister.registerIcon("BiomesOPlenty:mudrecord"); itemIcon = iconRegister.registerIcon("BiomesOPlenty:mudrecord");
} }
/** /**

View file

@ -1,38 +1,38 @@
package biomesoplenty.items; package biomesoplenty.items;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon; import net.minecraft.util.Icon;
public class ItemBOPSapling extends ItemBlock public class ItemBOPSapling extends ItemBlock
{ {
private static final String[] saplings = new String[] {"yellow", "bamboo", "magic", "dark", "brown", "fir", "holy", "orange", "origin", "pink", "red", "white"}; private static final String[] saplings = new String[] {"yellow", "bamboo", "magic", "dark", "brown", "fir", "holy", "orange", "origin", "pink", "red", "white"};
public ItemBOPSapling(int par1) public ItemBOPSapling(int par1)
{ {
super(par1); super(par1);
setMaxDamage(0); setMaxDamage(0);
setHasSubtypes(true); setHasSubtypes(true);
} }
@Override @Override
public int getMetadata(int meta) public int getMetadata(int meta)
{ {
return meta & 15; return meta & 15;
} }
@Override @Override
public String getUnlocalizedName(ItemStack itemStack) public String getUnlocalizedName(ItemStack itemStack)
{ {
return (new StringBuilder()).append(saplings[itemStack.getItemDamage()]).append("Sapling").toString(); return (new StringBuilder()).append(saplings[itemStack.getItemDamage()]).append("Sapling").toString();
} }
@Override @Override
public Icon getIconFromDamage(int meta) public Icon getIconFromDamage(int meta)
{ {
return Block.blocksList[this.itemID].getBlockTextureFromSideAndMetadata(0, meta); return Block.blocksList[this.itemID].getIcon(0, meta);
} }
} }

View file

@ -32,7 +32,8 @@ public class ItemBOPSlab extends ItemSlab
@Override @Override
public String getUnlocalizedName(ItemStack itemStack) { public String getUnlocalizedName(ItemStack itemStack) {
BlockBOPSlab slab = (BlockBOPSlab)Block.blocksList[itemStack.itemID]; // BlockBOPSlab slab = (BlockBOPSlab)Block.blocksList[itemStack.itemID];
return (new StringBuilder()).append(slab.getFullSlabName(itemStack.getItemDamage())).toString(); // return (new StringBuilder()).append(slab.getFullSlabName(itemStack.getItemDamage())).toString();
return itemStack.getItem().getUnlocalizedName();
} }
} }

View file

@ -14,10 +14,10 @@ public class ItemBOPSpade extends ItemSpade
TextureID = texture; TextureID = texture;
} }
public void updateIcons(IconRegister iconRegister) public void registerIcons(IconRegister iconRegister)
{ {
if(TextureID==0){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:mudshovel"); } if(TextureID==0){ itemIcon = iconRegister.registerIcon("BiomesOPlenty:mudshovel"); }
else if(TextureID==1){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:amethystshovel"); } else if(TextureID==1){ itemIcon = iconRegister.registerIcon("BiomesOPlenty:amethystshovel"); }
else { iconIndex = iconRegister.registerIcon("BiomesOPlenty:mudball"); } else { itemIcon = iconRegister.registerIcon("BiomesOPlenty:mudball"); }
} }
} }

View file

@ -14,10 +14,10 @@ public class ItemBOPSword extends ItemSword
TextureID = texture; TextureID = texture;
} }
public void updateIcons(IconRegister iconRegister) public void registerIcons(IconRegister iconRegister)
{ {
if(TextureID==0){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:mudsword"); } if(TextureID==0){ itemIcon = iconRegister.registerIcon("BiomesOPlenty:mudsword"); }
else if(TextureID==1){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:amethystsword"); } else if(TextureID==1){ itemIcon = iconRegister.registerIcon("BiomesOPlenty:amethystsword"); }
else { iconIndex = iconRegister.registerIcon("BiomesOPlenty:mudball"); } else { itemIcon = iconRegister.registerIcon("BiomesOPlenty:mudball"); }
} }
} }

View file

@ -18,9 +18,9 @@ public class ItemBamboo extends Item
this.spawnID = par2Block.blockID; this.spawnID = par2Block.blockID;
} }
public void updateIcons(IconRegister iconRegister) public void registerIcons(IconRegister iconRegister)
{ {
iconIndex = iconRegister.registerIcon("BiomesOPlenty:bamboo"); itemIcon = iconRegister.registerIcon("BiomesOPlenty:bamboo");
} }
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)

View file

@ -18,9 +18,9 @@ public class ItemBarley extends Item
this.spawnID = par2Block.blockID; this.spawnID = par2Block.blockID;
} }
public void updateIcons(IconRegister iconRegister) public void registerIcons(IconRegister iconRegister)
{ {
iconIndex = iconRegister.registerIcon("BiomesOPlenty:barley"); itemIcon = iconRegister.registerIcon("BiomesOPlenty:barley");
} }
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)

View file

@ -19,9 +19,9 @@ public class ItemBush extends Item
this.spawnID = par2Block.blockID; this.spawnID = par2Block.blockID;
} }
public void updateIcons(IconRegister iconRegister) public void registerIcons(IconRegister iconRegister)
{ {
iconIndex = iconRegister.registerIcon("BiomesOPlenty:bush"); itemIcon = iconRegister.registerIcon("BiomesOPlenty:bush");
} }
/** /**

View file

@ -19,9 +19,9 @@ public class ItemCattail extends Item
this.spawnID = par2Block.blockID; this.spawnID = par2Block.blockID;
} }
public void updateIcons(IconRegister iconRegister) public void registerIcons(IconRegister iconRegister)
{ {
iconIndex = iconRegister.registerIcon("BiomesOPlenty:cattail"); itemIcon = iconRegister.registerIcon("BiomesOPlenty:cattail");
} }
/** /**

View file

@ -18,9 +18,9 @@ public class ItemEnderporter extends Item
this.setMaxDamage(9); this.setMaxDamage(9);
} }
public void updateIcons(IconRegister iconRegister) public void registerIcons(IconRegister iconRegister)
{ {
iconIndex = iconRegister.registerIcon("BiomesOPlenty:enderporter"); itemIcon = iconRegister.registerIcon("BiomesOPlenty:enderporter");
} }
public boolean hasEffect(ItemStack par1ItemStack) public boolean hasEffect(ItemStack par1ItemStack)

View file

@ -19,9 +19,9 @@ public class ItemMediumGrass extends Item
this.spawnID = par2Block.blockID; this.spawnID = par2Block.blockID;
} }
public void updateIcons(IconRegister iconRegister) public void registerIcons(IconRegister iconRegister)
{ {
iconIndex = iconRegister.registerIcon("BiomesOPlenty:mediumgrass"); itemIcon = iconRegister.registerIcon("BiomesOPlenty:mediumgrass");
} }
/** /**

View file

@ -19,9 +19,9 @@ public class ItemShortGrass extends Item
this.spawnID = par2Block.blockID; this.spawnID = par2Block.blockID;
} }
public void updateIcons(IconRegister iconRegister) public void registerIcons(IconRegister iconRegister)
{ {
iconIndex = iconRegister.registerIcon("BiomesOPlenty:shortgrass"); itemIcon = iconRegister.registerIcon("BiomesOPlenty:shortgrass");
} }
/** /**

View file

@ -10,8 +10,8 @@ public class ItemShroomPowder extends ItemFood
super(par1, par2, par3, par4); super(par1, par2, par3, par4);
} }
public void updateIcons(IconRegister iconRegister) public void registerIcons(IconRegister iconRegister)
{ {
iconIndex = iconRegister.registerIcon("BiomesOPlenty:shroompowder"); itemIcon = iconRegister.registerIcon("BiomesOPlenty:shroompowder");
} }
} }

View file

@ -19,9 +19,9 @@ public class ItemSprout extends Item
this.spawnID = par2Block.blockID; this.spawnID = par2Block.blockID;
} }
public void updateIcons(IconRegister iconRegister) public void registerIcons(IconRegister iconRegister)
{ {
iconIndex = iconRegister.registerIcon("BiomesOPlenty:sprout"); itemIcon = iconRegister.registerIcon("BiomesOPlenty:sprout");
} }
/** /**

View file

@ -233,7 +233,7 @@ public class WorldGenBambooTree extends WorldGenerator
if (par2Random.nextInt(4 - var11) == 0) if (par2Random.nextInt(4 - var11) == 0)
{ {
var13 = par2Random.nextInt(3); var13 = par2Random.nextInt(3);
this.setBlockAndMetadata(par1World, par3 + Direction.offsetX[Direction.footInvisibleFaceRemap[var12]], par4 + var6 - 5 + var11, par5 + Direction.offsetZ[Direction.footInvisibleFaceRemap[var12]], Block.cocoaPlant.blockID, var13 << 2 | var12); this.setBlockAndMetadata(par1World, par3 + Direction.offsetX[Direction.rotateOpposite[var12]], par4 + var6 - 5 + var11, par5 + Direction.offsetZ[Direction.rotateOpposite[var12]], Block.cocoaPlant.blockID, var13 << 2 | var12);
} }
} }
} }

View file

@ -233,7 +233,7 @@ public class WorldGenBambooTree2 extends WorldGenerator
if (par2Random.nextInt(4 - var11) == 0) if (par2Random.nextInt(4 - var11) == 0)
{ {
var13 = par2Random.nextInt(3); var13 = par2Random.nextInt(3);
this.setBlockAndMetadata(par1World, X + Direction.offsetX[Direction.footInvisibleFaceRemap[var12]], Y + var6 - 5 + var11, Z + Direction.offsetZ[Direction.footInvisibleFaceRemap[var12]], Block.cocoaPlant.blockID, var13 << 2 | var12); this.setBlockAndMetadata(par1World, X + Direction.offsetX[Direction.rotateOpposite[var12]], Y + var6 - 5 + var11, Z + Direction.offsetZ[Direction.rotateOpposite[var12]], Block.cocoaPlant.blockID, var13 << 2 | var12);
} }
} }
} }

View file

@ -231,7 +231,7 @@ public class WorldGenDeciduous extends WorldGenerator
if (par2Random.nextInt(4 - var11) == 0) if (par2Random.nextInt(4 - var11) == 0)
{ {
var13 = par2Random.nextInt(3); var13 = par2Random.nextInt(3);
this.setBlockAndMetadata(par1World, par3 + Direction.offsetX[Direction.footInvisibleFaceRemap[var12]], par4 + var6 - 5 + var11, par5 + Direction.offsetZ[Direction.footInvisibleFaceRemap[var12]], Block.cocoaPlant.blockID, var13 << 2 | var12); this.setBlockAndMetadata(par1World, par3 + Direction.offsetX[Direction.rotateOpposite[var12]], par4 + var6 - 5 + var11, par5 + Direction.offsetZ[Direction.rotateOpposite[var12]], Block.cocoaPlant.blockID, var13 << 2 | var12);
} }
} }
} }

View file

@ -199,7 +199,7 @@ public class WorldGenHeath extends WorldGenerator
if (par2Random.nextInt(4 - var11) == 0) if (par2Random.nextInt(4 - var11) == 0)
{ {
var13 = par2Random.nextInt(3); var13 = par2Random.nextInt(3);
this.setBlockAndMetadata(par1World, par3 + Direction.offsetX[Direction.footInvisibleFaceRemap[var12]], par4 + var6 - 5 + var11, par5 + Direction.offsetZ[Direction.footInvisibleFaceRemap[var12]], Block.cocoaPlant.blockID, var13 << 2 | var12); this.setBlockAndMetadata(par1World, par3 + Direction.offsetX[Direction.rotateOpposite[var12]], par4 + var6 - 5 + var11, par5 + Direction.offsetZ[Direction.rotateOpposite[var12]], Block.cocoaPlant.blockID, var13 << 2 | var12);
} }
} }
} }

View file

@ -23,7 +23,7 @@ public class WorldGenMoss extends WorldGenerator
{ {
if (BOPBlocks.moss.canPlaceBlockOnSide(par1World, par3, par4, par5, var8)) if (BOPBlocks.moss.canPlaceBlockOnSide(par1World, par3, par4, par5, var8))
{ {
par1World.setBlock(par3, par4, par5, BOPBlocks.moss.blockID, 1 << Direction.vineGrowth[Facing.faceToSide[var8]], 2); par1World.setBlock(par3, par4, par5, BOPBlocks.moss.blockID, 1 << Direction.facingToDirection[Facing.oppositeSide[var8]], 2);
break; break;
} }
} }

View file

@ -211,7 +211,7 @@ public class WorldGenRainforestTree1 extends WorldGenerator
if (par2Random.nextInt(4 - var11) == 0) if (par2Random.nextInt(4 - var11) == 0)
{ {
var13 = par2Random.nextInt(3); var13 = par2Random.nextInt(3);
this.setBlockAndMetadata(par1World, par3 + Direction.offsetX[Direction.footInvisibleFaceRemap[var12]], par4 + var6 - 5 + var11, par5 + Direction.offsetZ[Direction.footInvisibleFaceRemap[var12]], Block.cocoaPlant.blockID, var13 << 2 | var12); this.setBlockAndMetadata(par1World, par3 + Direction.offsetX[Direction.rotateOpposite[var12]], par4 + var6 - 5 + var11, par5 + Direction.offsetZ[Direction.rotateOpposite[var12]], Block.cocoaPlant.blockID, var13 << 2 | var12);
} }
} }
} }

View file

@ -332,7 +332,7 @@ public class WorldGenRedwoodTree extends WorldGenerator
if (par2Random.nextInt(4 - var11) == 0) if (par2Random.nextInt(4 - var11) == 0)
{ {
var13 = par2Random.nextInt(3); var13 = par2Random.nextInt(3);
this.setBlockAndMetadata(par1World, par3 + Direction.offsetX[Direction.footInvisibleFaceRemap[var12]], par4 + var6 - 5 + var11, par5 + Direction.offsetZ[Direction.footInvisibleFaceRemap[var12]], Block.cocoaPlant.blockID, var13 << 2 | var12); this.setBlockAndMetadata(par1World, par3 + Direction.offsetX[Direction.rotateOpposite[var12]], par4 + var6 - 5 + var11, par5 + Direction.offsetZ[Direction.rotateOpposite[var12]], Block.cocoaPlant.blockID, var13 << 2 | var12);
} }
} }
} }

View file

@ -277,7 +277,7 @@ public class WorldGenRedwoodTree2 extends WorldGenerator
if (par2Random.nextInt(4 - var11) == 0) if (par2Random.nextInt(4 - var11) == 0)
{ {
var13 = par2Random.nextInt(3); var13 = par2Random.nextInt(3);
this.setBlockAndMetadata(par1World, par3 + Direction.offsetX[Direction.footInvisibleFaceRemap[var12]], par4 + var6 - 5 + var11, par5 + Direction.offsetZ[Direction.footInvisibleFaceRemap[var12]], Block.cocoaPlant.blockID, var13 << 2 | var12); this.setBlockAndMetadata(par1World, par3 + Direction.offsetX[Direction.rotateOpposite[var12]], par4 + var6 - 5 + var11, par5 + Direction.offsetZ[Direction.rotateOpposite[var12]], Block.cocoaPlant.blockID, var13 << 2 | var12);
} }
} }
} }