Skip to content

Instantly share code, notes, and snippets.

@perkinslr
Created February 25, 2015 20:09
Show Gist options
  • Save perkinslr/5c812814649c32b5274a to your computer and use it in GitHub Desktop.
Save perkinslr/5c812814649c32b5274a to your computer and use it in GitHub Desktop.
diff --git a/src/main/java/micdoodle8/mods/galacticraft/core/oxygen/ThreadFindSeal.java b/src/main/java/micdoodle8/mods/galacticraft/core/oxygen/ThreadFindSeal.java
index 79c5db7..ed195ec 100644
--- a/src/main/java/micdoodle8/mods/galacticraft/core/oxygen/ThreadFindSeal.java
+++ b/src/main/java/micdoodle8/mods/galacticraft/core/oxygen/ThreadFindSeal.java
@@ -124,26 +131,42 @@ public class ThreadFindSeal
public void check()
{
long time1 = System.nanoTime();
this.sealed = true;
this.checked.add(this.head.clone());
this.currentLayer = new LinkedList<BlockVec3>();
this.airToReplace = new LinkedList<BlockVec3>();
this.airToReplaceBright = new LinkedList<BlockVec3>();
if (this.checkCount > 0)
{
this.currentLayer.add(this.head);
if (this.head.x < -29990000 || this.head.z < -29990000 || this.head.x >= 29990000 || this.head.z >= 29990000)
{
- if (Blocks.air == this.head.getBlockID_noChunkLoad(this.world))
+ Block b = this.head.getBlockID_noChunkLoad(this.world);
+ if (Blocks.air == b)
{
this.airToReplace.add(this.head.clone());
}
- if (this.head.getBlockID_noChunkLoad(this.world) == GCBlocks.brightAir)
+ else if (b == GCBlocks.brightAir)
{
this.airToReplaceBright.add(this.head.clone());
}
this.doLayerNearMapEdge();
}
else
@@ -153,27 +176,33 @@ public class ThreadFindSeal
{
this.airToReplace.add(this.head.clone());
}
- if (headblock == GCBlocks.brightAir)
+ else if (headblock == GCBlocks.brightAir)
{
this.airToReplaceBright.add(this.head.clone());
}
this.doLayer();
}
}
else
{
this.sealed = false;
}
long time2 = System.nanoTime();
//Can only be properly sealed if there is at least one sealer here (on edge check)
if (this.sealers.isEmpty())
{
this.sealed = false;
}
if (this.sealed)
{
if (!this.airToReplace.isEmpty() || !this.airToReplaceBright.isEmpty())
{
@@ -185,16 +214,30 @@ public class ThreadFindSeal
for (BlockVec3 checkedVec : this.airToReplace)
{
//No block update for performance reasons; deal with unlit torches separately
- changeList.add(new ScheduledBlockChange(checkedVec.clone(), breatheableAirID, 0));
+ changeList.add(new ScheduledBlockChange(checkedVec.clone(), breatheableAirID, 0, checkedVec.getBlock(world), null));
}
for (BlockVec3 checkedVec : this.airToReplaceBright)
{
- changeList.add(new ScheduledBlockChange(checkedVec.clone(), GCBlocks.brightBreatheableAir, 0));
+ changeList.add(new ScheduledBlockChange(checkedVec.clone(), GCBlocks.brightBreatheableAir, 0, checkedVec.getBlock(world), null));
}
TickHandlerServer.scheduleNewBlockChange(this.world.provider.dimensionId, changeList);
}
if (!this.torchesToUpdate.isEmpty())
{
TickHandlerServer.scheduleNewTorchUpdate(this.world.provider.dimensionId, this.torchesToUpdate);
}
}
@@ -303,18 +349,28 @@ public class ThreadFindSeal
Block breatheableAirID = GCBlocks.breatheableAir;
for (BlockVec3 airVec : this.airToReplace)
{
- changeList.add(new ScheduledBlockChange(airVec.clone(), breatheableAirID, 0));
+ changeList.add(new ScheduledBlockChange(airVec.clone(), breatheableAirID, 0, airVec.getBlock(world), null));
}
for (BlockVec3 airVec : this.airToReplaceBright)
{
- changeList.add(new ScheduledBlockChange(airVec.clone(), GCBlocks.brightBreatheableAir, 0));
+ changeList.add(new ScheduledBlockChange(airVec.clone(), GCBlocks.brightBreatheableAir, 0, airVec.getBlock(world), null));
}
TickHandlerServer.scheduleNewBlockChange(this.world.provider.dimensionId, changeList);
}
if (!this.torchesToUpdate.isEmpty())
{
TickHandlerServer.scheduleNewTorchUpdate(this.world.provider.dimensionId, this.torchesToUpdate);
}
}
}
@@ -335,11 +391,11 @@ public class ThreadFindSeal
List<ScheduledBlockChange> changeList = new LinkedList<ScheduledBlockChange>();
for (BlockVec3 checkedVec : this.breatheableToReplace)
{
- changeList.add(new ScheduledBlockChange(checkedVec.clone(), Blocks.air, 0));
+ changeList.add(new ScheduledBlockChange(checkedVec.clone(), Blocks.air, 0, checkedVec.getBlock(world), null));
}
for (BlockVec3 checkedVec : this.breatheableToReplaceBright)
{
- changeList.add(new ScheduledBlockChange(checkedVec.clone(), GCBlocks.brightAir, 0));
+ changeList.add(new ScheduledBlockChange(checkedVec.clone(), GCBlocks.brightAir, 0, checkedVec.getBlock(world), null));
}
TickHandlerServer.scheduleNewBlockChange(this.world.provider.dimensionId, changeList);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment