Skip to content

Commit

Permalink
fix references to worldObj
Browse files Browse the repository at this point in the history
  • Loading branch information
progwml6 committed Jan 1, 2014
1 parent 2cb0bb3 commit 48be78c
Show file tree
Hide file tree
Showing 27 changed files with 162 additions and 163 deletions.
14 changes: 7 additions & 7 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) worldObj.getBlockTileEntity(getMasterPosition().x, getMasterPosition().y, getMasterPosition().z);
AdaptiveSmelteryLogic smeltery = (AdaptiveSmelteryLogic) field_145850_b.getBlockTileEntity(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) worldObj.getBlockTileEntity(getMasterPosition().x, getMasterPosition().y, getMasterPosition().z);
AdaptiveSmelteryLogic smeltery = (AdaptiveSmelteryLogic) field_145850_b.getBlockTileEntity(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) worldObj.getBlockTileEntity(getMasterPosition().x, getMasterPosition().y, getMasterPosition().z);
AdaptiveSmelteryLogic smeltery = (AdaptiveSmelteryLogic) field_145850_b.getBlockTileEntity(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) worldObj.getBlockTileEntity(getMasterPosition().x, getMasterPosition().y, getMasterPosition().z);
AdaptiveSmelteryLogic smeltery = (AdaptiveSmelteryLogic) field_145850_b.getBlockTileEntity(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) worldObj.getBlockTileEntity(getMasterPosition().x, getMasterPosition().y, getMasterPosition().z);
AdaptiveSmelteryLogic smeltery = (AdaptiveSmelteryLogic) field_145850_b.getBlockTileEntity(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) worldObj.getBlockTileEntity(getMasterPosition().x, getMasterPosition().y, getMasterPosition().z);
AdaptiveSmelteryLogic smeltery = (AdaptiveSmelteryLogic) field_145850_b.getBlockTileEntity(getMasterPosition().x, getMasterPosition().y, getMasterPosition().z);
return smeltery.getTankInfo(ForgeDirection.UNKNOWN);
}
return null;
Expand Down Expand Up @@ -175,6 +175,6 @@ public Packet getDescriptionPacket ()
public void onDataPacket (INetworkManager net, Packet132TileEntityData packet)
{
readFromNBT(packet.data);
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
field_145850_b.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
}
}
18 changes: 9 additions & 9 deletions src/main/java/tconstruct/blocks/logic/AdaptiveSmelteryLogic.java
Expand Up @@ -65,7 +65,7 @@ public void updateEntity ()
if (tick % 4 == 0)
smeltery.heatItems();

