Do a bunch of checks for isInvalid().

This commit is contained in:
Lizbeth Rika committed 2015-06-08 23:07:10 +01:00
1 parent 6211bb967f
commit 54cfa17511
6 files changed
+11 -9

No files matched your search

@@ -89,7 +89,7 @@ public class SubTileGenerating extends SubTileEntity {
if(supertile.getWorldObj().blockExists(cachedCollectorCoordinates.posX, cachedCollectorCoordinates.posY, cachedCollectorCoordinates.posZ)) {
needsNew = true;
TileEntity tileAt = supertile.getWorldObj().getTileEntity(cachedCollectorCoordinates.posX, cachedCollectorCoordinates.posY, cachedCollectorCoordinates.posZ);
if(tileAt != null && tileAt instanceof IManaCollector) {
if(tileAt != null && tileAt instanceof IManaCollector && !tileAt.isInvalid()) {
linkedCollector = tileAt;
needsNew = false;
}
@@ -100,7 +100,7 @@ public class SubTileGenerating extends SubTileEntity {
if(!needsNew && linkedCollector != null) {
TileEntity tileAt = supertile.getWorldObj().getTileEntity(linkedCollector.xCoord, linkedCollector.yCoord, linkedCollector.zCoord);
if(!(tileAt instanceof IManaCollector)) {
if(!(tileAt instanceof IManaCollector) || !tileAt.isInvalid()) {
linkedCollector = null;
needsNew = true;
} else linkedCollector = tileAt;