run through remap script

This commit is contained in:
Progwml6 committed 2014-02-05 08:28:53 -05:00
1 parent 689aeba09b
commit b8cf7cdc5e
208 files changed
+4117 -4117

No files matched your search

@@ -134,7 +134,7 @@ public class FilledBucket extends ItemBucket
public boolean tryPlaceContainedLiquid (World world, int clickX, int clickY, int clickZ, int type)
{
if (!WorldHelper.isAirBlock(world, clickX, clickY, clickZ) && world.func_147439_a(clickX, clickY, clickZ).func_149688_o().isSolid())
if (!WorldHelper.isAirBlock(world, clickX, clickY, clickZ) && world.getBlock(clickX, clickY, clickZ).getMaterial().isSolid())
{
return false;
}
@@ -145,7 +145,7 @@ public class FilledBucket extends ItemBucket
if (TRepo.fluidBlocks[type] instanceof BlockFluidFinite)
metadata = 7;
world.func_147465_d(clickX, clickY, clickZ, TRepo.fluidBlocks[type], metadata, 3); //TODO: Merge liquids
world.setBlock(clickX, clickY, clickZ, TRepo.fluidBlocks[type], metadata, 3); //TODO: Merge liquids
} catch (ArrayIndexOutOfBoundsException ex) {
TConstruct.logger.warn("AIOBE occured when placing bucket into world; " + ex);
return false;
@@ -156,7 +156,7 @@ public class FilledBucket extends ItemBucket
}
@Override
public void func_150895_a (Item b, CreativeTabs tab, List list)
public void getSubItems (Item b, CreativeTabs tab, List list)
{
for (int i = 0; i < icons.length; i++)
list.add(new ItemStack(b, 1, i));
@@ -29,7 +29,7 @@ public class MetalPattern extends Pattern
private static final String[] patternName = new String[] { "ingot", "rod", "pickaxe", "shovel", "axe", "swordblade", "largeguard", "mediumguard", "crossbar", "binding", "frypan", "sign",
"knifeblade", "chisel", "largerod", "toughbinding", "largeplate", "broadaxe", "scythe", "excavator", "largeblade", "hammerhead", "fullguard", "", "", "arrowhead", "gem" };
public void func_150895_a(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_)
public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_)
{
for (int i = 0; i < patternName.length; i++)
if (!(patternName[i].equals("")))
@@ -85,7 +85,7 @@ public class TitleIcon extends Item
}
@Override
public String func_150896_i (ItemStack par1ItemStack)
public String getPotionEffect (ItemStack par1ItemStack)
{
String s = ("" + StatCollector.translateToLocal(this.getUnlocalizedName() + ".name")).trim();
String s1 = mobNames[par1ItemStack.getItemDamage()];
@@ -99,7 +99,7 @@ public class TitleIcon extends Item
}
@Override
public void func_150895_a (Item b, CreativeTabs tab, List list)
public void getSubItems (Item b, CreativeTabs tab, List list)
{
for (int i = 0; i < mobNames.length; i++)
list.add(new ItemStack(b, 1, i));
@@ -120,13 +120,13 @@ public class TitleIcon extends Item
{
if (!world.isRemote)
{
Block b = world.func_147439_a(posX, posY, posZ);
Block b = world.getBlock(posX, posY, posZ);
posX += Facing.offsetsXForSide[par7];
posY += Facing.offsetsYForSide[par7];
posZ += Facing.offsetsZForSide[par7];
double d0 = 0.0D;
if (par7 == 1 && b != null && b.func_149645_b() == 11)
if (par7 == 1 && b != null && b.getRenderType() == 11)
{
d0 = 0.5D;
}
@@ -151,13 +151,13 @@ public class TitleIcon extends Item
public static EntityLiving activateSpawnEgg (ItemStack stack, World world, double posX, double posY, double posZ, int par7)
{
Block b = world.func_147439_a((int) posX, (int) posY, (int) posZ);
Block b = world.getBlock((int) posX, (int) posY, (int) posZ);
posX += Facing.offsetsXForSide[par7];
posY += Facing.offsetsYForSide[par7];
posZ += Facing.offsetsZForSide[par7];
double d0 = 0.0D;
if (par7 == 1 && b != null && b.func_149645_b() == 11)
if (par7 == 1 && b != null && b.getRenderType() == 11)
{
d0 = 0.5D;
}
@@ -206,7 +206,7 @@ public class TitleIcon extends Item
{
entity.setPosition(x, y, z);
entity.setSlimeSize(8);
entity.func_110161_a((IEntityLivingData) null);
entity.onSpawnWithEgg((IEntityLivingData) null);
world.spawnEntityInWorld(entity);
}
}
@@ -217,7 +217,7 @@ public class TitleIcon extends Item
{
entity.setPosition(x, y, z);
entity.setSlimeSize(8);
entity.func_110161_a((IEntityLivingData) null);
entity.onSpawnWithEgg((IEntityLivingData) null);
world.spawnEntityInWorld(entity);
}
}
+1 -1
View File
@@ -25,7 +25,7 @@ public class ToolPart extends CraftingItem implements IToolPart
}
@Override
public String func_150896_i (ItemStack par1ItemStack)
public String getPotionEffect (ItemStack par1ItemStack)
{
String material = StatCollector.translateToLocal("parttype." + toolTextureNames[par1ItemStack.getItemDamage()]);
String name = StatCollector.translateToLocal("toolpart." + partName);
@@ -32,14 +32,14 @@ public class BarricadeItem extends ItemBlock
public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
{
Block b = world.func_147439_a(x, y, z);
Block b = world.getBlock(x, y, z);
if (b == Blocks.snow && (world.getBlockMetadata(x, y, z) & 7) < 1)
{
side = 1;
}
else if (b != Blocks.vine && b != Blocks.tallgrass && b != Blocks.deadbush
&& (b == null || !b.func_149742_c(world, x, y, z)))
&& (b == null || !b.canPlaceBlockAt(world, x, y, z)))
{
if (side == 0)
{
@@ -80,22 +80,22 @@ public class BarricadeItem extends ItemBlock
{
return false;
}
else if (y == 255 && this.b.func_149688_o().isSolid())
else if (y == 255 && this.b.getMaterial().isSolid())
{
return false;
}
else if (world.func_147472_a(this.b, x, y, z, false, side, player, stack))
else if (world.canPlaceEntityOnSide(this.b, x, y, z, false, side, player, stack))
{
Block block = this.b;
//int meta = this.getMetadata(stack.getItemDamage());
int rotation = MathHelper.floor_double((double) (player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
int meta = rotation * 4;
int metadata = this.b.func_149660_a(world, x, y, z, side, hitX, hitY, hitZ, meta);
int metadata = this.b.onBlockPlaced(world, x, y, z, side, hitX, hitY, hitZ, meta);
if (placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ, metadata))
{
world.playSoundEffect((double) ((float) x + 0.5F), (double) ((float) y + 0.5F), (double) ((float) z + 0.5F), block.field_149762_H.field_150501_a,
(block.field_149762_H.func_150497_c() + 1.0F) / 2.0F, block.field_149762_H.func_150494_d() * 0.8F);
world.playSoundEffect((double) ((float) x + 0.5F), (double) ((float) y + 0.5F), (double) ((float) z + 0.5F), block.stepSound.soundName,
(block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getPitch() * 0.8F);
--stack.stackSize;
}
@@ -59,25 +59,25 @@ public class ItemBlockLandmine extends ItemBlock
@Override
public boolean placeBlockAt (ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata)
{
if (!world.func_147465_d(x, y, z, TRepo.landmine, metadata, 3))
if (!world.setBlock(x, y, z, TRepo.landmine, metadata, 3))
{
return false;
}
if (world.func_147439_a(x, y, z) == TRepo.landmine)
if (world.getBlock(x, y, z) == TRepo.landmine)
{
TRepo.landmine.func_149689_a(world, x, y, z, player, stack);
TRepo.landmine.onBlockPlacedBy(world, x, y, z, player, stack);
TileEntityLandmine te = (TileEntityLandmine) world.func_147438_o(x, y, z);
TileEntityLandmine te = (TileEntityLandmine) world.getTileEntity(x, y, z);
if (te == null)
{
te = (TileEntityLandmine) TRepo.landmine.createTileEntity(world, metadata);
}
te.triggerType = stack.getItemDamage();
world.func_147455_a(x, y, z, te);
world.setTileEntity(x, y, z, te);
TRepo.landmine.func_149714_e(world, x, y, z, metadata);
TRepo.landmine.onPostBlockPlaced(world, x, y, z, metadata);
}
return true;
@@ -42,15 +42,15 @@ public class OreberryBushItem extends MultiItemBlock
else if (player.canPlayerEdit(x, y, z, side, stack) && player.canPlayerEdit(x, y + 1, z, side, stack))
{
Block block = world.func_147439_a(x, y, z);
Block block = world.getBlock(x, y, z);
if (block != null && block.canSustainPlant(world, x, y, z, ForgeDirection.UP, (IPlantable) TRepo.oreBerry) && WorldHelper.isAirBlock(world, x, y + 1, z))
{
world.func_147465_d(x, y + 1, z, blockB, stack.getItemDamage() % 4, 3);
world.setBlock(x, y + 1, z, blockB, stack.getItemDamage() % 4, 3);
if (!player.capabilities.isCreativeMode)
stack.stackSize--;
if (!world.isRemote)
world.playAuxSFX(2001, x, y, z, Block.func_149682_b(block));
world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(block));
return true;
}
else
@@ -48,15 +48,15 @@ public class OreberryBushSecondItem extends MultiItemBlock
else if (player.canPlayerEdit(x, y, z, side, stack) && player.canPlayerEdit(x, y + 1, z, side, stack))
{
Block block = world.func_147439_a(x, y, z);
Block block = world.getBlock(x, y, z);
if (block != null && block.canSustainPlant(world, x, y, z, ForgeDirection.UP, (IPlantable) TRepo.oreBerrySecond) && WorldHelper.isAirBlock(world, x, y + 1, z))
{
world.func_147465_d(x, y + 1, z, blockB, stack.getItemDamage() % 4, 3);
world.setBlock(x, y + 1, z, blockB, stack.getItemDamage() % 4, 3);
if (!player.capabilities.isCreativeMode)
stack.stackSize--;
if (!world.isRemote)
world.playAuxSFX(2001, x, y, z, Block.func_149682_b(block));
world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(block));
return true;
}
else
@@ -24,7 +24,7 @@ public class SlimeTallGrassItem extends MultiItemBlock
public IIcon getIconFromDamage (int meta)
{
int arr = MathHelper.clamp_int(meta, 0, this.blockType.length);
return TRepo.slimeTallGrass.func_149691_a(0, arr);
return TRepo.slimeTallGrass.getIcon(0, arr);
}
}
@@ -24,17 +24,17 @@ public class WoolSlab1Item extends MultiItemBlock
@Override
public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
{
Block b = world.func_147439_a(x, y, z);
Block b = world.getBlock(x, y, z);
int meta = world.getBlockMetadata(x, y, z);
int trueMeta = meta % 8;
boolean flag = (b) != null;
if ((side == 1 && flag || side == 0 && !flag) && b == this.block && trueMeta == stack.getItemDamage())
{
if (world.func_147465_d(x, y, z, Blocks.wool, trueMeta, 3))
if (world.setBlock(x, y, z, Blocks.wool, trueMeta, 3))
{
world.playSoundEffect((double) ((float) x + 0.5F), (double) ((float) y + 0.5F), (double) ((float) z + 0.5F), this.block.field_149762_H.field_150501_a,
(this.block.field_149762_H.func_150497_c() + 1.0F) / 2.0F, this.block.field_149762_H.func_150494_d() * 0.8F);
world.playSoundEffect((double) ((float) x + 0.5F), (double) ((float) y + 0.5F), (double) ((float) z + 0.5F), this.block.stepSound.soundName,
(this.block.stepSound.getVolume() + 1.0F) / 2.0F, this.block.stepSound.getPitch() * 0.8F);
--stack.stackSize;
return true;
}
@@ -24,17 +24,17 @@ public class WoolSlab2Item extends MultiItemBlock
@Override
public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
{
Block block = world.func_147439_a(x, y, z);
Block block = world.getBlock(x, y, z);
int meta = world.getBlockMetadata(x, y, z);
int trueMeta = meta % 8;
boolean flag = (block) != null;
if ((side == 1 && flag || side == 0 && !flag) && block == this.block && trueMeta == stack.getItemDamage())
{
if (world.func_147465_d(x, y, z, Blocks.wool, trueMeta + 8, 3))
if (world.setBlock(x, y, z, Blocks.wool, trueMeta + 8, 3))
{
world.playSoundEffect((double) ((float) x + 0.5F), (double) ((float) y + 0.5F), (double) ((float) z + 0.5F), this.block.field_149762_H.field_150501_a,
(this.block.field_149762_H.func_150497_c() + 1.0F) / 2.0F, this.block.field_149762_H.func_150494_d() * 0.8F);
world.playSoundEffect((double) ((float) x + 0.5F), (double) ((float) y + 0.5F), (double) ((float) z + 0.5F), this.block.stepSound.soundName,
(this.block.stepSound.getVolume() + 1.0F) / 2.0F, this.block.stepSound.getPitch() * 0.8F);
--stack.stackSize;
return true;
}
@@ -45,15 +45,15 @@ public class Battleaxe extends HarvestTool
}
@Override
public boolean func_150894_a (ItemStack itemstack, World world, Block b, int x, int y, int z, EntityLivingBase player)
public boolean onBlockDestroyed (ItemStack itemstack, World world, Block b, int x, int y, int z, EntityLivingBase player)
{
if (b != null && b.func_149688_o() == Material.field_151584_j)
if (b != null && b.getMaterial() == Material.leaves)
return false;
return AbilityHelper.onBlockChanged(itemstack, world, b, x, y, z, player, random);
}
static Material[] materials = { Material.field_151575_d, Material.field_151582_l, Material.field_151594_q, Material.field_151570_A, Material.field_151572_C };
static Material[] materials = { Material.wood, Material.vine, Material.circuits, Material.cactus, Material.gourd };
@Override
public Item getHeadItem ()
@@ -247,15 +247,15 @@ public class Battleaxe extends HarvestTool
return false;
World world = player.worldObj;
final Block wood = world.func_147439_a(x,y,z);
final Block wood = world.getBlock(x,y,z);
NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool");
final int meta = world.getBlockMetadata(x, y, z);
for (int yPos = y + 1; yPos < y + 9; yPos++)
{
Block block = world.func_147439_a(x, yPos, z);
if (!(tags.getBoolean("Broken")) && block != null && block.func_149688_o() == Material.field_151575_d)
Block block = world.getBlock(x, yPos, z);
if (!(tags.getBoolean("Broken")) && block != null && block.getMaterial() == Material.wood)
{
Block localblock = world.func_147439_a(x, yPos, z);
Block localblock = world.getBlock(x, yPos, z);
int localMeta = world.getBlockMetadata(x, yPos, z);
int hlvl = block.getHarvestLevel(meta);
@@ -270,18 +270,18 @@ public class Battleaxe extends HarvestTool
if (!cancelHarvest)
{
if (block != null && block.func_149688_o() == Material.field_151575_d)
if (block != null && block.getMaterial() == Material.wood)
{
localMeta = world.getBlockMetadata(x, yPos, z);
if (!player.capabilities.isCreativeMode)
{
if (block.removedByPlayer(world, player, x, yPos, z))
{
block.func_149664_b(world, x, yPos, z, localMeta);
block.onBlockDestroyedByPlayer(world, x, yPos, z, localMeta);
}
block.func_149636_a(world, player, x, yPos, z, localMeta);
block.func_149681_a(world, x, yPos, z, localMeta, player);
func_150894_a(stack, world, block, x, yPos, z, player);
block.harvestBlock(world, player, x, yPos, z, localMeta);
block.onBlockHarvested(world, x, yPos, z, localMeta, player);
onBlockDestroyed(stack, world, block, x, yPos, z, player);
}
else
{
@@ -295,7 +295,7 @@ public class Battleaxe extends HarvestTool
break;
}
if (!world.isRemote)
world.playAuxSFX(2001, x, y, z, Block.func_149682_b(wood) + (meta << 12));
world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(wood) + (meta << 12));
return super.onBlockStartBreak(stack, x, y, z, player);
}
@@ -149,11 +149,11 @@ public abstract class BowBase extends ToolCore
//if (tinkerArrow != null)
if (slotID != -1 && (arrowID == -1 || slotID < arrowID))
{
player.inventory.func_146026_a(TRepo.arrow);
player.inventory.consumeInventoryItem(TRepo.arrow);
}
else
{
player.inventory.func_146026_a(Items.arrow);
player.inventory.consumeInventoryItem(Items.arrow);
}
}
@@ -96,13 +96,13 @@ public class Chisel extends ToolCore
int x = movingobjectposition.blockX;
int y = movingobjectposition.blockY;
int z = movingobjectposition.blockZ;
Block block = world.func_147439_a(x, y, z);
Block block = world.getBlock(x, y, z);
int meta = world.getBlockMetadata(x, y, z);
DetailInput details = TConstruct.chiselDetailing.getDetailing(block, meta);
if (details != null)
{
world.func_147465_d(x, y, z, BlockUtils.getBlockFromItemStack(details.output), details.outputMeta, 3);
world.setBlock(x, y, z, BlockUtils.getBlockFromItemStack(details.output), details.outputMeta, 3);
if (!(entityplayer.capabilities.isCreativeMode))
{
int reinforced = 0;
@@ -116,7 +116,7 @@ public class Chisel extends ToolCore
AbilityHelper.damageTool(itemstack, 1, null, false);
}
}
world.playAuxSFX(2001, x, y, z, Block.func_149682_b(block) + (meta << 12));
world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(block) + (meta << 12));
entityplayer.swingItem();
}
}
@@ -38,7 +38,7 @@ public class Excavator extends HarvestTool
return "shovel";
}
static Material[] materials = { Material.field_151577_b, Material.field_151578_c, Material.field_151595_p, Material.field_151597_y, Material.field_151596_z, Material.field_151571_B };
static Material[] materials = { Material.grass, Material.ground, Material.sand, Material.snow, Material.craftedSnow, Material.clay };
@Override
public Item getHeadItem ()
@@ -142,19 +142,19 @@ public class Excavator extends HarvestTool
World world = player.worldObj;
final int meta = world.getBlockMetadata(x, y, z);
Block block = world.func_147439_a(x, y, z);
Block block = world.getBlock(x, y, z);
if (!stack.hasTagCompound())
return false;
if (block == null)
return super.onBlockStartBreak(stack, x, y, z, player);
float blockHardness = block.func_149712_f(world, x, y, z);
float blockHardness = block.getBlockHardness(world, x, y, z);
boolean validStart = false;
for (int iter = 0; iter < materials.length; iter++)
{
if (materials[iter] == block.func_149688_o())
if (materials[iter] == block.getMaterial())
{
validStart = true;
break;
@@ -192,11 +192,11 @@ public class Excavator extends HarvestTool
{
if (!(tags.getBoolean("Broken")))
{
Block localblock = world.func_147439_a(xPos, yPos, zPos);
Block localblock = world.getBlock(xPos, yPos, zPos);
block = localblock;
int localMeta = world.getBlockMetadata(xPos, yPos, zPos);
int hlvl = block.getHarvestLevel(meta);
float localHardness = block == null ? Float.MAX_VALUE : block.func_149712_f(world, xPos, yPos, zPos);
float localHardness = block == null ? Float.MAX_VALUE : block.getBlockHardness(world, xPos, yPos, zPos);
if (hlvl <= tags.getInteger("HarvestLevel") && localHardness - 1.5 <= blockHardness)
{
@@ -213,18 +213,18 @@ public class Excavator extends HarvestTool
{
for (int iter = 0; iter < materials.length; iter++)
{
if (materials[iter] == block.func_149688_o())
if (materials[iter] == block.getMaterial())
{
if (!player.capabilities.isCreativeMode)
{
if (block.removedByPlayer(world, player, xPos, yPos, zPos))
{
block.func_149664_b(world, xPos, yPos, zPos, localMeta);
block.onBlockDestroyedByPlayer(world, xPos, yPos, zPos, localMeta);
}
block.func_149636_a(world, player, xPos, yPos, zPos, localMeta);
block.func_149681_a(world, xPos, yPos, zPos, localMeta, player);
block.harvestBlock(world, player, xPos, yPos, zPos, localMeta);
block.onBlockHarvested(world, xPos, yPos, zPos, localMeta, player);
if (blockHardness > 0f)
func_150894_a(stack, world, localblock, xPos, yPos, zPos, player);
onBlockDestroyed(stack, world, localblock, xPos, yPos, zPos, player);
}
else
{
@@ -240,7 +240,7 @@ public class Excavator extends HarvestTool
}
}
if (!world.isRemote)
world.playAuxSFX(2001, x, y, z, Block.func_149682_b(block) + (meta << 12));
world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(block) + (meta << 12));
return true;
}
@@ -257,7 +257,7 @@ public class Excavator extends HarvestTool
Material[] materials = getEffectiveMaterials();
for (int i = 0; i < materials.length; i++)
{
if (materials[i] == block.func_149688_o())
if (materials[i] == block.getMaterial())
{
float mineSpeed = tags.getInteger("MiningSpeed");
int heads = 1;
@@ -86,7 +86,7 @@ public class FryingPan extends Weapon
{
return false;
}
else if (!world.func_147439_a(x, y, z).func_149688_o().isSolid())
else if (!world.getBlock(x, y, z).getMaterial().isSolid())
{
return false;
}
@@ -121,17 +121,17 @@ public class FryingPan extends Weapon
{
return false;
}
else if (!TRepo.heldItemBlock.func_149742_c(world, x, y, z))
else if (!TRepo.heldItemBlock.canPlaceBlockAt(world, x, y, z))
{
return false;
}
else
{
world.func_147465_d(x, y, z, TRepo.heldItemBlock, 0, 3);
TRepo.heldItemBlock.func_149689_a(world, x, y, z, player, stack);
world.setBlock(x, y, z, TRepo.heldItemBlock, 0, 3);
TRepo.heldItemBlock.onBlockPlacedBy(world, x, y, z, player, stack);
world.playSoundEffect(x, y, z, "tinker:frypan_hit", 1.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 0.65F);
EquipLogic logic = (EquipLogic) world.func_147438_o(x, y, z);
EquipLogic logic = (EquipLogic) world.getTileEntity(x, y, z);
logic.setEquipmentItem(stack);
--stack.stackSize;
@@ -68,7 +68,7 @@ public class Hammer extends HarvestTool
return materials;
}
static Material[] materials = new Material[] { Material.field_151576_e, Material.field_151573_f, Material.field_151588_w, Material.field_151592_s, Material.piston, Material. field_151574_g };
static Material[] materials = new Material[] { Material.rock, Material.iron, Material.ice, Material.glass, Material.piston, Material. anvil };
@Override
public Item getHeadItem ()
@@ -234,7 +234,7 @@ public class Hammer extends HarvestTool
return false;
World world = player.worldObj;
final Block block = world.func_147439_a(x, y, z);
final Block block = world.getBlock(x, y, z);
final int meta = world.getBlockMetadata(x, y, z);
if (!stack.hasTagCompound())
return false;
@@ -242,12 +242,12 @@ public class Hammer extends HarvestTool
if (block == null)
return super.onBlockStartBreak(stack, x, y, z, player);
float blockHardness = block.func_149712_f(world, x, y, z);
float blockHardness = block.getBlockHardness(world, x, y, z);
boolean validStart = false;
for (int iter = 0; iter < materials.length; iter++)
{
if (materials[iter] == block.func_149688_o())
if (materials[iter] == block.getMaterial())
{
validStart = true;
break;
@@ -290,10 +290,10 @@ public class Hammer extends HarvestTool
{
if (!(tags.getBoolean("Broken")))
{
Block localBlock = world.func_147439_a(xPos, yPos, zPos);
Block localBlock = world.getBlock(xPos, yPos, zPos);
int localMeta = world.getBlockMetadata(xPos, yPos, zPos);
int hlvl = block.getHarvestLevel(meta);
float localHardness = localBlock == null ? Float.MAX_VALUE : localBlock.func_149712_f(world, xPos, yPos, zPos);
float localHardness = localBlock == null ? Float.MAX_VALUE : localBlock.getBlockHardness(world, xPos, yPos, zPos);
if (hlvl <= toolLevel && localHardness - 1.5 <= blockHardness)
{
@@ -310,18 +310,18 @@ public class Hammer extends HarvestTool
{
for (int iter = 0; iter < materials.length; iter++)
{
if (materials[iter] == localBlock.func_149688_o() || localBlock == Blocks.monster_egg)
if (materials[iter] == localBlock.getMaterial() || localBlock == Blocks.monster_egg)
{
if (!player.capabilities.isCreativeMode)
{
if (localBlock.removedByPlayer(world, player, xPos, yPos, zPos))
{
localBlock.func_149664_b(world, xPos, yPos, zPos, localMeta);
localBlock.onBlockDestroyedByPlayer(world, xPos, yPos, zPos, localMeta);
}
localBlock.func_149636_a(world, player, xPos, yPos, zPos, localMeta);
localBlock.func_149681_a(world, xPos, yPos, zPos, localMeta, player);
localBlock.harvestBlock(world, player, xPos, yPos, zPos, localMeta);
localBlock.onBlockHarvested(world, xPos, yPos, zPos, localMeta, player);
if (blockHardness > 0f)
func_150894_a(stack, world, localBlock, xPos, yPos, zPos, player);
onBlockDestroyed(stack, world, localBlock, xPos, yPos, zPos, player);
}
else
{
@@ -337,7 +337,7 @@ public class Hammer extends HarvestTool
}
}
if (!world.isRemote)
world.playAuxSFX(2001, x, y, z, Block.func_149682_b(block) + (meta << 12));
world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(block) + (meta << 12));
return true;
}
@@ -354,7 +354,7 @@ public class Hammer extends HarvestTool
Material[] materials = getEffectiveMaterials();
for (int i = 0; i < materials.length; i++)
{
if (materials[i] == block.func_149688_o())
if (materials[i] == block.getMaterial())
{
return getblockSpeed(tags, block, meta);
}
@@ -34,15 +34,15 @@ public class Hatchet extends HarvestTool
}
@Override
public boolean func_150894_a (ItemStack itemstack, World world, Block block, int x, int y, int z, EntityLivingBase player)
public boolean onBlockDestroyed (ItemStack itemstack, World world, Block block, int x, int y, int z, EntityLivingBase player)
{
if (block != null && block.func_149688_o() == Material.field_151584_j)
if (block != null && block.getMaterial() == Material.leaves)
return false;
return AbilityHelper.onBlockChanged(itemstack, world, block, x, y, z, player, random);
}
static Material[] materials = { Material.field_151575_d, Material.field_151584_j, Material.field_151582_l, Material.field_151594_q, Material.field_151570_A};//TODO find this//, Material.pumpkin };
static Material[] materials = { Material.wood, Material.leaves, Material.vine, Material.circuits, Material.cactus};//TODO find this//, Material.pumpkin };
@Override
public Item getHeadItem ()
@@ -55,15 +55,15 @@ public class LumberAxe extends HarvestTool
}
@Override
public boolean func_150894_a (ItemStack itemstack, World world, Block block, int x, int y, int z, EntityLivingBase player)
public boolean onBlockDestroyed (ItemStack itemstack, World world, Block block, int x, int y, int z, EntityLivingBase player)
{
if (block != null && block.func_149688_o() == Material.field_151584_j)
if (block != null && block.getMaterial() == Material.leaves)
return false;
return AbilityHelper.onBlockChanged(itemstack, world, block, x, y, z, player, random);
}
static Material[] materials = { Material.field_151575_d, Material.field_151582_l, Material.field_151594_q, Material.field_151570_A};//TODO find this//, Material.pumpkin };
static Material[] materials = { Material.wood, Material.vine, Material.circuits, Material.cactus};//TODO find this//, Material.pumpkin };
/* Lumber axe specific */
@@ -95,7 +95,7 @@ public class LumberAxe extends HarvestTool
Material[] materials = getEffectiveMaterials();
for (int i = 0; i < materials.length; i++)
{
if (materials[i] == block.func_149688_o())
if (materials[i] == block.getMaterial())
{
float mineSpeed = tags.getInteger("MiningSpeed");
int heads = 1;
@@ -139,19 +139,19 @@ public class LumberAxe extends HarvestTool
return false;
World world = player.worldObj;
final Block wood = world.func_147439_a(x, y, z);;
final Block wood = world.getBlock(x, y, z);;
if (wood == null)
{
return super.onBlockStartBreak(stack, x, y, z, player);
}
if (wood.isWood(world, x, y, z) || wood.func_149688_o() == Material.field_151583_m)
if (wood.isWood(world, x, y, z) || wood.getMaterial() == Material.sponge)
{
int height = y;
boolean foundTop = false;
do
{
height++;
Block block = world.func_147439_a(x, height, z);
Block block = world.getBlock(x, height, z);
if (block != wood)
{
height--;
@@ -168,7 +168,7 @@ public class LumberAxe extends HarvestTool
{
for (int zPos = z - 1; zPos <= z + 1; zPos++)
{
Block leaves = world.func_147439_a(xPos, yPos, zPos);
Block leaves = world.getBlock(xPos, yPos, zPos);
if (leaves != null && leaves.isLeaves(world, xPos, yPos, zPos))
numLeaves++;
}
@@ -184,15 +184,15 @@ public class LumberAxe extends HarvestTool
destroyWood(world, x, y, z, stack, tags, player);
if (!world.isRemote)
world.playAuxSFX(2001, x, y, z, Block.func_149682_b(wood) + (meta << 12));
world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(wood) + (meta << 12));
}
else if (wood.func_149688_o() == Material.field_151575_d)
else if (wood.getMaterial() == Material.wood)
{
NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool");
int meta = world.getBlockMetadata(x, y, z);
destroyWood(world, x, y, z, stack, tags, player);
if (!world.isRemote)
world.playAuxSFX(2001, x, y, z, Block.func_149682_b(wood) + (meta << 12));
world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(wood) + (meta << 12));
}
return super.onBlockStartBreak(stack, x, y, z, player);
}
@@ -208,7 +208,7 @@ public class LumberAxe extends HarvestTool
{
if (!(tags.getBoolean("Broken")))
{
Block localblock = world.func_147439_a(xPos, yPos, zPos);
Block localblock = world.getBlock(xPos, yPos, zPos);
if (bID == localblock)
{
block = localblock;
@@ -242,11 +242,11 @@ public class LumberAxe extends HarvestTool
{
if (block.removedByPlayer(world, player, xPos, yPos, zPos))
{
block.func_149664_b(world, xPos, yPos, zPos, meta);
block.onBlockDestroyedByPlayer(world, xPos, yPos, zPos, meta);
}
block.func_149636_a(world, player, xPos, yPos, zPos, meta);
block.func_149681_a(world, xPos, yPos, zPos, meta, player);
func_150894_a(stack, world, localblock, xPos, yPos, zPos, player);
block.harvestBlock(world, player, xPos, yPos, zPos, meta);
block.onBlockHarvested(world, xPos, yPos, zPos, meta, player);
onBlockDestroyed(stack, world, localblock, xPos, yPos, zPos, player);
}
else
{
@@ -286,11 +286,11 @@ public class LumberAxe extends HarvestTool
{
if (!(tags.getBoolean("Broken")))
{
Block block = world.func_147439_a(xPos, yPos, zPos);
Block block = world.getBlock(xPos, yPos, zPos);
int meta = world.getBlockMetadata(xPos, yPos, zPos);
int hlvl = block.getHarvestLevel(meta);
if (block != null && block.func_149688_o() == Material.field_151575_d)
if (block != null && block.getMaterial() == Material.wood)
{
if (hlvl <= tags.getInteger("HarvestLevel"))
{
@@ -307,8 +307,8 @@ public class LumberAxe extends HarvestTool
if (!player.capabilities.isCreativeMode)
{
//TODO harvestBlock
block.func_149636_a(world, player, xPos, yPos, zPos, meta);
func_150894_a(stack, world, block, xPos, yPos, zPos, player);
block.harvestBlock(world, player, xPos, yPos, zPos, meta);
onBlockDestroyed(stack, world, block, xPos, yPos, zPos, player);
}
}
}
@@ -47,8 +47,8 @@ public class Mattock extends DualHarvestTool
return "shovel";
}
static Material[] axeMaterials = { Material.field_151575_d, Material.field_151570_A};//TODO find this//, Material.pumpkin, Material.field_151585_k, Material.field_151582_l };
static Material[] shovelMaterials = { Material.field_151577_b, Material.field_151578_c, Material.field_151571_B };
static Material[] axeMaterials = { Material.wood, Material.cactus};//TODO find this//, Material.pumpkin, Material.plants, Material.vine };
static Material[] shovelMaterials = { Material.grass, Material.ground, Material.clay };
@Override
public Item getHeadItem ()
@@ -25,7 +25,7 @@ public class Pickaxe extends HarvestTool
return materials;
}
static Material[] materials = new Material[] { Material.field_151576_e, Material.field_151573_f, Material.field_151588_w, Material.field_151592_s, Material.piston, Material.field_151574_g, Material.field_151594_q };
static Material[] materials = new Material[] { Material.rock, Material.iron, Material.ice, Material.glass, Material.piston, Material.anvil, Material.circuits };
@Override
public Item getHeadItem ()
@@ -111,7 +111,7 @@ public class PotionLauncher extends Item
}
@Override
public void func_150895_a (Item b, CreativeTabs tabs, List list)
public void getSubItems (Item b, CreativeTabs tabs, List list)
{
ItemStack stack = new ItemStack(b, 1, 0);
NBTTagCompound compound = new NBTTagCompound();
@@ -40,7 +40,7 @@ public class Scythe extends Weapon
return materials;
}
static Material[] materials = new Material[] { Material.field_151569_G, Material.field_151570_A};//TODO find this//, Material.pumpkin, Material.field_151585_k, Material.field_151582_l, Material.field_151584_j };
static Material[] materials = new Material[] { Material.web, Material.cactus};//TODO find this//, Material.pumpkin, Material.plants, Material.vine, Material.leaves };
@Override
public Item getHeadItem ()
@@ -155,7 +155,7 @@ public class Scythe extends Weapon
return false;
World world = player.worldObj;
final Block blockB = world.func_147439_a(x, y, z);
final Block blockB = world.getBlock(x, y, z);
final int meta = world.getBlockMetadata(x, y, z);
if (!stack.hasTagCompound())
return false;
@@ -177,21 +177,21 @@ public class Scythe extends Weapon
if (!cancelHarvest)
{
Block block = world.func_147439_a(xPos, yPos, zPos);
if (block != null)// && (block.func_149688_o() == Material.field_151584_j || block.isLeaves(world, xPos, yPos, zPos)))
Block block = world.getBlock(xPos, yPos, zPos);
if (block != null)// && (block.getMaterial() == Material.leaves || block.isLeaves(world, xPos, yPos, zPos)))
{
for (int iter = 0; iter < materials.length; iter++)
{
if (materials[iter] == block.func_149688_o())
if (materials[iter] == block.getMaterial())
{
int localMeta = world.getBlockMetadata(xPos, yPos, zPos);
WorldHelper.setBlockToAir(world, xPos, yPos, zPos);
if (!player.capabilities.isCreativeMode)
{
block.func_149664_b(world, x, y, z, meta);
block.func_149636_a(world, player, xPos, yPos, zPos, localMeta);
block.func_149681_a(world, x, y, z, localMeta, player);
func_150894_a(stack, world, blockB, xPos, yPos, zPos, player);
block.onBlockDestroyedByPlayer(world, x, y, z, meta);
block.harvestBlock(world, player, xPos, yPos, zPos, localMeta);
block.onBlockHarvested(world, x, y, z, localMeta, player);
onBlockDestroyed(stack, world, blockB, xPos, yPos, zPos, player);
}
}
}
@@ -202,7 +202,7 @@ public class Scythe extends Weapon
}
}
if (!world.isRemote)
world.playAuxSFX(2001, x, y, z, Block.func_149682_b(blockB) + (meta << 12));
world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(blockB) + (meta << 12));
return super.onBlockStartBreak(stack, x, y, z, player);
}
@@ -27,7 +27,7 @@ public class Shovel extends HarvestTool
return "shovel";
}
static Material[] materials = { Material.field_151577_b, Material.field_151578_c, Material.field_151595_p, Material.field_151597_y, Material.field_151596_z, Material.field_151571_B };
static Material[] materials = { Material.grass, Material.ground, Material.sand, Material.snow, Material.craftedSnow, Material.clay };
@Override
public Item getHeadItem ()