if (!worldObj.isRemote)
if (!field_145850_b.isRemote)
{
if (tick % 20 == 0)
{
Expand Down Expand Up @@ -127,17 +127,17 @@ public List<LogicComponent> getComponents ()
/* Structure */

@Override
public void setWorldObj (World world)
public void setfield_145850_b (World world)
{
super.setWorldObj(world);
super.setfield_145850_b(world);
structure.setWorld(world);
smeltery.setWorld(world);
}

@Override
public void notifyChange (IServantLogic servant, int x, int y, int z)
{
if (!worldObj.isRemote)
if (!field_145850_b.isRemote)
{
//System.out.println("Notifying of change from "+new CoordTuple(x, y, z));
recheckStructure = true;
Expand All @@ -160,7 +160,7 @@ void validateSmeltery ()
smeltery.adjustSize(structure.getAirSize(), true);
multitank.setCapacity(structure.getAirSize() * (TConstruct.ingotLiquidValue * 18));
smeltery.setActiveLavaTank(structure.lavaTanks.get(0));
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
field_145850_b.markBlockForUpdate(xCoord, yCoord, zCoord);
}

@Override
Expand Down Expand Up @@ -285,7 +285,7 @@ void updateWorldBlock (int slot, ItemStack itemstack)
CoordTuple air = structure.getAirByIndex(slot);
if (air != null)
{
TileEntity te = worldObj.getBlockTileEntity(air.x, air.y, air.z);
TileEntity te = field_145850_b.getBlockTileEntity(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 = worldObj.getBlockTileEntity(coord.x, coord.y, coord.z);
TileEntity te = field_145850_b.getBlockTileEntity(coord.x, coord.y, coord.z);
if (te instanceof TankAirLogic)
{
((TankAirLogic) te).overrideFluids(((LiquidDataInstance) pairs.getValue()).fluids);
Expand All @@ -420,7 +420,7 @@ protected void updateFluidBlocks ()
public void updateAir ()
{
for (CoordTuple loc : structure.airCoords)
worldObj.markBlockForUpdate(loc.x, loc.y, loc.z);
field_145850_b.markBlockForUpdate(loc.x, loc.y, loc.z);
}

class LiquidData
Expand Down Expand Up @@ -574,7 +574,7 @@ public void writeNetworkNBT (NBTTagCompound tags)
public void onDataPacket (INetworkManager net, Packet132TileEntityData packet)
{
readNetworkNBT(packet.data);
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
field_145850_b.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
}

@Override
Expand Down
20 changes: 10 additions & 10 deletions src/main/java/tconstruct/blocks/logic/CastingBasinLogic.java
Expand Up @@ -142,7 +142,7 @@ public int fill (FluidStack resource, boolean doFill)
castingDelay = recipe.coolTime;
}
renderOffset = copyLiquid.amount;
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
field_145850_b.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
this.liquid = copyLiquid;
needsUpdate = true;
}
Expand All @@ -164,7 +164,7 @@ else if (resource.isFluidEqual(this.liquid))
renderOffset = roomInTank;
castingDelay = TConstruct.basinCasting.getCastingDelay(this.liquid, inventory[0]);
this.liquid.amount = this.capacity;
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
field_145850_b.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
needsUpdate = true;
}
return roomInTank;
Expand All @@ -175,7 +175,7 @@ else if (resource.isFluidEqual(this.liquid))
if (doFill)
{
this.liquid.amount += resource.amount;
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
field_145850_b.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
needsUpdate = true;
}
return resource.amount;
Expand All @@ -192,14 +192,14 @@ else if (resource.isFluidEqual(this.liquid))
public void onInventoryChanged () //Isn't actually called?
{
super.onInventoryChanged();
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
field_145850_b.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
needsUpdate = true;
}

public ItemStack decrStackSize (int slot, int quantity)
{
ItemStack stack = super.decrStackSize(slot, quantity);
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
field_145850_b.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
return stack;
}

Expand Down Expand Up @@ -228,7 +228,7 @@ public FluidStack drain (int maxDrain, boolean doDrain)
liquid = null;

if (doDrain)
FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent(drained, this.worldObj, this.xCoord, this.yCoord, this.zCoord, this));
FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent(drained, this.field_145850_b, this.xCoord, this.yCoord, this.zCoord, this));

return drained;
}
Expand Down Expand Up @@ -312,15 +312,15 @@ public void updateEntity ()
if (renderOffset > 0)
{
renderOffset -= 6;
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
field_145850_b.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
}

tick++;
if (tick % 20 == 0)
{
tick = 0;
if (needsUpdate)
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
field_145850_b.markBlockForUpdate(xCoord, yCoord, zCoord);
}
}

Expand All @@ -333,7 +333,7 @@ public void castLiquid ()
if (recipe.consumeCast)
inventory[0] = null;
liquid = null;
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
field_145850_b.markBlockForUpdate(xCoord, yCoord, zCoord);
}
}

Expand Down Expand Up @@ -398,7 +398,7 @@ public Packet getDescriptionPacket ()
public void onDataPacket (INetworkManager net, Packet132TileEntityData packet)
{
readFromNBT(packet.data);
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
field_145850_b.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
}

