Posted 10 July 2018 - 08:06 AM
Hello guys,
I am currently trying to make a turtle move using the chat, so I use my own mod. I can move turtle and it plays animations, but when I want it to move 2 blocks it just skips the first animation and teleports to the destination. Do you have any ideas why it is like that (in the description of the playAnimation method is mentioned that it makes other turtle commands wait until it is finished)?
Here is my method to move:
public boolean move(EnumFacing dir) {
if (!checkAir(dir))
return false;
if (!(dir.equals(EnumFacing.UP) || dir.equals(EnumFacing.DOWN))) {
turn(dir);
access.playAnimation(TurtleAnimation.MoveForward);
}
switch (dir) {
case NORTH:
pos = pos.north();
break;
case WEST:
pos = pos.west();
break;
case SOUTH:
pos = pos.south();
break;
case EAST:
pos = pos.east();
break;
case UP:
access.playAnimation(TurtleAnimation.MoveUp);
pos = pos.up();
break;
case DOWN:
access.playAnimation(TurtleAnimation.MoveDown);
pos = pos.down();
}
access.teleportTo(world, pos);
return true;
}
I am currently trying to make a turtle move using the chat, so I use my own mod. I can move turtle and it plays animations, but when I want it to move 2 blocks it just skips the first animation and teleports to the destination. Do you have any ideas why it is like that (in the description of the playAnimation method is mentioned that it makes other turtle commands wait until it is finished)?
Here is my method to move:
public boolean move(EnumFacing dir) {
if (!checkAir(dir))
return false;
if (!(dir.equals(EnumFacing.UP) || dir.equals(EnumFacing.DOWN))) {
turn(dir);
access.playAnimation(TurtleAnimation.MoveForward);
}
switch (dir) {
case NORTH:
pos = pos.north();
break;
case WEST:
pos = pos.west();
break;
case SOUTH:
pos = pos.south();
break;
case EAST:
pos = pos.east();
break;
case UP:
access.playAnimation(TurtleAnimation.MoveUp);
pos = pos.up();
break;
case DOWN:
access.playAnimation(TurtleAnimation.MoveDown);
pos = pos.down();
}
access.teleportTo(world, pos);
return true;
}