Prevent block updates while loading parts; Should fix http://openeye.openmods.info/crashes/baf3e72a51ad8a5b8680ec24a819bc86
This commit is contained in:
@@ -320,12 +320,21 @@ public class CableBusContainer implements AEMultiTile, ICableBusContainer
|
||||
return null;
|
||||
}
|
||||
|
||||
private static final ThreadLocal<Boolean> isLoading = new ThreadLocal();
|
||||
|
||||
public static boolean isLoading() {
|
||||
Boolean is = isLoading.get();
|
||||
return is != null && is == true;
|
||||
}
|
||||
|
||||
public void addToWorld()
|
||||
{
|
||||
if ( inWorld )
|
||||
return;
|
||||
|
||||
inWorld = true;
|
||||
|
||||
isLoading.set( true );
|
||||
|
||||
TileEntity te = getTile();
|
||||
hasRedstone = te.getWorldObj().isBlockIndirectlyGettingPowered( te.xCoord, te.yCoord, te.zCoord );
|
||||
|
||||
@@ -372,6 +381,8 @@ public class CableBusContainer implements AEMultiTile, ICableBusContainer
|
||||
}
|
||||
|
||||
partChanged();
|
||||
|
||||
isLoading.set(false);
|
||||
}
|
||||
|
||||
public void removeFromWorld()
|
||||
|
||||
Reference in New Issue
Block a user