@Override
Expand Down
52 changes: 26 additions & 26 deletions src/main/java/tconstruct/blocks/logic/CastingChannelLogic.java
Expand Up @@ -43,16 +43,16 @@ public CastingChannelLogic()
@Override
public void updateEntity ()
{
if (this.worldObj.isRemote)
if (this.field_145850_b.isRemote)
return;
ticks++;
ticksLPReset++;
if (!worldObj.isRemote)
if (!field_145850_b.isRemote)
{
if (this.pullingLiquids)
pullLiquids();
}
//this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
//this.field_145850_b.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
if (ticks == 20)
{
if (recentlyFilledDelay != 0)
Expand Down Expand Up @@ -83,7 +83,7 @@ void pullLiquids ()

boolean pullLiquid (int x, int y, int z, ForgeDirection direction)
{
TileEntity tank = worldObj.getBlockTileEntity(x, y, z);
TileEntity tank = field_145850_b.getBlockTileEntity(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.worldObj.getBlockTileEntity(this.xCoord, this.yCoord - 1, this.zCoord);
TileEntity te = this.field_145850_b.getBlockTileEntity(this.xCoord, this.yCoord - 1, this.zCoord);
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.worldObj.getBlockTileEntity(this.xCoord, this.yCoord - 1, this.zCoord) instanceof CastingChannelLogic);
return (this.field_145850_b.getBlockTileEntity(this.xCoord, this.yCoord - 1, this.zCoord) instanceof CastingChannelLogic);
case NORTH:
return (this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord - 1) instanceof CastingChannelLogic);
return (this.field_145850_b.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord - 1) instanceof CastingChannelLogic);
case SOUTH:
return (this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord + 1) instanceof CastingChannelLogic);
return (this.field_145850_b.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord + 1) instanceof CastingChannelLogic);
case WEST:
return (this.worldObj.getBlockTileEntity(this.xCoord - 1, this.yCoord, this.zCoord) instanceof CastingChannelLogic);
return (this.field_145850_b.getBlockTileEntity(this.xCoord - 1, this.yCoord, this.zCoord) instanceof CastingChannelLogic);
case EAST:
return (this.worldObj.getBlockTileEntity(this.xCoord + 1, this.yCoord, this.zCoord) instanceof CastingChannelLogic);
return (this.field_145850_b.getBlockTileEntity(this.xCoord + 1, this.yCoord, this.zCoord) instanceof CastingChannelLogic);
default:
return false;
}
Expand All @@ -330,15 +330,15 @@ public boolean hasTankConnected (ForgeDirection dir)
switch (dir)
{
case DOWN:
return (this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord - 1, this.zCoord) instanceof IFluidHandler);
return (this.field_145850_b.getBlockTileEntity(this.xCoord, this.yCoord - 1, this.zCoord) instanceof IFluidHandler);
case NORTH:
return (this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord - 1) instanceof IFluidHandler);
return (this.field_145850_b.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord - 1) instanceof IFluidHandler);
case SOUTH:
return (this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord + 1) instanceof IFluidHandler);
return (this.field_145850_b.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord + 1) instanceof IFluidHandler);
case WEST:
return (this.worldObj.getBlockTileEntity(this.xCoord - 1, this.yCoord, this.zCoord) instanceof IFluidHandler);
return (this.field_145850_b.getBlockTileEntity(this.xCoord - 1, this.yCoord, this.zCoord) instanceof IFluidHandler);
case EAST:
return (this.worldObj.getBlockTileEntity(this.xCoord + 1, this.yCoord, this.zCoord) instanceof IFluidHandler);
return (this.field_145850_b.getBlockTileEntity(this.xCoord + 1, this.yCoord, this.zCoord) 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.worldObj.getBlockTileEntity(this.xCoord + 1, this.yCoord, this.zCoord);
TileEntity tankXminus = this.worldObj.getBlockTileEntity(this.xCoord - 1, this.yCoord, this.zCoord);
TileEntity tankZplus = this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord + 1);
TileEntity tankZminus = this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord - 1);
TileEntity tankYminus = this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord - 1, this.zCoord);
TileEntity tankXplus = this.field_145850_b.getBlockTileEntity(this.xCoord + 1, this.yCoord, this.zCoord);
TileEntity tankXminus = this.field_145850_b.getBlockTileEntity(this.xCoord - 1, this.yCoord, this.zCoord);
TileEntity tankZplus = this.field_145850_b.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord + 1);
TileEntity tankZminus = this.field_145850_b.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord - 1);
TileEntity tankYminus = this.field_145850_b.getBlockTileEntity(this.xCoord, this.yCoord - 1, this.zCoord);

if (this.pullingLiquids)
{
Expand Down Expand Up @@ -420,7 +420,7 @@ public int fill (FluidStack stack, boolean doFill)

if (doFill)
{
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
this.field_145850_b.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
this.liquid = transfered;
}
recentlyFilledDelay = 2;
Expand All @@ -437,15 +437,15 @@ public int fill (FluidStack stack, boolean doFill)
if ((doFill) && (spaceInTank > 0))
{
this.liquid.amount = this.fillMax;
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
this.field_145850_b.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
}
return spaceInTank;
}

if (doFill)
{
this.liquid.amount += stack.amount;
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
this.field_145850_b.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
}
return stack.amount;
}
Expand Down Expand Up @@ -492,8 +492,8 @@ public FluidStack drain (int maxDrain, boolean doDrain)
}
if (doDrain)
{
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent(drained, this.worldObj, this.xCoord, this.yCoord, this.zCoord, this));
this.field_145850_b.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent(drained, this.field_145850_b, this.xCoord, this.yCoord, this.zCoord, this));
}
return drained;
}
Expand Down Expand Up @@ -574,7 +574,7 @@ public Packet getDescriptionPacket ()
public void onDataPacket (INetworkManager net, Packet132TileEntityData packet)
{
readCustomNBT(packet.data);
this.worldObj.markBlockForRenderUpdate(this.xCoord, this.yCoord, this.zCoord);
this.field_145850_b.markBlockForRenderUpdate(this.xCoord, this.yCoord, this.zCoord);
}

public int convertFDToInt (ForgeDirection dir)
Expand Down

0 comments on commit 48be78c

Please sign in to comment.