more fixes

This commit is contained in:
Progwml6 committed 2014-01-09 04:08:38 -05:00
1 parent eba66e0182
commit fb04e8eb08
55 files changed
+1446 -1442

No files matched your search

@@ -4,6 +4,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.Random;
import mantle.blocks.BlockUtils;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.EnumMobType;
@@ -55,9 +56,9 @@ public class BlockLandmine extends BlockContainer
@Override
public int getLightValue (IBlockAccess world, int x, int y, int z)
{
if (world.func_147439_a(x, y, z) == (Block) this && world.getBlockTileEntity(x, y, z) instanceof TileEntityLandmine)
if (world.func_147439_a(x, y, z) == (Block) this && world.func_147438_o(x, y, z) instanceof TileEntityLandmine)
{
TileEntityLandmine te = (TileEntityLandmine) world.getBlockTileEntity(x, y, z);
TileEntityLandmine te = (TileEntityLandmine) world.func_147438_o(x, y, z);
if (te != null)
{
@@ -79,12 +80,12 @@ public class BlockLandmine extends BlockContainer
@Override
public IIcon getBlockTexture (IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
{
TileEntityLandmine te = (TileEntityLandmine) par1IBlockAccess.getBlockTileEntity(par2, par3, par4);
TileEntityLandmine te = (TileEntityLandmine) par1IBlockAccess.func_147438_o(par2, par3, par4);
ItemStack camo = te.getStackInSlot(3);
if (camo != null && camo.itemID < blocksList.length)
if (camo != null)
{
return Block.blocksList[camo.itemID].getIcon(par5, camo.getItemDamage());
return BlockUtils.getBlockFromItem(camo.getItem()).getIcon(par5, camo.getItemDamage());
}
else
{
@@ -137,7 +138,7 @@ public class BlockLandmine extends BlockContainer
@Override
public void breakBlock (World par1World, int par2, int par3, int par4, int par5, int par6)
{
TileEntityLandmine tileentity = (TileEntityLandmine) par1World.getBlockTileEntity(par2, par3, par4);
TileEntityLandmine tileentity = (TileEntityLandmine) par1World.func_147438_o(par2, par3, par4);
int metadata = par1World.getBlockMetadata(par2, par3, par4);
@@ -295,7 +296,7 @@ public class BlockLandmine extends BlockContainer
if (par6ItemStack.hasDisplayName())
{
((TileEntityLandmine) par1World.getBlockTileEntity(par2, par3, par4)).setGuiDisplayName(par6ItemStack.getDisplayName());
((TileEntityLandmine) par1World.func_147438_o(par2, par3, par4)).setGuiDisplayName(par6ItemStack.getDisplayName());
}
}
@@ -420,7 +421,7 @@ public class BlockLandmine extends BlockContainer
{
if (hasItems(par1World, par2, par3, par4))
{
TileEntityLandmine te = (TileEntityLandmine) par1World.getBlockTileEntity(par2, par3, par4);
TileEntityLandmine te = (TileEntityLandmine) par1World.func_147438_o(par2, par3, par4);
if (te.soundcountything <= 0)
{
par1World.playSoundEffect((double) par2 + 0.5D, (double) par3 + 0.1D, (double) par4 + 0.5D, "random.click", 0.3F, 0.6F);
@@ -439,7 +440,7 @@ public class BlockLandmine extends BlockContainer
private boolean hasItems (World par1World, int par2, int par3, int par4)
{
TileEntityLandmine te = (TileEntityLandmine) par1World.getBlockTileEntity(par2, par3, par4);
TileEntityLandmine te = (TileEntityLandmine) par1World.func_147438_o(par2, par3, par4);
if (te != null && te.getStackInSlot(0) != null || te.getStackInSlot(1) != null || te.getStackInSlot(2) != null)
{
return true;
@@ -454,7 +455,7 @@ public class BlockLandmine extends BlockContainer
{
EnumMobType triggerMobType;
TileEntityLandmine te = (TileEntityLandmine) par1World.getBlockTileEntity(par2, par3, par4);
TileEntityLandmine te = (TileEntityLandmine) par1World.func_147438_o(par2, par3, par4);
// Change to return 1 if you want the landmine to blow up when the block
// holding it is broken
@@ -552,7 +553,7 @@ public class BlockLandmine extends BlockContainer
EnumMobType triggerMobType;
TileEntityLandmine te = (TileEntityLandmine) par1World.getBlockTileEntity(par2, par3, par4);
TileEntityLandmine te = (TileEntityLandmine) par1World.func_147438_o(par2, par3, par4);
// Change to return 1 if you want the landmine to blow up when the
// block holding it is broken
@@ -1,5 +1,6 @@
package tconstruct.blocks;
import mantle.common.ComparisonHelper;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -34,7 +35,7 @@ public class CastingChannelBlock extends BlockContainer
{
if (!world.isRemote)
{
CastingChannelLogic tile = (CastingChannelLogic) world.getBlockTileEntity(x, y, z);
CastingChannelLogic tile = (CastingChannelLogic) world.func_147438_o(x, y, z);
if (player.isSneaking())
{
}
@@ -49,7 +50,7 @@ public class CastingChannelBlock extends BlockContainer
}
ItemStack stack = player.getCurrentEquippedItem();
if (stack != null && stack.itemID == this.blockID)
if (stack != null && ComparisonHelper.areEquivalent(stack.getItem(), this))
return false;
return true;
}
@@ -57,7 +58,7 @@ public class CastingChannelBlock extends BlockContainer
@Override
public void setBlockBoundsBasedOnState (IBlockAccess world, int x, int y, int z)
{
CastingChannelLogic tile = (CastingChannelLogic) world.getBlockTileEntity(x, y, z);
CastingChannelLogic tile = (CastingChannelLogic) world.func_147438_o(x, y, z);
float minX = 0.3125F;
float maxX = 0.6875F;
float minZ = 0.3125F;
@@ -20,7 +20,7 @@ import mantle.blocks.abstracts.InventoryBlock;
public class CraftingStationBlock extends InventoryBlock
{
public CraftingStationBlock(int id, Material material)
public CraftingStationBlock(Material material)
{
super(material);
this.setCreativeTab(TConstructRegistry.blockTab);
@@ -27,7 +27,7 @@ public class DryingRack extends InventoryBlock
public DryingRack()
{
super(Material.wood);
super(Material.field_151575_d);
this.setCreativeTab(TConstructRegistry.blockTab);
setHardness(2.0f);
setStepSound(soundMetalFootstep);
@@ -87,7 +87,7 @@ public class DryingRack extends InventoryBlock
{
if (!world.isRemote)
{
DryingRackLogic logic = (DryingRackLogic) world.getBlockTileEntity(x, y, z);
DryingRackLogic logic = (DryingRackLogic) world.func_147438_o(x, y, z);
if (!logic.isStackInSlot(0))
{
@@ -6,6 +6,7 @@ import tconstruct.util.config.PHConstruct;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
@@ -43,9 +44,9 @@ public class GlassBlockConnectedMeta extends GlassBlockConnected
}
@Override
public boolean shouldConnectToBlock (IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5, int par6)
public boolean shouldConnectToBlock (IBlockAccess par1IBlockAccess, int par2, int par3, int par4, Block par5, int par6)
{
return par5 == this.blockID && (par6 == par1IBlockAccess.getBlockMetadata(par2, par3, par4) || ignoreMetaForConnectedGlass);
return par5 == this && (par6 == par1IBlockAccess.getBlockMetadata(par2, par3, par4) || ignoreMetaForConnectedGlass);
}
@Override
@@ -55,7 +56,7 @@ public class GlassBlockConnectedMeta extends GlassBlockConnected
}
@Override
public void getSubBlocks (Block b, CreativeTabs par2CreativeTabs, List par3List)
public void getSubBlocks (Item b, CreativeTabs par2CreativeTabs, List par3List)
{
for (int i = 0; i < textures.length; i++)
{
@@ -37,8 +37,8 @@ public class GlassPaneConnected extends GlassBlockConnected
{
if (par5 == 0 || par5 == 1)
{
return par1IBlockAccess.getBlockId(par2, par3 - 1, par4) == this.blockID && par5 == 0 ? icons[15]
: par1IBlockAccess.getBlockId(par2, par3 + 1, par4) == this.blockID && par5 == 1 ? icons[15] : getSideTextureIndex();
return par1IBlockAccess.getBlock(par2, par3 - 1, par4) == this && par5 == 0 ? icons[15]
: par1IBlockAccess.getBlock(par2, par3 + 1, par4) == this && par5 == 1 ? icons[15] : getSideTextureIndex();
}
else
{
@@ -64,22 +64,22 @@ public class GlassPaneConnected extends GlassBlockConnected
switch (par5)
{
case 0:
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2 - 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4)))
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 - 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4)))
{
isOpenDown = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2 + 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4)))
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 + 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4)))
{
isOpenUp = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3, par4 - 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1)))
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 - 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1)))
{
isOpenLeft = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3, par4 + 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1)))
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 + 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1)))
{
isOpenRight = true;
}
@@ -146,22 +146,22 @@ public class GlassPaneConnected extends GlassBlockConnected
}
break;
case 1:
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2 - 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4)))
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 - 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4)))
{
isOpenDown = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2 + 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4)))
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 + 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4)))
{
isOpenUp = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3, par4 - 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1)))
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 - 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1)))
{
isOpenLeft = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3, par4 + 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1)))
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 + 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1)))
{
isOpenRight = true;
}
@@ -228,22 +228,22 @@ public class GlassPaneConnected extends GlassBlockConnected
}
break;
case 2:
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3 - 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4)))
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 - 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4)))
{
isOpenDown = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3 + 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4)))
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 + 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4)))
{
isOpenUp = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2 - 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4)))
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 - 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4)))
{
isOpenLeft = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2 + 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4)))
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 + 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4)))
{
isOpenRight = true;
}
@@ -310,22 +310,22 @@ public class GlassPaneConnected extends GlassBlockConnected
}
break;
case 3:
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3 - 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4)))
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 - 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4)))
{
isOpenDown = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3 + 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4)))
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 + 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4)))
{
isOpenUp = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2 - 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4)))
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 - 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4)))
{
isOpenLeft = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2 + 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4)))
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 + 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4)))
{
isOpenRight = true;
}
@@ -392,22 +392,22 @@ public class GlassPaneConnected extends GlassBlockConnected
}
break;
case 4:
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3 - 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4)))
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 - 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4)))
{
isOpenDown = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3 + 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4)))
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 + 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4)))
{
isOpenUp = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3, par4 - 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1)))
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 - 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1)))
{
isOpenLeft = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3, par4 + 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1)))
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 + 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1)))
{
isOpenRight = true;
}
@@ -474,22 +474,22 @@ public class GlassPaneConnected extends GlassBlockConnected
}
break;
case 5:
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3 - 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4)))
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 - 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4)))
{
isOpenDown = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3 + 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4)))
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 + 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4)))
{
isOpenUp = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3, par4 - 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1)))
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 - 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1)))
{
isOpenLeft = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3, par4 + 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1)))
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 + 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1)))
{
isOpenRight = true;
}
@@ -688,7 +688,7 @@ public class GlassPaneConnected extends GlassBlockConnected
public boolean shouldSideBeRendered (IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
{
// if(par5 == 0 || par5 == 1){
// return par1IBlockAccess.getBlockId(par2, par3, par4) != this.blockID;
// return par1IBlockAccess.getBlock(par2, par3, par4) != this.blockID;
// }else{
// return true;
// }
@@ -21,7 +21,7 @@ public class MeatBlock extends Block
public MeatBlock()
{
super(Material.wood);
super(Material.field_151575_d);
this.setHardness(1.0F);
this.setStepSound(Block.soundWoodFootstep);
//setBurnProperties(this.blockID, 5, 20);
@@ -88,11 +88,11 @@ public class MeatBlock extends Block
{
for (int i2 = -b0; i2 <= b0; ++i2)
{
int j2 = par1World.getBlockId(par2 + k1, par3 + l1, par4 + i2);
Block j2 = par1World.getBlock(par2 + k1, par3 + l1, par4 + i2);
if (Block.blocksList[j2] != null)
if (j2 != null)
{
Block.blocksList[j2].beginLeavesDecay(par1World, par2 + k1, par3 + l1, par4 + i2);
j2.beginLeavesDecay(par1World, par2 + k1, par3 + l1, par4 + i2);
}
}
}
@@ -144,7 +144,7 @@ public class MeatBlock extends Block
protected ItemStack createStackedBlock (int par1)
{
return new ItemStack(this.blockID, 1, limitToValidMetadata(par1));
return new ItemStack(this, 1, limitToValidMetadata(par1));
}
public boolean isBlockReplaceable (World world, int x, int y, int z)
@@ -165,7 +165,7 @@ public class MeatBlock extends Block
@SideOnly(Side.CLIENT)
@Override
public void getSubBlocks (Block b, CreativeTabs par2CreativeTabs, List par3List)
public void getSubBlocks (Item b, CreativeTabs par2CreativeTabs, List par3List)
{
for (int i = 0; i < icons.length / 2; i++)
par3List.add(new ItemStack(b, 1, i));
@@ -186,7 +186,7 @@ public class OreberryBush extends BlockLeavesBase implements IPlantable
int meta = world.getBlockMetadata(x, y, z);
if (meta >= 12)
{
world.setBlock(x, y, z, blockID, meta - 4, 3);
world.setBlock(x, y, z, this, meta - 4, 3);
AbilityHelper.spawnItemAtPlayer(player, new ItemStack(TRepo.oreBerries, 1, meta % 4 + itemMeat));
}
}
@@ -205,7 +205,7 @@ public class OreberryBush extends BlockLeavesBase implements IPlantable
if (world.isRemote)
return true;
world.setBlock(x, y, z, blockID, meta - 4, 3);
world.setBlock(x, y, z, this, meta - 4, 3);
AbilityHelper.spawnItemAtPlayer(player, new ItemStack(TRepo.oreBerries, random.nextInt(3) + 1, meta % 4 + itemMeat));
return true;
}
@@ -266,7 +266,7 @@ public class OreberryBush extends BlockLeavesBase implements IPlantable
int meta = world.getBlockMetadata(x, y, z);
if (meta < 12)
{
world.setBlock(x, y, z, blockID, meta + 4, 3);
world.setBlock(x, y, z, this, meta + 4, 3);
}
}
/*else if (meta < 8)
@@ -27,7 +27,7 @@ import net.minecraftforge.common.util.ForgeDirection;
public class ToolStationBlock extends InventoryBlock
{
public ToolStationBlock(int id, Material material)
public ToolStationBlock(Material material)
{
super(material);
this.setCreativeTab(TConstructRegistry.blockTab);
@@ -1,6 +1,7 @@
package tconstruct.blocks.logic;
import tconstruct.inventory.FrypanContainer;
import mantle.blocks.BlockUtils;
import mantle.blocks.iface.IActiveLogic;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
@@ -227,12 +228,11 @@ public class FrypanLogic extends EquipLogic implements IActiveLogic
}
else
{
int itemID = stack.getItem().itemID;
Item item = stack.getItem();
if (stack.getItem() instanceof ItemBlock && Block.blocksList[itemID] != null)
if (stack.getItem() instanceof ItemBlock && BlockUtils.getBlockFromItem(item) != null)
{
Block block = Block.blocksList[itemID];
Block block = BlockUtils.getBlockFromItem(item);
if (block == Blocks.wooden_slab)
{
@@ -244,7 +244,7 @@ public class FrypanLogic extends EquipLogic implements IActiveLogic
return 2400;
}
if (block.func_149688_o() == Material.wood)
if (block.func_149688_o() == Material.field_151575_d)
{
return 300;
}
@@ -22,6 +22,7 @@ import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import tconstruct.inventory.FurnaceContainer;
import mantle.blocks.BlockUtils;
import mantle.blocks.abstracts.InventoryLogic;
import mantle.blocks.iface.IActiveLogic;
import mantle.blocks.iface.IFacingLogic;
@@ -208,9 +209,9 @@ public class FurnaceLogic extends InventoryLogic implements IActiveLogic, IFacin
{
Item item = stack.getItem();
if (stack.getItem() instanceof ItemBlock && Block.blocksList[i] != null)
if (stack.getItem() instanceof ItemBlock && BlockUtils.getBlockFromItem(item) != null)
{
Block block = Block.blocksList[i];
Block block = BlockUtils.getBlockFromItem(item);
if (block == Blocks.wooden_slab)
{
@@ -222,7 +223,7 @@ public class FurnaceLogic extends InventoryLogic implements IActiveLogic, IFacin
return 1200;
}
if (block.func_149688_o() == Material.wood)
if (block.func_149688_o() == Material.field_151575_d)
{
return 300;
}
@@ -26,7 +26,7 @@ public class SlimeTallGrass extends BlockFlower implements IShearable
public SlimeTallGrass()
{
super(Material.vine);
super(Material.field_151582_l);
float f = 0.4F;
this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.8F, 0.5F + f);
setCreativeTab(TConstructRegistry.blockTab);
@@ -1,10 +1,12 @@
package tconstruct.blocks.traps;
import mantle.blocks.MantleBlock;
import mantle.common.ComparisonHelper;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.IIcon;
@@ -21,9 +23,9 @@ public class BarricadeBlock extends MantleBlock
Block modelBlock;
int modelMeta;
public BarricadeBlock( Block model, int meta)
public BarricadeBlock(Block model, int meta)
{
super(Material.wood);
super(Material.field_151575_d);
this.modelBlock = model;
this.modelMeta = meta;
func_149711_c(4.0F);
@@ -61,7 +63,7 @@ public class BarricadeBlock extends MantleBlock
return AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1);
}
public void setBlockBoundsBasedOnState (IBlockAccess par1IBlockAccess, int x, int y, int z)
public void func_147465_dBoundsBasedOnState (IBlockAccess par1IBlockAccess, int x, int y, int z)
{
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
}
@@ -70,7 +72,7 @@ public class BarricadeBlock extends MantleBlock
{
if (meta % 4 > 0)
{
world.setBlock(x, y, z, this.blockID, meta - 1, 3);
world.func_147465_d(x, y, z, this, meta - 1, 3);
dropBlockAsItem_do(world, x, y, z, new ItemStack(this));
}
else
@@ -83,14 +85,14 @@ public class BarricadeBlock extends MantleBlock
public boolean onBlockActivated (World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9)
{
ItemStack stack = player.getCurrentEquippedItem();
if ((stack != null) && (stack.itemID == this.blockID) && (!player.isSneaking()))
if ((stack != null) && (ComparisonHelper.areEquivalent(stack.getItem(), this)) && (!player.isSneaking()))
{
int meta = world.getBlockMetadata(x, y, z);
if (meta % 4 != 3)
{
world.setBlock(x, y, z, this, meta + 1, 3);
this..onBlockPlacedBy(world, x, y, z, player, stack);
this.blockID.onPostBlockPlaced(world, x, y, z, meta);
world.func_147465_d(x, y, z, this, meta + 1, 3);
this.onBlockPlacedBy(world, x, y, z, player, stack);
this.onPostBlockPlaced(world, x, y, z, meta);
Block var9 = this;
world.playSoundEffect(x + 0.5F, y + 0.5F, z + 0.5F, var9.stepSound.getStepSound(), (var9.stepSound.getVolume() + 1.0F) / 2.0F, var9.stepSound.getPitch() * 0.8F);
@@ -114,7 +116,7 @@ public class BarricadeBlock extends MantleBlock
int trueMeta = meta % 4;
trueMeta -= power;
if (trueMeta < 0)
world.setBlockToAir(x, y, z);
world.func_147465_d(x, y, z, Blocks.air, 0, 0);
else
world.setBlockMetadataWithNotify(x, y, z, (int) (meta - power), 3);
onBlockDestroyedByExplosion(world, x, y, z, explosion);
@@ -233,8 +233,8 @@ public class Landmine extends MantleBlock
{
if (par6 > 0)
{
par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID);
par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID);
par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this);
par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this);
}
super.breakBlock(par1World, par2, par3, par4, par5, par6);
@@ -1,5 +1,6 @@
package tconstruct.client;
import mantle.blocks.BlockUtils;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.ItemRenderer;
@@ -48,9 +49,9 @@ public class CustomBowRenderer implements IItemRenderer
GL11.glPushMatrix();
Block block = null;
if (stack.getItem() instanceof ItemBlock && stack.itemID < Block.blocksList.length)
if (stack.getItem() instanceof ItemBlock)
{
block = Block.blocksList[stack.itemID];
block = BlockUtils.getBlockFromItem(stack.getItem());
}
IIcon icon = null; //living.getItemIcon(stack, renderPass);
@@ -896,7 +896,7 @@ public class TProxyClient extends TProxyCommon
}
else if (par1Str.equals("dripWater"))
{
entityfx = new EntityDropParticleFX(mc.theWorld, par2, par4, par6, Material.water);
entityfx = new EntityDropParticleFX(mc.theWorld, par2, par4, par6, Material.field_151586_h);
}
else if (par1Str.equals("dripLava"))
{
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -2,6 +2,7 @@ package tconstruct.client.entity;
import java.util.Random;
import mantle.blocks.BlockUtils;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
@@ -70,17 +71,14 @@ public class FancyItemRender extends Render
int i;
Block block = null;
if (itemstack.itemID < Block.blocksList.length)
{
block = Block.blocksList[itemstack.itemID];
}
if (ForgeHooksClient.renderEntityItem(par1EntityItem, itemstack, f2, f3, random, renderManager.renderEngine, renderBlocks))
block = BlockUtils.getBlockFromItem(itemstack.getItem());
if (ForgeHooksClient.renderEntityItem(par1EntityItem, itemstack, f2, f3, random, renderManager.renderEngine, field_147909_c))
{
;
}
else if (itemstack.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType()))
else if (itemstack.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d(BlockUtils.getBlockFromItem(itemstack.getItem()).getRenderType()))
{
GL11.glRotatef(f3, 0.0F, 1.0F, 0.0F);
@@ -171,7 +169,7 @@ public class FancyItemRender extends Render
if (this.renderWithColor)
{
int l = Item.itemsList[itemstack.itemID].getColorFromItemStack(itemstack, 0);
int l = itemstack.getItem().getColorFromItemStack(itemstack, 0);
f8 = (float) (l >> 16 & 255) / 255.0F;
float f9 = (float) (l >> 8 & 255) / 255.0F;
f5 = (float) (l & 255) / 255.0F;
@@ -323,8 +321,8 @@ public class FancyItemRender extends Render
float f1;
float f2;
//TODO make this be the block equivalent to k
Block block = (k < Block.blocksList.length ? Block.blocksList[k] : null);
if (par3ItemStack.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d(Block.blocksList[k].getRenderType()))
Block block = BlockUtils.getBlockFromItem(k];
if (par3ItemStack.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d(block.getRenderType()))
{
par2TextureManager.bindTexture(TextureMap.locationBlocksTexture);
GL11.glPushMatrix();
@@ -436,7 +434,7 @@ public class FancyItemRender extends Render
{
if (par3ItemStack != null)
{
if (!ForgeHooksClient.renderInventoryItem(renderBlocks, par2TextureManager, par3ItemStack, renderWithColor, zLevel, (float) par4, (float) par5))
if (!ForgeHooksClient.renderInventoryItem(field_147909_c, par2TextureManager, par3ItemStack, renderWithColor, zLevel, (float) par4, (float) par5))
{
this.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5, true);
}
@@ -2,6 +2,7 @@ package tconstruct.client.entity.projectile;
import java.util.Random;
import mantle.blocks.BlockUtils;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
@@ -23,7 +24,6 @@ import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import tconstruct.entity.projectile.ArrowEntity;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -73,10 +73,10 @@ public class ArrowRender extends Render
Block block = null;
if (itemstack.itemID < Block.blocksList.length)
{
block = Block.blocksList[itemstack.itemID];
block = BlockUtils.getBlockFromItem(itemstack.getItem());
}
if (itemstack.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType()))
if (itemstack.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d(BlockUtils.getBlockFromItem(itemstack.getItem()).getRenderType()))
{
GL11.glRotatef(f3, 0.0F, 1.0F, 0.0F);
@@ -123,7 +123,7 @@ public class ArrowRender extends Render
if (this.renderWithColor)
{
i = Item.itemsList[itemstack.itemID].getColorFromItemStack(itemstack, k);
i = itemstack.getItem().getColorFromItemStack(itemstack, k);
f5 = (float) (i >> 16 & 255) / 255.0F;
f4 = (float) (i >> 8 & 255) / 255.0F;
f6 = (float) (i & 255) / 255.0F;
@@ -144,7 +144,7 @@ public class ArrowRender extends Render
if (this.renderWithColor)
{
int l = Item.itemsList[itemstack.itemID].getColorFromItemStack(itemstack, 0);
int l =itemstack.getItem().getColorFromItemStack(itemstack, 0);
f8 = (float) (l >> 16 & 255) / 255.0F;
float f9 = (float) (l >> 8 & 255) / 255.0F;
f5 = (float) (l & 255) / 255.0F;
@@ -2,6 +2,7 @@ package tconstruct.client.entity.projectile;
import java.util.Random;
import mantle.blocks.BlockUtils;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
@@ -23,7 +24,6 @@ import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import tconstruct.entity.projectile.DaggerEntity;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -70,13 +70,9 @@ public class DaggerRender extends Render
float f6;
int i;
Block block = null;
if (itemstack.itemID < Block.blocksList.length)
{
block = Block.blocksList[itemstack.itemID];
}
Block block = BlockUtils.getBlockFromItem(itemstack.getItem());
if (itemstack.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType()))
if (itemstack.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d(BlockUtils.getBlockFromItem(itemstack.getItem()).getRenderType()))
{
GL11.glRotatef(f3, 0.0F, 1.0F, 0.0F);
@@ -167,7 +163,7 @@ public class DaggerRender extends Render
if (this.renderWithColor)
{
int l = Item.itemsList[itemstack.itemID].getColorFromItemStack(itemstack, 0);
int l = itemstack.getItem().getColorFromItemStack(itemstack, 0);
f8 = (float) (l >> 16 & 255) / 255.0F;
float f9 = (float) (l >> 8 & 255) / 255.0F;
f5 = (float) (l & 255) / 255.0F;
@@ -306,7 +302,7 @@ public class DaggerRender extends Render
public void renderItemIntoGUI (FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5, boolean renderEffect)
{
int k = par3ItemStack.itemID;
Item k = par3ItemStack.getItem();
int l = par3ItemStack.getItemDamage();
Object object = par3ItemStack.getIconIndex();
float f;
@@ -314,8 +310,8 @@ public class DaggerRender extends Render
float f1;
float f2;
Block block = (k < Block.blocksList.length ? Block.blocksList[k] : null);
if (par3ItemStack.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d(Block.blocksList[k].getRenderType()))
Block block = BlockUtils.getBlockFromItem(k);
if (par3ItemStack.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d(BlockUtils.getBlockFromItem(k).getRenderType()))
{
par2TextureManager.bindTexture(TextureMap.locationBlocksTexture);
GL11.glPushMatrix();
@@ -325,7 +321,7 @@ public class DaggerRender extends Render
GL11.glScalef(1.0F, 1.0F, -1.0F);
GL11.glRotatef(210.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
i1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, 0);
i1 = k.getColorFromItemStack(par3ItemStack, 0);
f = (float) (i1 >> 16 & 255) / 255.0F;
f1 = (float) (i1 >> 8 & 255) / 255.0F;
f2 = (float) (i1 & 255) / 255.0F;
@@ -341,15 +337,15 @@ public class DaggerRender extends Render
this.itemRenderBlocks.field_147844_c = true;
GL11.glPopMatrix();
}
else if (Item.itemsList[k].requiresMultipleRenderPasses())
else if (k.requiresMultipleRenderPasses())
{
GL11.glDisable(GL11.GL_LIGHTING);
for (int j1 = 0; j1 < Item.itemsList[k].getRenderPasses(l); ++j1)
for (int j1 = 0; j1 < k.getRenderPasses(l); ++j1)
{
par2TextureManager.bindTexture(par3ItemStack.getItemSpriteNumber() == 0 ? TextureMap.locationBlocksTexture : TextureMap.locationItemsTexture);
IIcon icon = Item.itemsList[k].getIcon(par3ItemStack, j1);
int k1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, j1);
IIcon icon = k.getIcon(par3ItemStack, j1);
int k1 = k.getColorFromItemStack(par3ItemStack, j1);
f1 = (float) (k1 >> 16 & 255) / 255.0F;
f2 = (float) (k1 >> 8 & 255) / 255.0F;
float f3 = (float) (k1 & 255) / 255.0F;
@@ -380,7 +376,7 @@ public class DaggerRender extends Render
object = ((TextureMap) Minecraft.getMinecraft().getTextureManager().getTexture(resourcelocation)).getAtlasSprite("missingno");
}
i1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, 0);
i1 = k.getColorFromItemStack(par3ItemStack, 0);
f = (float) (i1 >> 16 & 255) / 255.0F;
f1 = (float) (i1 >> 8 & 255) / 255.0F;
f2 = (float) (i1 & 255) / 255.0F;
@@ -36,17 +36,17 @@ public class ArmorExtendedGui extends InventoryEffectRenderer
super.initGui();
int cornerX = guiLeft;
int cornerY = (this.height - this.ySize) / 2;
this.buttonList.clear();
int cornerY = (this.field_146294_l - this.ySize) / 2;
this.field_146292_n.clear();
// InventoryTab tab = new InventoryTab(2, cornerX, cornerY - 28, new ItemStack(Block.workbench), 0);
// this.buttonList.add(tab);
// this.field_146292_n.add(tab);
// tab = new InventoryTab(3, cornerX + 28, cornerY - 28, new ItemStack(Item.plateDiamond), 1);
// tab.enabled = false;
// this.buttonList.add(tab);
// this.field_146292_n.add(tab);
TabRegistry.updateTabValues(cornerX, cornerY, InventoryTabArmorExtended.class);
TabRegistry.addTabsToList(this.buttonList);
TabRegistry.addTabsToList(this.field_146292_n);
}
protected void drawGuiContainerForegroundLayer (int par1, int par2)
@@ -62,19 +62,19 @@ public class ArmorExtendedGui extends InventoryEffectRenderer
this.ySize_lo = (float) par2;
// if (stats.inventory[2] != null && stats.inventory[2].getItem() == TContent.knapsack)
// {
// if (this.buttonList.size() < 3)
// if (this.field_146292_n.size() < 3)
// {
// int cornerX = guiLeft;
// int cornerY = (this.height - this.ySize) / 2;
// InventoryTab tab = new InventoryTab(4, cornerX + 56, cornerY - 28, new ItemStack(TContent.knapsack), 1);
// this.buttonList.add(tab);
// this.field_146292_n.add(tab);
// }
// }
// else
// {
// if (this.buttonList.size() >= 3)
// if (this.field_146292_n.size() >= 3)
// {
// buttonList.remove(2);
// field_146292_n.remove(2);
// }
// }
}
@@ -87,7 +87,7 @@ public class ArmorExtendedGui extends InventoryEffectRenderer
//mc.renderEngine.bindTexture("/mods/tinker/textures/gui/armorextended.png");
this.field_146297_k.getTextureManager().bindTexture(background);
int cornerX = guiLeft;
int cornerY = (height - ySize) / 2;
int cornerY = (field_146294_l - ySize) / 2;
drawTexturedModalRect(cornerX, cornerY, 0, 0, xSize, ySize);
if (!stats.isStackInSlot(0))
@@ -27,19 +27,19 @@ public class KnapsackGui extends GuiContainer
super.initGui();
int cornerX = guiLeft;
int cornerY = (this.height - this.ySize) / 2;
this.buttonList.clear();
int cornerY = (this.field_146294_l - this.ySize) / 2;
this.field_146292_n.clear();
TabRegistry.updateTabValues(cornerX, cornerY, InventoryTabKnapsack.class);
TabRegistry.addTabsToList(this.buttonList);
TabRegistry.addTabsToList(this.field_146292_n);
// InventoryTab tab = new InventoryTab(2, cornerX, cornerY - 28, new ItemStack(Block.workbench), 0);
// this.buttonList.add(tab);
// this.field_146292_n.add(tab);
// tab = new InventoryTab(3, cornerX + 28, cornerY - 28, new ItemStack(Item.plateDiamond), 1);
// this.buttonList.add(tab);
// this.field_146292_n.add(tab);
// tab = new InventoryTab(4, cornerX + 56, cornerY - 28, new ItemStack(TContent.knapsack), 1);
// tab.enabled = false;
// this.buttonList.add(tab);
// this.field_146292_n.add(tab);
}
protected void drawGuiContainerForegroundLayer (int par1, int par2)
@@ -55,7 +55,7 @@ public class KnapsackGui extends GuiContainer
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.field_146297_k.getTextureManager().bindTexture(background);
int cornerX = guiLeft;
int cornerY = (height - ySize) / 2;
int cornerY = (field_146294_l - ySize) / 2;
drawTexturedModalRect(cornerX, cornerY, 0, 0, xSize, ySize);
}
@@ -66,20 +66,20 @@ public class StencilTableGui extends GuiContainer
int cornerX = (this.field_146294_l - this.xSize) / 2;
int cornerY = (this.field_146295_m - this.ySize) / 2;
this.buttonList.clear();
this.field_146292_n.clear();
/*ToolGuiElement repair = TConstruct.toolButtons.get(0);
GuiButtonTool repairButton = new GuiButtonTool(0, cornerX - 110, cornerY, repair.buttonIconX, repair.buttonIconY, repair.texture); // Repair
repairButton.enabled = false;
this.buttonList.add(repairButton);*/
this.buttonList.add(new GuiButton(0, cornerX - 120, cornerY, 120, 20, StatCollector.translateToLocal("gui.stenciltable1")));
this.buttonList.add(new GuiButton(1, cornerX - 120, cornerY + 20, 120, 20, StatCollector.translateToLocal("gui.stenciltable1")));
this.field_146292_n.add(repairButton);*/
this.field_146292_n.add(new GuiButton(0, cornerX - 120, cornerY, 120, 20, StatCollector.translateToLocal("gui.stenciltable1")));
this.field_146292_n.add(new GuiButton(1, cornerX - 120, cornerY + 20, 120, 20, StatCollector.translateToLocal("gui.stenciltable1")));
//for (int iter = 0; iter < TConstructContent.patternOutputs.length; iter++)
//{
/*ToolGuiElement element = TConstruct.toolButtons.get(iter);
GuiButtonTool button = new GuiButtonTool(iter, cornerX - 110 + 22 * (iter % 5), cornerY + 22 * (iter / 5), element.buttonIconX, element.buttonIconY, element.texture); // Repair
this.buttonList.add(button);*/
this.field_146292_n.add(button);*/
//}
}
@@ -91,7 +91,7 @@ public class StencilTableGui extends GuiContainer
int meta = pattern.getItemDamage();
if (meta == 0)
{
if (button.id == 0)
if (button.field_146127_k == 0)
{
patternIndex++;
if (patternIndex == 21)
@@ -99,7 +99,7 @@ public class StencilTableGui extends GuiContainer
if (patternIndex >= TRepo.patternOutputs.length - 1)
patternIndex = 0;
}
else if (button.id == 1)
else if (button.field_146127_k == 1)
{
patternIndex--;
if (patternIndex < 0)
@@ -39,11 +39,11 @@ public class ToolForgeGui extends ToolStationGui
int cornerX = (this.field_146294_l - this.xSize) / 2;
int cornerY = (this.field_146295_m - this.ySize) / 2;
this.buttonList.clear();
this.field_146292_n.clear();
ToolGuiElement repair = TConstructClientRegistry.toolButtons.get(0);
GuiButtonTool repairButton = new GuiButtonTool(0, cornerX - 110, cornerY, repair.buttonIconX, repair.buttonIconY, repair.domain, repair.texture, repair); // Repair
repairButton.enabled = false;
this.buttonList.add(repairButton);
repairButton.field_146124_l = false;
this.field_146292_n.add(repairButton);
int offset = TConstructClientRegistry.tierTwoButtons.size();
for (int iter = 0; iter < TConstructClientRegistry.tierTwoButtons.size(); iter++)
@@ -51,7 +51,7 @@ public class ToolForgeGui extends ToolStationGui
ToolGuiElement element = TConstructClientRegistry.tierTwoButtons.get(iter);
GuiButtonTool button = new GuiButtonTool(iter + 1, cornerX - 110 + 22 * ((iter + 1) % 5), cornerY + 22 * ((iter + 1) / 5), element.buttonIconX, element.buttonIconY, repair.domain,
element.texture, element);
this.buttonList.add(button);
this.field_146292_n.add(button);
}
for (int iter = 1; iter < TConstructClientRegistry.toolButtons.size(); iter++)
@@ -59,16 +59,16 @@ public class ToolForgeGui extends ToolStationGui
ToolGuiElement element = TConstructClientRegistry.toolButtons.get(iter);
GuiButtonTool button = new GuiButtonTool(iter + offset, cornerX - 110 + 22 * ((iter + offset) % 5), cornerY + 22 * ((iter + offset) / 5), element.buttonIconX, element.buttonIconY,
repair.domain, element.texture, element);
this.buttonList.add(button);
this.field_146292_n.add(button);
}
}
protected void actionPerformed (GuiButton button)
{
GuiButtonTool b = (GuiButtonTool) button;
((GuiButton) this.buttonList.get(selectedButton)).enabled = true;
selectedButton = button.id;
button.enabled = false;
((GuiButton) this.field_146292_n.get(selectedButton)).field_146124_l = true;
selectedButton = button.field_146127_k;
button.field_146124_l = false;
setSlotType(b.element.slotType);
iconX = b.element.iconsX;
@@ -90,26 +90,26 @@ public class ToolStationGui extends NewContainerGui
int cornerX = (this.field_146294_l - this.xSize) / 2;
int cornerY = (this.field_146295_m - this.ySize) / 2;
this.buttonList.clear();
this.field_146292_n.clear();
ToolGuiElement repair = TConstructClientRegistry.toolButtons.get(0);
GuiButtonTool repairButton = new GuiButtonTool(0, cornerX - 110, cornerY, repair.buttonIconX, repair.buttonIconY, repair.domain, repair.texture, repair); // Repair
repairButton.enabled = false;
this.buttonList.add(repairButton);
repairButton.field_146124_l = false;
this.field_146292_n.add(repairButton);
for (int iter = 1; iter < TConstructClientRegistry.toolButtons.size(); iter++)
{
ToolGuiElement element = TConstructClientRegistry.toolButtons.get(iter);
GuiButtonTool button = new GuiButtonTool(iter, cornerX - 110 + 22 * (iter % 5), cornerY + 22 * (iter / 5), element.buttonIconX, element.buttonIconY, repair.domain, element.texture,
element);
this.buttonList.add(button);
this.field_146292_n.add(button);
}
}
protected void actionPerformed (GuiButton button)
{
((GuiButton) this.buttonList.get(guiType)).enabled = true;
guiType = button.id;
button.enabled = false;
((GuiButton) this.field_146292_n.get(guiType)).field_146124_l = true;
guiType = button.field_146127_k;
button.field_146124_l = false;
ToolGuiElement element = TConstructClientRegistry.toolButtons.get(guiType);
setSlotType(element.slotType);
@@ -30,10 +30,10 @@ public class TabRegistry
//Values are public at runtime.
int cornerX = gui.guiLeft;
int cornerY = gui.guiTop;
gui.buttonList.clear();
gui.field_146292_n.clear();
updateTabValues(cornerX, cornerY, InventoryTabVanilla.class);
addTabsToList(gui.buttonList);
addTabsToList(gui.field_146292_n);
}
}
@@ -64,13 +64,13 @@ public class TabRegistry
}
}
public static void addTabsToList (List buttonList)
public static void addTabsToList (List field_146292_n)
{
for (AbstractTab tab : tabList)
{
if (tab.shouldAddToList())
{
buttonList.add(tab);
field_146292_n.add(tab);
}
}
}
+33 -33
View File
@@ -90,9 +90,9 @@ public class TContent implements IFuelHandler
void registerBlocks ()
{
//Tool Station
TRepo.toolStationWood = new ToolStationBlock(PHConstruct.woodStation, Material.field_151575_d).func_149663_c("ToolStation");
TRepo.toolStationWood = new ToolStationBlock(Material.field_151575_d).func_149663_c("ToolStation");
TRepo.toolForge = new ToolForgeBlock(Material.field_151573_f).func_149663_c("ToolForge");
TRepo.craftingStationWood = new CraftingStationBlock(PHConstruct.woodCrafter, Material.field_151575_d).func_149663_c("CraftingStation");
TRepo.craftingStationWood = new CraftingStationBlock(Material.field_151575_d).func_149663_c("CraftingStation");
TRepo.craftingSlabWood = new CraftingSlab(Material.field_151575_d).func_149663_c("CraftingSlab");
TRepo.furnaceSlab = new FurnaceSlab(Material.field_151576_e).func_149663_c("FurnaceSlab");
@@ -113,9 +113,9 @@ public class TContent implements IFuelHandler
TRepo.meatBlock = new MeatBlock().func_149663_c("tconstruct.meatblock");
TRepo.glueBlock = new GlueBlock().func_149663_c("GlueBlock").setCreativeTab(TConstructRegistry.blockTab);
TRepo.woolSlab1 = new SlabBase(Material.cloth, Blocks.wool, 0, 8).func_149663_c("cloth");
TRepo.woolSlab1 = new SlabBase(Material.field_151580_n, Blocks.wool, 0, 8).func_149663_c("cloth");
TRepo.woolSlab1.setStepSound(Block.soundClothFootstep).setCreativeTab(CreativeTabs.tabDecorations);
TRepo.woolSlab2 = new SlabBase(Material.cloth, Blocks.wool, 8, 8).func_149663_c("cloth");
TRepo.woolSlab2 = new SlabBase(Material.field_151580_n, Blocks.wool, 8, 8).func_149663_c("cloth");
TRepo.woolSlab2.setStepSound(Block.soundClothFootstep).setCreativeTab(CreativeTabs.tabDecorations);
//Smeltery
@@ -177,7 +177,7 @@ public class TContent implements IFuelHandler
TRepo.moltenTin = new TConstructFluid(PHConstruct.moltenTin, TRepo.moltenTinFluid, Material.field_151587_i, "liquid_tin").func_149663_c("fluid.molten.tin");
GameRegistry.registerBlock(TRepo.moltenTin, "fluid.molten.tin");
TRepo.moltenTinFluid.setBlockID(TRepo.moltenTin).setLuminosity(12).setDensity(3000).setViscosity(6000).setTemperature(1300);
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.moltenTinFluid, 1000), new ItemStack(TRepo.buckets, 1, 3), new ItemStack(Item.bucketEmpty)));
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.moltenTinFluid, 1000), new ItemStack(TRepo.buckets, 1, 3), new ItemStack(Items.bucket)));
TRepo.moltenAluminumFluid = new Fluid("aluminum.molten");
if (!FluidRegistry.registerFluid(TRepo.moltenAluminumFluid))
@@ -185,7 +185,7 @@ public class TContent implements IFuelHandler
TRepo.moltenAluminum = new TConstructFluid(PHConstruct.moltenAluminum, TRepo.moltenAluminumFluid, Material.field_151587_i, "liquid_aluminum").func_149663_c("fluid.molten.aluminum");
GameRegistry.registerBlock(TRepo.moltenAluminum, "fluid.molten.aluminum");
TRepo.moltenAluminumFluid.setBlockID(TRepo.moltenAluminum).setLuminosity(12).setDensity(3000).setViscosity(6000).setTemperature(1300);
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.moltenAluminumFluid, 1000), new ItemStack(TRepo.buckets, 1, 4), new ItemStack(Item.bucketEmpty)));
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.moltenAluminumFluid, 1000), new ItemStack(TRepo.buckets, 1, 4), new ItemStack(Items.bucket)));
TRepo.moltenCobaltFluid = new Fluid("cobalt.molten");
if (!FluidRegistry.registerFluid(TRepo.moltenCobaltFluid))
@@ -193,7 +193,7 @@ public class TContent implements IFuelHandler
TRepo.moltenCobalt = new TConstructFluid(PHConstruct.moltenCobalt, TRepo.moltenCobaltFluid, Material.field_151587_i, "liquid_cobalt").func_149663_c("fluid.molten.cobalt");
GameRegistry.registerBlock(TRepo.moltenCobalt, "fluid.molten.cobalt");
TRepo.moltenCobaltFluid.setBlockID(TRepo.moltenCobalt).setLuminosity(12).setDensity(3000).setViscosity(6000).setTemperature(1300);
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.moltenCobaltFluid, 1000), new ItemStack(TRepo.buckets, 1, 5), new ItemStack(Item.bucketEmpty)));
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.moltenCobaltFluid, 1000), new ItemStack(TRepo.buckets, 1, 5), new ItemStack(Items.bucket)));
TRepo.moltenArditeFluid = new Fluid("ardite.molten");
if (!FluidRegistry.registerFluid(TRepo.moltenArditeFluid))
@@ -201,7 +201,7 @@ public class TContent implements IFuelHandler
TRepo.moltenArdite = new TConstructFluid(PHConstruct.moltenArdite, TRepo.moltenArditeFluid, Material.field_151587_i, "liquid_ardite").func_149663_c("fluid.molten.ardite");
GameRegistry.registerBlock(TRepo.moltenArdite, "fluid.molten.ardite");
TRepo.moltenArditeFluid.setBlockID(TRepo.moltenArdite).setLuminosity(12).setDensity(3000).setViscosity(6000).setTemperature(1300);
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.moltenArditeFluid, 1000), new ItemStack(TRepo.buckets, 1, 6), new ItemStack(Item.bucketEmpty)));
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.moltenArditeFluid, 1000), new ItemStack(TRepo.buckets, 1, 6), new ItemStack(Items.bucket)));
TRepo.moltenBronzeFluid = new Fluid("bronze.molten");
if (!FluidRegistry.registerFluid(TRepo.moltenBronzeFluid))
@@ -209,7 +209,7 @@ public class TContent implements IFuelHandler
TRepo.moltenBronze = new TConstructFluid(PHConstruct.moltenBronze, TRepo.moltenBronzeFluid, Material.field_151587_i, "liquid_bronze").func_149663_c("fluid.molten.bronze");
GameRegistry.registerBlock(TRepo.moltenBronze, "fluid.molten.bronze");
TRepo.moltenBronzeFluid.setBlockID(TRepo.moltenBronze).setLuminosity(12).setDensity(3000).setViscosity(6000).setTemperature(1300);
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.moltenBronzeFluid, 1000), new ItemStack(TRepo.buckets, 1, 7), new ItemStack(Item.bucketEmpty)));
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.moltenBronzeFluid, 1000), new ItemStack(TRepo.buckets, 1, 7), new ItemStack(Items.bucket)));
TRepo.moltenAlubrassFluid = new Fluid("aluminumbrass.molten");
if (!FluidRegistry.registerFluid(TRepo.moltenAlubrassFluid))
@@ -217,7 +217,7 @@ public class TContent implements IFuelHandler
TRepo.moltenAlubrass = new TConstructFluid(PHConstruct.moltenAlubrass, TRepo.moltenAlubrassFluid, Material.field_151587_i, "liquid_alubrass").func_149663_c("fluid.molten.alubrass");
GameRegistry.registerBlock(TRepo.moltenAlubrass, "fluid.molten.alubrass");
TRepo.moltenAlubrassFluid.setBlockID(TRepo.moltenAlubrass).setLuminosity(12).setDensity(3000).setViscosity(6000).setTemperature(1300);
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.moltenAlubrassFluid, 1000), new ItemStack(TRepo.buckets, 1, 8), new ItemStack(Item.bucketEmpty)));
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.moltenAlubrassFluid, 1000), new ItemStack(TRepo.buckets, 1, 8), new ItemStack(Items.bucket)));
TRepo.moltenManyullynFluid = new Fluid("manyullyn.molten");
if (!FluidRegistry.registerFluid(TRepo.moltenManyullynFluid))
@@ -225,7 +225,7 @@ public class TContent implements IFuelHandler
TRepo.moltenManyullyn = new TConstructFluid(PHConstruct.moltenManyullyn, TRepo.moltenManyullynFluid, Material.field_151587_i, "liquid_manyullyn").func_149663_c("fluid.molten.manyullyn");
GameRegistry.registerBlock(TRepo.moltenManyullyn, "fluid.molten.manyullyn");
TRepo.moltenManyullynFluid.setBlockID(TRepo.moltenManyullyn).setLuminosity(12).setDensity(3000).setViscosity(6000).setTemperature(1300);
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.moltenManyullynFluid, 1000), new ItemStack(TRepo.buckets, 1, 9), new ItemStack(Item.bucketEmpty)));
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.moltenManyullynFluid, 1000), new ItemStack(TRepo.buckets, 1, 9), new ItemStack(Items.bucket)));
TRepo.moltenAlumiteFluid = new Fluid("alumite.molten");
if (!FluidRegistry.registerFluid(TRepo.moltenAlumiteFluid))
@@ -233,7 +233,7 @@ public class TContent implements IFuelHandler
TRepo.moltenAlumite = new TConstructFluid(PHConstruct.moltenAlumite, TRepo.moltenAlumiteFluid, Material.field_151587_i, "liquid_alumite").func_149663_c("fluid.molten.alumite");
GameRegistry.registerBlock(TRepo.moltenAlumite, "fluid.molten.alumite");
TRepo.moltenAlumiteFluid.setBlockID(TRepo.moltenAlumite).setLuminosity(12).setDensity(3000).setViscosity(6000).setTemperature(1300);
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.moltenAlumiteFluid, 1000), new ItemStack(TRepo.buckets, 1, 10), new ItemStack(Item.bucketEmpty)));
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.moltenAlumiteFluid, 1000), new ItemStack(TRepo.buckets, 1, 10), new ItemStack(Items.bucket)));
TRepo.moltenObsidianFluid = new Fluid("obsidian.molten");
if (!FluidRegistry.registerFluid(TRepo.moltenObsidianFluid))
@@ -241,7 +241,7 @@ public class TContent implements IFuelHandler
TRepo.moltenObsidian = new TConstructFluid(PHConstruct.moltenObsidian, TRepo.moltenObsidianFluid, Material.field_151587_i, "liquid_obsidian").func_149663_c("fluid.molten.obsidian");
GameRegistry.registerBlock(TRepo.moltenObsidian, "fluid.molten.obsidian");
TRepo.moltenObsidianFluid.setBlockID(TRepo.moltenObsidian).setLuminosity(12).setDensity(3000).setViscosity(6000).setTemperature(1300);
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.moltenObsidianFluid, 1000), new ItemStack(TRepo.buckets, 1, 11), new ItemStack(Item.bucketEmpty)));
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.moltenObsidianFluid, 1000), new ItemStack(TRepo.buckets, 1, 11), new ItemStack(Items.bucket)));
TRepo.moltenSteelFluid = new Fluid("steel.molten");
if (!FluidRegistry.registerFluid(TRepo.moltenSteelFluid))
@@ -249,7 +249,7 @@ public class TContent implements IFuelHandler
TRepo.moltenSteel = new TConstructFluid(PHConstruct.moltenSteel, TRepo.moltenSteelFluid, Material.field_151587_i, "liquid_steel").func_149663_c("fluid.molten.steel");
GameRegistry.registerBlock(TRepo.moltenSteel, "fluid.molten.steel");
TRepo.moltenSteelFluid.setBlockID(TRepo.moltenSteel).setLuminosity(12).setDensity(3000).setViscosity(6000).setTemperature(1300);
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.moltenSteelFluid, 1000), new ItemStack(TRepo.buckets, 1, 12), new ItemStack(Item.bucketEmpty)));
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.moltenSteelFluid, 1000), new ItemStack(TRepo.buckets, 1, 12), new ItemStack(Items.bucket)));
TRepo.moltenGlassFluid = new Fluid("glass.molten");
if (!FluidRegistry.registerFluid(TRepo.moltenGlassFluid))
@@ -257,7 +257,7 @@ public class TContent implements IFuelHandler
TRepo.moltenGlass = new TConstructFluid(PHConstruct.moltenGlass, TRepo.moltenGlassFluid, Material.field_151587_i, "liquid_glass", true).func_149663_c("fluid.molten.glass");
GameRegistry.registerBlock(TRepo.moltenGlass, "fluid.molten.glass");
TRepo.moltenGlassFluid.setBlockID(TRepo.moltenGlass).setLuminosity(12).setDensity(3000).setViscosity(6000).setTemperature(1300);
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.moltenGlassFluid, 1000), new ItemStack(TRepo.buckets, 1, 13), new ItemStack(Item.bucketEmpty)));
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.moltenGlassFluid, 1000), new ItemStack(TRepo.buckets, 1, 13), new ItemStack(Items.bucket)));
TRepo.moltenStoneFluid = new Fluid("stone.seared");
if (!FluidRegistry.registerFluid(TRepo.moltenStoneFluid))
@@ -265,7 +265,7 @@ public class TContent implements IFuelHandler
TRepo.moltenStone = new TConstructFluid(PHConstruct.moltenStone, TRepo.moltenStoneFluid, Material.field_151587_i, "liquid_stone").func_149663_c("molten.stone");
GameRegistry.registerBlock(TRepo.moltenStone, "molten.stone");
TRepo.moltenStoneFluid.setBlockID(TRepo.moltenStone).setLuminosity(12).setDensity(3000).setViscosity(6000).setTemperature(1300);
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.moltenStoneFluid, 1000), new ItemStack(TRepo.buckets, 1, 14), new ItemStack(Item.bucketEmpty)));
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.moltenStoneFluid, 1000), new ItemStack(TRepo.buckets, 1, 14), new ItemStack(Items.bucket)));
TRepo.moltenEmeraldFluid = new Fluid("emerald.liquid");
if (!FluidRegistry.registerFluid(TRepo.moltenEmeraldFluid))
@@ -273,7 +273,7 @@ public class TContent implements IFuelHandler
TRepo.moltenEmerald = new TConstructFluid(PHConstruct.moltenEmerald, TRepo.moltenEmeraldFluid, Material.water, "liquid_villager").func_149663_c("molten.emerald");
GameRegistry.registerBlock(TRepo.moltenEmerald, "molten.emerald");
TRepo.moltenEmeraldFluid.setBlockID(TRepo.moltenEmerald).setDensity(3000).setViscosity(6000).setTemperature(1300);
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.moltenEmeraldFluid, 1000), new ItemStack(TRepo.buckets, 1, 15), new ItemStack(Item.bucketEmpty)));
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.moltenEmeraldFluid, 1000), new ItemStack(TRepo.buckets, 1, 15), new ItemStack(Items.bucket)));
TRepo.bloodFluid = new Fluid("blood");
if (!FluidRegistry.registerFluid(TRepo.bloodFluid))
@@ -281,7 +281,7 @@ public class TContent implements IFuelHandler
TRepo.blood = new BloodBlock(PHConstruct.blood, TRepo.bloodFluid, Material.water, "liquid_cow").func_149663_c("liquid.blood");
GameRegistry.registerBlock(TRepo.blood, "liquid.blood");
TRepo.bloodFluid.setBlockID(TRepo.blood).setDensity(3000).setViscosity(6000).setTemperature(1300);
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.bloodFluid, 1000), new ItemStack(TRepo.buckets, 1, 16), new ItemStack(Item.bucketEmpty)));
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.bloodFluid, 1000), new ItemStack(TRepo.buckets, 1, 16), new ItemStack(Items.bucket)));
TRepo.moltenNickelFluid = new Fluid("nickel.molten");
if (!FluidRegistry.registerFluid(TRepo.moltenNickelFluid))
@@ -289,7 +289,7 @@ public class TContent implements IFuelHandler
TRepo.moltenNickel = new TConstructFluid(PHConstruct.moltenNickel, TRepo.moltenNickelFluid, Material.field_151587_i, "liquid_ferrous").func_149663_c("fluid.molten.nickel");
GameRegistry.registerBlock(TRepo.moltenNickel, "fluid.molten.nickel");
TRepo.moltenNickelFluid.setBlockID(TRepo.moltenNickel).setDensity(3000).setViscosity(6000).setTemperature(1300);
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.moltenNickelFluid, 1000), new ItemStack(TRepo.buckets, 1, 17), new ItemStack(Item.bucketEmpty)));
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.moltenNickelFluid, 1000), new ItemStack(TRepo.buckets, 1, 17), new ItemStack(Items.bucket)));
TRepo.moltenLeadFluid = new Fluid("lead.molten");
if (!FluidRegistry.registerFluid(TRepo.moltenLeadFluid))
@@ -297,7 +297,7 @@ public class TContent implements IFuelHandler
TRepo.moltenLead = new TConstructFluid(PHConstruct.moltenLead, TRepo.moltenLeadFluid, Material.field_151587_i, "liquid_lead").func_149663_c("fluid.molten.lead");
GameRegistry.registerBlock(TRepo.moltenLead, "fluid.molten.lead");
TRepo.moltenLeadFluid.setBlockID(TRepo.moltenLead).setDensity(3000).setViscosity(6000).setTemperature(1300);
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.moltenLeadFluid, 1000), new ItemStack(TRepo.buckets, 1, 18), new ItemStack(Item.bucketEmpty)));
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.moltenLeadFluid, 1000), new ItemStack(TRepo.buckets, 1, 18), new ItemStack(Items.bucket)));
TRepo.moltenSilverFluid = new Fluid("silver.molten");
if (!FluidRegistry.registerFluid(TRepo.moltenSilverFluid))
@@ -305,7 +305,7 @@ public class TContent implements IFuelHandler
TRepo.moltenSilver = new TConstructFluid(PHConstruct.moltenSilver, TRepo.moltenSilverFluid, Material.field_151587_i, "liquid_silver").func_149663_c("fluid.molten.silver");
GameRegistry.registerBlock(TRepo.moltenSilver, "fluid.molten.silver");
TRepo.moltenSilverFluid.setBlockID(TRepo.moltenSilver).setDensity(3000).setViscosity(6000).setTemperature(1300);
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.moltenSilverFluid, 1000), new ItemStack(TRepo.buckets, 1, 19), new ItemStack(Item.bucketEmpty)));
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.moltenSilverFluid, 1000), new ItemStack(TRepo.buckets, 1, 19), new ItemStack(Items.bucket)));
TRepo.moltenShinyFluid = new Fluid("platinum.molten");
if (!FluidRegistry.registerFluid(TRepo.moltenShinyFluid))
@@ -313,7 +313,7 @@ public class TContent implements IFuelHandler
TRepo.moltenShiny = new TConstructFluid(PHConstruct.moltenShiny, TRepo.moltenShinyFluid, Material.field_151587_i, "liquid_shiny").func_149663_c("fluid.molten.shiny");
GameRegistry.registerBlock(TRepo.moltenShiny, "fluid.molten.shiny");
TRepo.moltenShinyFluid.setBlockID(TRepo.moltenShiny).setDensity(3000).setViscosity(6000).setTemperature(1300);
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.moltenShinyFluid, 1000), new ItemStack(TRepo.buckets, 1, 20), new ItemStack(Item.bucketEmpty)));
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.moltenShinyFluid, 1000), new ItemStack(TRepo.buckets, 1, 20), new ItemStack(Items.bucket)));
TRepo.moltenInvarFluid = new Fluid("invar.molten");
if (!FluidRegistry.registerFluid(TRepo.moltenInvarFluid))
@@ -321,7 +321,7 @@ public class TContent implements IFuelHandler
TRepo.moltenInvar = new TConstructFluid(PHConstruct.moltenInvar, TRepo.moltenInvarFluid, Material.field_151587_i, "liquid_invar").func_149663_c("fluid.molten.invar");
GameRegistry.registerBlock(TRepo.moltenInvar, "fluid.molten.invar");
TRepo.moltenInvarFluid.setBlockID(TRepo.moltenInvar).setDensity(3000).setViscosity(6000).setTemperature(1300);
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.moltenInvarFluid, 1000), new ItemStack(TRepo.buckets, 1, 21), new ItemStack(Item.bucketEmpty)));
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.moltenInvarFluid, 1000), new ItemStack(TRepo.buckets, 1, 21), new ItemStack(Items.bucket)));
TRepo.moltenElectrumFluid = new Fluid("electrum.molten");
if (!FluidRegistry.registerFluid(TRepo.moltenElectrumFluid))
@@ -329,7 +329,7 @@ public class TContent implements IFuelHandler
TRepo.moltenElectrum = new TConstructFluid(PHConstruct.moltenElectrum, TRepo.moltenElectrumFluid, Material.field_151587_i, "liquid_electrum").func_149663_c("fluid.molten.electrum");
GameRegistry.registerBlock(TRepo.moltenElectrum, "fluid.molten.electrum");
TRepo.moltenElectrumFluid.setBlockID(TRepo.moltenElectrum).setDensity(3000).setViscosity(6000).setTemperature(1300);
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.moltenElectrumFluid, 1000), new ItemStack(TRepo.buckets, 1, 22), new ItemStack(Item.bucketEmpty)));
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.moltenElectrumFluid, 1000), new ItemStack(TRepo.buckets, 1, 22), new ItemStack(Items.bucket)));
TRepo.moltenEnderFluid = new Fluid("ender");
if (!FluidRegistry.registerFluid(TRepo.moltenEnderFluid))
@@ -344,7 +344,7 @@ public class TContent implements IFuelHandler
TRepo.moltenEnder = new TConstructFluid(PHConstruct.moltenEnder, TRepo.moltenEnderFluid, Material.water, "liquid_ender").func_149663_c("fluid.ender");
GameRegistry.registerBlock(TRepo.moltenEnder, "fluid.ender");
TRepo.moltenEnderFluid.setBlockID(TRepo.moltenEnder).setDensity(3000).setViscosity(6000);
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.moltenEnderFluid, 1000), new ItemStack(TRepo.buckets, 1, 23), new ItemStack(Item.bucketEmpty)));
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.moltenEnderFluid, 1000), new ItemStack(TRepo.buckets, 1, 23), new ItemStack(Items.bucket)));
}
//Slime
@@ -357,7 +357,7 @@ public class TContent implements IFuelHandler
.func_149663_c("liquid.slime");
GameRegistry.registerBlock(TRepo.slimePool, "liquid.slime");
TRepo.blueSlimeFluid.setBlockID(TRepo.slimePool);
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.blueSlimeFluid, 1000), new ItemStack(TRepo.buckets, 1, 24), new ItemStack(Item.bucketEmpty)));
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.blueSlimeFluid, 1000), new ItemStack(TRepo.buckets, 1, 24), new ItemStack(Items.bucket)));
//Glue
TRepo.glueFluid = new Fluid("glue").setDensity(6000).setViscosity(6000).setTemperature(200);
@@ -367,7 +367,7 @@ public class TContent implements IFuelHandler
.func_149663_c("liquid.glue");
GameRegistry.registerBlock(TRepo.glueFluidBlock, "liquid.glue");
TRepo.glueFluid.setBlockID(TRepo.glueFluidBlock);
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.glueFluid, 1000), new ItemStack(TRepo.buckets, 1, 26), new ItemStack(Item.bucketEmpty)));
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(TRepo.glueFluid, 1000), new ItemStack(TRepo.buckets, 1, 26), new ItemStack(Items.bucket)));
TRepo.pigIronFluid = new Fluid("pigiron.molten");
if (!FluidRegistry.registerFluid(TRepo.pigIronFluid))
@@ -389,7 +389,7 @@ public class TContent implements IFuelHandler
TRepo.slimeSapling = (SlimeSapling) new SlimeSapling(PHConstruct.slimeSapling).setStepSound(TRepo.slimeStep).func_149663_c("slime.sapling");
TRepo.slimeChannel = new ConveyorBase(PHConstruct.slimeChannel, Material.water, "greencurrent").setHardness(0.3f).setStepSound(TRepo.slimeStep).func_149663_c("slime.channel");
TRepo.bloodChannel = new ConveyorBase(PHConstruct.bloodChannel, Material.water, "liquid_cow").setHardness(0.3f).setStepSound(TRepo.slimeStep).func_149663_c("blood.channel");
TRepo.slimePad = new SlimePad(PHConstruct.slimePad, Material.cloth).setStepSound(TRepo.slimeStep).setHardness(0.3f).func_149663_c("slime.pad");
TRepo.slimePad = new SlimePad(PHConstruct.slimePad, Material.field_151580_n).setStepSound(TRepo.slimeStep).setHardness(0.3f).func_149663_c("slime.pad");
//Decoration
TRepo.stoneTorch = new StoneTorch(PHConstruct.stoneTorch).func_149663_c("decoration.stonetorch");
@@ -701,18 +701,18 @@ public class TContent implements IFuelHandler
TConstructRegistry.addArrowMaterial(17, 0.42F, 0.0F, 100F); //Blue Slime
TConstructRegistry.addArrowMaterial(18, 6.8F, 0.5F, 100F); //Iron
TConstructRegistry.addBowstringMaterial(0, 2, new ItemStack(Item.silk), new ItemStack(TRepo.bowstring, 1, 0), 1F, 1F, 1f); //String
TConstructRegistry.addFletchingMaterial(0, 2, new ItemStack(Item.feather), new ItemStack(TRepo.fletching, 1, 0), 100F, 0F, 0.05F); //Feather
TConstructRegistry.addBowstringMaterial(0, 2, new ItemStack(Items.string), new ItemStack(TRepo.bowstring, 1, 0), 1F, 1F, 1f); //String
TConstructRegistry.addFletchingMaterial(0, 2, new ItemStack(Items.feather), new ItemStack(TRepo.fletching, 1, 0), 100F, 0F, 0.05F); //Feather
for (int i = 0; i < 4; i++)
TConstructRegistry.addFletchingMaterial(1, 2, new ItemStack(Block.leaves, 1, i), new ItemStack(TRepo.fletching, 1, 1), 75F, 0F, 0.2F); //All four vanialla Leaves
TConstructRegistry.addFletchingMaterial(1, 2, new ItemStack(Blocks.leaves, 1, i), new ItemStack(TRepo.fletching, 1, 1), 75F, 0F, 0.2F); //All four vanialla Leaves
TConstructRegistry.addFletchingMaterial(2, 2, new ItemStack(TRepo.materials, 1, 1), new ItemStack(TRepo.fletching, 1, 2), 100F, 0F, 0.12F); //Slime
TConstructRegistry.addFletchingMaterial(3, 2, new ItemStack(TRepo.materials, 1, 17), new ItemStack(TRepo.fletching, 1, 3), 100F, 0F, 0.12F); //BlueSlime
PatternBuilder pb = PatternBuilder.instance;
if (PHConstruct.enableTWood)
pb.registerFullMaterial(Block.planks, 2, "Wood", new ItemStack(Item.stick), new ItemStack(Item.stick), 0);
pb.registerFullMaterial(Blocks.planks, 2, "Wood", new ItemStack(Items.stick), new ItemStack(Items.stick), 0);
else
pb.registerMaterialSet("Wood", new ItemStack(Item.stick, 2), new ItemStack(Item.stick), 0);
pb.registerMaterialSet("Wood", new ItemStack(Items.stick, 2), new ItemStack(Items.stick), 0);
if (PHConstruct.enableTStone)
{
pb.registerFullMaterial(Block.stone, 2, "Stone", new ItemStack(TRepo.toolShard, 1, 1), new ItemStack(TRepo.toolRod, 1, 1), 1);
@@ -132,8 +132,10 @@ public class TRecipes
GameRegistry.registerBlock(TRepo.slimeChannel, "slime.channel");
GameRegistry.registerBlock(TRepo.bloodChannel, "blood.channel");
GameRegistry.registerBlock(TRepo.slimePad, "slime.pad");
TConstructRegistry.drawbridgeState[TRepo.slimePad] = 1;
//TODO fix this
/*TConstructRegistry.drawbridgeState[TRepo.slimePad] = 1;
TConstructRegistry.drawbridgeState[TRepo.bloodChannel] = 1;
*/
//Decoration
GameRegistry.registerBlock(TRepo.stoneTorch, "decoration.stonetorch");
@@ -15,11 +15,12 @@ import net.minecraft.util.StatCollector;
public class BarricadeItem extends ItemBlock
{
private int bID;
private Block b;
public BarricadeItem(Block b)
{
super(b);
this.b = b;
}
@Override
@@ -79,17 +80,17 @@ public class BarricadeItem extends ItemBlock
{
return false;
}
else if (y == 255 && Block.blocksList[this.bID].blockMaterial.isSolid())
else if (y == 255 && this.b.func_149688_o().isSolid())
{
return false;
}
else if (world.canPlaceEntityOnSide(this.bID, x, y, z, false, side, player, stack))
else if (world.canPlaceEntityOnSide(this.b, x, y, z, false, side, player, stack))
{
Block block = Block.blocksList[this.bID];
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 = Block.blocksList[this.bID].onBlockPlaced(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))
{
@@ -10,15 +10,13 @@ import net.minecraft.world.World;
public class WoolSlab1Item extends MultiItemBlock
{
int blockID;
Block block;
public WoolSlab1Item(Block b)
{
super(b, "", "slab", ItemDye.dyeColorNames);
this.setSpecialIndex(7, 15);
this.blockID = id + 256;
this.block = Block.blocksList[id + 256];
this.block = b;
setMaxDamage(0);
setHasSubtypes(true);
}
@@ -31,9 +29,9 @@ public class WoolSlab1Item extends MultiItemBlock
int trueMeta = meta % 8;
boolean flag = (id & 8) != 0;
if ((side == 1 && flag || side == 0 && !flag) && id == this.blockID && trueMeta == stack.getItemDamage())
if ((side == 1 && flag || side == 0 && !flag) && id == this && trueMeta == stack.getItemDamage())
{
if (world.setBlock(x, y, z, Blocks.wool.blockID, 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.stepSound.getPlaceSound(),
(this.block.stepSound.getVolume() + 1.0F) / 2.0F, this.block.stepSound.getPitch() * 0.8F);
@@ -27,14 +27,14 @@ 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)
{
int id = world.getBlockId(x, y, z);
int id = world.func_147439_a(x, y, z);
int meta = world.getBlockMetadata(x, y, z);
int trueMeta = meta % 8;
boolean flag = (id & 8) != 0;
if ((side == 1 && flag || side == 0 && !flag) && id == this.blockID && trueMeta == stack.getItemDamage())
{
if (world.setBlock(x, y, z, Blocks.wool.blockID, trueMeta + 8, 3))
if (world.func_147465_d(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.stepSound.getPlaceSound(),
(this.block.stepSound.getVolume() + 1.0F) / 2.0F, this.block.stepSound.getPitch() * 0.8F);
@@ -52,7 +52,7 @@ public class Battleaxe extends HarvestTool
return AbilityHelper.onBlockChanged(itemstack, world, b, x, y, z, player, random);
}
static Material[] materials = { Material.wood, Material.vine, Material.circuits, Material.cactus, Material.pumpkin };
static Material[] materials = { Material.field_151575_d, Material.field_151582_l, Material.circuits, Material.cactus, Material.pumpkin };
@Override
public Item getHeadItem ()
@@ -252,7 +252,7 @@ public class Battleaxe extends HarvestTool
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.wood)
if (!(tags.getBoolean("Broken")) && block != null && block.func_149688_o() == Material.field_151575_d)
{
Block localblock = world.func_147439_a(x, yPos, z);
int localMeta = world.getBlockMetadata(x, yPos, z);
@@ -269,7 +269,7 @@ public class Battleaxe extends HarvestTool
if (!cancelHarvest)
{
if (block != null && block.func_149688_o() == Material.wood)
if (block != null && block.func_149688_o() == Material.field_151575_d)
{
localMeta = world.getBlockMetadata(x, yPos, z);
if (!player.capabilities.isCreativeMode)
@@ -280,7 +280,7 @@ public class Battleaxe extends HarvestTool
}
block.harvestBlock(world, player, x, yPos, z, localMeta);
block.onBlockHarvested(world, x, yPos, z, localMeta, player);
onBlockDestroyed(stack, world, func_147439_a, x, yPos, z, player);
onBlockDestroyed(stack, world, block, x, yPos, z, player);
}
else
{
@@ -140,9 +140,8 @@ public class Excavator extends HarvestTool
return false;
World world = player.worldObj;
final int blockID = world.getBlockId(x, y, z);
final int meta = world.getBlockMetadata(x, y, z);
Block block = Block.blocksList[blockID];
Block block = world.getBlock(x, y, z);
if (!stack.hasTagCompound())
return false;
@@ -192,8 +191,8 @@ public class Excavator extends HarvestTool
{
if (!(tags.getBoolean("Broken")))
{
int localblockID = world.getBlockId(xPos, yPos, zPos);
block = Block.blocksList[localblockID];
Block localblock = world.getBlock(xPos, yPos, zPos);
block = localblock;
int localMeta = world.getBlockMetadata(xPos, yPos, zPos);
int hlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType());
float localHardness = block == null ? Float.MAX_VALUE : block.getBlockHardness(world, xPos, yPos, zPos);
@@ -224,7 +223,7 @@ public class Excavator extends HarvestTool
block.harvestBlock(world, player, xPos, yPos, zPos, localMeta);
block.onBlockHarvested(world, xPos, yPos, zPos, localMeta, player);
if (blockHardness > 0f)
onBlockDestroyed(stack, world, localblockID, xPos, yPos, zPos, player);
onBlockDestroyed(stack, world, localblock, xPos, yPos, zPos, player);
}
else
{
@@ -127,7 +127,7 @@ public class FryingPan extends Weapon
}
else
{
world.setBlock(x, y, z, TRepo.heldItemBlock.blockID, 0, 3);
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);
@@ -289,8 +289,7 @@ public class Hammer extends HarvestTool
{
if (!(tags.getBoolean("Broken")))
{
int localblockID = world.getBlockId(xPos, yPos, zPos);
Block localBlock = Block.blocksList[localblockID];
Block localBlock = world.getBlock(xPos, yPos, zPos);
int localMeta = world.getBlockMetadata(xPos, yPos, zPos);
int hlvl = MinecraftForge.getBlockHarvestLevel(localBlock, meta, getHarvestType());
float localHardness = localBlock == null ? Float.MAX_VALUE : localBlock.getBlockHardness(world, xPos, yPos, zPos);
@@ -321,7 +320,7 @@ public class Hammer extends HarvestTool
localBlock.harvestBlock(world, player, xPos, yPos, zPos, localMeta);
localBlock.onBlockHarvested(world, xPos, yPos, zPos, localMeta, player);
if (blockHardness > 0f)
onBlockDestroyed(stack, world, localblockID, xPos, yPos, zPos, player);
onBlockDestroyed(stack, world, localBlock, xPos, yPos, zPos, player);
}
else
{
@@ -34,16 +34,15 @@ public class Hatchet extends HarvestTool
}
@Override
public boolean onBlockDestroyed (ItemStack itemstack, World world, int bID, 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)
{
Block block = Block.blocksList[bID];
if (block != null && block.func_149688_o() == Material.leaves)
return false;
return AbilityHelper.onBlockChanged(itemstack, world, bID, x, y, z, player, random);
return AbilityHelper.onBlockChanged(itemstack, world, block, x, y, z, player, random);
}
static Material[] materials = { Material.wood, Material.leaves, Material.vine, Material.circuits, Material.cactus, Material.pumpkin };
static Material[] materials = { Material.field_151575_d, Material.leaves, Material.field_151582_l, Material.circuits, Material.cactus, Material.pumpkin };
@Override
public Item getHeadItem ()
@@ -54,16 +54,15 @@ public class LumberAxe extends HarvestTool
}
@Override
public boolean onBlockDestroyed (ItemStack itemstack, World world, int bID, 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)
{
Block block = Block.blocksList[bID];
if (block != null && block.func_149688_o() == Material.leaves)
return false;
return AbilityHelper.onBlockChanged(itemstack, world, bID, x, y, z, player, random);
return AbilityHelper.onBlockChanged(itemstack, world, block, x, y, z, player, random);
}
static Material[] materials = { Material.wood, Material.vine, Material.circuits, Material.cactus, Material.pumpkin };
static Material[] materials = { Material.field_151575_d, Material.field_151582_l, Material.circuits, Material.cactus, Material.pumpkin };
/* Lumber axe specific */
@@ -139,8 +138,7 @@ public class LumberAxe extends HarvestTool
return false;
World world = player.worldObj;
final int woodID = world.getBlockId(x, y, z);
final Block wood = Block.blocksList[woodID];
final Block wood = world.func_147439_a(x, y, z);;
if (wood == null)
{
return super.onBlockStartBreak(stack, x, y, z, player);
@@ -152,8 +150,8 @@ public class LumberAxe extends HarvestTool
do
{
height++;
int blockID = world.getBlockId(x, height, z);
if (blockID != woodID)
Block block = world.func_147439_a(x, height, z);
if (block != wood)
{
height--;
foundTop = true;
@@ -169,7 +167,7 @@ public class LumberAxe extends HarvestTool
{
for (int zPos = z - 1; zPos <= z + 1; zPos++)
{
Block leaves = Block.blocksList[world.getBlockId(xPos, yPos, zPos)];
Block leaves = world.func_147439_a(xPos, yPos, zPos);
if (leaves != null && leaves.isLeaves(world, xPos, yPos, zPos))
numLeaves++;
}
@@ -180,14 +178,14 @@ public class LumberAxe extends HarvestTool
NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool");
int meta = world.getBlockMetadata(x, y, z);
if (numLeaves > 3)
breakTree(world, x, y, z, stack, tags, woodID, meta, player);
breakTree(world, x, y, z, stack, tags, wood, meta, player);
else
destroyWood(world, x, y, z, stack, tags, player);
if (!world.isRemote)
world.playAuxSFX(2001, x, y, z, woodID + (meta << 12));
}
else if (wood.func_149688_o() == Material.wood)
else if (wood.func_149688_o() == Material.field_151575_d)
{
NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool");
int meta = world.getBlockMetadata(x, y, z);
@@ -198,7 +196,7 @@ public class LumberAxe extends HarvestTool
return super.onBlockStartBreak(stack, x, y, z, player);
}
void breakTree (World world, int x, int y, int z, ItemStack stack, NBTTagCompound tags, int bID, int meta, EntityPlayer player)
void breakTree (World world, int x, int y, int z, ItemStack stack, NBTTagCompound tags, Block bID, int meta, EntityPlayer player)
{
Block block;
for (int xPos = x - 1; xPos <= x + 1; xPos++)
@@ -209,10 +207,10 @@ public class LumberAxe extends HarvestTool
{
if (!(tags.getBoolean("Broken")))
{
int localblockID = world.getBlockId(xPos, yPos, zPos);
if (bID == localblockID)
Block localblock = world.func_147439_a(xPos, yPos, zPos);
if (bID == localblock)
{
block = Block.blocksList[localblockID];
block = localblock;
meta = world.getBlockMetadata(xPos, yPos, zPos);
int hlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType());
@@ -231,7 +229,7 @@ public class LumberAxe extends HarvestTool
}
else
{
if (localblockID == bID && world.getBlockMetadata(xPos, yPos, zPos) % 4 == meta % 4)
if (localblock == bID && world.getBlockMetadata(xPos, yPos, zPos) % 4 == meta % 4)
{
/* world.setBlock(xPos, yPos, zPos, 0, 0, 3);
if (!player.capabilities.isCreativeMode)
@@ -247,7 +245,7 @@ public class LumberAxe extends HarvestTool
}
block.harvestBlock(world, player, xPos, yPos, zPos, meta);
block.onBlockHarvested(world, xPos, yPos, zPos, meta, player);
onBlockDestroyed(stack, world, localblockID, xPos, yPos, zPos, player);
onBlockDestroyed(stack, world, localblock, xPos, yPos, zPos, player);
}
else
{
@@ -287,11 +285,11 @@ public class LumberAxe extends HarvestTool
{
if (!(tags.getBoolean("Broken")))
{
Block block = world.getBlock(xPos, yPos, zPos);
Block block = world.func_147439_a(xPos, yPos, zPos);
int meta = world.getBlockMetadata(xPos, yPos, zPos);
int hlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType());
if (block != null && block.func_149688_o() == Material.wood)
if (block != null && block.func_149688_o() == Material.field_151575_d)
{
if (hlvl <= tags.getInteger("HarvestLevel"))
{
@@ -47,7 +47,7 @@ public class Mattock extends DualHarvestTool
return "shovel";
}
static Material[] axeMaterials = { Material.wood, Material.cactus, Material.pumpkin, Material.plants, Material.vine };
static Material[] axeMaterials = { Material.field_151575_d, Material.cactus, Material.pumpkin, Material.plants, Material.vine };
static Material[] shovelMaterials = { Material.grass, Material.ground, Material.clay };
@Override
@@ -122,8 +122,8 @@ public class Mattock extends DualHarvestTool
{
if (!TRepo.supressMissingToolLogs)
{
TConstruct.logger.warning("Creative builder failed tool for " + name + this.getToolName());
TConstruct.logger.warning("Make sure you do not have item ID conflicts");
TConstruct.logger.warn("Creative builder failed tool for " + name + this.getToolName());
TConstruct.logger.warn("Make sure you do not have item ID conflicts");
}
}
else
@@ -40,7 +40,7 @@ public class Scythe extends Weapon
return materials;
}
static Material[] materials = new Material[] { Material.web, Material.cactus, Material.pumpkin, Material.plants, Material.vine, Material.leaves };
static Material[] materials = new Material[] { Material.web, Material.cactus, Material.pumpkin, Material.plants, Material.field_151582_l, Material.leaves };
@Override
public Item getHeadItem ()
@@ -512,11 +512,11 @@ public class TConstructRegistry
* 5: Has rotational TileEntity data
* 6: Custom placement logic
*/
public static Block[] drawbridgeState = new Block[Block.blocksList.length];
public static Block[] drawbridgeState = new Block[Integer.MAX_VALUE];
/** Blocks that are interchangable with each other. Ex: Still and flowing water */
public static int[] interchangableBlockMapping = new int[Block.blocksList.length];
public static int[] interchangableBlockMapping = new int[Integer.MAX_VALUE];
/** Blocks that place items, and vice versa */
public static int[] blockToItemMapping = new int[Item.itemsList.length];
public static int[] blockToItemMapping = new int[Integer.MAX_VALUE];
static void initializeDrawbridgeState ()
{
@@ -3,10 +3,12 @@ package tconstruct.library.component;
import java.util.*;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.nbt.*;
import net.minecraft.tileentity.TileEntity;
import tconstruct.TConstruct;
import mantle.world.*;
import mantle.blocks.BlockUtils;
import mantle.blocks.iface.IFacingLogic;
import mantle.blocks.iface.IMasterLogic;
import mantle.blocks.iface.IServantLogic;
@@ -153,7 +155,7 @@ public class TankLayerScan extends LogicComponent
for (CoordTuple coord : blockCoords)
{
TileEntity servant = world.getBlockTileEntity(coord.x, coord.y, coord.z);
TileEntity servant = world.func_147438_o(coord.x, coord.y, coord.z);
if (servant instanceof IServantLogic)
((IServantLogic) servant).verifyMaster(imaster, world, master.field_145851_c, master.field_145848_d, master.field_145849_e);
}
@@ -191,8 +193,8 @@ public class TankLayerScan extends LogicComponent
protected boolean checkAir (int x, int y, int z)
{
Block block = Block.blocksList[world.getBlockId(x, y, z)];
if (block == null || block.isAirBlock(world, x, y, z))// || block == TContent.tankAir)
Block block = world.func_147439_a(x, y, z);
if (block == null || block == Blocks.air)// || block == TContent.tankAir)
return true;
return false;
@@ -200,14 +202,14 @@ public class TankLayerScan extends LogicComponent
protected boolean checkServant (int x, int y, int z)
{
Block block = Block.blocksList[world.getBlockId(x, y, z)];
if (block == null || block.isAirBlock(world, x, y, z) || !isValidBlock(x, y, z))
Block block = world.func_147439_a(x, y, z);
if (block == null || block == Blocks.air || !isValidBlock(x, y, z))
return false;
if (!block.hasTileEntity(world.getBlockMetadata(x, y, z)))
return false;
TileEntity be = world.getBlockTileEntity(x, y, z);
TileEntity be = world.func_147438_o(x, y, z);
if (be instanceof IServantLogic)
return ((IServantLogic) be).setPotentialMaster(this.imaster, this.world, x, y, z);
@@ -245,7 +247,7 @@ public class TankLayerScan extends LogicComponent
protected boolean isValidBlock (int x, int y, int z)
{
Block block = Block.blocksList[world.getBlockId(x, y, z)];
Block block = world.func_147439_a(x, y, z);
if (block != null)
{
for (int i = 0; i < scanBlocks.length; i++)
@@ -415,7 +417,7 @@ public class TankLayerScan extends LogicComponent
int height = -1;
for (CoordTuple coord : blockCoords)
{
TileEntity servant = world.getBlockTileEntity(coord.x, coord.y, coord.z);
TileEntity servant = world.func_147438_o(coord.x, coord.y, coord.z);
boolean canPass = false;
if (servant instanceof IServantLogic)
{
@@ -455,7 +457,7 @@ public class TankLayerScan extends LogicComponent
completeStructure = false;
for (CoordTuple coord : blockCoords)
{
TileEntity servant = world.getBlockTileEntity(coord.x, coord.y, coord.z);
TileEntity servant = world.func_147438_o(coord.x, coord.y, coord.z);
if (servant instanceof IServantLogic)
((IServantLogic) servant).invalidateMaster(imaster, world, master.field_145851_c, master.field_145848_d, master.field_145849_e);
}
@@ -469,7 +471,7 @@ public class TankLayerScan extends LogicComponent
if (coord.y < height)
continue;
TileEntity servant = world.getBlockTileEntity(coord.x, coord.y, coord.z);
TileEntity servant = world.func_147438_o(coord.x, coord.y, coord.z);
if (servant instanceof IServantLogic)
((IServantLogic) servant).invalidateMaster(imaster, world, master.field_145851_c, master.field_145848_d, master.field_145849_e);
}
@@ -482,7 +484,7 @@ public class TankLayerScan extends LogicComponent
while (i.hasNext())
{
CoordTuple coord = (CoordTuple) i.next();
TileEntity te = world.getBlockTileEntity(coord.x, coord.y, coord.z);
TileEntity te = world.func_147438_o(coord.x, coord.y, coord.z);
if (te != null && te instanceof IServantLogic)
{
((IServantLogic) te).invalidateMaster(imaster, world, master.field_145851_c, master.field_145848_d, master.field_145849_e);
@@ -58,9 +58,9 @@ public class Detailing
toolTag.setInteger("RenderAccessory", 2);
toolTag.setInteger("Damage", 0);
toolTag.setInteger("TotalDurability", 100);
compound.setCompoundTag("InfiTool", toolTag);
compound.setTag("InfiTool", toolTag);
toolstack.setTagCompound(compound);
addShapelessToolRecipe(new ItemStack(details.outputID, 1, details.outputMeta), toolstack, new ItemStack(details.inputID, 1, details.inputMeta));
addShapelessToolRecipe(new ItemStack(details.output, 1, details.outputMeta), toolstack, new ItemStack(details.input, 1, details.inputMeta));
}
public void addShapelessToolRecipe (ItemStack par1ItemStack, Object... par2ArrayOfObj)
@@ -30,7 +30,7 @@ public class ModFlux extends ModBoolean
{
for (ItemStack stack : batteries)
{
if (stack.itemID == input[0].itemID && input[0].getItem() instanceof IEnergyContainerItem)
if (stack.getItem() == input[0].getItem() && input[0].getItem() instanceof IEnergyContainerItem)
{
battery = true;
}
@@ -43,7 +43,7 @@ public class ModFlux extends ModBoolean
for (ItemStack stack : batteries)
{
if (stack.itemID == input[1].itemID && input[1].getItem() instanceof IEnergyContainerItem)
if (stack.getItem() == input[1].getItem() && input[1].getItem() instanceof IEnergyContainerItem)
{
battery = true;
}
@@ -59,9 +59,9 @@ public class TActiveOmniMod extends ActiveToolMod
NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool");
World world = entity.worldObj;
int bID = entity.worldObj.getBlockId(x, y, z);
Block block = entity.worldObj.getBlock(x, y, z);
int meta = world.getBlockMetadata(x, y, z);
Block block = Block.blocksList[bID];
//TODO do we need the next to lines????????
if (block == null || bID < 1 || bID > 4095)
return false;
@@ -35,9 +35,9 @@ public class EnvironmentGui extends GuiScreen
public void initGui ()
{
Keyboard.enableRepeatEvents(true);
this.buttonList.clear();
this.buttonList.add(new GuiButton(0, this.field_146294_l / 2 - 175, this.field_146295_m / 4 + 96 + 24, 350, 20, I18n.getStringParams("I accept responsibility for all cross-mod bugs in this modpack.")));
this.buttonList.add(new GuiButton(1, this.field_146294_l / 2 - 175, this.field_146295_m / 4 + 120 + 24, 350, 20, I18n.getStringParams("I do not want to run these mods together. (Exits Minecraft)")));
this.field_146292_n.clear();
this.field_146292_n.add(new GuiButton(0, this.field_146294_l / 2 - 175, this.field_146295_m / 4 + 96 + 24, 350, 20, I18n.getStringParams("I accept responsibility for all cross-mod bugs in this modpack.")));
this.field_146292_n.add(new GuiButton(1, this.field_146294_l / 2 - 175, this.field_146295_m / 4 + 120 + 24, 350, 20, I18n.getStringParams("I do not want to run these mods together. (Exits Minecraft)")));
}
/**
@@ -53,15 +53,15 @@ public class EnvironmentGui extends GuiScreen
*/
protected void actionPerformed (GuiButton button)
{
if (button.enabled)
if (button.field_146124_l)
{
if (button.id == 0)
if (button.field_146127_k == 0)
{
count++;
if (count >= mods.size())
this.field_146297_k.displayGuiScreen(this.parentGuiScreen);
}
if (button.id == 1)
if (button.field_146127_k == 1)
{
System.exit(0);
}
@@ -70,11 +70,11 @@ public class MiningExplosion extends Explosion
int l = MathHelper.floor_double(d0);
int i1 = MathHelper.floor_double(d1);
int j1 = MathHelper.floor_double(d2);
int k1 = this.world.getBlockId(l, i1, j1);
Block k1 = this.world.getBlock(l, i1, j1);
if (k1 > 0)
if (k1 != Blocks.air)
{
Block block = Block.blocksList[k1];
Block block = k1;
float f3 = this.exploder != null ? this.exploder.getBlockExplosionResistance(this, this.world, l, i1, j1, block) : block.getExplosionResistance(this.exploder, world,
l, i1, j1, explosionX, explosionY, explosionZ);
f1 -= (f3 + 0.8F) * f2 * 0.25f;
@@ -160,7 +160,7 @@ public class MiningExplosion extends Explosion
int i;
int j;
int k;
int l;
Block l;
if (this.isSmoking)
{
@@ -172,7 +172,7 @@ public class MiningExplosion extends Explosion
i = chunkposition.x;
j = chunkposition.y;
k = chunkposition.z;
l = this.world.getBlockId(i, j, k);
l = this.world.getBlock(i, j, k);
if (par1)
{
@@ -195,9 +195,9 @@ public class MiningExplosion extends Explosion
this.world.spawnParticle("smoke", d0, d1, d2, d3, d4, d5);
}
if (l > 0)
if (l != Blocks.air)
{
Block block = Block.blocksList[l];
Block block = l;
if (block.canDropFromExplosion(this))
{
@@ -219,10 +219,10 @@ public class MiningExplosion extends Explosion
i = chunkposition.x;
j = chunkposition.y;
k = chunkposition.z;
l = this.world.getBlockId(i, j, k);
int i1 = this.world.getBlockId(i, j - 1, k);
l = this.world.getBlock(i, j, k);
Block i1 = this.world.getBlock(i, j - 1, k);
if (l == 0 && Block.opaqueCubeLookup[i1] && this.random.nextInt(3) == 0)
if (l == Blocks.air && Block.opaqueCubeLookup[i1] && this.random.nextInt(3) == 0)
{
this.world.setBlock(i, j, k, Blocks.fire);
}
@@ -1,13 +1,14 @@
package tconstruct.util;
import tconstruct.achievements.TAchievements;
import tconstruct.TConstruct;
import tconstruct.common.TRepo;
import tconstruct.library.tools.AbilityHelper;
import tconstruct.util.player.TPlayerStats;
import mantle.common.ComparisonHelper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import cpw.mods.fml.common.ICraftingHandler;
@@ -16,12 +17,12 @@ public class TCraftingHandler implements ICraftingHandler
{
@Override
public void onCrafting (EntityPlayer player, ItemStack item, IInventory craftMatrix)
public void onCrafting (EntityPlayer player, ItemStack itemstack, IInventory craftMatrix)
{
int itemID = item.getItem().itemID;
Item item = itemstack.getItem();
if (!player.worldObj.isRemote)
{
if (itemID == TRepo.toolStationWood.blockID)
if (ComparisonHelper.areEquivalent(item,TRepo.toolStationWood))
{
TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.getDisplayName());
NBTTagCompound tags = player.getEntityData().getCompoundTag("TConstruct");
@@ -32,7 +33,7 @@ public class TCraftingHandler implements ICraftingHandler
AbilityHelper.spawnItemAtPlayer(player, new ItemStack(TRepo.manualBook, 1, 1));
}
}
if (itemID == TRepo.smeltery.blockID || itemID == TRepo.lavaTank.blockID)
if (ComparisonHelper.areEquivalent(item,TRepo.smeltery) || ComparisonHelper.areEquivalent(item,TRepo.lavaTank))
{
TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.getDisplayName());
NBTTagCompound tags = player.getEntityData().getCompoundTag("TConstruct");
@@ -45,7 +46,7 @@ public class TCraftingHandler implements ICraftingHandler
player.addStat(TAchievements.achievements.get("tconstruct.smelteryMaker"), 1);
}
if (itemID == TRepo.craftingStationWood.blockID){
if (ComparisonHelper.areEquivalent(item,TRepo.craftingStationWood)){
player.addStat(TAchievements.achievements.get("tconstruct.betterCrafting"), 1);
}
}
@@ -1,6 +1,7 @@
package tconstruct.util;
import tconstruct.util.player.ArmorExtended;
import mantle.blocks.BlockUtils;
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
import java.util.Random;
@@ -224,7 +225,7 @@ public class TEventHandler
{
if (stack.itemID >= 4096)
return false;
Block block = Block.blocksList[stack.itemID];
Block block = BlockUtils.getBlockFromItem(stack.getItem());
if (block != null)
{
if (block.isLeaves(null, 0, 0, 0))
@@ -2,6 +2,7 @@ package tconstruct.util.landmine.behavior;
import java.util.List;
import mantle.common.ComparisonHelper;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -24,7 +25,7 @@ public class BehaviorExplosive extends Behavior
public void executeLogic (World par1World, int par2, int par3, int par4, ItemStack par5ItemStack, Entity triggerer, boolean willBlockBeRemoved)
{
float explodeStrenght = 0;
if (par5ItemStack.itemID == Blocks.tnt.blockID)
if (ComparisonHelper.areEquivalent(par5ItemStack.getItem(), Blocks.tnt))
{
explodeStrenght = 4.0F * par5ItemStack.stackSize;
}
@@ -40,7 +41,7 @@ public class BehaviorExplosive extends Behavior
public void getInformation (ItemStack par1ItemStack, List par2List)
{
String str = "UNDEFINED";
if (par1ItemStack.itemID == Blocks.tnt.blockID)
if (ComparisonHelper.areEquivalent(par1ItemStack.getItem(), Blocks.tnt))
{
str = "medium";
}
@@ -3,13 +3,14 @@ package tconstruct.worldgen;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenerator;
public class PlantGen extends WorldGenerator
{
/** The ID of the plant block used in this plant generator. */
public final int plantID;
public final Block plant;
public final int metadata;
public int chances = 64;
int xSize = 8;
@@ -17,15 +18,15 @@ public class PlantGen extends WorldGenerator
int zSize = 8;
boolean clumped = true;
public PlantGen(int id, int meta)
public PlantGen(Block b, int meta)
{
this.plantID = id;
this.plant = b;
this.metadata = meta;
}
public PlantGen(int id, int meta, int count, int range, int height, int width, boolean clumped)
public PlantGen(Block b, int meta, int count, int range, int height, int width, boolean clumped)
{
this.plantID = id;
this.plant = b;
this.metadata = meta;
this.chances = count;
this.xSize = range;
@@ -42,9 +43,9 @@ public class PlantGen extends WorldGenerator
int posY = clumped ? y + random.nextInt(ySize) - random.nextInt(ySize) : y + random.nextInt(ySize);
int posZ = clumped ? z + random.nextInt(zSize) - random.nextInt(zSize) : z + random.nextInt(zSize);
if (world.isAirBlock(posX, posY, posZ) && (!world.provider.hasNoSky || posY < 127) && Block.blocksList[this.plantID].canBlockStay(world, posX, posY, posZ))
if (world.func_147439_a(posX, posY, posZ) == Blocks.air && (!world.provider.hasNoSky || posY < 127) && this.plant.func_149718_j(world, posX, posY, posZ))
{
world.setBlock(posX, posY, posZ, this.plantID, this.metadata, 2);
world.func_147465_d(posX, posY, posZ, this.plant, this.metadata, 2);
}
}
@@ -5,6 +5,7 @@ import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
import net.minecraft.world.EnumSkyBlock;
import net.minecraft.world.World;
import net.minecraft.world.WorldType;
@@ -66,7 +67,7 @@ public class SlimeIslandGen extends WorldGenerator implements IWorldGenerator
for (int y = 0; y <= height; y++)
{
if (ellipse.contains(x, z))
world.setBlock(x + xChunk, y + yCenter, z + zChunk, base, 5, 0);
world.func_147465_d(x + xChunk, y + yCenter, z + zChunk, base, 5, 0);
}
}
}
@@ -82,14 +83,14 @@ public class SlimeIslandGen extends WorldGenerator implements IWorldGenerator
int xPos = x + xChunk;
int yPos = y + yCenter + height;
int zPos = z + zChunk;
if (world.getBlock(xPos - 1, yPos + 1, zPos) == base && world.getBlock(xPos + 1, yPos + 1, zPos) == base && world.getBlock(xPos, yPos + 1, zPos - 1) == base
&& world.getBlock(xPos - 1, yPos + 1, zPos + 1) == base && random.nextInt(100) > randomness)
if (world.func_147439_a(xPos - 1, yPos + 1, zPos) == base && world.func_147439_a(xPos + 1, yPos + 1, zPos) == base && world.func_147439_a(xPos, yPos + 1, zPos - 1) == base
&& world.func_147439_a(xPos - 1, yPos + 1, zPos + 1) == base && random.nextInt(100) > randomness)
{
;
}
else
{
world.setBlock(xPos, yPos, zPos, 0, 0, 0);
world.func_147465_d(xPos, yPos, zPos, Blocks.air, 0, 0);
}
}
@@ -107,14 +108,14 @@ public class SlimeIslandGen extends WorldGenerator implements IWorldGenerator
int xPos = x + xChunk;
int yPos = y + yCenter + initialHeight - height + 1;
int zPos = z + zChunk;
if (world.getBlock(xPos - 1, yPos - 1, zPos) == base && world.getBlock(xPos + 1, yPos - 1, zPos) == base && world.getBlock(xPos, yPos - 1, zPos - 1) == base
&& world.getBlock(xPos - 1, yPos - 1, zPos + 1) == base)
if (world.func_147439_a(xPos - 1, yPos - 1, zPos) == base && world.func_147439_a(xPos + 1, yPos - 1, zPos) == base && world.func_147439_a(xPos, yPos - 1, zPos - 1) == base
&& world.func_147439_a(xPos - 1, yPos - 1, zPos + 1) == base)
{
;
}
else
{
world.setBlock(xPos, yPos, zPos, 0, 0, 0);
world.func_147465_d(xPos, yPos, zPos, Blocks.air, 0, 0);
}
}
}
@@ -130,11 +131,11 @@ public class SlimeIslandGen extends WorldGenerator implements IWorldGenerator
int xPos = x + xChunk;
int yPos = y + yCenter + initialHeight - height;
int zPos = z + zChunk;
if (world.getBlock(xPos, yPos, zPos) == base)
if (world.func_147439_a(xPos, yPos, zPos) == base)
{
Block block = Block.blocksList[world.getBlock(xPos, yPos + 1, zPos)];
if (block == null || block.isAirBlock(world, xPos, yPos + 1, zPos))
world.setBlock(xPos, yPos, zPos, top, 0, 0);
Block block = world.func_147439_a(xPos, yPos + 1, zPos);
if (block == null || block == Blocks.air)
world.func_147465_d(xPos, yPos, zPos, top, 0, 0);
}
}
}
@@ -145,7 +146,7 @@ public class SlimeIslandGen extends WorldGenerator implements IWorldGenerator
{
generateSlimePool(world, rand, xChunk + xRange / 2, yCenter + initialHeight, zChunk + zRange / 2);
}
PlantGen tallGrass = new PlantGen(TRepo.slimeTallGrass.blockID, 0, 128, xRange, 1, zRange, false);
PlantGen tallGrass = new PlantGen(TRepo.slimeTallGrass, 0, 128, xRange, 1, zRange, false);
tallGrass.generate(world, rand, xChunk, yCenter + initialHeight + 1, zChunk);
for (int i = 0; i < 3; i++)
{
@@ -232,7 +233,7 @@ public class SlimeIslandGen extends WorldGenerator implements IWorldGenerator
return false;
}
if (yPos < 4 && !var12.isSolid() && world.getBlock(x + xPos, y + yPos, z + zPos) != this.liquidBlock)
if (yPos < 4 && !var12.isSolid() && world.func_147439_a(x + xPos, y + yPos, z + zPos) != this.liquidBlock)
{
return false;
}
@@ -249,7 +250,7 @@ public class SlimeIslandGen extends WorldGenerator implements IWorldGenerator
{
if (validLocations[(xPos * 16 + zPos) * 8 + yPos])
{
world.setBlock(x + xPos, y + yPos, z + zPos, yPos >= 4 ? 0 : this.liquidBlock);
world.func_147465_d(x + xPos, y + yPos, z + zPos, yPos >= 4 ? Blocks.air : this.liquidBlock);
}
}
}
@@ -261,17 +262,17 @@ public class SlimeIslandGen extends WorldGenerator implements IWorldGenerator
{
for (yPos = 4; yPos < 8; ++yPos)
{
if (validLocations[(xPos * 16 + zPos) * 8 + yPos] && world.getBlock(x + xPos, y + yPos - 1, z + zPos) == base
if (validLocations[(xPos * 16 + zPos) * 8 + yPos] && world.func_147439_a(x + xPos, y + yPos - 1, z + zPos) == base
&& world.getSavedLightValue(EnumSkyBlock.Sky, x + xPos, y + yPos, z + zPos) > 0)
{
world.setBlock(x + xPos, y + yPos - 1, z + zPos, top, 0, 0);
world.func_147465_d(x + xPos, y + yPos - 1, z + zPos, top, 0, 0);
}
}
}
}
//Generate blocks around
if (this.liquidBlock.blockMaterial == Material.water)
if (this.liquidBlock.func_149688_o() == Material.field_151586_h)
{
for (xPos = 0; xPos < 16; ++xPos)
{
@@ -285,9 +286,9 @@ public class SlimeIslandGen extends WorldGenerator implements IWorldGenerator
&& validLocations[(xPos * 16 + zPos) * 8 + yPos + 1] || yPos > 0 && validLocations[(xPos * 16 + zPos) * 8 + (yPos - 1)]);
if (var33 && (yPos < 4 || rand.nextInt(2) != 0) && world.getBlockMaterial(x + xPos, y + yPos, z + zPos).isSolid()
&& world.getBlockMaterial(x + xPos, y + yPos + 1, z + zPos) != Material.water)
&& world.getBlockMaterial(x + xPos, y + yPos + 1, z + zPos) != Material.field_151586_h)
{
world.setBlock(x + xPos, y + yPos, z + zPos, TRepo.slimeGel, gelMeta, 2);
world.func_147465_d(x + xPos, y + yPos, z + zPos, TRepo.slimeGel, gelMeta, 2);
}
}
}
@@ -17,12 +17,12 @@ public class TBaseWorldGenerator implements IWorldGenerator
{
public TBaseWorldGenerator()
{
copper = new WorldGenMinable(TRepo.oreSlag, 3, 8, Block.stone);
tin = new WorldGenMinable(TRepo.oreSlag, 4, 8, Block.stone);
aluminum = new WorldGenMinable(TRepo.oreSlag, 5, 6, Block.stone);
copper = new WorldGenMinable(TRepo.oreSlag, 3, 8, Blocks.stone);
tin = new WorldGenMinable(TRepo.oreSlag, 4, 8, Blocks.stone);
aluminum = new WorldGenMinable(TRepo.oreSlag, 5, 6, Blocks.stone);
cobalt = new WorldGenMinable(TRepo.oreSlag, 1, 3, Block.netherrack);
ardite = new WorldGenMinable(TRepo.oreSlag, 2, 3, Block.netherrack);
cobalt = new WorldGenMinable(TRepo.oreSlag, 1, 3, Blocks.netherrack);
ardite = new WorldGenMinable(TRepo.oreSlag, 2, 3, Blocks.netherrack);
ironBush = new OreberryBushGen(TRepo.oreBerry, 12, 12);
goldBush = new OreberryBushGen(TRepo.oreBerry, 13, 6);
@@ -243,7 +243,7 @@ public class TBaseWorldGenerator implements IWorldGenerator
int height = y;
do
{
if (world.getBlockId(x, height, z) == 0 && world.getBlockId(x, height + 1, z) != 0)
if (world.func_147439_a(x, height, z) == Blocks.air && world.func_147439_a(x, height + 1, z) != Blocks.air)
return height + 1;
height++;
} while (height < heightLimit);
@@ -251,7 +251,7 @@ public class TBaseWorldGenerator implements IWorldGenerator
height = y;
do
{
if (world.getBlockId(x, height, z) == 0 && world.getBlockId(x, height - 1, z) != 0)
if (world.func_147439_a(x, height, z) == Blocks.air && world.func_147439_a(x, height - 1, z) != Blocks.air)
return height - 1;
height--;
} while (height > depthLimit);
@@ -263,7 +263,7 @@ public class TBaseWorldGenerator implements IWorldGenerator
{
/*for (int x = 0; x < 16; x++)
for (int z = 0; z < 16; z++)
world.setBlock(x+chunkX, 192, z+chunkZ, Block.glowStone);*/
world.func_147465_d(x+chunkX, 192, z+chunkZ, Block.glowStone);*/
for (int x = 0; x < 16; x++)
{
@@ -271,20 +271,19 @@ public class TBaseWorldGenerator implements IWorldGenerator
{
for (int y = 0; y < 128; y++)
{
int blockID = world.getBlockId(x + chunkX, y, z + chunkZ);
Block block = Block.blocksList[blockID];
Block block = world.func_147439_a(x + chunkX, y, z + chunkZ);
if (block != null)
{
if (block.func_149688_o() == Material.leaves)
world.setBlock(x + chunkX, y, z + chunkZ, Blocks.lava, 0, 0);
if (block.func_149688_o() == Material.wood)
world.setBlock(x + chunkX, y, z + chunkZ, Blocks.netherrack, 0, 0);
world.func_147465_d(x + chunkX, y, z + chunkZ, Blocks.lava, 0, 0);
if (block.func_149688_o() == Material.field_151575_d)
world.func_147465_d(x + chunkX, y, z + chunkZ, Blocks.netherrack, 0, 0);
if (block == Blocks.stone)
world.setBlock(x + chunkX, y, z + chunkZ, Blocks.end_stone, 0, 0);
world.func_147465_d(x + chunkX, y, z + chunkZ, Blocks.end_stone, 0, 0);
if (y > 40 && (block.func_149688_o() == Material.ground || block.func_149688_o() == Material.grass))
world.setBlock(x + chunkX, y, z + chunkZ, Blocks.soul_sand, 0, 0);
world.func_147465_d(x + chunkX, y, z + chunkZ, Blocks.soul_sand, 0, 0);
if (block.func_149688_o() == Material.sand)
world.setBlock(x + chunkX, y, z + chunkZ, Block.silverfish, 0, 0);
world.func_147465_d(x + chunkX, y, z + chunkZ, Blocks.silverfish, 0, 0);
}
}
}
@@ -301,7 +300,7 @@ public class TBaseWorldGenerator implements IWorldGenerator
{
for (int y = 0; y < 256; y++)
{
world.setBlock(x + chunkX, y, z + chunkZ, Blocks.bedrock, 0, 0);
world.func_147465_d(x + chunkX, y, z + chunkZ, Blocks.bedrock, 0, 0);
}
}
}
@@ -6,6 +6,7 @@ import java.util.Random;
import tconstruct.TConstruct;
import tconstruct.common.TRepo;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.gen.structure.MapGenStructureIO;
import net.minecraft.world.gen.structure.MapGenVillage;
@@ -58,25 +59,25 @@ public class ComponentSmeltery extends MapGenVillage
* maxZ, int placeBlockId, int replaceBlockId, boolean alwaysreplace)
*/
this.fillWithBlocks(world, sbb, 1, 0, 0, 7, 0, 6, Block.stoneBrick.blockID, Block.stoneBrick.blockID, false); //Base
this.fillWithBlocks(world, sbb, 0, 0, 1, 0, 0, 5, Block.stoneBrick.blockID, Block.stoneBrick.blockID, false);
this.fillWithBlocks(world, sbb, 8, 0, 1, 8, 0, 5, Block.stoneBrick.blockID, Block.stoneBrick.blockID, false);
this.fillWithBlocks(world, sbb, 1, 0, 0, 7, 0, 6, Blocks.stonebrick, Blocks.stonebrick, false); //Base
this.fillWithBlocks(world, sbb, 0, 0, 1, 0, 0, 5, Blocks.stonebrick, Blocks.stonebrick, false);
this.fillWithBlocks(world, sbb, 8, 0, 1, 8, 0, 5, Blocks.stonebrick, Blocks.stonebrick, false);
this.fillWithBlocks(world, sbb, 0, 1, 0, 9, 3, 7, 0, 0, false);
this.fillWithMetaBlocks(world, sbb, 2, 0, 1, 6, 2, 5, TRepo.smeltery.blockID, 2, TRepo.smeltery.blockID, 2, false); //Basin
this.fillWithMetaBlocks(world, sbb, 2, 0, 1, 6, 2, 5, TRepo.smeltery, 2, TRepo.smeltery, 2, false); //Basin
this.fillWithBlocks(world, sbb, 3, 1, 2, 5, 2, 4, 0, 0, false);
this.placeBlockAtCurrentPosition(world, TRepo.searedBlock.blockID, 0, 1, 1, 2, sbb);
this.placeBlockAtCurrentPosition(world, TRepo.searedBlock.blockID, 2, 1, 1, 4, sbb);
this.placeBlockAtCurrentPosition(world, TRepo.searedBlock.blockID, 0, 7, 1, 2, sbb);
this.placeBlockAtCurrentPosition(world, TRepo.searedBlock.blockID, 2, 7, 1, 4, sbb);
this.placeBlockAtCurrentPosition(world, TRepo.searedBlock, 0, 1, 1, 2, sbb);
this.placeBlockAtCurrentPosition(world, TRepo.searedBlock, 2, 1, 1, 4, sbb);
this.placeBlockAtCurrentPosition(world, TRepo.searedBlock, 0, 7, 1, 2, sbb);
this.placeBlockAtCurrentPosition(world, TRepo.searedBlock, 2, 7, 1, 4, sbb);
for (int l = 1; l < 6; ++l)
{
for (int i1 = 0; i1 < 9; ++i1)
{
this.clearCurrentPositionBlocksUpwards(world, i1, 9, l, sbb);
this.fillCurrentPositionBlocksDownwards(world, Block.stoneBrick.blockID, 0, i1, -1, l, sbb);
this.fillCurrentPositionBlocksDownwards(world, Blocks.stonebrick, 0, i1, -1, l, sbb);
}
}
@@ -85,7 +86,7 @@ public class ComponentSmeltery extends MapGenVillage
for (int i1 = 1; i1 < 8; ++i1)
{
this.clearCurrentPositionBlocksUpwards(world, i1, 9, l, sbb);
this.fillCurrentPositionBlocksDownwards(world, Block.stoneBrick.blockID, 0, i1, -1, l, sbb);
this.fillCurrentPositionBlocksDownwards(world, Blocks.stonebrick, 0, i1, -1, l, sbb);
}
}
return true;
@@ -105,7 +106,7 @@ public class ComponentSmeltery extends MapGenVillage
case 3:
return 0;
}
TConstruct.logger.severe("This shouldn't happen (remapDirection in tconstruct.worldgen.village.ComponentSmeltery)");
TConstruct.logger.error("This shouldn't happen (remapDirection in tconstruct.worldgen.village.ComponentSmeltery)");
return -1;
}
@@ -157,10 +157,10 @@ public class ComponentToolWorkshop extends MapGenVillage
int posY = this.getYWithOffset(y);
int posZ = this.getZWithOffset(x, z);
if (par2StructureBoundingBox.isVecInside(posX, posY, posZ) && world.getBlockId(posX, posY, posZ) != Blocks.chest.blockID)
if (par2StructureBoundingBox.isVecInside(posX, posY, posZ) && world.getBlock(posX, posY, posZ) != Blocks.chest)
{
world.setBlock(posX, posY, posZ, TRepo.craftingStationWood, 5, 2);
CraftingStationLogic logic = (CraftingStationLogic) world.getBlockTileEntity(posX, posY, posZ);
CraftingStationLogic logic = (CraftingStationLogic) world.func_147438_o(posX, posY, posZ);
if (logic != null)
{
@@ -181,10 +181,10 @@ public class ComponentToolWorkshop extends MapGenVillage
int posY = this.getYWithOffset(y);
int posZ = this.getZWithOffset(x, z);
if (par2StructureBoundingBox.isVecInside(posX, posY, posZ) && world.getBlockId(posX, posY, posZ) != Blocks.chest.blockID)
if (par2StructureBoundingBox.isVecInside(posX, posY, posZ) && world.getBlock(posX, posY, posZ) != Blocks.chest)
{
world.setBlock(posX, posY, posZ, TRepo.toolStationWood, 5, 2);
PatternChestLogic logic = (PatternChestLogic) world.getBlockTileEntity(posX, posY, posZ);
PatternChestLogic logic = (PatternChestLogic) world.func_147438_o(posX, posY, posZ);
if (logic != null)
{