mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2024-06-30 17:13:20 +00:00
![ObloxCC](/assets/img/avatar_default.png)
* Updated (C) * Fixed Whitespace bugs, bugs, and more bugs * Fixed Whitespaces 1/2 * Fixed Whitespaces 2/2 * Fixed Whitespaces 3/2
43 lines
937 B
Java
43 lines
937 B
Java
/*
|
|
* This file is part of ComputerCraft - http://www.computercraft.info
|
|
* Copyright Daniel Ratcliffe, 2011-2017. Do not distribute without permission.
|
|
* Send enquiries to dratcliffe@gmail.com
|
|
*/
|
|
|
|
package dan200.computercraft.shared.turtle.core;
|
|
|
|
import dan200.computercraft.api.turtle.ITurtleAccess;
|
|
import net.minecraft.util.EnumFacing;
|
|
|
|
public enum MoveDirection
|
|
{
|
|
Forward,
|
|
Back,
|
|
Up,
|
|
Down;
|
|
|
|
public EnumFacing toWorldDir( ITurtleAccess turtle )
|
|
{
|
|
switch( this )
|
|
{
|
|
case Forward:
|
|
default:
|
|
{
|
|
return turtle.getDirection();
|
|
}
|
|
case Back:
|
|
{
|
|
return turtle.getDirection().getOpposite();
|
|
}
|
|
case Up:
|
|
{
|
|
return EnumFacing.UP;
|
|
}
|
|
case Down:
|
|
{
|
|
return EnumFacing.DOWN;
|
|
}
|
|
}
|
|
}
|
|
}
|