2013-12-27 23:59:59 +01:00
|
|
|
package appeng.helpers;
|
|
|
|
|
|
|
|
import net.minecraft.world.IBlockAccess;
|
2014-02-09 02:34:52 +01:00
|
|
|
import net.minecraftforge.common.util.ForgeDirection;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.api.util.IOrientable;
|
|
|
|
|
|
|
|
public class LocationRotation implements IOrientable
|
|
|
|
{
|
|
|
|
|
|
|
|
final IBlockAccess w;
|
|
|
|
final int x;
|
|
|
|
final int y;
|
|
|
|
final int z;
|
|
|
|
|
|
|
|
public LocationRotation(IBlockAccess world, int x, int y, int z) {
|
|
|
|
w = world;
|
|
|
|
this.x = x;
|
|
|
|
this.y = y;
|
|
|
|
this.z = z;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void setOrientation(ForgeDirection Forward, ForgeDirection Up)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public ForgeDirection getUp()
|
|
|
|
{
|
|
|
|
int num = Math.abs( x + y + z ) % 6;
|
|
|
|
return ForgeDirection.getOrientation( num );
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public ForgeDirection getForward()
|
|
|
|
{
|
|
|
|
if ( getUp().offsetY == 0 )
|
|
|
|
return ForgeDirection.UP;
|
|
|
|
return ForgeDirection.SOUTH;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean canBeRotated()
|
|
|
|
{
|
2014-04-04 06:12:35 +02:00
|
|
|
return false;
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
}
|