Jump to content


DevSven's Content

There have been 2 items by DevSven (Search limited from 10-February 22)


By content type

See this member's

Sort by                Order  

#277740 playAnimation does not wait

Posted by DevSven on 10 July 2018 - 07:06 AM in Ask a Pro

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;
}



#277397 Own mod build on top of Computercraft

Posted by DevSven on 25 May 2018 - 12:01 PM in Ask a Pro

Hello guys,
I am currently trying to build a mod on top of computercraft to modify it a little bit but I have a little problem now: I don't know how to link the java object TileTurtle to the actual turtle block in minecraft. If anybody knows how to do this so I can use java to control the turtle please write how to do that :)