Delay Block Updates, and save the world!
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package appeng.util;
|
||||
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockUpdate implements Callable
|
||||
{
|
||||
|
||||
final World w;
|
||||
final int x, y, z;
|
||||
|
||||
public BlockUpdate(World w, int x, int y, int z) {
|
||||
this.w = w;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object call() throws Exception
|
||||
{
|
||||
w.notifyBlocksOfNeighborChange( x, y, z, Platform.air );
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -84,6 +84,7 @@ import appeng.core.AEConfig;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
import appeng.hooks.TickHandler;
|
||||
import appeng.me.GridAccessException;
|
||||
import appeng.me.GridNode;
|
||||
import appeng.me.helpers.AENetworkProxy;
|
||||
@@ -1638,4 +1639,10 @@ public class Platform
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void notifyBlocksOfNeighbors(World worldObj, int xCoord, int yCoord, int zCoord)
|
||||
{
|
||||
if ( !worldObj.isRemote )
|
||||
TickHandler.instance.addCallable( worldObj, new BlockUpdate( worldObj, xCoord, yCoord, zCoord ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user