From a20592178fd418b3ace2bbc69ed98644032bde73 Mon Sep 17 00:00:00 2001 From: DarkGuardsman Date: Tue, 23 Jul 2013 23:49:27 -0400 Subject: [PATCH] Fixed crash on placing Armbot --- .../common/armbot/TileEntityArmbot.java | 9 +++++++-- .../common/machine/TileEntityAssembly.java | 17 ++++++++--------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/minecraft/dark/assembly/common/armbot/TileEntityArmbot.java b/src/minecraft/dark/assembly/common/armbot/TileEntityArmbot.java index ede4903d..500fca9f 100644 --- a/src/minecraft/dark/assembly/common/armbot/TileEntityArmbot.java +++ b/src/minecraft/dark/assembly/common/armbot/TileEntityArmbot.java @@ -105,7 +105,7 @@ public class TileEntityArmbot extends TileEntityAssembly implements IMultiBlock, if (this.isRunning()) { - if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER) + if (!this.worldObj.isRemote) { if (this.disk == null && this.computersAttached == 0) { @@ -130,7 +130,9 @@ public class TileEntityArmbot extends TileEntityAssembly implements IMultiBlock, } } if (!this.worldObj.isRemote) + { this.commandManager.onUpdate(); + } } else { @@ -589,7 +591,10 @@ public class TileEntityArmbot extends TileEntityAssembly implements IMultiBlock, @Override public void onCreate(Vector3 placedPosition) { - DarkMain.blockMulti.makeFakeBlock(this.worldObj, Vector3.add(placedPosition, new Vector3(0, 1, 0)), placedPosition); + if (DarkMain.blockMulti != null) + { + DarkMain.blockMulti.makeFakeBlock(this.worldObj, Vector3.add(placedPosition, new Vector3(0, 1, 0)), placedPosition); + } } @Override diff --git a/src/minecraft/dark/assembly/common/machine/TileEntityAssembly.java b/src/minecraft/dark/assembly/common/machine/TileEntityAssembly.java index ab1755d0..eb5dedb8 100644 --- a/src/minecraft/dark/assembly/common/machine/TileEntityAssembly.java +++ b/src/minecraft/dark/assembly/common/machine/TileEntityAssembly.java @@ -85,21 +85,20 @@ public abstract class TileEntityAssembly extends TileEntityMachine implements IN this.onUpdate(); } + @Override + public boolean canRun() + { + //TODO add check for network power + return super.canRun() || AssemblyLine.REQUIRE_NO_POWER; + } + /** Same as updateEntity */ public abstract void onUpdate(); /** Checks to see if this assembly tile can run using several methods */ public boolean isRunning() { - if (!this.worldObj.isRemote) - { - return this.running || AssemblyLine.REQUIRE_NO_POWER; - } - else - { - return this.running; - } - + return this.running; } /** Amount of energy this tile runs on per tick */