Skip to content

Commit

Permalink
swap to java based mantle
Browse files Browse the repository at this point in the history
  • Loading branch information
progwml6 committed Dec 5, 2013
1 parent f2e5330 commit fb44714
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 40 deletions.
4 changes: 2 additions & 2 deletions build.properties
@@ -1,4 +1,4 @@
minecraft_version=1.6.4
forge_version=9.11.1.964
mantle_version=5ed4cc
tconstruct_version=a181dc
mantle_version=11d586
tconstruct_version=34812e
2 changes: 1 addition & 1 deletion src/main/java/tmechworks/blocks/RedstoneMachine.java
Expand Up @@ -302,7 +302,7 @@ public void onNeighborBlockChange (World world, int x, int y, int z, int neighbo
continue;

coord = directions.get(i);
tmpStrength = world.getIndirectPowerLevelTo(x + coord.x(), y + coord.y(), z + coord.z(), (i == 2 || i == 3) ? i : i ^ 1);
tmpStrength = world.getIndirectPowerLevelTo(x + coord.x, y + coord.y, z + coord.z, (i == 2 || i == 3) ? i : i ^ 1);
if (tmpStrength > maxStrength)
{
maxStrength = tmpStrength;
Expand Down
Expand Up @@ -59,9 +59,9 @@ public boolean doUpdate ()
// Send updates to SignalBuses
for (CoordTuple coord : tetheredBuses.keySet())
{
if (worldObj.getChunkProvider().chunkExists(coord.x() >> 4, coord.z() >> 4))
if (worldObj.getChunkProvider().chunkExists(coord.x >> 4, coord.z >> 4))
{
te = worldObj.getBlockTileEntity(coord.x(), coord.y(), coord.z());
te = worldObj.getBlockTileEntity(coord.x, coord.y, coord.z);
if (te instanceof SignalBusLogic)
{
((SignalBusLogic) te).updateLocalSignals(masterSignals);
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/tmechworks/blocks/logic/SignalBusLogic.java
Expand Up @@ -101,9 +101,9 @@ public void broadcastSouthboundSignals ()

for (CoordTuple coord : transceivers.keySet())
{
if (worldObj.getChunkProvider().chunkExists(coord.x() >> 4, coord.z() >> 4))
if (worldObj.getChunkProvider().chunkExists(coord.x >> 4, coord.z >> 4))
{
te = worldObj.getBlockTileEntity(coord.x(), coord.y(), coord.z());
te = worldObj.getBlockTileEntity(coord.x, coord.y, coord.z);
if (te instanceof ISignalTransceiver)
{
((ISignalTransceiver) te).receiveSignalUpdate(cachedReceivedSignals);
Expand Down Expand Up @@ -556,7 +556,7 @@ public boolean willConnect (CoordTuple coord)
continue;
}
jDir = ForgeDirection.VALID_DIRECTIONS[j];
if (xCoord + jDir.offsetX == coord.x() && yCoord + jDir.offsetY == coord.y() && zCoord + jDir.offsetZ == coord.z())
if (xCoord + jDir.offsetX == coord.x && yCoord + jDir.offsetY == coord.y && zCoord + jDir.offsetZ == coord.z)
{
te = worldObj.getBlockTileEntity(xCoord + jDir.offsetX, yCoord + jDir.offsetY, zCoord + jDir.offsetZ);
if (te instanceof ISignalBusConnectable && ((ISignalBusConnectable)te).connectableOnFace(iDir))
Expand All @@ -568,7 +568,7 @@ public boolean willConnect (CoordTuple coord)
{
continue;
}
if (xCoord + iDir.offsetX + jDir.offsetX == coord.x() && yCoord + iDir.offsetY + jDir.offsetY == coord.y() && zCoord + iDir.offsetZ + jDir.offsetZ == coord.z())
if (xCoord + iDir.offsetX + jDir.offsetX == coord.x && yCoord + iDir.offsetY + jDir.offsetY == coord.y && zCoord + iDir.offsetZ + jDir.offsetZ == coord.z)
{
te = worldObj.getBlockTileEntity(xCoord + iDir.offsetX + jDir.offsetX, yCoord + iDir.offsetY + jDir.offsetY, zCoord + iDir.offsetZ + jDir.offsetZ);
if (te instanceof ISignalBusConnectable && ((ISignalBusConnectable)te).connectableOnCorner(iDir.getOpposite(), jDir.getOpposite()))
Expand Down Expand Up @@ -640,7 +640,7 @@ public int getDroppedWire ()
TileEntity te;
for (CoordTuple coord : transceivers.keySet())
{
te = worldObj.getBlockTileEntity(coord.x(), coord.y(), coord.z());
te = worldObj.getBlockTileEntity(coord.x, coord.y, coord.z);
if (te instanceof ISignalTransceiver)
{
calc += ((ISignalTransceiver) te).getDroppedWire();
Expand All @@ -657,7 +657,7 @@ public void notifyBreak ()
TileEntity te;
for (CoordTuple coord : scan)
{
te = worldObj.getBlockTileEntity(coord.x(), coord.y(), coord.z());
te = worldObj.getBlockTileEntity(coord.x, coord.y, coord.z);
if (te instanceof ISignalTransceiver)
{
((ISignalTransceiver) te).doUnregister(true);
Expand Down
22 changes: 11 additions & 11 deletions src/main/java/tmechworks/blocks/logic/SignalTerminalLogic.java
Expand Up @@ -61,7 +61,7 @@ private void tryRegister ()
return;
}

TileEntity te = worldObj.getBlockTileEntity(signalBus.x(), signalBus.y(), signalBus.z());
TileEntity te = worldObj.getBlockTileEntity(signalBus.x, signalBus.y, signalBus.z);
if (!(te instanceof SignalBusLogic))
{
return;
Expand Down Expand Up @@ -138,9 +138,9 @@ public void writeToNBT (NBTTagCompound data)

if (signalBus != null)
{
data.setInteger("BusX", signalBus.x());
data.setInteger("BusY", signalBus.y());
data.setInteger("BusZ", signalBus.z());
data.setInteger("BusX", signalBus.x);
data.setInteger("BusY", signalBus.y);
data.setInteger("BusZ", signalBus.z);
}
else
{
Expand Down Expand Up @@ -423,7 +423,7 @@ public void notifyBreak ()
return;
}

TileEntity te = worldObj.getBlockTileEntity(signalBus.x(), signalBus.y(), signalBus.z());
TileEntity te = worldObj.getBlockTileEntity(signalBus.x, signalBus.y, signalBus.z);
if (te == null || !(te instanceof SignalBusLogic))
{
return;
Expand All @@ -446,7 +446,7 @@ public void checkNeighbors ()
{
if (signalBus != null && signalBus instanceof CoordTuple)
{
TileEntity te = worldObj.getBlockTileEntity(signalBus.x(), signalBus.y(), signalBus.z());
TileEntity te = worldObj.getBlockTileEntity(signalBus.x, signalBus.y, signalBus.z);

if (te instanceof SignalBusLogic)
{
Expand Down Expand Up @@ -617,8 +617,8 @@ public int doUnregister (boolean reHoming)

if (signalBus != null)
{
TileEntity te = worldObj.getBlockTileEntity(signalBus.x(), signalBus.y(), signalBus.z());
dropWire = Math.abs(xCoord - signalBus.x()) + Math.abs(yCoord - signalBus.y()) + Math.abs(zCoord - signalBus.z());
TileEntity te = worldObj.getBlockTileEntity(signalBus.x, signalBus.y, signalBus.z);
dropWire = Math.abs(xCoord - signalBus.x) + Math.abs(yCoord - signalBus.y) + Math.abs(zCoord - signalBus.z);
if (te instanceof SignalBusLogic)
{
((SignalBusLogic)te).unregisterTerminal(worldObj, xCoord, yCoord, zCoord);
Expand Down Expand Up @@ -660,9 +660,9 @@ public int getDroppedWire ()
int calcWire = 0;
if (signalBus instanceof CoordTuple)
{
calcWire += Math.abs(signalBus.x() - xCoord);
calcWire += Math.abs(signalBus.y() - yCoord);
calcWire += Math.abs(signalBus.z() - zCoord);
calcWire += Math.abs(signalBus.x - xCoord);
calcWire += Math.abs(signalBus.y - yCoord);
calcWire += Math.abs(signalBus.z - zCoord);

return calcWire;
}
Expand Down
Expand Up @@ -92,8 +92,8 @@ public void onWorldRenderLast (RenderWorldLastEvent event)
{
renderPair = transceivers.pop();

GL11.glVertex3d(renderPair.a().x() + 0.5, renderPair.a().y() + 0.5, renderPair.a().z() + 0.5);
GL11.glVertex3d(renderPair.b().x() + 0.5, renderPair.b().y(), renderPair.b().z() + 0.5);
GL11.glVertex3d(renderPair.a.x + 0.5, renderPair.a.y + 0.5, renderPair.a.z + 0.5);
GL11.glVertex3d(renderPair.b.x + 0.5, renderPair.b.y, renderPair.b.z + 0.5);
}

GL11.glEnd();
Expand Down
Expand Up @@ -142,7 +142,7 @@ public IMultiblockMember[] getNeighboringMembers ()
List<IMultiblockMember> neighborMembers = new LinkedList<IMultiblockMember>();
for (CoordTuple neighbor : neighbors)
{
te = this.worldObj.getBlockTileEntity(neighbor.x(), neighbor.y(), neighbor.z());
te = this.worldObj.getBlockTileEntity(neighbor.x, neighbor.y, neighbor.z);
if (te instanceof IMultiblockMember)
{
// Verify compatible member
Expand Down Expand Up @@ -242,7 +242,7 @@ public void onOrphaned ()
CoordTuple[] neighborCoords = getNeighborCoords();
for (CoordTuple coord : neighborCoords)
{
TileEntity neighborTE = this.worldObj.getBlockTileEntity(coord.x(), coord.y(), coord.z());
TileEntity neighborTE = this.worldObj.getBlockTileEntity(coord.x, coord.y, coord.z);
if (neighborTE instanceof IMultiblockMember && !((IMultiblockMember) neighborTE).isConnected() && ((IMultiblockMember) neighborTE).willConnect(getCoordInWorld()))
{
membersToCheck.add((IMultiblockMember) neighborTE);
Expand Down
Expand Up @@ -65,7 +65,7 @@ public void attachBlock (IMultiblockMember member)
connectedBlocks.add(coords);
member.onAttached(this);
this.onBlockAdded(member);
this.worldObj.markBlockForUpdate(coords.x(), coords.y(), coords.z());
this.worldObj.markBlockForUpdate(coords.x, coords.y, coords.z);

if (newMultiblock)
{
Expand All @@ -79,7 +79,7 @@ public void attachBlock (IMultiblockMember member)
}
else if (coords.compareTo(referenceCoord) < 0)
{
TileEntity te = this.worldObj.getBlockTileEntity(referenceCoord.x(), referenceCoord.y(), referenceCoord.z());
TileEntity te = this.worldObj.getBlockTileEntity(referenceCoord.x, referenceCoord.y, referenceCoord.z);
((IMultiblockMember) te).forfeitMultiblockSaveDelegate();

referenceCoord = coords;
Expand Down Expand Up @@ -147,7 +147,7 @@ else if (this.chunksHaveLoaded)
{
for (CoordTuple tcoord : connectedBlocks)
{
TileEntity te = this.worldObj.getBlockTileEntity(tcoord.x(), tcoord.y(), tcoord.z());
TileEntity te = this.worldObj.getBlockTileEntity(tcoord.x, tcoord.y, tcoord.z);
if (te == null)
{
continue;
Expand All @@ -166,7 +166,7 @@ else if (tcoord.compareTo(referenceCoord) < 0)

if (referenceCoord != null)
{
TileEntity te = this.worldObj.getBlockTileEntity(referenceCoord.x(), referenceCoord.y(), referenceCoord.z());
TileEntity te = this.worldObj.getBlockTileEntity(referenceCoord.x, referenceCoord.y, referenceCoord.z);
((IMultiblockMember) te).becomeMultiblockSaveDelegate();
}
}
Expand Down Expand Up @@ -207,7 +207,7 @@ public void merge (MultiblockMasterBaseLogic other)
for (CoordTuple coord : acquiredMembers)
{
this.connectedBlocks.add(coord);
te = this.worldObj.getBlockTileEntity(coord.x(), coord.y(), coord.z());
te = this.worldObj.getBlockTileEntity(coord.x, coord.y, coord.z);
acquiredMember = (IMultiblockMember) te;
acquiredMember.onMasterMerged(this);
this.onBlockAdded(acquiredMember);
Expand All @@ -220,7 +220,7 @@ private void onMergedIntoOtherMaster (MultiblockMasterBaseLogic newMaster)

if (referenceCoord != null)
{
TileEntity te = this.worldObj.getBlockTileEntity(referenceCoord.x(), referenceCoord.y(), referenceCoord.z());
TileEntity te = this.worldObj.getBlockTileEntity(referenceCoord.x, referenceCoord.y, referenceCoord.z);
if (te instanceof IMultiblockMember)
{
((IMultiblockMember) te).forfeitMultiblockSaveDelegate();
Expand Down Expand Up @@ -265,7 +265,7 @@ public final void doMultiblockTick ()
{
for (CoordTuple tcoord : connectedBlocks)
{
TileEntity te = this.worldObj.getBlockTileEntity(tcoord.x(), tcoord.y(), tcoord.z());
TileEntity te = this.worldObj.getBlockTileEntity(tcoord.x, tcoord.y, tcoord.z);
if (!(te instanceof IMultiblockMember))
{
continue;
Expand All @@ -284,7 +284,7 @@ else if (tcoord.compareTo(referenceCoord) < 0)

if (referenceCoord != null)
{
TileEntity te = this.worldObj.getBlockTileEntity(referenceCoord.x(), referenceCoord.y(), referenceCoord.z());
TileEntity te = this.worldObj.getBlockTileEntity(referenceCoord.x, referenceCoord.y, referenceCoord.z);
((IMultiblockMember) te).becomeMultiblockSaveDelegate();
}
}
Expand Down Expand Up @@ -331,7 +331,7 @@ public void revisitBlocks ()
{
TileEntity te;
// Ensure that our current reference coords are valid. If not, invalidate it.
if (referenceCoord != null && this.worldObj.getBlockTileEntity(referenceCoord.x(), referenceCoord.y(), referenceCoord.z()) == null)
if (referenceCoord != null && this.worldObj.getBlockTileEntity(referenceCoord.x, referenceCoord.y, referenceCoord.z) == null)
{
referenceCoord = null;
}
Expand All @@ -340,12 +340,12 @@ public void revisitBlocks ()
for (CoordTuple coord : connectedBlocks)
{

if (!this.worldObj.getChunkProvider().chunkExists(coord.x() >> 4, coord.z() >> 4))
if (!this.worldObj.getChunkProvider().chunkExists(coord.x >> 4, coord.z >> 4))
{
continue;
}

te = this.worldObj.getBlockTileEntity(coord.x(), coord.y(), coord.z());
te = this.worldObj.getBlockTileEntity(coord.x, coord.y, coord.z);
if (!(te instanceof IMultiblockMember))
{
continue;
Expand All @@ -372,7 +372,7 @@ else if (coord.compareTo(referenceCoord) < 0)
// Now visit all connected parts, breadth-first, starting from reference coord.
LinkedList<IMultiblockMember> membersToCheck = new LinkedList<IMultiblockMember>();
IMultiblockMember[] nearbyMembers = null;
IMultiblockMember member = (IMultiblockMember) this.worldObj.getBlockTileEntity(referenceCoord.x(), referenceCoord.y(), referenceCoord.z());
IMultiblockMember member = (IMultiblockMember) this.worldObj.getBlockTileEntity(referenceCoord.x, referenceCoord.y, referenceCoord.z);

membersToCheck.add(member);
while (!membersToCheck.isEmpty())
Expand Down Expand Up @@ -402,12 +402,12 @@ else if (coord.compareTo(referenceCoord) < 0)
List<CoordTuple> deadBlocks = new ArrayList<CoordTuple>();
for (CoordTuple coord : connectedBlocks)
{
if (!this.worldObj.getChunkProvider().chunkExists(coord.x() >> 4, coord.z() >> 4))
if (!this.worldObj.getChunkProvider().chunkExists(coord.x >> 4, coord.z >> 4))
{
deadBlocks.add(coord);
continue;
}
member = (IMultiblockMember) this.worldObj.getBlockTileEntity(coord.x(), coord.y(), coord.z());
member = (IMultiblockMember) this.worldObj.getBlockTileEntity(coord.x, coord.y, coord.z);
if (!member.isVisited())
{
orphans.add(member);
Expand Down

0 comments on commit fb44714

Please sign in to comment.