mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-11-07 08:52:59 +00:00
Normalise enums to use SHOUTY_CASE
PascalCase is more .NET than Java
This commit is contained in:
@@ -133,11 +133,11 @@ public class TurtleAPI implements ILuaAPI
|
||||
}
|
||||
else if( side.equalsIgnoreCase( "left" ) )
|
||||
{
|
||||
return TurtleSide.Left;
|
||||
return TurtleSide.LEFT;
|
||||
}
|
||||
else if( side.equalsIgnoreCase( "right" ) )
|
||||
{
|
||||
return TurtleSide.Right;
|
||||
return TurtleSide.RIGHT;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -152,58 +152,58 @@ public class TurtleAPI implements ILuaAPI
|
||||
{
|
||||
case 0: // forward
|
||||
m_environment.addTrackingChange( TrackingField.TURTLE_OPS );
|
||||
return tryCommand( context, new TurtleMoveCommand( MoveDirection.Forward ) );
|
||||
return tryCommand( context, new TurtleMoveCommand( MoveDirection.FORWARD ) );
|
||||
case 1: // back
|
||||
m_environment.addTrackingChange( TrackingField.TURTLE_OPS );
|
||||
return tryCommand( context, new TurtleMoveCommand( MoveDirection.Back ) );
|
||||
return tryCommand( context, new TurtleMoveCommand( MoveDirection.BACK ) );
|
||||
case 2: // up
|
||||
m_environment.addTrackingChange( TrackingField.TURTLE_OPS );
|
||||
return tryCommand( context, new TurtleMoveCommand( MoveDirection.Up ) );
|
||||
return tryCommand( context, new TurtleMoveCommand( MoveDirection.UP ) );
|
||||
case 3: // down
|
||||
m_environment.addTrackingChange( TrackingField.TURTLE_OPS );
|
||||
return tryCommand( context, new TurtleMoveCommand( MoveDirection.Down ) );
|
||||
return tryCommand( context, new TurtleMoveCommand( MoveDirection.DOWN ) );
|
||||
case 4: // turnLeft
|
||||
m_environment.addTrackingChange( TrackingField.TURTLE_OPS );
|
||||
return tryCommand( context, new TurtleTurnCommand( TurnDirection.Left ) );
|
||||
return tryCommand( context, new TurtleTurnCommand( TurnDirection.LEFT ) );
|
||||
case 5: // turnRight
|
||||
m_environment.addTrackingChange( TrackingField.TURTLE_OPS );
|
||||
return tryCommand( context, new TurtleTurnCommand( TurnDirection.Right ) );
|
||||
return tryCommand( context, new TurtleTurnCommand( TurnDirection.RIGHT ) );
|
||||
case 6:
|
||||
{
|
||||
// dig
|
||||
TurtleSide side = parseSide( args, 0 );
|
||||
m_environment.addTrackingChange( TrackingField.TURTLE_OPS );
|
||||
return tryCommand( context, TurtleToolCommand.dig( InteractDirection.Forward, side ) );
|
||||
return tryCommand( context, TurtleToolCommand.dig( InteractDirection.FORWARD, side ) );
|
||||
}
|
||||
case 7:
|
||||
{
|
||||
// digUp
|
||||
TurtleSide side = parseSide( args, 0 );
|
||||
m_environment.addTrackingChange( TrackingField.TURTLE_OPS );
|
||||
return tryCommand( context, TurtleToolCommand.dig( InteractDirection.Up, side ) );
|
||||
return tryCommand( context, TurtleToolCommand.dig( InteractDirection.UP, side ) );
|
||||
}
|
||||
case 8:
|
||||
{
|
||||
// digDown
|
||||
TurtleSide side = parseSide( args, 0 );
|
||||
m_environment.addTrackingChange( TrackingField.TURTLE_OPS );
|
||||
return tryCommand( context, TurtleToolCommand.dig( InteractDirection.Down, side ) );
|
||||
return tryCommand( context, TurtleToolCommand.dig( InteractDirection.DOWN, side ) );
|
||||
}
|
||||
case 9: // place
|
||||
m_environment.addTrackingChange( TrackingField.TURTLE_OPS );
|
||||
return tryCommand( context, new TurtlePlaceCommand( InteractDirection.Forward, args ) );
|
||||
return tryCommand( context, new TurtlePlaceCommand( InteractDirection.FORWARD, args ) );
|
||||
case 10: // placeUp
|
||||
m_environment.addTrackingChange( TrackingField.TURTLE_OPS );
|
||||
return tryCommand( context, new TurtlePlaceCommand( InteractDirection.Up, args ) );
|
||||
return tryCommand( context, new TurtlePlaceCommand( InteractDirection.UP, args ) );
|
||||
case 11: // placeDown
|
||||
m_environment.addTrackingChange( TrackingField.TURTLE_OPS );
|
||||
return tryCommand( context, new TurtlePlaceCommand( InteractDirection.Down, args ) );
|
||||
return tryCommand( context, new TurtlePlaceCommand( InteractDirection.DOWN, args ) );
|
||||
case 12:
|
||||
{
|
||||
// drop
|
||||
int count = parseCount( args, 0 );
|
||||
m_environment.addTrackingChange( TrackingField.TURTLE_OPS );
|
||||
return tryCommand( context, new TurtleDropCommand( InteractDirection.Forward, count ) );
|
||||
return tryCommand( context, new TurtleDropCommand( InteractDirection.FORWARD, count ) );
|
||||
}
|
||||
case 13:
|
||||
{
|
||||
@@ -229,72 +229,72 @@ public class TurtleAPI implements ILuaAPI
|
||||
return new Object[] { stack.isEmpty() ? 64 : Math.min( stack.getMaxStackSize(), 64 ) - stack.getCount() };
|
||||
}
|
||||
case 16: // detect
|
||||
return tryCommand( context, new TurtleDetectCommand( InteractDirection.Forward ) );
|
||||
return tryCommand( context, new TurtleDetectCommand( InteractDirection.FORWARD ) );
|
||||
case 17: // detectUp
|
||||
return tryCommand( context, new TurtleDetectCommand( InteractDirection.Up ) );
|
||||
return tryCommand( context, new TurtleDetectCommand( InteractDirection.UP ) );
|
||||
case 18: // detectDown
|
||||
return tryCommand( context, new TurtleDetectCommand( InteractDirection.Down ) );
|
||||
return tryCommand( context, new TurtleDetectCommand( InteractDirection.DOWN ) );
|
||||
case 19: // compare
|
||||
return tryCommand( context, new TurtleCompareCommand( InteractDirection.Forward ) );
|
||||
return tryCommand( context, new TurtleCompareCommand( InteractDirection.FORWARD ) );
|
||||
case 20: // compareUp
|
||||
return tryCommand( context, new TurtleCompareCommand( InteractDirection.Up ) );
|
||||
return tryCommand( context, new TurtleCompareCommand( InteractDirection.UP ) );
|
||||
case 21: // compareDown
|
||||
return tryCommand( context, new TurtleCompareCommand( InteractDirection.Down ) );
|
||||
return tryCommand( context, new TurtleCompareCommand( InteractDirection.DOWN ) );
|
||||
case 22:
|
||||
{
|
||||
// attack
|
||||
TurtleSide side = parseSide( args, 0 );
|
||||
m_environment.addTrackingChange( TrackingField.TURTLE_OPS );
|
||||
return tryCommand( context, TurtleToolCommand.attack( InteractDirection.Forward, side ) );
|
||||
return tryCommand( context, TurtleToolCommand.attack( InteractDirection.FORWARD, side ) );
|
||||
}
|
||||
case 23:
|
||||
{
|
||||
// attackUp
|
||||
TurtleSide side = parseSide( args, 0 );
|
||||
m_environment.addTrackingChange( TrackingField.TURTLE_OPS );
|
||||
return tryCommand( context, TurtleToolCommand.attack( InteractDirection.Up, side ) );
|
||||
return tryCommand( context, TurtleToolCommand.attack( InteractDirection.UP, side ) );
|
||||
}
|
||||
case 24:
|
||||
{
|
||||
// attackDown
|
||||
TurtleSide side = parseSide( args, 0 );
|
||||
m_environment.addTrackingChange( TrackingField.TURTLE_OPS );
|
||||
return tryCommand( context, TurtleToolCommand.attack( InteractDirection.Down, side ) );
|
||||
return tryCommand( context, TurtleToolCommand.attack( InteractDirection.DOWN, side ) );
|
||||
}
|
||||
case 25:
|
||||
{
|
||||
// dropUp
|
||||
int count = parseCount( args, 0 );
|
||||
m_environment.addTrackingChange( TrackingField.TURTLE_OPS );
|
||||
return tryCommand( context, new TurtleDropCommand( InteractDirection.Up, count ) );
|
||||
return tryCommand( context, new TurtleDropCommand( InteractDirection.UP, count ) );
|
||||
}
|
||||
case 26:
|
||||
{
|
||||
// dropDown
|
||||
int count = parseCount( args, 0 );
|
||||
m_environment.addTrackingChange( TrackingField.TURTLE_OPS );
|
||||
return tryCommand( context, new TurtleDropCommand( InteractDirection.Down, count ) );
|
||||
return tryCommand( context, new TurtleDropCommand( InteractDirection.DOWN, count ) );
|
||||
}
|
||||
case 27:
|
||||
{
|
||||
// suck
|
||||
int count = parseCount( args, 0 );
|
||||
m_environment.addTrackingChange( TrackingField.TURTLE_OPS );
|
||||
return tryCommand( context, new TurtleSuckCommand( InteractDirection.Forward, count ) );
|
||||
return tryCommand( context, new TurtleSuckCommand( InteractDirection.FORWARD, count ) );
|
||||
}
|
||||
case 28:
|
||||
{
|
||||
// suckUp
|
||||
int count = parseCount( args, 0 );
|
||||
m_environment.addTrackingChange( TrackingField.TURTLE_OPS );
|
||||
return tryCommand( context, new TurtleSuckCommand( InteractDirection.Up, count ) );
|
||||
return tryCommand( context, new TurtleSuckCommand( InteractDirection.UP, count ) );
|
||||
}
|
||||
case 29:
|
||||
{
|
||||
// suckDown
|
||||
int count = parseCount( args, 0 );
|
||||
m_environment.addTrackingChange( TrackingField.TURTLE_OPS );
|
||||
return tryCommand( context, new TurtleSuckCommand( InteractDirection.Down, count ) );
|
||||
return tryCommand( context, new TurtleSuckCommand( InteractDirection.DOWN, count ) );
|
||||
}
|
||||
case 30: // getFuelLevel
|
||||
return new Object[] { m_turtle.isFuelNeeded() ? m_turtle.getFuelLevel() : "unlimited" };
|
||||
@@ -324,16 +324,16 @@ public class TurtleAPI implements ILuaAPI
|
||||
return new Object[] { m_turtle.isFuelNeeded() ? m_turtle.getFuelLimit() : "unlimited" };
|
||||
case 36: // equipLeft
|
||||
m_environment.addTrackingChange( TrackingField.TURTLE_OPS );
|
||||
return tryCommand( context, new TurtleEquipCommand( TurtleSide.Left ) );
|
||||
return tryCommand( context, new TurtleEquipCommand( TurtleSide.LEFT ) );
|
||||
case 37: // equipRight
|
||||
m_environment.addTrackingChange( TrackingField.TURTLE_OPS );
|
||||
return tryCommand( context, new TurtleEquipCommand( TurtleSide.Right ) );
|
||||
return tryCommand( context, new TurtleEquipCommand( TurtleSide.RIGHT ) );
|
||||
case 38: // inspect
|
||||
return tryCommand( context, new TurtleInspectCommand( InteractDirection.Forward ) );
|
||||
return tryCommand( context, new TurtleInspectCommand( InteractDirection.FORWARD ) );
|
||||
case 39: // inspectUp
|
||||
return tryCommand( context, new TurtleInspectCommand( InteractDirection.Up ) );
|
||||
return tryCommand( context, new TurtleInspectCommand( InteractDirection.UP ) );
|
||||
case 40: // inspectDown
|
||||
return tryCommand( context, new TurtleInspectCommand( InteractDirection.Down ) );
|
||||
return tryCommand( context, new TurtleInspectCommand( InteractDirection.DOWN ) );
|
||||
case 41: // getItemDetail
|
||||
{
|
||||
// FIXME: There's a race condition here if the stack is being modified (mutating NBT, etc...)
|
||||
|
||||
@@ -152,7 +152,7 @@ public class BlockTurtle extends BlockComputerBase<TileTurtle> implements IWater
|
||||
@Override
|
||||
public float getExplosionResistance( BlockState state, IWorldReader world, BlockPos pos, @Nullable Entity exploder, Explosion explosion )
|
||||
{
|
||||
if( getFamily() == ComputerFamily.Advanced || exploder instanceof LivingEntity || exploder instanceof DamagingProjectileEntity )
|
||||
if( getFamily() == ComputerFamily.ADVANCED || exploder instanceof LivingEntity || exploder instanceof DamagingProjectileEntity )
|
||||
{
|
||||
return 2000;
|
||||
}
|
||||
|
||||
@@ -57,12 +57,12 @@ public class TileTurtle extends TileComputerBase implements ITurtleTile, Default
|
||||
|
||||
public static final NamedTileEntityType<TileTurtle> FACTORY_NORMAL = NamedTileEntityType.create(
|
||||
new ResourceLocation( ComputerCraft.MOD_ID, "turtle_normal" ),
|
||||
type -> new TileTurtle( type, ComputerFamily.Normal )
|
||||
type -> new TileTurtle( type, ComputerFamily.NORMAL )
|
||||
);
|
||||
|
||||
public static final NamedTileEntityType<TileTurtle> FACTORY_ADVANCED = NamedTileEntityType.create(
|
||||
new ResourceLocation( ComputerCraft.MOD_ID, "turtle_advanced" ),
|
||||
type -> new TileTurtle( type, ComputerFamily.Advanced )
|
||||
type -> new TileTurtle( type, ComputerFamily.ADVANCED )
|
||||
);
|
||||
|
||||
enum MoveState
|
||||
@@ -526,10 +526,10 @@ public class TileTurtle extends TileComputerBase implements ITurtleTile, Default
|
||||
switch( side )
|
||||
{
|
||||
case RIGHT:
|
||||
upgrade = getUpgrade( TurtleSide.Right );
|
||||
upgrade = getUpgrade( TurtleSide.RIGHT );
|
||||
break;
|
||||
case LEFT:
|
||||
upgrade = getUpgrade( TurtleSide.Left );
|
||||
upgrade = getUpgrade( TurtleSide.LEFT );
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
|
||||
@@ -10,20 +10,20 @@ import net.minecraft.util.Direction;
|
||||
|
||||
public enum InteractDirection
|
||||
{
|
||||
Forward,
|
||||
Up,
|
||||
Down;
|
||||
FORWARD,
|
||||
UP,
|
||||
DOWN;
|
||||
|
||||
public Direction toWorldDir( ITurtleAccess turtle )
|
||||
{
|
||||
switch( this )
|
||||
{
|
||||
case Forward:
|
||||
case FORWARD:
|
||||
default:
|
||||
return turtle.getDirection();
|
||||
case Up:
|
||||
case UP:
|
||||
return Direction.UP;
|
||||
case Down:
|
||||
case DOWN:
|
||||
return Direction.DOWN;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,23 +10,23 @@ import net.minecraft.util.Direction;
|
||||
|
||||
public enum MoveDirection
|
||||
{
|
||||
Forward,
|
||||
Back,
|
||||
Up,
|
||||
Down;
|
||||
FORWARD,
|
||||
BACK,
|
||||
UP,
|
||||
DOWN;
|
||||
|
||||
public Direction toWorldDir( ITurtleAccess turtle )
|
||||
{
|
||||
switch( this )
|
||||
{
|
||||
case Forward:
|
||||
case FORWARD:
|
||||
default:
|
||||
return turtle.getDirection();
|
||||
case Back:
|
||||
case BACK:
|
||||
return turtle.getDirection().getOpposite();
|
||||
case Up:
|
||||
case UP:
|
||||
return Direction.UP;
|
||||
case Down:
|
||||
case DOWN:
|
||||
return Direction.DOWN;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,6 @@ package dan200.computercraft.shared.turtle.core;
|
||||
|
||||
public enum TurnDirection
|
||||
{
|
||||
Left,
|
||||
Right,
|
||||
LEFT,
|
||||
RIGHT,
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ public class TurtleBrain implements ITurtleAccess
|
||||
private int m_colourHex = -1;
|
||||
private ResourceLocation m_overlay = null;
|
||||
|
||||
private TurtleAnimation m_animation = TurtleAnimation.None;
|
||||
private TurtleAnimation m_animation = TurtleAnimation.NONE;
|
||||
private int m_animationProgress = 0;
|
||||
private int m_lastAnimationProgress = 0;
|
||||
|
||||
@@ -166,18 +166,18 @@ public class TurtleBrain implements ITurtleAccess
|
||||
m_overlay = nbt.contains( NBT_OVERLAY ) ? new ResourceLocation( nbt.getString( NBT_OVERLAY ) ) : null;
|
||||
|
||||
// Read upgrades
|
||||
setUpgrade( TurtleSide.Left, nbt.contains( NBT_LEFT_UPGRADE ) ? TurtleUpgrades.get( nbt.getString( NBT_LEFT_UPGRADE ) ) : null );
|
||||
setUpgrade( TurtleSide.Right, nbt.contains( NBT_RIGHT_UPGRADE ) ? TurtleUpgrades.get( nbt.getString( NBT_RIGHT_UPGRADE ) ) : null );
|
||||
setUpgrade( TurtleSide.LEFT, nbt.contains( NBT_LEFT_UPGRADE ) ? TurtleUpgrades.get( nbt.getString( NBT_LEFT_UPGRADE ) ) : null );
|
||||
setUpgrade( TurtleSide.RIGHT, nbt.contains( NBT_RIGHT_UPGRADE ) ? TurtleUpgrades.get( nbt.getString( NBT_RIGHT_UPGRADE ) ) : null );
|
||||
|
||||
// NBT
|
||||
m_upgradeNBTData.clear();
|
||||
if( nbt.contains( NBT_LEFT_UPGRADE_DATA ) )
|
||||
{
|
||||
m_upgradeNBTData.put( TurtleSide.Left, nbt.getCompound( NBT_LEFT_UPGRADE_DATA ).copy() );
|
||||
m_upgradeNBTData.put( TurtleSide.LEFT, nbt.getCompound( NBT_LEFT_UPGRADE_DATA ).copy() );
|
||||
}
|
||||
if( nbt.contains( NBT_RIGHT_UPGRADE_DATA ) )
|
||||
{
|
||||
m_upgradeNBTData.put( TurtleSide.Right, nbt.getCompound( NBT_RIGHT_UPGRADE_DATA ).copy() );
|
||||
m_upgradeNBTData.put( TurtleSide.RIGHT, nbt.getCompound( NBT_RIGHT_UPGRADE_DATA ).copy() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,19 +188,19 @@ public class TurtleBrain implements ITurtleAccess
|
||||
if( m_overlay != null ) nbt.putString( NBT_OVERLAY, m_overlay.toString() );
|
||||
|
||||
// Write upgrades
|
||||
String leftUpgradeId = getUpgradeId( getUpgrade( TurtleSide.Left ) );
|
||||
String leftUpgradeId = getUpgradeId( getUpgrade( TurtleSide.LEFT ) );
|
||||
if( leftUpgradeId != null ) nbt.putString( NBT_LEFT_UPGRADE, leftUpgradeId );
|
||||
String rightUpgradeId = getUpgradeId( getUpgrade( TurtleSide.Right ) );
|
||||
String rightUpgradeId = getUpgradeId( getUpgrade( TurtleSide.RIGHT ) );
|
||||
if( rightUpgradeId != null ) nbt.putString( NBT_RIGHT_UPGRADE, rightUpgradeId );
|
||||
|
||||
// Write upgrade NBT
|
||||
if( m_upgradeNBTData.containsKey( TurtleSide.Left ) )
|
||||
if( m_upgradeNBTData.containsKey( TurtleSide.LEFT ) )
|
||||
{
|
||||
nbt.put( NBT_LEFT_UPGRADE_DATA, getUpgradeNBTData( TurtleSide.Left ).copy() );
|
||||
nbt.put( NBT_LEFT_UPGRADE_DATA, getUpgradeNBTData( TurtleSide.LEFT ).copy() );
|
||||
}
|
||||
if( m_upgradeNBTData.containsKey( TurtleSide.Right ) )
|
||||
if( m_upgradeNBTData.containsKey( TurtleSide.RIGHT ) )
|
||||
{
|
||||
nbt.put( NBT_RIGHT_UPGRADE_DATA, getUpgradeNBTData( TurtleSide.Right ).copy() );
|
||||
nbt.put( NBT_RIGHT_UPGRADE_DATA, getUpgradeNBTData( TurtleSide.RIGHT ).copy() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -259,9 +259,9 @@ public class TurtleBrain implements ITurtleAccess
|
||||
// Animation
|
||||
TurtleAnimation anim = TurtleAnimation.values()[nbt.getInt( "Animation" )];
|
||||
if( anim != m_animation &&
|
||||
anim != TurtleAnimation.Wait &&
|
||||
anim != TurtleAnimation.ShortWait &&
|
||||
anim != TurtleAnimation.None )
|
||||
anim != TurtleAnimation.WAIT &&
|
||||
anim != TurtleAnimation.SHORT_WAIT &&
|
||||
anim != TurtleAnimation.NONE )
|
||||
{
|
||||
m_animation = anim;
|
||||
m_animationProgress = 0;
|
||||
@@ -385,7 +385,7 @@ public class TurtleBrain implements ITurtleAccess
|
||||
float yaw = getDirection().getHorizontalAngle();
|
||||
switch( m_animation )
|
||||
{
|
||||
case TurnLeft:
|
||||
case TURN_LEFT:
|
||||
{
|
||||
yaw += 90.0f * (1.0f - getAnimationFraction( f ));
|
||||
if( yaw >= 360.0f )
|
||||
@@ -394,7 +394,7 @@ public class TurtleBrain implements ITurtleAccess
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TurnRight:
|
||||
case TURN_RIGHT:
|
||||
{
|
||||
yaw += -90.0f * (1.0f - getAnimationFraction( f ));
|
||||
if( yaw < 0.0f )
|
||||
@@ -474,7 +474,7 @@ public class TurtleBrain implements ITurtleAccess
|
||||
@Override
|
||||
public int getFuelLimit()
|
||||
{
|
||||
if( m_owner.getFamily() == ComputerFamily.Advanced )
|
||||
if( m_owner.getFamily() == ComputerFamily.ADVANCED )
|
||||
{
|
||||
return ComputerCraft.advancedTurtleFuelLimit;
|
||||
}
|
||||
@@ -546,7 +546,7 @@ public class TurtleBrain implements ITurtleAccess
|
||||
if( getWorld().isRemote ) throw new UnsupportedOperationException( "Cannot play animations on the client" );
|
||||
|
||||
m_animation = animation;
|
||||
if( m_animation == TurtleAnimation.ShortWait )
|
||||
if( m_animation == TurtleAnimation.SHORT_WAIT )
|
||||
{
|
||||
m_animationProgress = ANIM_DURATION / 2;
|
||||
m_lastAnimationProgress = ANIM_DURATION / 2;
|
||||
@@ -688,26 +688,26 @@ public class TurtleBrain implements ITurtleAccess
|
||||
{
|
||||
switch( m_animation )
|
||||
{
|
||||
case MoveForward:
|
||||
case MoveBack:
|
||||
case MoveUp:
|
||||
case MoveDown:
|
||||
case MOVE_FORWARD:
|
||||
case MOVE_BACK:
|
||||
case MOVE_UP:
|
||||
case MOVE_DOWN:
|
||||
{
|
||||
// Get direction
|
||||
Direction dir;
|
||||
switch( m_animation )
|
||||
{
|
||||
case MoveForward:
|
||||
case MOVE_FORWARD:
|
||||
default:
|
||||
dir = getDirection();
|
||||
break;
|
||||
case MoveBack:
|
||||
case MOVE_BACK:
|
||||
dir = getDirection().getOpposite();
|
||||
break;
|
||||
case MoveUp:
|
||||
case MOVE_UP:
|
||||
dir = Direction.UP;
|
||||
break;
|
||||
case MoveDown:
|
||||
case MOVE_DOWN:
|
||||
dir = Direction.DOWN;
|
||||
break;
|
||||
}
|
||||
@@ -728,8 +728,8 @@ public class TurtleBrain implements ITurtleAccess
|
||||
|
||||
public float getToolRenderAngle( TurtleSide side, float f )
|
||||
{
|
||||
return (side == TurtleSide.Left && m_animation == TurtleAnimation.SwingLeftTool) ||
|
||||
(side == TurtleSide.Right && m_animation == TurtleAnimation.SwingRightTool)
|
||||
return (side == TurtleSide.LEFT && m_animation == TurtleAnimation.SWING_LEFT_TOOL) ||
|
||||
(side == TurtleSide.RIGHT && m_animation == TurtleAnimation.SWING_RIGHT_TOOL)
|
||||
? 45.0f * (float) Math.sin( getAnimationFraction( f ) * Math.PI )
|
||||
: 0.0f;
|
||||
}
|
||||
@@ -738,9 +738,9 @@ public class TurtleBrain implements ITurtleAccess
|
||||
{
|
||||
switch( side )
|
||||
{
|
||||
case Left:
|
||||
case LEFT:
|
||||
return ComputerSide.LEFT;
|
||||
case Right:
|
||||
case RIGHT:
|
||||
default:
|
||||
return ComputerSide.RIGHT;
|
||||
}
|
||||
@@ -779,7 +779,7 @@ public class TurtleBrain implements ITurtleAccess
|
||||
|
||||
private void updateCommands()
|
||||
{
|
||||
if( m_animation != TurtleAnimation.None || m_commandQueue.isEmpty() ) return;
|
||||
if( m_animation != TurtleAnimation.NONE || m_commandQueue.isEmpty() ) return;
|
||||
|
||||
// If we've got a computer, ensure that we're allowed to perform work.
|
||||
ServerComputer computer = m_owner.getServerComputer();
|
||||
@@ -828,33 +828,33 @@ public class TurtleBrain implements ITurtleAccess
|
||||
|
||||
private void updateAnimation()
|
||||
{
|
||||
if( m_animation != TurtleAnimation.None )
|
||||
if( m_animation != TurtleAnimation.NONE )
|
||||
{
|
||||
World world = getWorld();
|
||||
|
||||
if( ComputerCraft.turtlesCanPush )
|
||||
{
|
||||
// Advance entity pushing
|
||||
if( m_animation == TurtleAnimation.MoveForward ||
|
||||
m_animation == TurtleAnimation.MoveBack ||
|
||||
m_animation == TurtleAnimation.MoveUp ||
|
||||
m_animation == TurtleAnimation.MoveDown )
|
||||
if( m_animation == TurtleAnimation.MOVE_FORWARD ||
|
||||
m_animation == TurtleAnimation.MOVE_BACK ||
|
||||
m_animation == TurtleAnimation.MOVE_UP ||
|
||||
m_animation == TurtleAnimation.MOVE_DOWN )
|
||||
{
|
||||
BlockPos pos = getPosition();
|
||||
Direction moveDir;
|
||||
switch( m_animation )
|
||||
{
|
||||
case MoveForward:
|
||||
case MOVE_FORWARD:
|
||||
default:
|
||||
moveDir = getDirection();
|
||||
break;
|
||||
case MoveBack:
|
||||
case MOVE_BACK:
|
||||
moveDir = getDirection().getOpposite();
|
||||
break;
|
||||
case MoveUp:
|
||||
case MOVE_UP:
|
||||
moveDir = Direction.UP;
|
||||
break;
|
||||
case MoveDown:
|
||||
case MOVE_DOWN:
|
||||
moveDir = Direction.DOWN;
|
||||
break;
|
||||
}
|
||||
@@ -912,11 +912,11 @@ public class TurtleBrain implements ITurtleAccess
|
||||
}
|
||||
|
||||
// Advance valentines day easter egg
|
||||
if( world.isRemote && m_animation == TurtleAnimation.MoveForward && m_animationProgress == 4 )
|
||||
if( world.isRemote && m_animation == TurtleAnimation.MOVE_FORWARD && m_animationProgress == 4 )
|
||||
{
|
||||
// Spawn love pfx if valentines day
|
||||
Holiday currentHoliday = HolidayUtil.getCurrentHoliday();
|
||||
if( currentHoliday == Holiday.Valentines )
|
||||
if( currentHoliday == Holiday.VALENTINES )
|
||||
{
|
||||
Vec3d position = getVisualPosition( 1.0f );
|
||||
if( position != null )
|
||||
@@ -938,7 +938,7 @@ public class TurtleBrain implements ITurtleAccess
|
||||
m_lastAnimationProgress = m_animationProgress;
|
||||
if( ++m_animationProgress >= ANIM_DURATION )
|
||||
{
|
||||
m_animation = TurtleAnimation.None;
|
||||
m_animation = TurtleAnimation.NONE;
|
||||
m_animationProgress = 0;
|
||||
m_lastAnimationProgress = 0;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public class TurtleCraftCommand implements ITurtleCommand
|
||||
}
|
||||
}
|
||||
|
||||
if( !results.isEmpty() ) turtle.playAnimation( TurtleAnimation.Wait );
|
||||
if( !results.isEmpty() ) turtle.playAnimation( TurtleAnimation.WAIT );
|
||||
return TurtleCommandResult.success();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ public class TurtleDropCommand implements ITurtleCommand
|
||||
// Dropping nothing is easy
|
||||
if( m_quantity == 0 )
|
||||
{
|
||||
turtle.playAnimation( TurtleAnimation.Wait );
|
||||
turtle.playAnimation( TurtleAnimation.WAIT );
|
||||
return TurtleCommandResult.success();
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ public class TurtleDropCommand implements ITurtleCommand
|
||||
// Return true if we stored anything
|
||||
if( remainder != stack )
|
||||
{
|
||||
turtle.playAnimation( TurtleAnimation.Wait );
|
||||
turtle.playAnimation( TurtleAnimation.WAIT );
|
||||
return TurtleCommandResult.success();
|
||||
}
|
||||
else
|
||||
@@ -96,7 +96,7 @@ public class TurtleDropCommand implements ITurtleCommand
|
||||
// Drop the item into the world
|
||||
WorldUtil.dropItemStack( stack, world, oldPosition, direction );
|
||||
world.playBroadcastSound( 1000, newPosition, 0 );
|
||||
turtle.playAnimation( TurtleAnimation.Wait );
|
||||
turtle.playAnimation( TurtleAnimation.WAIT );
|
||||
return TurtleCommandResult.success();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ public class TurtleEquipCommand implements ITurtleCommand
|
||||
// Animate
|
||||
if( newUpgrade != null || oldUpgrade != null )
|
||||
{
|
||||
turtle.playAnimation( TurtleAnimation.Wait );
|
||||
turtle.playAnimation( TurtleAnimation.WAIT );
|
||||
}
|
||||
|
||||
return TurtleCommandResult.success();
|
||||
|
||||
@@ -72,7 +72,7 @@ public class TurtleMoveCommand implements ITurtleCommand
|
||||
|
||||
if( !oldWorld.checkNoEntityCollision( null, collision ) )
|
||||
{
|
||||
if( !ComputerCraft.turtlesCanPush || m_direction == MoveDirection.Up || m_direction == MoveDirection.Down )
|
||||
if( !ComputerCraft.turtlesCanPush || m_direction == MoveDirection.UP || m_direction == MoveDirection.DOWN )
|
||||
{
|
||||
return TurtleCommandResult.failure( "Movement obstructed" );
|
||||
}
|
||||
@@ -114,18 +114,18 @@ public class TurtleMoveCommand implements ITurtleCommand
|
||||
// Animate
|
||||
switch( m_direction )
|
||||
{
|
||||
case Forward:
|
||||
case FORWARD:
|
||||
default:
|
||||
turtle.playAnimation( TurtleAnimation.MoveForward );
|
||||
turtle.playAnimation( TurtleAnimation.MOVE_FORWARD );
|
||||
break;
|
||||
case Back:
|
||||
turtle.playAnimation( TurtleAnimation.MoveBack );
|
||||
case BACK:
|
||||
turtle.playAnimation( TurtleAnimation.MOVE_BACK );
|
||||
break;
|
||||
case Up:
|
||||
turtle.playAnimation( TurtleAnimation.MoveUp );
|
||||
case UP:
|
||||
turtle.playAnimation( TurtleAnimation.MOVE_UP );
|
||||
break;
|
||||
case Down:
|
||||
turtle.playAnimation( TurtleAnimation.MoveDown );
|
||||
case DOWN:
|
||||
turtle.playAnimation( TurtleAnimation.MOVE_DOWN );
|
||||
break;
|
||||
}
|
||||
return TurtleCommandResult.success();
|
||||
|
||||
@@ -86,7 +86,7 @@ public class TurtlePlaceCommand implements ITurtleCommand
|
||||
turtle.getInventory().markDirty();
|
||||
|
||||
// Animate and return success
|
||||
turtle.playAnimation( TurtleAnimation.Wait );
|
||||
turtle.playAnimation( TurtleAnimation.WAIT );
|
||||
return TurtleCommandResult.success();
|
||||
}
|
||||
else
|
||||
|
||||
@@ -39,7 +39,7 @@ public class TurtleRefuelCommand implements ITurtleCommand
|
||||
if( limit != 0 )
|
||||
{
|
||||
turtle.addFuel( event.getHandler().refuel( turtle, stack, slot, limit ) );
|
||||
turtle.playAnimation( TurtleAnimation.Wait );
|
||||
turtle.playAnimation( TurtleAnimation.WAIT );
|
||||
}
|
||||
|
||||
return TurtleCommandResult.success();
|
||||
|
||||
@@ -42,7 +42,7 @@ public class TurtleSuckCommand implements ITurtleCommand
|
||||
// Sucking nothing is easy
|
||||
if( m_quantity == 0 )
|
||||
{
|
||||
turtle.playAnimation( TurtleAnimation.Wait );
|
||||
turtle.playAnimation( TurtleAnimation.WAIT );
|
||||
return TurtleCommandResult.success();
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ public class TurtleSuckCommand implements ITurtleCommand
|
||||
// Return true if we consumed anything
|
||||
if( remainder != stack )
|
||||
{
|
||||
turtle.playAnimation( TurtleAnimation.Wait );
|
||||
turtle.playAnimation( TurtleAnimation.WAIT );
|
||||
return TurtleCommandResult.success();
|
||||
}
|
||||
else
|
||||
@@ -142,7 +142,7 @@ public class TurtleSuckCommand implements ITurtleCommand
|
||||
|
||||
// Play fx
|
||||
world.playBroadcastSound( 1000, turtlePosition, 0 ); // BLOCK_DISPENSER_DISPENSE
|
||||
turtle.playAnimation( TurtleAnimation.Wait );
|
||||
turtle.playAnimation( TurtleAnimation.WAIT );
|
||||
return TurtleCommandResult.success();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,14 +41,14 @@ public class TurtleToolCommand implements ITurtleCommand
|
||||
{
|
||||
switch( side )
|
||||
{
|
||||
case Left:
|
||||
turtle.playAnimation( TurtleAnimation.SwingLeftTool );
|
||||
case LEFT:
|
||||
turtle.playAnimation( TurtleAnimation.SWING_LEFT_TOOL );
|
||||
break;
|
||||
case Right:
|
||||
turtle.playAnimation( TurtleAnimation.SwingRightTool );
|
||||
case RIGHT:
|
||||
turtle.playAnimation( TurtleAnimation.SWING_RIGHT_TOOL );
|
||||
break;
|
||||
default:
|
||||
turtle.playAnimation( TurtleAnimation.Wait );
|
||||
turtle.playAnimation( TurtleAnimation.WAIT );
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
@@ -64,11 +64,11 @@ public class TurtleToolCommand implements ITurtleCommand
|
||||
|
||||
public static TurtleToolCommand attack( InteractDirection direction, @Nullable TurtleSide side )
|
||||
{
|
||||
return new TurtleToolCommand( TurtleVerb.Attack, direction, side );
|
||||
return new TurtleToolCommand( TurtleVerb.ATTACK, direction, side );
|
||||
}
|
||||
|
||||
public static TurtleToolCommand dig( InteractDirection direction, @Nullable TurtleSide side )
|
||||
{
|
||||
return new TurtleToolCommand( TurtleVerb.Dig, direction, side );
|
||||
return new TurtleToolCommand( TurtleVerb.DIG, direction, side );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public class TurtleTransferToCommand implements ITurtleCommand
|
||||
ItemStack stack = InventoryUtil.takeItems( m_quantity, turtle.getItemHandler(), turtle.getSelectedSlot(), 1, turtle.getSelectedSlot() );
|
||||
if( stack.isEmpty() )
|
||||
{
|
||||
turtle.playAnimation( TurtleAnimation.Wait );
|
||||
turtle.playAnimation( TurtleAnimation.WAIT );
|
||||
return TurtleCommandResult.success();
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public class TurtleTransferToCommand implements ITurtleCommand
|
||||
// Return true if we moved anything
|
||||
if( remainder != stack )
|
||||
{
|
||||
turtle.playAnimation( TurtleAnimation.Wait );
|
||||
turtle.playAnimation( TurtleAnimation.WAIT );
|
||||
return TurtleCommandResult.success();
|
||||
}
|
||||
else
|
||||
|
||||
@@ -36,16 +36,16 @@ public class TurtleTurnCommand implements ITurtleCommand
|
||||
|
||||
switch( m_direction )
|
||||
{
|
||||
case Left:
|
||||
case LEFT:
|
||||
{
|
||||
turtle.setDirection( turtle.getDirection().rotateYCCW() );
|
||||
turtle.playAnimation( TurtleAnimation.TurnLeft );
|
||||
turtle.playAnimation( TurtleAnimation.TURN_LEFT );
|
||||
return TurtleCommandResult.success();
|
||||
}
|
||||
case Right:
|
||||
case RIGHT:
|
||||
{
|
||||
turtle.setDirection( turtle.getDirection().rotateY() );
|
||||
turtle.playAnimation( TurtleAnimation.TurnRight );
|
||||
turtle.playAnimation( TurtleAnimation.TURN_RIGHT );
|
||||
return TurtleCommandResult.success();
|
||||
}
|
||||
default:
|
||||
|
||||
@@ -76,8 +76,8 @@ public class ItemTurtle extends ItemComputerBase implements ITurtleItem
|
||||
public ITextComponent getDisplayName( @Nonnull ItemStack stack )
|
||||
{
|
||||
String baseString = getTranslationKey( stack );
|
||||
ITurtleUpgrade left = getUpgrade( stack, TurtleSide.Left );
|
||||
ITurtleUpgrade right = getUpgrade( stack, TurtleSide.Right );
|
||||
ITurtleUpgrade left = getUpgrade( stack, TurtleSide.LEFT );
|
||||
ITurtleUpgrade right = getUpgrade( stack, TurtleSide.RIGHT );
|
||||
if( left != null && right != null )
|
||||
{
|
||||
return new TranslationTextComponent( baseString + ".upgraded_twice",
|
||||
@@ -110,14 +110,14 @@ public class ItemTurtle extends ItemComputerBase implements ITurtleItem
|
||||
// Determine our "creator mod" from the upgrades. We attempt to find the first non-vanilla/non-CC
|
||||
// upgrade (starting from the left).
|
||||
|
||||
ITurtleUpgrade left = getUpgrade( stack, TurtleSide.Left );
|
||||
ITurtleUpgrade left = getUpgrade( stack, TurtleSide.LEFT );
|
||||
if( left != null )
|
||||
{
|
||||
String mod = TurtleUpgrades.getOwner( left );
|
||||
if( mod != null && !mod.equals( ComputerCraft.MOD_ID ) ) return mod;
|
||||
}
|
||||
|
||||
ITurtleUpgrade right = getUpgrade( stack, TurtleSide.Right );
|
||||
ITurtleUpgrade right = getUpgrade( stack, TurtleSide.RIGHT );
|
||||
if( right != null )
|
||||
{
|
||||
String mod = TurtleUpgrades.getOwner( right );
|
||||
@@ -133,7 +133,7 @@ public class ItemTurtle extends ItemComputerBase implements ITurtleItem
|
||||
return TurtleItemFactory.create(
|
||||
getComputerID( stack ), getLabel( stack ),
|
||||
getColour( stack ), family,
|
||||
getUpgrade( stack, TurtleSide.Left ), getUpgrade( stack, TurtleSide.Right ),
|
||||
getUpgrade( stack, TurtleSide.LEFT ), getUpgrade( stack, TurtleSide.RIGHT ),
|
||||
getFuelLevel( stack ), getOverlay( stack )
|
||||
);
|
||||
}
|
||||
@@ -144,7 +144,7 @@ public class ItemTurtle extends ItemComputerBase implements ITurtleItem
|
||||
CompoundNBT tag = stack.getTag();
|
||||
if( tag == null ) return null;
|
||||
|
||||
String key = side == TurtleSide.Left ? NBT_LEFT_UPGRADE : NBT_RIGHT_UPGRADE;
|
||||
String key = side == TurtleSide.LEFT ? NBT_LEFT_UPGRADE : NBT_RIGHT_UPGRADE;
|
||||
return tag.contains( key ) ? TurtleUpgrades.get( tag.getString( key ) ) : null;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,8 +22,8 @@ public final class TurtleItemFactory
|
||||
@Nonnull
|
||||
public static ItemStack create( ITurtleTile turtle )
|
||||
{
|
||||
ITurtleUpgrade leftUpgrade = turtle.getAccess().getUpgrade( TurtleSide.Left );
|
||||
ITurtleUpgrade rightUpgrade = turtle.getAccess().getUpgrade( TurtleSide.Right );
|
||||
ITurtleUpgrade leftUpgrade = turtle.getAccess().getUpgrade( TurtleSide.LEFT );
|
||||
ITurtleUpgrade rightUpgrade = turtle.getAccess().getUpgrade( TurtleSide.RIGHT );
|
||||
|
||||
String label = turtle.getLabel();
|
||||
if( label == null )
|
||||
@@ -41,9 +41,9 @@ public final class TurtleItemFactory
|
||||
{
|
||||
switch( family )
|
||||
{
|
||||
case Normal:
|
||||
case NORMAL:
|
||||
return ComputerCraft.Items.turtleNormal.create( id, label, colour, leftUpgrade, rightUpgrade, fuelLevel, overlay );
|
||||
case Advanced:
|
||||
case ADVANCED:
|
||||
return ComputerCraft.Items.turtleAdvanced.create( id, label, colour, leftUpgrade, rightUpgrade, fuelLevel, overlay );
|
||||
default:
|
||||
return ItemStack.EMPTY;
|
||||
|
||||
@@ -38,7 +38,7 @@ public final class TurtleUpgradeRecipe extends SpecialRecipe
|
||||
@Override
|
||||
public ItemStack getRecipeOutput()
|
||||
{
|
||||
return TurtleItemFactory.create( -1, null, -1, ComputerFamily.Normal, null, null, 0, null );
|
||||
return TurtleItemFactory.create( -1, null, -1, ComputerFamily.NORMAL, null, null, 0, null );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -142,8 +142,8 @@ public final class TurtleUpgradeRecipe extends SpecialRecipe
|
||||
ITurtleItem itemTurtle = (ITurtleItem) turtle.getItem();
|
||||
ComputerFamily family = itemTurtle.getFamily();
|
||||
ITurtleUpgrade[] upgrades = new ITurtleUpgrade[] {
|
||||
itemTurtle.getUpgrade( turtle, TurtleSide.Left ),
|
||||
itemTurtle.getUpgrade( turtle, TurtleSide.Right ),
|
||||
itemTurtle.getUpgrade( turtle, TurtleSide.LEFT ),
|
||||
itemTurtle.getUpgrade( turtle, TurtleSide.RIGHT ),
|
||||
};
|
||||
|
||||
// Get the upgrades for the new items
|
||||
|
||||
@@ -29,7 +29,7 @@ public class TurtleCraftingTable extends AbstractTurtleUpgrade
|
||||
|
||||
public TurtleCraftingTable( ResourceLocation id )
|
||||
{
|
||||
super( id, TurtleUpgradeType.Peripheral, Blocks.CRAFTING_TABLE );
|
||||
super( id, TurtleUpgradeType.PERIPHERAL, Blocks.CRAFTING_TABLE );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -54,6 +54,6 @@ public class TurtleCraftingTable extends AbstractTurtleUpgrade
|
||||
public TransformedModel getModel( ITurtleAccess turtle, @Nonnull TurtleSide side )
|
||||
{
|
||||
loadModelLocations();
|
||||
return TransformedModel.of( side == TurtleSide.Left ? m_leftModel : m_rightModel );
|
||||
return TransformedModel.of( side == TurtleSide.LEFT ? m_leftModel : m_rightModel );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ public class TurtleHoe extends TurtleTool
|
||||
@Override
|
||||
public TurtleCommandResult useTool( @Nonnull ITurtleAccess turtle, @Nonnull TurtleSide side, @Nonnull TurtleVerb verb, @Nonnull Direction direction )
|
||||
{
|
||||
if( verb == TurtleVerb.Dig )
|
||||
if( verb == TurtleVerb.DIG )
|
||||
{
|
||||
ItemStack hoe = item.copy();
|
||||
ItemStack remainder = TurtlePlaceCommand.deploy( hoe, turtle, direction, null, null );
|
||||
|
||||
@@ -78,7 +78,7 @@ public class TurtleModem extends AbstractTurtleUpgrade
|
||||
public TurtleModem( boolean advanced, ResourceLocation id )
|
||||
{
|
||||
super(
|
||||
id, TurtleUpgradeType.Peripheral,
|
||||
id, TurtleUpgradeType.PERIPHERAL,
|
||||
advanced
|
||||
? ComputerCraft.Blocks.wirelessModemAdvanced
|
||||
: ComputerCraft.Blocks.wirelessModemNormal
|
||||
@@ -135,7 +135,7 @@ public class TurtleModem extends AbstractTurtleUpgrade
|
||||
active = turtleNBT.contains( "active" ) && turtleNBT.getBoolean( "active" );
|
||||
}
|
||||
|
||||
return side == TurtleSide.Left
|
||||
return side == TurtleSide.LEFT
|
||||
? TransformedModel.of( active ? m_leftOnModel : m_leftOffModel )
|
||||
: TransformedModel.of( active ? m_rightOnModel : m_rightOffModel );
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public class TurtleShovel extends TurtleTool
|
||||
@Override
|
||||
public TurtleCommandResult useTool( @Nonnull ITurtleAccess turtle, @Nonnull TurtleSide side, @Nonnull TurtleVerb verb, @Nonnull Direction direction )
|
||||
{
|
||||
if( verb == TurtleVerb.Dig )
|
||||
if( verb == TurtleVerb.DIG )
|
||||
{
|
||||
ItemStack shovel = item.copy();
|
||||
ItemStack remainder = TurtlePlaceCommand.deploy( shovel, turtle, direction, null, null );
|
||||
|
||||
@@ -63,7 +63,7 @@ public class TurtleSpeaker extends AbstractTurtleUpgrade
|
||||
|
||||
public TurtleSpeaker( ResourceLocation id )
|
||||
{
|
||||
super( id, TurtleUpgradeType.Peripheral, ComputerCraft.Blocks.speaker );
|
||||
super( id, TurtleUpgradeType.PERIPHERAL, ComputerCraft.Blocks.speaker );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -88,7 +88,7 @@ public class TurtleSpeaker extends AbstractTurtleUpgrade
|
||||
public TransformedModel getModel( ITurtleAccess turtle, @Nonnull TurtleSide side )
|
||||
{
|
||||
loadModelLocations();
|
||||
return TransformedModel.of( side == TurtleSide.Left ? m_leftModel : m_rightModel );
|
||||
return TransformedModel.of( side == TurtleSide.LEFT ? m_leftModel : m_rightModel );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -51,19 +51,19 @@ public class TurtleTool extends AbstractTurtleUpgrade
|
||||
|
||||
public TurtleTool( ResourceLocation id, String adjective, Item item )
|
||||
{
|
||||
super( id, TurtleUpgradeType.Tool, adjective, item );
|
||||
super( id, TurtleUpgradeType.TOOL, adjective, item );
|
||||
this.item = new ItemStack( item );
|
||||
}
|
||||
|
||||
public TurtleTool( ResourceLocation id, Item item )
|
||||
{
|
||||
super( id, TurtleUpgradeType.Tool, item );
|
||||
super( id, TurtleUpgradeType.TOOL, item );
|
||||
this.item = new ItemStack( item );
|
||||
}
|
||||
|
||||
public TurtleTool( ResourceLocation id, ItemStack craftItem, ItemStack toolItem )
|
||||
{
|
||||
super( id, TurtleUpgradeType.Tool, craftItem );
|
||||
super( id, TurtleUpgradeType.TOOL, craftItem );
|
||||
this.item = toolItem;
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ public class TurtleTool extends AbstractTurtleUpgrade
|
||||
@OnlyIn( Dist.CLIENT )
|
||||
public TransformedModel getModel( ITurtleAccess turtle, @Nonnull TurtleSide side )
|
||||
{
|
||||
float xOffset = side == TurtleSide.Left ? -0.40625f : 0.40625f;
|
||||
float xOffset = side == TurtleSide.LEFT ? -0.40625f : 0.40625f;
|
||||
Matrix4f transform = new Matrix4f( new float[] {
|
||||
0.0f, 0.0f, -1.0f, 1.0f + xOffset,
|
||||
1.0f, 0.0f, 0.0f, 0.0f,
|
||||
@@ -88,9 +88,9 @@ public class TurtleTool extends AbstractTurtleUpgrade
|
||||
{
|
||||
switch( verb )
|
||||
{
|
||||
case Attack:
|
||||
case ATTACK:
|
||||
return attack( turtle, direction, side );
|
||||
case Dig:
|
||||
case DIG:
|
||||
return dig( turtle, direction, side );
|
||||
default:
|
||||
return TurtleCommandResult.failure( "Unsupported action" );
|
||||
|
||||
Reference in New Issue
Block a user