Fixed command processing to work
This commit is contained in:
parent
af74b4230b
commit
e07b10b47f
2 changed files with 16 additions and 0 deletions
|
@ -4,12 +4,25 @@ import assemblyline.common.machine.armbot.TileEntityArmbot;
|
|||
|
||||
public class CommandIdle extends Command
|
||||
{
|
||||
/**
|
||||
* The amount of time in which the machine will idle.
|
||||
*/
|
||||
public int idleTime = 80;
|
||||
|
||||
protected boolean doTask()
|
||||
{
|
||||
/**
|
||||
* Randomly move the arm to simulate life in the arm if the arm is powered
|
||||
*/
|
||||
this.tileEntity.rotationPitch *= 0.98 * this.world.rand.nextFloat();
|
||||
|
||||
if (this.idleTime > 0)
|
||||
{
|
||||
this.idleTime--;
|
||||
System.out.println("RESTING");
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ public class CommandManager
|
|||
while (iter.hasNext())
|
||||
{
|
||||
task = iter.next();
|
||||
|
||||
if (task.getTickInterval() > 0)
|
||||
{
|
||||
if (this.ticks % task.getTickInterval() == 0)
|
||||
|
@ -38,6 +39,8 @@ public class CommandManager
|
|||
task.onTaskEnd();
|
||||
iter.remove();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue