Skip to content

Commit

Permalink
misc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
progwml6 committed Jan 9, 2014
1 parent ab73baf commit eba66e0
Show file tree
Hide file tree
Showing 27 changed files with 120 additions and 117 deletions.
Expand Up @@ -145,7 +145,7 @@ void updateFuelGague ()
return;
}

TileEntity tankContainer = world.getBlockTileEntity(activeLavaTank.x, activeLavaTank.y, activeLavaTank.z);
TileEntity tankContainer = world.func_147438_o(activeLavaTank.x, activeLavaTank.y, activeLavaTank.z);
if (tankContainer == null)
{
fuelAmount = 0;
Expand Down Expand Up @@ -182,7 +182,7 @@ void updateFuelGague ()
while (!foundTank)
{
CoordTuple possibleTank = structure.lavaTanks.get(iter);
TileEntity newTankContainer = world.getBlockTileEntity(possibleTank.x, possibleTank.y, possibleTank.z);
TileEntity newTankContainer = world.func_147438_o(possibleTank.x, possibleTank.y, possibleTank.z);
if (newTankContainer instanceof IFluidHandler)
{
FluidStack newliquid = ((IFluidHandler) newTankContainer).drain(ForgeDirection.UNKNOWN, drainFuelAmount(), false);
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/tconstruct/blocks/component/SmelteryScan.java
Expand Up @@ -50,7 +50,7 @@ protected boolean checkServant (int x, int y, int z)
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)
{
boolean ret = ((IServantLogic) be).setPotentialMaster(this.imaster, this.world, x, y, z);
Expand All @@ -75,7 +75,7 @@ protected void finalizeStructure ()
if (world.func_147439_a(coord.x, coord.y, coord.z) != TRepo.tankAir)
{
world.setBlock(coord.x, coord.y, coord.z, TRepo.tankAir);
IServantLogic servant = (IServantLogic) world.getBlockTileEntity(coord.x, coord.y, coord.z);
IServantLogic servant = (IServantLogic) world.func_147438_o(coord.x, coord.y, coord.z);
servant.verifyMaster(imaster, world, master.field_145851_c, master.field_145848_d, master.field_145849_e);
}
}
Expand All @@ -88,7 +88,7 @@ protected void invalidateStructure ()
super.invalidateStructure();
for (CoordTuple coord : airCoords)
{
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);
}
Expand All @@ -102,7 +102,7 @@ protected void invalidateBlocksAbove (int height)
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);
}
Expand All @@ -116,7 +116,7 @@ public void cleanup ()
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);
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/tconstruct/blocks/logic/AdaptiveDrainLogic.java
Expand Up @@ -37,7 +37,7 @@ public int fill (ForgeDirection from, FluidStack resource, boolean doFill)
{
if (hasValidMaster() && canDrain(from, null))
{
AdaptiveSmelteryLogic smeltery = (AdaptiveSmelteryLogic) field_145850_b.getBlockTileEntity(getMasterPosition().x, getMasterPosition().y, getMasterPosition().z);
AdaptiveSmelteryLogic smeltery = (AdaptiveSmelteryLogic) field_145850_b.func_147438_o(getMasterPosition().x, getMasterPosition().y, getMasterPosition().z);
return smeltery.fill(from, resource, doFill);
}
return 0;
Expand All @@ -49,7 +49,7 @@ public FluidStack drain (ForgeDirection from, int maxDrain, boolean doDrain)
// TConstruct.logger.info("Attempting drain " + hasValidMaster());
if (hasValidMaster() && canDrain(from, null))
{
AdaptiveSmelteryLogic smeltery = (AdaptiveSmelteryLogic) field_145850_b.getBlockTileEntity(getMasterPosition().x, getMasterPosition().y, getMasterPosition().z);
AdaptiveSmelteryLogic smeltery = (AdaptiveSmelteryLogic) field_145850_b.func_147438_o(getMasterPosition().x, getMasterPosition().y, getMasterPosition().z);
// TConstruct.logger.info("Found master");
return smeltery.drain(from, maxDrain, doDrain);
}
Expand All @@ -61,7 +61,7 @@ public FluidStack drain (ForgeDirection from, FluidStack resource, boolean doDra
{
if (hasValidMaster() && canDrain(from, null))
{
AdaptiveSmelteryLogic smeltery = (AdaptiveSmelteryLogic) field_145850_b.getBlockTileEntity(getMasterPosition().x, getMasterPosition().y, getMasterPosition().z);
AdaptiveSmelteryLogic smeltery = (AdaptiveSmelteryLogic) field_145850_b.func_147438_o(getMasterPosition().x, getMasterPosition().y, getMasterPosition().z);
return smeltery.drain(from, resource, doDrain);
}
return null;
Expand All @@ -72,7 +72,7 @@ public boolean canFill (ForgeDirection from, Fluid fluid)
{
if (hasValidMaster())
{
AdaptiveSmelteryLogic smeltery = (AdaptiveSmelteryLogic) field_145850_b.getBlockTileEntity(getMasterPosition().x, getMasterPosition().y, getMasterPosition().z);
AdaptiveSmelteryLogic smeltery = (AdaptiveSmelteryLogic) field_145850_b.func_147438_o(getMasterPosition().x, getMasterPosition().y, getMasterPosition().z);
return smeltery.getFillState() < 2;
}
return false;
Expand All @@ -83,7 +83,7 @@ public boolean canDrain (ForgeDirection from, Fluid fluid)
{
if (hasValidMaster())
{
AdaptiveSmelteryLogic smeltery = (AdaptiveSmelteryLogic) field_145850_b.getBlockTileEntity(getMasterPosition().x, getMasterPosition().y, getMasterPosition().z);
AdaptiveSmelteryLogic smeltery = (AdaptiveSmelteryLogic) field_145850_b.func_147438_o(getMasterPosition().x, getMasterPosition().y, getMasterPosition().z);
return smeltery.getFillState() > 0;
}
return false;
Expand All @@ -94,7 +94,7 @@ public FluidTankInfo[] getTankInfo (ForgeDirection from)
{
if (hasValidMaster() && (from == getForgeDirection() || from == getForgeDirection().getOpposite() || from == ForgeDirection.UNKNOWN))
{
AdaptiveSmelteryLogic smeltery = (AdaptiveSmelteryLogic) field_145850_b.getBlockTileEntity(getMasterPosition().x, getMasterPosition().y, getMasterPosition().z);
AdaptiveSmelteryLogic smeltery = (AdaptiveSmelteryLogic) field_145850_b.func_147438_o(getMasterPosition().x, getMasterPosition().y, getMasterPosition().z);
return smeltery.getTankInfo(ForgeDirection.UNKNOWN);
}
return null;
Expand Down
Expand Up @@ -285,7 +285,7 @@ void updateWorldBlock (int slot, ItemStack itemstack)
CoordTuple air = structure.getAirByIndex(slot);
if (air != null)
{
TileEntity te = field_145850_b.getBlockTileEntity(air.x, air.y, air.z);
TileEntity te = field_145850_b.func_147438_o(air.x, air.y, air.z);
if (te != null && te instanceof TankAirLogic)
{
((TankAirLogic) te).setInventorySlotContents(0, itemstack);
Expand Down Expand Up @@ -407,7 +407,7 @@ protected void updateFluidBlocks ()
{
Map.Entry pairs = (Map.Entry) iter.next();
CoordTuple coord = (CoordTuple) pairs.getKey();
TileEntity te = field_145850_b.getBlockTileEntity(coord.x, coord.y, coord.z);
TileEntity te = field_145850_b.func_147438_o(coord.x, coord.y, coord.z);
if (te instanceof TankAirLogic)
{
((TankAirLogic) te).overrideFluids(((LiquidDataInstance) pairs.getValue()).fluids);
Expand Down
34 changes: 17 additions & 17 deletions src/main/java/tconstruct/blocks/logic/CastingChannelLogic.java
Expand Up @@ -83,7 +83,7 @@ void pullLiquids ()

boolean pullLiquid (int x, int y, int z, ForgeDirection direction)
{
TileEntity tank = field_145850_b.getBlockTileEntity(x, y, z);
TileEntity tank = field_145850_b.func_147438_o(x, y, z);
if (tank instanceof IFluidHandler && !(tank instanceof CastingChannelLogic))
{
FluidStack templiquid = ((IFluidHandler) tank).drain(direction, 3, false);
Expand Down Expand Up @@ -291,7 +291,7 @@ private void moveLiquidToTanks ()
@SideOnly(Side.CLIENT)
public float tankBelow ()
{
TileEntity te = this.field_145850_b.getBlockTileEntity(this.field_145851_c, this.field_145848_d - 1, this.field_145849_e);
TileEntity te = this.field_145850_b.func_147438_o(this.field_145851_c, this.field_145848_d - 1, this.field_145849_e);
if (te instanceof CastingChannelLogic)
return -0.5f;
if (te instanceof LavaTankLogic)
Expand All @@ -311,15 +311,15 @@ public boolean hasChannelConnected (ForgeDirection dir)
switch (dir)
{
case DOWN:
return (this.field_145850_b.getBlockTileEntity(this.field_145851_c, this.field_145848_d - 1, this.field_145849_e) instanceof CastingChannelLogic);
return (this.field_145850_b.func_147438_o(this.field_145851_c, this.field_145848_d - 1, this.field_145849_e) instanceof CastingChannelLogic);
case NORTH:
return (this.field_145850_b.getBlockTileEntity(this.field_145851_c, this.field_145848_d, this.field_145849_e - 1) instanceof CastingChannelLogic);
return (this.field_145850_b.func_147438_o(this.field_145851_c, this.field_145848_d, this.field_145849_e - 1) instanceof CastingChannelLogic);
case SOUTH:
return (this.field_145850_b.getBlockTileEntity(this.field_145851_c, this.field_145848_d, this.field_145849_e + 1) instanceof CastingChannelLogic);
return (this.field_145850_b.func_147438_o(this.field_145851_c, this.field_145848_d, this.field_145849_e + 1) instanceof CastingChannelLogic);
case WEST:
return (this.field_145850_b.getBlockTileEntity(this.field_145851_c - 1, this.field_145848_d, this.field_145849_e) instanceof CastingChannelLogic);
return (this.field_145850_b.func_147438_o(this.field_145851_c - 1, this.field_145848_d, this.field_145849_e) instanceof CastingChannelLogic);
case EAST:
return (this.field_145850_b.getBlockTileEntity(this.field_145851_c + 1, this.field_145848_d, this.field_145849_e) instanceof CastingChannelLogic);
return (this.field_145850_b.func_147438_o(this.field_145851_c + 1, this.field_145848_d, this.field_145849_e) instanceof CastingChannelLogic);
default:
return false;
}
Expand All @@ -330,15 +330,15 @@ public boolean hasTankConnected (ForgeDirection dir)
switch (dir)
{
case DOWN:
return (this.field_145850_b.getBlockTileEntity(this.field_145851_c, this.field_145848_d - 1, this.field_145849_e) instanceof IFluidHandler);
return (this.field_145850_b.func_147438_o(this.field_145851_c, this.field_145848_d - 1, this.field_145849_e) instanceof IFluidHandler);
case NORTH:
return (this.field_145850_b.getBlockTileEntity(this.field_145851_c, this.field_145848_d, this.field_145849_e - 1) instanceof IFluidHandler);
return (this.field_145850_b.func_147438_o(this.field_145851_c, this.field_145848_d, this.field_145849_e - 1) instanceof IFluidHandler);
case SOUTH:
return (this.field_145850_b.getBlockTileEntity(this.field_145851_c, this.field_145848_d, this.field_145849_e + 1) instanceof IFluidHandler);
return (this.field_145850_b.func_147438_o(this.field_145851_c, this.field_145848_d, this.field_145849_e + 1) instanceof IFluidHandler);
case WEST:
return (this.field_145850_b.getBlockTileEntity(this.field_145851_c - 1, this.field_145848_d, this.field_145849_e) instanceof IFluidHandler);
return (this.field_145850_b.func_147438_o(this.field_145851_c - 1, this.field_145848_d, this.field_145849_e) instanceof IFluidHandler);
case EAST:
return (this.field_145850_b.getBlockTileEntity(this.field_145851_c + 1, this.field_145848_d, this.field_145849_e) instanceof IFluidHandler);
return (this.field_145850_b.func_147438_o(this.field_145851_c + 1, this.field_145848_d, this.field_145849_e) instanceof IFluidHandler);
default:
return false;
}
Expand All @@ -347,11 +347,11 @@ public boolean hasTankConnected (ForgeDirection dir)
private HashMap getOutputs ()
{
HashMap map = new HashMap();
TileEntity tankXplus = this.field_145850_b.getBlockTileEntity(this.field_145851_c + 1, this.field_145848_d, this.field_145849_e);
TileEntity tankXminus = this.field_145850_b.getBlockTileEntity(this.field_145851_c - 1, this.field_145848_d, this.field_145849_e);
TileEntity tankZplus = this.field_145850_b.getBlockTileEntity(this.field_145851_c, this.field_145848_d, this.field_145849_e + 1);
TileEntity tankZminus = this.field_145850_b.getBlockTileEntity(this.field_145851_c, this.field_145848_d, this.field_145849_e - 1);
TileEntity tankYminus = this.field_145850_b.getBlockTileEntity(this.field_145851_c, this.field_145848_d - 1, this.field_145849_e);
TileEntity tankXplus = this.field_145850_b.func_147438_o(this.field_145851_c + 1, this.field_145848_d, this.field_145849_e);
TileEntity tankXminus = this.field_145850_b.func_147438_o(this.field_145851_c - 1, this.field_145848_d, this.field_145849_e);
TileEntity tankZplus = this.field_145850_b.func_147438_o(this.field_145851_c, this.field_145848_d, this.field_145849_e + 1);
TileEntity tankZminus = this.field_145850_b.func_147438_o(this.field_145851_c, this.field_145848_d, this.field_145849_e - 1);
TileEntity tankYminus = this.field_145850_b.func_147438_o(this.field_145851_c, this.field_145848_d - 1, this.field_145849_e);

if (this.pullingLiquids)
{
Expand Down
Expand Up @@ -45,7 +45,7 @@ public Container getGuiContainer (InventoryPlayer inventoryplayer, World world,
{
for (int zPos = z - 1; zPos <= z + 1; zPos++)
{
TileEntity tile = world.getBlockTileEntity(xPos, yPos, zPos);
TileEntity tile = world.func_147438_o(xPos, yPos, zPos);
if (chest == null && tile instanceof TileEntityChest)
{
chest = new WeakReference(tile);
Expand All @@ -68,7 +68,7 @@ else if (tinkerTable == false && tile instanceof ToolStationLogic)

void checkForChest (World world, int x, int y, int z)
{
TileEntity tile = world.getBlockTileEntity(x, y, z);
TileEntity tile = world.func_147438_o(x, y, z);
if (tile instanceof TileEntityChest)
doubleChest = new WeakReference(tile);
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/tconstruct/blocks/logic/FaucetLogic.java
Expand Up @@ -43,8 +43,8 @@ public boolean activateFaucet ()
break;
}

TileEntity drainte = field_145850_b.getBlockTileEntity(x, field_145848_d, z);
TileEntity tankte = field_145850_b.getBlockTileEntity(field_145851_c, field_145848_d - 1, field_145849_e);
TileEntity drainte = field_145850_b.func_147438_o(x, field_145848_d, z);
TileEntity tankte = field_145850_b.func_147438_o(field_145851_c, field_145848_d - 1, field_145849_e);

if (drainte != null && drainte instanceof IFluidHandler && tankte != null && tankte instanceof IFluidHandler)
{
Expand Down
Expand Up @@ -28,7 +28,7 @@ public class LandmineExplodeLogic
public LandmineExplodeLogic(World par1World, int par2, int par3, int par4, Entity entity)
{
worldObj = par1World;
this.tileEntity = (TileEntityLandmine) par1World.getBlockTileEntity(par2, par3, par4);
this.tileEntity = (TileEntityLandmine) par1World.func_147438_o(par2, par3, par4);
this.x = par2;
this.y = par3;
this.z = par4;
Expand Down
Expand Up @@ -22,7 +22,7 @@ public class LandmineSpecialStackLogic
public LandmineSpecialStackLogic(World par1World, int par2, int par3, int par4, Entity entity, boolean mayHurtPlayer, ArrayList<ItemStack> items)
{
worldObj = par1World;
this.tileEntity = (TileEntityLandmine) par1World.getBlockTileEntity(par2, par3, par4);
this.tileEntity = (TileEntityLandmine) par1World.func_147438_o(par2, par3, par4);
this.x = par2;
this.y = par3;
this.z = par4;
Expand Down
Expand Up @@ -38,7 +38,7 @@ public Container getGuiContainer (InventoryPlayer inventoryplayer, World world,
{
for (int zPos = z - 1; zPos <= z + 1; zPos++)
{
TileEntity tile = world.getBlockTileEntity(xPos, y, zPos);
TileEntity tile = world.func_147438_o(xPos, y, zPos);
if (tile != null && tile instanceof PatternChestLogic)
return new PartCrafterChestContainer(inventoryplayer, this, (PatternChestLogic) tile);
}
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/tconstruct/blocks/logic/SmelteryDrainLogic.java
Expand Up @@ -30,7 +30,7 @@ public int fill (ForgeDirection from, FluidStack resource, boolean doFill)
{
if (doFill)
{
SmelteryLogic smeltery = (SmelteryLogic) field_145850_b.getBlockTileEntity(getMasterPosition().x, getMasterPosition().y, getMasterPosition().z);
SmelteryLogic smeltery = (SmelteryLogic) field_145850_b.func_147438_o(getMasterPosition().x, getMasterPosition().y, getMasterPosition().z);
return smeltery.fill(resource, doFill);
}
else
Expand All @@ -49,7 +49,7 @@ public FluidStack drain (ForgeDirection from, int maxDrain, boolean doDrain)
{
if (hasValidMaster() && canDrain(from, null))
{
SmelteryLogic smeltery = (SmelteryLogic) field_145850_b.getBlockTileEntity(getMasterPosition().x, getMasterPosition().y, getMasterPosition().z);
SmelteryLogic smeltery = (SmelteryLogic) field_145850_b.func_147438_o(getMasterPosition().x, getMasterPosition().y, getMasterPosition().z);
return smeltery.drain(maxDrain, doDrain);
}
else
Expand Down Expand Up @@ -80,7 +80,7 @@ public boolean canDrain (ForgeDirection from, Fluid fluid)
boolean containsFluid = fluid == null;
if (fluid != null)
{
SmelteryLogic smeltery = (SmelteryLogic) field_145850_b.getBlockTileEntity(getMasterPosition().x, getMasterPosition().y, getMasterPosition().z);
SmelteryLogic smeltery = (SmelteryLogic) field_145850_b.func_147438_o(getMasterPosition().x, getMasterPosition().y, getMasterPosition().z);
for (FluidStack fstack : smeltery.moltenMetal)
{
if (fstack.fluidID == fluid.getID())
Expand All @@ -99,7 +99,7 @@ public FluidTankInfo[] getTankInfo (ForgeDirection from)
{
if (hasValidMaster() && (from == getForgeDirection() || from == getForgeDirection().getOpposite() || from == ForgeDirection.UNKNOWN))
{
SmelteryLogic smeltery = (SmelteryLogic) field_145850_b.getBlockTileEntity(getMasterPosition().x, getMasterPosition().y, getMasterPosition().z);
SmelteryLogic smeltery = (SmelteryLogic) field_145850_b.func_147438_o(getMasterPosition().x, getMasterPosition().y, getMasterPosition().z);
return smeltery.getMultiTankInfo();
//return new FluidTankInfo[] { smeltery.getInfo() };
}
Expand Down

0 comments on commit eba66e0

Please sign in to comment.