Fixed crash on placing Armbot

This commit is contained in:
DarkGuardsman 2013-07-23 23:49:27 -04:00
parent ddc983cd40
commit a20592178f
2 changed files with 15 additions and 11 deletions

View file

@ -105,7 +105,7 @@ public class TileEntityArmbot extends TileEntityAssembly implements IMultiBlock,
if (this.isRunning()) if (this.isRunning())
{ {
if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER) if (!this.worldObj.isRemote)
{ {
if (this.disk == null && this.computersAttached == 0) if (this.disk == null && this.computersAttached == 0)
{ {
@ -130,8 +130,10 @@ public class TileEntityArmbot extends TileEntityAssembly implements IMultiBlock,
} }
} }
if (!this.worldObj.isRemote) if (!this.worldObj.isRemote)
{
this.commandManager.onUpdate(); this.commandManager.onUpdate();
} }
}
else else
{ {
} }
@ -588,9 +590,12 @@ public class TileEntityArmbot extends TileEntityAssembly implements IMultiBlock,
@Override @Override
public void onCreate(Vector3 placedPosition) public void onCreate(Vector3 placedPosition)
{
if (DarkMain.blockMulti != null)
{ {
DarkMain.blockMulti.makeFakeBlock(this.worldObj, Vector3.add(placedPosition, new Vector3(0, 1, 0)), placedPosition); DarkMain.blockMulti.makeFakeBlock(this.worldObj, Vector3.add(placedPosition, new Vector3(0, 1, 0)), placedPosition);
} }
}
@Override @Override
public void onDestroy(TileEntity callingBlock) public void onDestroy(TileEntity callingBlock)

View file

@ -85,23 +85,22 @@ public abstract class TileEntityAssembly extends TileEntityMachine implements IN
this.onUpdate(); this.onUpdate();
} }
@Override
public boolean canRun()
{
//TODO add check for network power
return super.canRun() || AssemblyLine.REQUIRE_NO_POWER;
}
/** Same as updateEntity */ /** Same as updateEntity */
public abstract void onUpdate(); public abstract void onUpdate();
/** Checks to see if this assembly tile can run using several methods */ /** Checks to see if this assembly tile can run using several methods */
public boolean isRunning() 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 */ /** Amount of energy this tile runs on per tick */
public double getWattLoad() public double getWattLoad()
{ {