mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-11-07 17:03:00 +00:00
Add @Nullable and @NonNull annotations
This commit is contained in:
@@ -19,6 +19,7 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -58,6 +59,7 @@ public class TurtleAPI implements ILuaAPI
|
||||
{
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String[] getMethodNames()
|
||||
{
|
||||
@@ -181,7 +183,7 @@ public class TurtleAPI implements ILuaAPI
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] callMethod( ILuaContext context, int method, Object[] args ) throws LuaException, InterruptedException
|
||||
public Object[] callMethod( @Nonnull ILuaContext context, int method, @Nonnull Object[] args ) throws LuaException, InterruptedException
|
||||
{
|
||||
switch( method )
|
||||
{
|
||||
|
||||
@@ -27,6 +27,8 @@ import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockTurtle extends BlockComputerBase
|
||||
{
|
||||
// Statics
|
||||
@@ -54,6 +56,7 @@ public class BlockTurtle extends BlockComputerBase
|
||||
);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public EnumBlockRenderType getRenderType( IBlockState state )
|
||||
{
|
||||
@@ -72,12 +75,14 @@ public class BlockTurtle extends BlockComputerBase
|
||||
return false;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState()
|
||||
{
|
||||
return new BlockStateContainer(this, Properties.FACING );
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBlockState getStateFromMeta( int meta )
|
||||
{
|
||||
@@ -90,8 +95,9 @@ public class BlockTurtle extends BlockComputerBase
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBlockState getActualState( IBlockState state, IBlockAccess world, BlockPos pos )
|
||||
public IBlockState getActualState( @Nonnull IBlockState state, IBlockAccess world, BlockPos pos )
|
||||
{
|
||||
return state.withProperty( Properties.FACING, getDirection( world, pos ) );
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ import net.minecraft.util.math.*;
|
||||
import net.minecraft.util.text.*;
|
||||
import net.minecraftforge.common.util.Constants;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.List;
|
||||
|
||||
public class TileTurtle extends TileComputerBase
|
||||
@@ -144,7 +145,7 @@ public class TileTurtle extends TileComputerBase
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDroppedItems( List<ItemStack> drops, boolean creative )
|
||||
public void getDroppedItems( @Nonnull List<ItemStack> drops, boolean creative )
|
||||
{
|
||||
IComputer computer = getComputer();
|
||||
if( !creative || (computer != null && computer.getLabel() != null) )
|
||||
@@ -243,6 +244,7 @@ public class TileTurtle extends TileComputerBase
|
||||
}
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public AxisAlignedBB getBounds()
|
||||
{
|
||||
@@ -293,7 +295,7 @@ public class TileTurtle extends TileComputerBase
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighbourTileEntityChange(BlockPos neighbour)
|
||||
public void onNeighbourTileEntityChange( @Nonnull BlockPos neighbour)
|
||||
{
|
||||
if ( m_moveState == MoveState.NOT_MOVED )
|
||||
{
|
||||
@@ -342,6 +344,7 @@ public class TileTurtle extends TileComputerBase
|
||||
m_brain.readFromNBT( nbttagcompound );
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT( NBTTagCompound nbttagcompound )
|
||||
{
|
||||
@@ -539,6 +542,7 @@ public class TileTurtle extends TileComputerBase
|
||||
}
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getName()
|
||||
{
|
||||
@@ -569,6 +573,7 @@ public class TileTurtle extends TileComputerBase
|
||||
return false;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ITextComponent getDisplayName()
|
||||
{
|
||||
@@ -589,17 +594,17 @@ public class TileTurtle extends TileComputerBase
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory( EntityPlayer player )
|
||||
public void openInventory( @Nonnull EntityPlayer player )
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory( EntityPlayer player )
|
||||
public void closeInventory( @Nonnull EntityPlayer player )
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot( int slot, ItemStack stack )
|
||||
public boolean isItemValidForSlot( int slot, @Nonnull ItemStack stack )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -625,7 +630,7 @@ public class TileTurtle extends TileComputerBase
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer( EntityPlayer player )
|
||||
public boolean isUseableByPlayer( @Nonnull EntityPlayer player )
|
||||
{
|
||||
return isUsable( player, false );
|
||||
}
|
||||
@@ -666,14 +671,14 @@ public class TileTurtle extends TileComputerBase
|
||||
// Networking stuff
|
||||
|
||||
@Override
|
||||
public void writeDescription( NBTTagCompound nbttagcompound )
|
||||
public void writeDescription( @Nonnull NBTTagCompound nbttagcompound )
|
||||
{
|
||||
super.writeDescription( nbttagcompound );
|
||||
m_brain.writeDescription( nbttagcompound );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readDescription( NBTTagCompound nbttagcompound )
|
||||
public void readDescription( @Nonnull NBTTagCompound nbttagcompound )
|
||||
{
|
||||
super.readDescription( nbttagcompound );
|
||||
m_brain.readDescription( nbttagcompound );
|
||||
|
||||
@@ -32,6 +32,7 @@ import net.minecraft.util.text.*;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.Constants;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.*;
|
||||
|
||||
@@ -473,12 +474,14 @@ public class TurtleBrain implements ITurtleAccess
|
||||
m_fuelLevel = nbttagcompound.getInteger( "fuelLevel" );
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public World getWorld()
|
||||
{
|
||||
return m_owner.getWorld();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public BlockPos getPosition()
|
||||
{
|
||||
@@ -486,7 +489,7 @@ public class TurtleBrain implements ITurtleAccess
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean teleportTo( World world, BlockPos pos )
|
||||
public boolean teleportTo( @Nonnull World world, @Nonnull BlockPos pos )
|
||||
{
|
||||
if( world.isRemote || getWorld().isRemote )
|
||||
{
|
||||
@@ -555,6 +558,7 @@ public class TurtleBrain implements ITurtleAccess
|
||||
return false;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Vec3d getVisualPosition( float f )
|
||||
{
|
||||
@@ -596,6 +600,7 @@ public class TurtleBrain implements ITurtleAccess
|
||||
return yaw;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public EnumFacing getDirection()
|
||||
{
|
||||
@@ -603,7 +608,7 @@ public class TurtleBrain implements ITurtleAccess
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDirection( EnumFacing dir )
|
||||
public void setDirection( @Nonnull EnumFacing dir )
|
||||
{
|
||||
if( dir.getAxis() == EnumFacing.Axis.Y )
|
||||
{
|
||||
@@ -635,6 +640,7 @@ public class TurtleBrain implements ITurtleAccess
|
||||
}
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IInventory getInventory()
|
||||
{
|
||||
@@ -711,8 +717,9 @@ public class TurtleBrain implements ITurtleAccess
|
||||
return m_commandsIssued;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Object[] executeCommand( ILuaContext context, ITurtleCommand command ) throws LuaException, InterruptedException
|
||||
public Object[] executeCommand( @Nonnull ILuaContext context, @Nonnull ITurtleCommand command ) throws LuaException, InterruptedException
|
||||
{
|
||||
if( getWorld().isRemote )
|
||||
{
|
||||
@@ -742,7 +749,7 @@ public class TurtleBrain implements ITurtleAccess
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playAnimation( TurtleAnimation animation )
|
||||
public void playAnimation( @Nonnull TurtleAnimation animation )
|
||||
{
|
||||
if( getWorld().isRemote )
|
||||
{
|
||||
@@ -798,7 +805,7 @@ public class TurtleBrain implements ITurtleAccess
|
||||
}
|
||||
|
||||
@Override
|
||||
public ITurtleUpgrade getUpgrade( TurtleSide side )
|
||||
public ITurtleUpgrade getUpgrade( @Nonnull TurtleSide side )
|
||||
{
|
||||
if( m_upgrades.containsKey( side ) )
|
||||
{
|
||||
@@ -808,7 +815,7 @@ public class TurtleBrain implements ITurtleAccess
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUpgrade( TurtleSide side, ITurtleUpgrade upgrade )
|
||||
public void setUpgrade( @Nonnull TurtleSide side, ITurtleUpgrade upgrade )
|
||||
{
|
||||
// Remove old upgrade
|
||||
if( m_upgrades.containsKey( side ) )
|
||||
@@ -846,7 +853,7 @@ public class TurtleBrain implements ITurtleAccess
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPeripheral getPeripheral( TurtleSide side )
|
||||
public IPeripheral getPeripheral( @Nonnull TurtleSide side )
|
||||
{
|
||||
if( m_peripherals.containsKey( side ) )
|
||||
{
|
||||
@@ -855,6 +862,7 @@ public class TurtleBrain implements ITurtleAccess
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public NBTTagCompound getUpgradeNBTData( TurtleSide side )
|
||||
{
|
||||
@@ -866,7 +874,7 @@ public class TurtleBrain implements ITurtleAccess
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateUpgradeNBTData( TurtleSide side )
|
||||
public void updateUpgradeNBTData( @Nonnull TurtleSide side )
|
||||
{
|
||||
m_owner.updateBlock();
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@ import dan200.computercraft.api.turtle.ITurtleCommand;
|
||||
import dan200.computercraft.api.turtle.TurtleCommandResult;
|
||||
import dan200.computercraft.core.apis.IAPIEnvironment;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class TurtleCheckRedstoneCommand implements ITurtleCommand
|
||||
{
|
||||
private final IAPIEnvironment m_environment;
|
||||
@@ -22,8 +24,9 @@ public class TurtleCheckRedstoneCommand implements ITurtleCommand
|
||||
m_direction = direction;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TurtleCommandResult execute( ITurtleAccess turtle )
|
||||
public TurtleCommandResult execute( @Nonnull ITurtleAccess turtle )
|
||||
{
|
||||
// Do the checking
|
||||
int redstoneSide;
|
||||
|
||||
@@ -19,6 +19,7 @@ import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.ReflectionHelper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Iterator;
|
||||
|
||||
@@ -31,8 +32,9 @@ public class TurtleCompareCommand implements ITurtleCommand
|
||||
m_direction = direction;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TurtleCommandResult execute( ITurtleAccess turtle )
|
||||
public TurtleCommandResult execute( @Nonnull ITurtleAccess turtle )
|
||||
{
|
||||
// Get world direction from direction
|
||||
EnumFacing direction = m_direction.toWorldDir( turtle );
|
||||
|
||||
@@ -12,6 +12,8 @@ import dan200.computercraft.api.turtle.TurtleCommandResult;
|
||||
import dan200.computercraft.shared.util.InventoryUtil;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class TurtleCompareToCommand implements ITurtleCommand
|
||||
{
|
||||
private final int m_slot;
|
||||
@@ -21,8 +23,9 @@ public class TurtleCompareToCommand implements ITurtleCommand
|
||||
m_slot = slot;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TurtleCommandResult execute( ITurtleAccess turtle )
|
||||
public TurtleCommandResult execute( @Nonnull ITurtleAccess turtle )
|
||||
{
|
||||
ItemStack selectedStack = turtle.getInventory().getStackInSlot( turtle.getSelectedSlot() );
|
||||
ItemStack stack = turtle.getInventory().getStackInSlot( m_slot );
|
||||
|
||||
@@ -16,6 +16,7 @@ import dan200.computercraft.shared.util.WorldUtil;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class TurtleCraftCommand implements ITurtleCommand
|
||||
@@ -27,8 +28,9 @@ public class TurtleCraftCommand implements ITurtleCommand
|
||||
m_limit = limit;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TurtleCommandResult execute( ITurtleAccess turtle )
|
||||
public TurtleCommandResult execute( @Nonnull ITurtleAccess turtle )
|
||||
{
|
||||
// Craft the item
|
||||
TurtleInventoryCrafting crafting = new TurtleInventoryCrafting( turtle );
|
||||
|
||||
@@ -14,6 +14,8 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class TurtleDetectCommand implements ITurtleCommand
|
||||
{
|
||||
private final InteractDirection m_direction;
|
||||
@@ -23,8 +25,9 @@ public class TurtleDetectCommand implements ITurtleCommand
|
||||
m_direction = direction;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TurtleCommandResult execute( ITurtleAccess turtle )
|
||||
public TurtleCommandResult execute( @Nonnull ITurtleAccess turtle )
|
||||
{
|
||||
// Get world direction from direction
|
||||
EnumFacing direction = m_direction.toWorldDir( turtle );
|
||||
|
||||
@@ -21,6 +21,8 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class TurtleDropCommand implements ITurtleCommand
|
||||
{
|
||||
private final InteractDirection m_direction;
|
||||
@@ -32,8 +34,9 @@ public class TurtleDropCommand implements ITurtleCommand
|
||||
m_quantity = quantity;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TurtleCommandResult execute( ITurtleAccess turtle )
|
||||
public TurtleCommandResult execute( @Nonnull ITurtleAccess turtle )
|
||||
{
|
||||
// Dropping nothing is easy
|
||||
if( m_quantity == 0 )
|
||||
|
||||
@@ -15,6 +15,8 @@ import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class TurtleEquipCommand implements ITurtleCommand
|
||||
{
|
||||
private final TurtleSide m_side;
|
||||
@@ -24,8 +26,9 @@ public class TurtleEquipCommand implements ITurtleCommand
|
||||
m_side = side;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TurtleCommandResult execute( ITurtleAccess turtle )
|
||||
public TurtleCommandResult execute( @Nonnull ITurtleAccess turtle )
|
||||
{
|
||||
// Determine the upgrade to equipLeft
|
||||
ITurtleUpgrade newUpgrade;
|
||||
|
||||
@@ -19,6 +19,7 @@ import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -32,8 +33,9 @@ public class TurtleInspectCommand implements ITurtleCommand
|
||||
m_direction = direction;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TurtleCommandResult execute( ITurtleAccess turtle )
|
||||
public TurtleCommandResult execute( @Nonnull ITurtleAccess turtle )
|
||||
{
|
||||
// Get world direction from direction
|
||||
EnumFacing direction = m_direction.toWorldDir( turtle );
|
||||
|
||||
@@ -19,6 +19,7 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.List;
|
||||
|
||||
public class TurtleMoveCommand implements ITurtleCommand
|
||||
@@ -30,8 +31,9 @@ public class TurtleMoveCommand implements ITurtleCommand
|
||||
m_direction = direction;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TurtleCommandResult execute( ITurtleAccess turtle )
|
||||
public TurtleCommandResult execute( @Nonnull ITurtleAccess turtle )
|
||||
{
|
||||
// Get world direction from direction
|
||||
EnumFacing direction = m_direction.toWorldDir( turtle );
|
||||
|
||||
@@ -33,6 +33,8 @@ import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class TurtlePlaceCommand implements ITurtleCommand
|
||||
{
|
||||
private final InteractDirection m_direction;
|
||||
@@ -44,8 +46,9 @@ public class TurtlePlaceCommand implements ITurtleCommand
|
||||
m_extraArguments = arguments;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TurtleCommandResult execute( ITurtleAccess turtle )
|
||||
public TurtleCommandResult execute( @Nonnull ITurtleAccess turtle )
|
||||
{
|
||||
// Get thing to place
|
||||
ItemStack stack = turtle.getInventory().getStackInSlot( turtle.getSelectedSlot() );
|
||||
|
||||
@@ -18,6 +18,7 @@ import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraftforge.common.util.FakePlayer;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.UUID;
|
||||
|
||||
public class TurtlePlayer extends FakePlayer
|
||||
@@ -83,7 +84,7 @@ public class TurtlePlayer extends FakePlayer
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dismountEntity( Entity entity )
|
||||
public void dismountEntity( @Nonnull Entity entity )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@ import dan200.computercraft.shared.util.InventoryUtil;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class TurtleRefuelCommand implements ITurtleCommand
|
||||
{
|
||||
private final int m_limit;
|
||||
@@ -23,8 +25,9 @@ public class TurtleRefuelCommand implements ITurtleCommand
|
||||
m_limit = limit;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TurtleCommandResult execute( ITurtleAccess turtle )
|
||||
public TurtleCommandResult execute( @Nonnull ITurtleAccess turtle )
|
||||
{
|
||||
if( m_limit == 0 )
|
||||
{
|
||||
|
||||
@@ -10,6 +10,8 @@ import dan200.computercraft.api.turtle.ITurtleAccess;
|
||||
import dan200.computercraft.api.turtle.ITurtleCommand;
|
||||
import dan200.computercraft.api.turtle.TurtleCommandResult;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class TurtleSelectCommand implements ITurtleCommand
|
||||
{
|
||||
private final int m_slot;
|
||||
@@ -19,8 +21,9 @@ public class TurtleSelectCommand implements ITurtleCommand
|
||||
m_slot = slot;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TurtleCommandResult execute( ITurtleAccess turtle )
|
||||
public TurtleCommandResult execute( @Nonnull ITurtleAccess turtle )
|
||||
{
|
||||
turtle.setSelectedSlot( m_slot );
|
||||
return TurtleCommandResult.success();
|
||||
|
||||
@@ -12,6 +12,8 @@ import dan200.computercraft.api.turtle.TurtleAnimation;
|
||||
import dan200.computercraft.api.turtle.TurtleCommandResult;
|
||||
import dan200.computercraft.core.apis.IAPIEnvironment;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class TurtleSetRedstoneCommand implements ITurtleCommand
|
||||
{
|
||||
private final IAPIEnvironment m_environment;
|
||||
@@ -25,8 +27,9 @@ public class TurtleSetRedstoneCommand implements ITurtleCommand
|
||||
m_value = value;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TurtleCommandResult execute( ITurtleAccess turtle )
|
||||
public TurtleCommandResult execute( @Nonnull ITurtleAccess turtle )
|
||||
{
|
||||
// Do the setting
|
||||
int redstoneSide;
|
||||
|
||||
@@ -21,6 +21,7 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.List;
|
||||
|
||||
public class TurtleSuckCommand implements ITurtleCommand
|
||||
@@ -34,8 +35,9 @@ public class TurtleSuckCommand implements ITurtleCommand
|
||||
m_quantity = quantity;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TurtleCommandResult execute( ITurtleAccess turtle )
|
||||
public TurtleCommandResult execute( @Nonnull ITurtleAccess turtle )
|
||||
{
|
||||
// Sucking nothing is easy
|
||||
if( m_quantity == 0 )
|
||||
|
||||
@@ -9,6 +9,8 @@ package dan200.computercraft.shared.turtle.core;
|
||||
import com.google.common.base.Optional;
|
||||
import dan200.computercraft.api.turtle.*;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class TurtleToolCommand implements ITurtleCommand
|
||||
{
|
||||
private final TurtleVerb m_verb;
|
||||
@@ -22,8 +24,9 @@ public class TurtleToolCommand implements ITurtleCommand
|
||||
m_side = side;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TurtleCommandResult execute( ITurtleAccess turtle )
|
||||
public TurtleCommandResult execute( @Nonnull ITurtleAccess turtle )
|
||||
{
|
||||
TurtleCommandResult firstFailure = null;
|
||||
for( TurtleSide side : TurtleSide.values() )
|
||||
|
||||
@@ -13,6 +13,8 @@ import dan200.computercraft.api.turtle.TurtleCommandResult;
|
||||
import dan200.computercraft.shared.util.InventoryUtil;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class TurtleTransferToCommand implements ITurtleCommand
|
||||
{
|
||||
private final int m_slot;
|
||||
@@ -24,8 +26,9 @@ public class TurtleTransferToCommand implements ITurtleCommand
|
||||
m_quantity = limit;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TurtleCommandResult execute( ITurtleAccess turtle )
|
||||
public TurtleCommandResult execute( @Nonnull ITurtleAccess turtle )
|
||||
{
|
||||
// Take stack
|
||||
ItemStack stack = InventoryUtil.takeItems( m_quantity, turtle.getInventory(), turtle.getSelectedSlot(), 1, turtle.getSelectedSlot() );
|
||||
|
||||
@@ -12,6 +12,8 @@ import dan200.computercraft.api.turtle.TurtleAnimation;
|
||||
import dan200.computercraft.api.turtle.TurtleCommandResult;
|
||||
import dan200.computercraft.shared.util.DirectionUtil;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class TurtleTurnCommand implements ITurtleCommand
|
||||
{
|
||||
private final TurnDirection m_direction;
|
||||
@@ -21,8 +23,9 @@ public class TurtleTurnCommand implements ITurtleCommand
|
||||
m_direction = direction;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TurtleCommandResult execute( ITurtleAccess turtle )
|
||||
public TurtleCommandResult execute( @Nonnull ITurtleAccess turtle )
|
||||
{
|
||||
switch( m_direction )
|
||||
{
|
||||
|
||||
@@ -16,6 +16,7 @@ import net.minecraft.util.EnumHandSide;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class TurtleVisionCamera extends EntityLivingBase
|
||||
@@ -42,6 +43,7 @@ public class TurtleVisionCamera extends EntityLivingBase
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public EnumHandSide getPrimaryHand()
|
||||
{
|
||||
@@ -93,16 +95,17 @@ public class TurtleVisionCamera extends EntityLivingBase
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setItemStackToSlot(EntityEquipmentSlot slot, ItemStack stack)
|
||||
public void setItemStackToSlot( @Nonnull EntityEquipmentSlot slot, ItemStack stack)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItemStackFromSlot(EntityEquipmentSlot slot)
|
||||
public ItemStack getItemStackFromSlot( @Nonnull EntityEquipmentSlot slot)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Iterable<ItemStack> getArmorInventoryList()
|
||||
{
|
||||
|
||||
@@ -18,6 +18,7 @@ import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class ContainerTurtle extends Container
|
||||
@@ -133,7 +134,7 @@ public class ContainerTurtle extends Container
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith( EntityPlayer player )
|
||||
public boolean canInteractWith( @Nonnull EntityPlayer player )
|
||||
{
|
||||
TileTurtle turtle = ((TurtleBrain)m_turtle).getOwner();
|
||||
if( turtle != null )
|
||||
|
||||
@@ -27,6 +27,7 @@ import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -42,7 +43,7 @@ public abstract class ItemTurtleBase extends ItemComputerBase implements ITurtle
|
||||
public abstract ItemStack create( int id, String label, Colour colour, ITurtleUpgrade leftUpgrade, ITurtleUpgrade rightUpgrade, int fuelLevel, ResourceLocation overlay );
|
||||
|
||||
@Override
|
||||
public void getSubItems( Item itemID, CreativeTabs tabs, List list )
|
||||
public void getSubItems( @Nonnull Item itemID, @Nonnull CreativeTabs tabs, @Nonnull List list )
|
||||
{
|
||||
List<ItemStack> all = new ArrayList<ItemStack>();
|
||||
ComputerCraft.addAllUpgradedTurtles( all );
|
||||
@@ -56,7 +57,7 @@ public abstract class ItemTurtleBase extends ItemComputerBase implements ITurtle
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean placeBlockAt( ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, IBlockState newState )
|
||||
public boolean placeBlockAt( @Nonnull ItemStack stack, @Nonnull EntityPlayer player, World world, @Nonnull BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, @Nonnull IBlockState newState )
|
||||
{
|
||||
if( super.placeBlockAt( stack, player, world, pos, side, hitX, hitY, hitZ, newState ) )
|
||||
{
|
||||
@@ -112,6 +113,7 @@ public abstract class ItemTurtleBase extends ItemComputerBase implements ITurtle
|
||||
}
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUnlocalizedName( ItemStack stack )
|
||||
{
|
||||
@@ -134,8 +136,9 @@ public abstract class ItemTurtleBase extends ItemComputerBase implements ITurtle
|
||||
}
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getItemStackDisplayName( ItemStack stack )
|
||||
public String getItemStackDisplayName( @Nonnull ItemStack stack )
|
||||
{
|
||||
String baseString = getUnlocalizedName( stack );
|
||||
ITurtleUpgrade left = getUpgrade( stack, TurtleSide.Left );
|
||||
|
||||
@@ -15,6 +15,8 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class TurtleRecipe implements IRecipe
|
||||
{
|
||||
private final Item[] m_recipe;
|
||||
@@ -39,13 +41,13 @@ public class TurtleRecipe implements IRecipe
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches( InventoryCrafting _inventory, World world )
|
||||
public boolean matches( @Nonnull InventoryCrafting _inventory, @Nonnull World world )
|
||||
{
|
||||
return (getCraftingResult( _inventory ) != null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getCraftingResult( InventoryCrafting inventory )
|
||||
public ItemStack getCraftingResult( @Nonnull InventoryCrafting inventory )
|
||||
{
|
||||
// See if we match the recipe, and extract the input computercraft ID
|
||||
int computerID = -1;
|
||||
@@ -90,8 +92,9 @@ public class TurtleRecipe implements IRecipe
|
||||
}
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack[] getRemainingItems( InventoryCrafting inventoryCrafting )
|
||||
public ItemStack[] getRemainingItems( @Nonnull InventoryCrafting inventoryCrafting )
|
||||
{
|
||||
ItemStack[] results = new ItemStack[ inventoryCrafting.getSizeInventory() ];
|
||||
for (int i = 0; i < results.length; ++i)
|
||||
|
||||
@@ -20,6 +20,8 @@ import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class TurtleUpgradeRecipe implements IRecipe
|
||||
{
|
||||
public TurtleUpgradeRecipe()
|
||||
@@ -39,13 +41,13 @@ public class TurtleUpgradeRecipe implements IRecipe
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches( InventoryCrafting inventory, World world )
|
||||
public boolean matches( @Nonnull InventoryCrafting inventory, @Nonnull World world )
|
||||
{
|
||||
return (getCraftingResult( inventory ) != null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getCraftingResult( InventoryCrafting inventory )
|
||||
public ItemStack getCraftingResult( @Nonnull InventoryCrafting inventory )
|
||||
{
|
||||
// Scan the grid for a row containing a turtle and 1 or 2 items
|
||||
ItemStack leftItem = null;
|
||||
@@ -157,8 +159,9 @@ public class TurtleUpgradeRecipe implements IRecipe
|
||||
return TurtleItemFactory.create( computerID, label, colour, family, upgrades[0], upgrades[1], fuelLevel, overlay );
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack[] getRemainingItems( InventoryCrafting inventoryCrafting )
|
||||
public ItemStack[] getRemainingItems( @Nonnull InventoryCrafting inventoryCrafting )
|
||||
{
|
||||
ItemStack[] results = new ItemStack[ inventoryCrafting.getSizeInventory() ];
|
||||
for (int i = 0; i < results.length; ++i)
|
||||
|
||||
@@ -13,6 +13,8 @@ import dan200.computercraft.api.peripheral.IPeripheral;
|
||||
import dan200.computercraft.api.turtle.ITurtleAccess;
|
||||
import dan200.computercraft.shared.turtle.core.TurtleCraftCommand;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class CraftingTablePeripheral
|
||||
implements IPeripheral
|
||||
{
|
||||
@@ -25,12 +27,14 @@ public class CraftingTablePeripheral
|
||||
|
||||
// IPeripheral implementation
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getType()
|
||||
{
|
||||
return "workbench";
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String[] getMethodNames()
|
||||
{
|
||||
@@ -59,7 +63,7 @@ public class CraftingTablePeripheral
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] callMethod( IComputerAccess computer, ILuaContext context, int method, Object[] arguments ) throws LuaException, InterruptedException
|
||||
public Object[] callMethod( @Nonnull IComputerAccess computer, @Nonnull ILuaContext context, int method, @Nonnull Object[] arguments ) throws LuaException, InterruptedException
|
||||
{
|
||||
switch( method )
|
||||
{
|
||||
@@ -77,12 +81,12 @@ public class CraftingTablePeripheral
|
||||
}
|
||||
|
||||
@Override
|
||||
public void attach( IComputerAccess computer )
|
||||
public void attach( @Nonnull IComputerAccess computer )
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void detach( IComputerAccess computer )
|
||||
public void detach( @Nonnull IComputerAccess computer )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.vecmath.Matrix4f;
|
||||
|
||||
public class TurtleCraftingTable implements ITurtleUpgrade
|
||||
@@ -41,6 +42,7 @@ public class TurtleCraftingTable implements ITurtleUpgrade
|
||||
m_item = new ItemStack( Blocks.CRAFTING_TABLE, 1, 0 );
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ResourceLocation getUpgradeID()
|
||||
{
|
||||
@@ -53,12 +55,14 @@ public class TurtleCraftingTable implements ITurtleUpgrade
|
||||
return m_legacyID;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUnlocalisedAdjective()
|
||||
{
|
||||
return "upgrade.minecraft:crafting_table.adjective";
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TurtleUpgradeType getType()
|
||||
{
|
||||
@@ -72,13 +76,14 @@ public class TurtleCraftingTable implements ITurtleUpgrade
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPeripheral createPeripheral( ITurtleAccess turtle, TurtleSide side )
|
||||
public IPeripheral createPeripheral( @Nonnull ITurtleAccess turtle, @Nonnull TurtleSide side )
|
||||
{
|
||||
return new CraftingTablePeripheral( turtle );
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TurtleCommandResult useTool( ITurtleAccess turtle, TurtleSide side, TurtleVerb verb, EnumFacing dir )
|
||||
public TurtleCommandResult useTool( @Nonnull ITurtleAccess turtle, @Nonnull TurtleSide side, @Nonnull TurtleVerb verb, @Nonnull EnumFacing dir )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -93,9 +98,10 @@ public class TurtleCraftingTable implements ITurtleUpgrade
|
||||
}
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public Pair<IBakedModel, Matrix4f> getModel( ITurtleAccess turtle, TurtleSide side )
|
||||
public Pair<IBakedModel, Matrix4f> getModel( ITurtleAccess turtle, @Nonnull TurtleSide side )
|
||||
{
|
||||
loadModelLocations();
|
||||
|
||||
@@ -113,7 +119,7 @@ public class TurtleCraftingTable implements ITurtleUpgrade
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update( ITurtleAccess turtle, TurtleSide side )
|
||||
public void update( @Nonnull ITurtleAccess turtle, @Nonnull TurtleSide side )
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,8 @@ import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class TurtleHoe extends TurtleTool
|
||||
{
|
||||
public TurtleHoe( ResourceLocation id, int legacyId, String adjective, Item item )
|
||||
@@ -45,8 +47,9 @@ public class TurtleHoe extends TurtleTool
|
||||
return false;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TurtleCommandResult useTool( ITurtleAccess turtle, TurtleSide side, TurtleVerb verb, EnumFacing direction )
|
||||
public TurtleCommandResult useTool( @Nonnull ITurtleAccess turtle, @Nonnull TurtleSide side, @Nonnull TurtleVerb verb, @Nonnull EnumFacing direction )
|
||||
{
|
||||
if( verb == TurtleVerb.Dig )
|
||||
{
|
||||
|
||||
@@ -18,6 +18,7 @@ import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class TurtleInventoryCrafting extends InventoryCrafting
|
||||
@@ -201,6 +202,7 @@ public class TurtleInventoryCrafting extends InventoryCrafting
|
||||
return m_turtle.getInventory().getStackInSlot( i );
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getName()
|
||||
{
|
||||
@@ -213,6 +215,7 @@ public class TurtleInventoryCrafting extends InventoryCrafting
|
||||
return false;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ITextComponent getDisplayName()
|
||||
{
|
||||
|
||||
@@ -26,6 +26,7 @@ import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.vecmath.Matrix4f;
|
||||
|
||||
public class TurtleModem implements ITurtleUpgrade
|
||||
@@ -93,6 +94,7 @@ public class TurtleModem implements ITurtleUpgrade
|
||||
m_legacyID = legacyId;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ResourceLocation getUpgradeID()
|
||||
{
|
||||
@@ -105,6 +107,7 @@ public class TurtleModem implements ITurtleUpgrade
|
||||
return m_legacyID;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUnlocalisedAdjective()
|
||||
{
|
||||
@@ -118,6 +121,7 @@ public class TurtleModem implements ITurtleUpgrade
|
||||
}
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TurtleUpgradeType getType()
|
||||
{
|
||||
@@ -138,13 +142,14 @@ public class TurtleModem implements ITurtleUpgrade
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPeripheral createPeripheral( ITurtleAccess turtle, TurtleSide side )
|
||||
public IPeripheral createPeripheral( @Nonnull ITurtleAccess turtle, @Nonnull TurtleSide side )
|
||||
{
|
||||
return new Peripheral( turtle, m_advanced );
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TurtleCommandResult useTool( ITurtleAccess turtle, TurtleSide side, TurtleVerb verb, EnumFacing dir )
|
||||
public TurtleCommandResult useTool( @Nonnull ITurtleAccess turtle, @Nonnull TurtleSide side, @Nonnull TurtleVerb verb, @Nonnull EnumFacing dir )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -171,9 +176,10 @@ public class TurtleModem implements ITurtleUpgrade
|
||||
}
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public Pair<IBakedModel, Matrix4f> getModel( ITurtleAccess turtle, TurtleSide side )
|
||||
public Pair<IBakedModel, Matrix4f> getModel( ITurtleAccess turtle, @Nonnull TurtleSide side )
|
||||
{
|
||||
loadModelLocations();
|
||||
|
||||
@@ -207,7 +213,7 @@ public class TurtleModem implements ITurtleUpgrade
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update( ITurtleAccess turtle, TurtleSide side )
|
||||
public void update( @Nonnull ITurtleAccess turtle, @Nonnull TurtleSide side )
|
||||
{
|
||||
// Advance the modem
|
||||
if( !turtle.getWorld().isRemote )
|
||||
|
||||
@@ -35,6 +35,7 @@ import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.vecmath.Matrix4f;
|
||||
import java.util.Iterator;
|
||||
|
||||
@@ -53,6 +54,7 @@ public class TurtleTool implements ITurtleUpgrade
|
||||
m_item = new ItemStack( item, 1, 0 );
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ResourceLocation getUpgradeID()
|
||||
{
|
||||
@@ -65,12 +67,14 @@ public class TurtleTool implements ITurtleUpgrade
|
||||
return m_legacyId;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUnlocalisedAdjective()
|
||||
{
|
||||
return m_adjective;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TurtleUpgradeType getType()
|
||||
{
|
||||
@@ -84,14 +88,15 @@ public class TurtleTool implements ITurtleUpgrade
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPeripheral createPeripheral( ITurtleAccess turtle, TurtleSide side )
|
||||
public IPeripheral createPeripheral( @Nonnull ITurtleAccess turtle, @Nonnull TurtleSide side )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public Pair<IBakedModel, Matrix4f> getModel( ITurtleAccess turtle, TurtleSide side )
|
||||
public Pair<IBakedModel, Matrix4f> getModel( ITurtleAccess turtle, @Nonnull TurtleSide side )
|
||||
{
|
||||
float xOffset = (side == TurtleSide.Left) ? -0.40625f : 0.40625f;
|
||||
Matrix4f transform = new Matrix4f(
|
||||
@@ -108,12 +113,13 @@ public class TurtleTool implements ITurtleUpgrade
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update( ITurtleAccess turtle, TurtleSide side )
|
||||
public void update( @Nonnull ITurtleAccess turtle, @Nonnull TurtleSide side )
|
||||
{
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TurtleCommandResult useTool( ITurtleAccess turtle, TurtleSide side, TurtleVerb verb, EnumFacing direction )
|
||||
public TurtleCommandResult useTool( @Nonnull ITurtleAccess turtle, @Nonnull TurtleSide side, @Nonnull TurtleVerb verb, @Nonnull EnumFacing direction )
|
||||
{
|
||||
switch( verb )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user