From dc5517303fba5fb3573349eca9e8fee4a1de630f Mon Sep 17 00:00:00 2001 From: SquidDev Date: Sun, 7 May 2017 00:07:42 +0100 Subject: [PATCH 1/7] Add @Nullable and @NonNull annotations --- .../dan200/computercraft/ComputerCraft.java | 6 +- .../computercraft/api/ComputerCraftAPI.java | 29 +++++---- .../computercraft/api/filesystem/IMount.java | 12 ++-- .../api/filesystem/IWritableMount.java | 13 ++-- .../computercraft/api/lua/ILuaContext.java | 17 +++-- .../computercraft/api/lua/ILuaObject.java | 9 ++- .../computercraft/api/lua/ILuaTask.java | 5 +- .../computercraft/api/lua/LuaException.java | 6 +- .../computercraft/api/media/IMedia.java | 17 +++-- .../api/media/IMediaProvider.java | 6 +- .../api/peripheral/IComputerAccess.java | 23 ++++--- .../api/peripheral/IPeripheral.java | 18 ++++-- .../api/peripheral/IPeripheralProvider.java | 6 +- .../ITurtlePermissionProvider.java | 6 +- .../redstone/IBundledRedstoneProvider.java | 4 +- .../api/turtle/ITurtleAccess.java | 62 +++++++++++-------- .../api/turtle/ITurtleCommand.java | 5 +- .../api/turtle/ITurtleUpgrade.java | 27 +++++--- .../api/turtle/TurtleCommandResult.java | 13 +++- .../client/proxy/CCTurtleProxyClient.java | 7 ++- .../proxy/ComputerCraftProxyClient.java | 14 +++-- .../render/TileEntityMonitorRenderer.java | 4 +- .../render/TileEntityTurtleRenderer.java | 3 +- .../client/render/TurtleMultiModel.java | 5 ++ .../client/render/TurtleSmartItemModel.java | 10 ++- .../computercraft/core/apis/BitAPI.java | 5 +- .../computercraft/core/apis/BufferAPI.java | 8 ++- .../dan200/computercraft/core/apis/FSAPI.java | 16 +++-- .../computercraft/core/apis/HTTPAPI.java | 7 ++- .../dan200/computercraft/core/apis/OSAPI.java | 6 +- .../core/apis/PeripheralAPI.java | 15 +++-- .../computercraft/core/apis/RedstoneAPI.java | 4 +- .../computercraft/core/apis/TermAPI.java | 5 +- .../core/filesystem/ComboMount.java | 12 ++-- .../core/filesystem/EmptyMount.java | 12 ++-- .../core/filesystem/FileMount.java | 26 ++++---- .../core/filesystem/JarMount.java | 12 ++-- .../core/filesystem/SubMount.java | 12 ++-- .../core/lua/LuaJLuaMachine.java | 8 ++- .../shared/common/BlockGeneric.java | 36 ++++++----- .../DefaultBundledRedstoneProvider.java | 4 +- .../shared/common/TileGeneric.java | 23 ++++--- .../shared/computer/apis/CommandAPI.java | 4 +- .../computer/blocks/BlockCommandComputer.java | 7 ++- .../shared/computer/blocks/BlockComputer.java | 7 ++- .../computer/blocks/ComputerPeripheral.java | 10 ++- .../shared/computer/blocks/ComputerState.java | 3 + .../computer/blocks/TileCommandComputer.java | 9 ++- .../shared/computer/blocks/TileComputer.java | 5 +- .../computer/blocks/TileComputerBase.java | 13 ++-- .../computer/inventory/ContainerComputer.java | 3 +- .../computer/items/ItemCommandComputer.java | 3 +- .../shared/computer/items/ItemComputer.java | 6 +- .../computer/items/ItemComputerBase.java | 13 ++-- .../media/common/DefaultMediaProvider.java | 4 +- .../media/inventory/ContainerHeldItem.java | 4 +- .../shared/media/items/ItemDiskLegacy.java | 13 ++-- .../shared/media/items/ItemPrintout.java | 7 ++- .../shared/media/items/ItemTreasureDisk.java | 13 ++-- .../shared/media/items/RecordMedia.java | 12 ++-- .../shared/media/recipes/DiskRecipe.java | 9 ++- .../shared/media/recipes/PrintoutRecipe.java | 9 ++- .../shared/peripheral/PeripheralType.java | 3 + .../commandblock/CommandBlockPeripheral.java | 10 ++- .../CommandBlockPeripheralProvider.java | 4 +- .../shared/peripheral/common/BlockCable.java | 9 ++- .../common/BlockCableModemVariant.java | 3 + .../peripheral/common/BlockPeripheral.java | 8 ++- .../common/BlockPeripheralBase.java | 4 +- .../common/BlockPeripheralVariant.java | 3 + .../common/DefaultPeripheralProvider.java | 4 +- .../peripheral/common/ItemAdvancedModem.java | 3 +- .../shared/peripheral/common/ItemCable.java | 6 +- .../peripheral/common/ItemPeripheral.java | 3 +- .../peripheral/common/ItemPeripheralBase.java | 5 +- .../peripheral/common/TilePeripheralBase.java | 10 +-- .../diskdrive/ContainerDiskDrive.java | 4 +- .../diskdrive/DiskDrivePeripheral.java | 10 ++- .../peripheral/diskdrive/TileDiskDrive.java | 18 +++--- .../peripheral/modem/BlockAdvancedModem.java | 9 ++- .../peripheral/modem/ModemPeripheral.java | 9 ++- .../shared/peripheral/modem/TileCable.java | 27 ++++---- .../peripheral/modem/TileModemBase.java | 5 +- .../peripheral/modem/TileWirelessModem.java | 4 +- .../peripheral/monitor/MonitorPeripheral.java | 10 ++- .../peripheral/monitor/TileMonitor.java | 9 ++- .../peripheral/printer/ContainerPrinter.java | 4 +- .../peripheral/printer/PrinterPeripheral.java | 10 ++- .../peripheral/printer/TilePrinter.java | 28 +++++---- .../shared/pocket/apis/PocketAPI.java | 5 +- .../pocket/items/ItemPocketComputer.java | 20 +++--- .../recipes/PocketComputerUpgradeRecipe.java | 9 ++- .../shared/turtle/apis/TurtleAPI.java | 4 +- .../shared/turtle/blocks/BlockTurtle.java | 8 ++- .../shared/turtle/blocks/TileTurtle.java | 21 ++++--- .../shared/turtle/core/TurtleBrain.java | 24 ++++--- .../core/TurtleCheckRedstoneCommand.java | 5 +- .../turtle/core/TurtleCompareCommand.java | 4 +- .../turtle/core/TurtleCompareToCommand.java | 5 +- .../turtle/core/TurtleCraftCommand.java | 4 +- .../turtle/core/TurtleDetectCommand.java | 5 +- .../shared/turtle/core/TurtleDropCommand.java | 5 +- .../turtle/core/TurtleEquipCommand.java | 5 +- .../turtle/core/TurtleInspectCommand.java | 4 +- .../shared/turtle/core/TurtleMoveCommand.java | 4 +- .../turtle/core/TurtlePlaceCommand.java | 5 +- .../shared/turtle/core/TurtlePlayer.java | 3 +- .../turtle/core/TurtleRefuelCommand.java | 5 +- .../turtle/core/TurtleSelectCommand.java | 5 +- .../turtle/core/TurtleSetRedstoneCommand.java | 5 +- .../shared/turtle/core/TurtleSuckCommand.java | 4 +- .../shared/turtle/core/TurtleToolCommand.java | 5 +- .../turtle/core/TurtleTransferToCommand.java | 5 +- .../shared/turtle/core/TurtleTurnCommand.java | 5 +- .../turtle/entity/TurtleVisionCamera.java | 7 ++- .../turtle/inventory/ContainerTurtle.java | 3 +- .../shared/turtle/items/ItemTurtleBase.java | 9 ++- .../shared/turtle/recipes/TurtleRecipe.java | 9 ++- .../turtle/recipes/TurtleUpgradeRecipe.java | 9 ++- .../upgrades/CraftingTablePeripheral.java | 10 ++- .../turtle/upgrades/TurtleCraftingTable.java | 14 +++-- .../shared/turtle/upgrades/TurtleHoe.java | 5 +- .../upgrades/TurtleInventoryCrafting.java | 3 + .../shared/turtle/upgrades/TurtleModem.java | 14 +++-- .../shared/turtle/upgrades/TurtleTool.java | 14 +++-- .../shared/util/CreativeTabMain.java | 4 ++ .../shared/util/CreativeTabTreasure.java | 4 ++ .../shared/util/ImpostorRecipe.java | 6 +- 128 files changed, 818 insertions(+), 381 deletions(-) diff --git a/src/main/java/dan200/computercraft/ComputerCraft.java b/src/main/java/dan200/computercraft/ComputerCraft.java index d7f5edf80..4dad6ade6 100644 --- a/src/main/java/dan200/computercraft/ComputerCraft.java +++ b/src/main/java/dan200/computercraft/ComputerCraft.java @@ -722,7 +722,7 @@ public class ComputerCraft } } - public static IMount createResourceMount( Class modClass, String domain, String subPath ) + public static IMount createResourceMount( Class modClass, String domain, String subPath ) { // Start building list of mounts List mounts = new ArrayList(); @@ -806,7 +806,7 @@ public class ComputerCraft } } - private static File getContainingJar( Class modClass ) + private static File getContainingJar( Class modClass ) { String path = modClass.getProtectionDomain().getCodeSource().getLocation().getPath(); int bangIndex = path.indexOf( "!" ); @@ -831,7 +831,7 @@ public class ComputerCraft return file; } - private static File getDebugCodeDir( Class modClass ) + private static File getDebugCodeDir( Class modClass ) { String path = modClass.getProtectionDomain().getCodeSource().getLocation().getPath(); int bangIndex = path.indexOf("!"); diff --git a/src/main/java/dan200/computercraft/api/ComputerCraftAPI.java b/src/main/java/dan200/computercraft/api/ComputerCraftAPI.java index c4194f5b2..9c4adfcdf 100644 --- a/src/main/java/dan200/computercraft/api/ComputerCraftAPI.java +++ b/src/main/java/dan200/computercraft/api/ComputerCraftAPI.java @@ -21,6 +21,8 @@ import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; import java.lang.reflect.Method; /** @@ -36,6 +38,7 @@ public final class ComputerCraftAPI return computerCraft != null; } + @Nonnull public static String getInstalledVersion() { findCC(); @@ -50,6 +53,7 @@ public final class ComputerCraftAPI return ""; } + @Nonnull public static String getAPIVersion() { return "${version}"; @@ -68,7 +72,7 @@ public final class ComputerCraftAPI * available for writing. * @see #createSaveDirMount(World, String, long) */ - public static int createUniqueNumberedSaveDir( World world, String parentSubPath ) + public static int createUniqueNumberedSaveDir( @Nonnull World world, @Nonnull String parentSubPath ) { findCC(); if( computerCraft_createUniqueNumberedSaveDir != null ) @@ -100,7 +104,8 @@ public final class ComputerCraftAPI * @see IMount * @see IWritableMount */ - public static IWritableMount createSaveDirMount( World world, String subPath, long capacity ) + @Nullable + public static IWritableMount createSaveDirMount( @Nonnull World world, @Nonnull String subPath, long capacity ) { findCC(); if( computerCraft_createSaveDirMount != null ) @@ -132,7 +137,8 @@ public final class ComputerCraftAPI * @see IComputerAccess#mountWritable(String, IWritableMount) * @see IMount */ - public static IMount createResourceMount( Class modClass, String domain, String subPath ) + @Nullable + public static IMount createResourceMount( @Nonnull Class modClass, @Nonnull String domain, @Nonnull String subPath ) { findCC(); if( computerCraft_createResourceMount != null ) @@ -153,7 +159,7 @@ public final class ComputerCraftAPI * @see dan200.computercraft.api.peripheral.IPeripheral * @see dan200.computercraft.api.peripheral.IPeripheralProvider */ - public static void registerPeripheralProvider( IPeripheralProvider handler ) + public static void registerPeripheralProvider( @Nonnull IPeripheralProvider handler ) { findCC(); if ( computerCraft_registerPeripheralProvider != null) @@ -174,7 +180,7 @@ public final class ComputerCraftAPI * @param upgrade The turtle upgrade to register. * @see dan200.computercraft.api.turtle.ITurtleUpgrade */ - public static void registerTurtleUpgrade( ITurtleUpgrade upgrade ) + public static void registerTurtleUpgrade( @Nonnull ITurtleUpgrade upgrade ) { if( upgrade != null ) { @@ -196,7 +202,7 @@ public final class ComputerCraftAPI * @param handler The bundled redstone provider to register. * @see dan200.computercraft.api.redstone.IBundledRedstoneProvider */ - public static void registerBundledRedstoneProvider( IBundledRedstoneProvider handler ) + public static void registerBundledRedstoneProvider( @Nonnull IBundledRedstoneProvider handler ) { findCC(); if( computerCraft_registerBundledRedstoneProvider != null ) @@ -219,7 +225,7 @@ public final class ComputerCraftAPI * If there is no block capable of emitting bundled redstone at the location, -1 will be returned. * @see dan200.computercraft.api.redstone.IBundledRedstoneProvider */ - public static int getBundledRedstoneOutput( World world, BlockPos pos, EnumFacing side ) + public static int getBundledRedstoneOutput( @Nonnull World world, @Nonnull BlockPos pos, @Nonnull EnumFacing side ) { findCC(); if( computerCraft_getDefaultBundledRedstoneOutput != null ) @@ -239,7 +245,7 @@ public final class ComputerCraftAPI * @param handler The media provider to register. * @see dan200.computercraft.api.media.IMediaProvider */ - public static void registerMediaProvider( IMediaProvider handler ) + public static void registerMediaProvider( @Nonnull IMediaProvider handler ) { findCC(); if( computerCraft_registerMediaProvider != null ) @@ -258,7 +264,7 @@ public final class ComputerCraftAPI * @param handler The turtle permission provider to register. * @see dan200.computercraft.api.permissions.ITurtlePermissionProvider */ - public static void registerPermissionProvider( ITurtlePermissionProvider handler ) + public static void registerPermissionProvider( @Nonnull ITurtlePermissionProvider handler ) { findCC(); if( computerCraft_registerPermissionProvider != null ) @@ -271,7 +277,8 @@ public final class ComputerCraftAPI } } - public static void registerPocketUpgrade(IPocketUpgrade upgrade) { + public static void registerPocketUpgrade( @Nonnull IPocketUpgrade upgrade ) + { findCC(); if(computerCraft_registerPocketUpgrade != null) { try { @@ -331,7 +338,7 @@ public final class ComputerCraftAPI } } - private static Method findCCMethod( String name, Class[] args ) + private static Method findCCMethod( String name, Class[] args ) { try { if( computerCraft != null ) diff --git a/src/main/java/dan200/computercraft/api/filesystem/IMount.java b/src/main/java/dan200/computercraft/api/filesystem/IMount.java index d5869d3e8..32e063743 100644 --- a/src/main/java/dan200/computercraft/api/filesystem/IMount.java +++ b/src/main/java/dan200/computercraft/api/filesystem/IMount.java @@ -10,6 +10,7 @@ import dan200.computercraft.api.ComputerCraftAPI; import dan200.computercraft.api.peripheral.IComputerAccess; import net.minecraft.world.World; +import javax.annotation.Nonnull; import java.io.IOException; import java.io.InputStream; import java.util.List; @@ -36,7 +37,7 @@ public interface IMount * @return If the file exists. * @throws IOException If an error occurs when checking the existence of the file. */ - public boolean exists( String path ) throws IOException; + boolean exists( @Nonnull String path ) throws IOException; /** * Returns whether a file with a given path is a directory or not. @@ -45,7 +46,7 @@ public interface IMount * @return If the file exists and is a directory * @throws IOException If an error occurs when checking whether the file is a directory. */ - public boolean isDirectory( String path ) throws IOException; + boolean isDirectory( @Nonnull String path ) throws IOException; /** * Returns the file names of all the files in a directory. @@ -54,7 +55,7 @@ public interface IMount * @param contents A list of strings. Add all the file names to this list. * @throws IOException If the file was not a directory, or could not be listed. */ - public void list( String path, List contents ) throws IOException; + void list( @Nonnull String path, @Nonnull List contents ) throws IOException; /** * Returns the size of a file with a given path, in bytes @@ -63,7 +64,7 @@ public interface IMount * @return The size of the file, in bytes. * @throws IOException If the file does not exist, or its size could not be determined. */ - public long getSize( String path ) throws IOException; + long getSize( @Nonnull String path ) throws IOException; /** * Opens a file with a given path, and returns an {@link InputStream} representing its contents. @@ -72,5 +73,6 @@ public interface IMount * @return A stream representing the contents of the file. * @throws IOException If the file does not exist, or could not be opened. */ - public InputStream openForRead( String path ) throws IOException; + @Nonnull + InputStream openForRead( @Nonnull String path ) throws IOException; } diff --git a/src/main/java/dan200/computercraft/api/filesystem/IWritableMount.java b/src/main/java/dan200/computercraft/api/filesystem/IWritableMount.java index a1173167f..3f4bc68e3 100644 --- a/src/main/java/dan200/computercraft/api/filesystem/IWritableMount.java +++ b/src/main/java/dan200/computercraft/api/filesystem/IWritableMount.java @@ -10,6 +10,7 @@ import dan200.computercraft.api.ComputerCraftAPI; import dan200.computercraft.api.peripheral.IComputerAccess; import net.minecraft.world.World; +import javax.annotation.Nonnull; import java.io.IOException; import java.io.OutputStream; @@ -33,7 +34,7 @@ public interface IWritableMount extends IMount * @param path A file path in normalised format, relative to the mount location. ie: "programs/mynewprograms". * @throws IOException If the directory already exists or could not be created. */ - public void makeDirectory( String path ) throws IOException; + void makeDirectory( @Nonnull String path ) throws IOException; /** * Deletes a directory at a given path inside the virtual file system. @@ -41,7 +42,7 @@ public interface IWritableMount extends IMount * @param path A file path in normalised format, relative to the mount location. ie: "programs/myoldprograms". * @throws IOException If the file does not exist or could not be deleted. */ - public void delete( String path ) throws IOException; + void delete( @Nonnull String path ) throws IOException; /** * Opens a file with a given path, and returns an {@link OutputStream} for writing to it. @@ -50,7 +51,8 @@ public interface IWritableMount extends IMount * @return A stream for writing to * @throws IOException If the file could not be opened for writing. */ - public OutputStream openForWrite( String path ) throws IOException; + @Nonnull + OutputStream openForWrite( @Nonnull String path ) throws IOException; /** * Opens a file with a given path, and returns an {@link OutputStream} for appending to it. @@ -59,7 +61,8 @@ public interface IWritableMount extends IMount * @return A stream for writing to. * @throws IOException If the file could not be opened for writing. */ - public OutputStream openForAppend( String path ) throws IOException; + @Nonnull + OutputStream openForAppend( @Nonnull String path ) throws IOException; /** * Get the amount of free space on the mount, in bytes. You should decrease this value as the user writes to the @@ -68,5 +71,5 @@ public interface IWritableMount extends IMount * @return The amount of free space, in bytes. * @throws IOException If the remaining space could not be computed. */ - public long getRemainingSpace() throws IOException; + long getRemainingSpace() throws IOException; } diff --git a/src/main/java/dan200/computercraft/api/lua/ILuaContext.java b/src/main/java/dan200/computercraft/api/lua/ILuaContext.java index 16ce1d8d6..5f4c74218 100644 --- a/src/main/java/dan200/computercraft/api/lua/ILuaContext.java +++ b/src/main/java/dan200/computercraft/api/lua/ILuaContext.java @@ -6,6 +6,9 @@ package dan200.computercraft.api.lua; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + /** * An interface passed to peripherals and {@link ILuaObject}s by computers or turtles, providing methods * that allow the peripheral call to wait for events before returning, just like in lua. This is very useful if you need @@ -28,7 +31,8 @@ public interface ILuaContext * event, InterruptedException will be thrown. This exception must not be caught or * intercepted, or the computer will leak memory and end up in a broken state. */ - public Object[] pullEvent( String filter ) throws LuaException, InterruptedException; + @Nonnull + Object[] pullEvent( @Nullable String filter ) throws LuaException, InterruptedException; /** * The same as {@link #pullEvent(String)}, except "terminated" events are ignored. Only use this if you want to @@ -42,7 +46,8 @@ public interface ILuaContext * intercepted, or the computer will leak memory and end up in a broken state. * @see #pullEvent(String) */ - public Object[] pullEventRaw( String filter ) throws InterruptedException; + @Nonnull + Object[] pullEventRaw( @Nullable String filter ) throws InterruptedException; /** * Yield the current coroutine with some arguments until it is resumed. This method is exactly equivalent to @@ -55,7 +60,8 @@ public interface ILuaContext * intercepted, or the computer will leak memory and end up in a broken state. * @see #pullEvent(String) */ - public Object[] yield( Object[] arguments ) throws InterruptedException; + @Nonnull + Object[] yield( @Nullable Object[] arguments ) throws InterruptedException; /** * Queue a task to be executed on the main server thread at the beginning of next tick, waiting for it to complete. @@ -71,7 +77,8 @@ public interface ILuaContext * InterruptedException will be thrown. This exception must not be caught or * intercepted, or the computer will leak memory and end up in a broken state. */ - public Object[] executeMainThreadTask( ILuaTask task ) throws LuaException, InterruptedException; + @Nullable + Object[] executeMainThreadTask( @Nonnull ILuaTask task ) throws LuaException, InterruptedException; /** * Queue a task to be executed on the main server thread at the beginning of next tick, but do not wait for it to @@ -86,5 +93,5 @@ public interface ILuaContext * @return The "id" of the task. This will be the first argument to the {@code task_completed} event. * @throws LuaException If the task could not be queued. */ - public long issueMainThreadTask( ILuaTask task ) throws LuaException; + long issueMainThreadTask( @Nonnull ILuaTask task ) throws LuaException; } diff --git a/src/main/java/dan200/computercraft/api/lua/ILuaObject.java b/src/main/java/dan200/computercraft/api/lua/ILuaObject.java index 6da7ea720..8e40d75a7 100644 --- a/src/main/java/dan200/computercraft/api/lua/ILuaObject.java +++ b/src/main/java/dan200/computercraft/api/lua/ILuaObject.java @@ -9,6 +9,9 @@ package dan200.computercraft.api.lua; import dan200.computercraft.api.peripheral.IComputerAccess; import dan200.computercraft.api.peripheral.IPeripheral; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + /** * An interface for representing custom objects returned by {@link IPeripheral#callMethod(IComputerAccess, ILuaContext, int, Object[])} * calls. @@ -24,7 +27,8 @@ public interface ILuaObject * @return The method names this object provides. * @see IPeripheral#getMethodNames() */ - public String[] getMethodNames(); + @Nonnull + String[] getMethodNames(); /** * Called when a user calls one of the methods that this object implements. This works the same as @@ -47,5 +51,6 @@ public interface ILuaObject * intercepted, or the computer will leak memory and end up in a broken state.w * @see IPeripheral#callMethod(IComputerAccess, ILuaContext, int, Object[]) */ - public Object[] callMethod( ILuaContext context, int method, Object[] arguments ) throws LuaException, InterruptedException; + @Nullable + Object[] callMethod( @Nonnull ILuaContext context, int method, @Nonnull Object[] arguments ) throws LuaException, InterruptedException; } diff --git a/src/main/java/dan200/computercraft/api/lua/ILuaTask.java b/src/main/java/dan200/computercraft/api/lua/ILuaTask.java index 88e3ee035..0b31fb428 100644 --- a/src/main/java/dan200/computercraft/api/lua/ILuaTask.java +++ b/src/main/java/dan200/computercraft/api/lua/ILuaTask.java @@ -6,6 +6,8 @@ package dan200.computercraft.api.lua; +import javax.annotation.Nullable; + /** * A task which can be executed via {@link ILuaContext#executeMainThreadTask(ILuaTask)} or * {@link ILuaContext#issueMainThreadTask(ILuaTask)}. This will be run on the main thread, at the beginning of the @@ -25,5 +27,6 @@ public interface ILuaTask * same message as your exception. Use this to throw appropriate errors if the wrong * arguments are supplied to your method. */ - public Object[] execute() throws LuaException; + @Nullable + Object[] execute() throws LuaException; } diff --git a/src/main/java/dan200/computercraft/api/lua/LuaException.java b/src/main/java/dan200/computercraft/api/lua/LuaException.java index 90038d164..4f07e6e64 100644 --- a/src/main/java/dan200/computercraft/api/lua/LuaException.java +++ b/src/main/java/dan200/computercraft/api/lua/LuaException.java @@ -6,6 +6,8 @@ package dan200.computercraft.api.lua; +import javax.annotation.Nullable; + /** * An exception representing an error in Lua, like that raised by the {@code error()} function. */ @@ -19,12 +21,12 @@ public class LuaException extends Exception this( "error", 1 ); } - public LuaException( String message ) + public LuaException( @Nullable String message ) { this( message, 1 ); } - public LuaException( String message, int level ) + public LuaException( @Nullable String message, int level ) { super( message ); m_level = level; diff --git a/src/main/java/dan200/computercraft/api/media/IMedia.java b/src/main/java/dan200/computercraft/api/media/IMedia.java index b6eee6414..e35cffc9b 100644 --- a/src/main/java/dan200/computercraft/api/media/IMedia.java +++ b/src/main/java/dan200/computercraft/api/media/IMedia.java @@ -11,6 +11,9 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.SoundEvent; import net.minecraft.world.World; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + /** * Represents an item that can be placed in a disk drive and used by a Computer. * Implement this interface on your Item class to allow it to be used in the drive. @@ -23,7 +26,8 @@ public interface IMedia * @param stack The itemstack to inspect. * @return The label. ie: "Dan's Programs". */ - public String getLabel( ItemStack stack ); + @Nullable + String getLabel( @Nonnull ItemStack stack ); /** * Set a string representing the label of this item. Will be called vi {@code disk.setLabel()} in lua. @@ -32,7 +36,7 @@ public interface IMedia * @param label The string to set the label to. * @return true if the label was updated, false if the label may not be modified. */ - public boolean setLabel( ItemStack stack, String label ); + boolean setLabel( @Nonnull ItemStack stack, @Nullable String label ); /** * If this disk represents an item with audio (like a record), get the readable name of the audio track. ie: @@ -41,7 +45,8 @@ public interface IMedia * @param stack The itemstack to inspect. * @return The name, or null if this item does not represent an item with audio. */ - public String getAudioTitle( ItemStack stack ); + @Nullable + String getAudioTitle( @Nonnull ItemStack stack ); /** * If this disk represents an item with audio (like a record), get the resource name of the audio track to play. @@ -49,7 +54,8 @@ public interface IMedia * @param stack The itemstack to inspect. * @return The name, or null if this item does not represent an item with audio. */ - public SoundEvent getAudio( ItemStack stack ); + @Nullable + SoundEvent getAudio( @Nonnull ItemStack stack ); /** * If this disk represents an item with data (like a floppy disk), get a mount representing it's contents. This will @@ -64,5 +70,6 @@ public interface IMedia * @see dan200.computercraft.api.ComputerCraftAPI#createSaveDirMount(World, String, long) * @see dan200.computercraft.api.ComputerCraftAPI#createResourceMount(Class, String, String) */ - public IMount createDataMount( ItemStack stack, World world ); + @Nullable + IMount createDataMount( @Nonnull ItemStack stack, @Nonnull World world ); } diff --git a/src/main/java/dan200/computercraft/api/media/IMediaProvider.java b/src/main/java/dan200/computercraft/api/media/IMediaProvider.java index 5b0188e04..0a9cdcaa5 100644 --- a/src/main/java/dan200/computercraft/api/media/IMediaProvider.java +++ b/src/main/java/dan200/computercraft/api/media/IMediaProvider.java @@ -8,6 +8,9 @@ package dan200.computercraft.api.media; import net.minecraft.item.ItemStack; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + /** * This interface is used to provide {@link IMedia} implementations for {@link ItemStack}. * @@ -22,5 +25,6 @@ public interface IMediaProvider * @return An IMedia implementation, or null if the item is not something you wish to handle * @see dan200.computercraft.api.ComputerCraftAPI#registerMediaProvider(IMediaProvider) */ - public IMedia getMedia( ItemStack stack ); + @Nullable + IMedia getMedia( @Nonnull ItemStack stack ); } diff --git a/src/main/java/dan200/computercraft/api/peripheral/IComputerAccess.java b/src/main/java/dan200/computercraft/api/peripheral/IComputerAccess.java index 964f48480..1caab9033 100644 --- a/src/main/java/dan200/computercraft/api/peripheral/IComputerAccess.java +++ b/src/main/java/dan200/computercraft/api/peripheral/IComputerAccess.java @@ -11,6 +11,9 @@ import dan200.computercraft.api.filesystem.IMount; import dan200.computercraft.api.filesystem.IWritableMount; import net.minecraft.world.World; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + /** * The interface passed to peripherals by computers or turtles, providing methods * that they can call. This should not be implemented by your classes. Do not interact @@ -33,7 +36,8 @@ public interface IComputerAccess * @see #unmount(String) * @see IMount */ - public String mount( String desiredLocation, IMount mount ); + @Nullable + String mount( @Nonnull String desiredLocation, @Nonnull IMount mount ); /** * Mount a mount onto the computer's file system in a read only mode. @@ -51,7 +55,8 @@ public interface IComputerAccess * @see #unmount(String) * @see IMount */ - public String mount( String desiredLocation, IMount mount, String driveName ); + @Nullable + String mount( @Nonnull String desiredLocation, @Nonnull IMount mount, @Nonnull String driveName ); /** * Mount a mount onto the computer's file system in a writable mode. @@ -67,7 +72,8 @@ public interface IComputerAccess * @see #unmount(String) * @see IMount */ - public String mountWritable( String desiredLocation, IWritableMount mount ); + @Nullable + String mountWritable( @Nonnull String desiredLocation, @Nonnull IWritableMount mount ); /** * Mount a mount onto the computer's file system in a writable mode. @@ -84,7 +90,7 @@ public interface IComputerAccess * @see #unmount(String) * @see IMount */ - public String mountWritable( String desiredLocation, IWritableMount mount, String driveName ); + String mountWritable( @Nonnull String desiredLocation, @Nonnull IWritableMount mount, @Nonnull String driveName ); /** * Unmounts a directory previously mounted onto the computers file system by {@link #mount(String, IMount)} @@ -104,7 +110,7 @@ public interface IComputerAccess * @see #mount(String, IMount) * @see #mountWritable(String, IWritableMount) */ - public void unmount( String location ); + void unmount( @Nullable String location ); /** * Returns the numerical ID of this computer. @@ -114,7 +120,7 @@ public interface IComputerAccess * * @return The identifier. */ - public int getID(); + int getID(); /** * Causes an event to be raised on this computer, which the computer can respond to by calling @@ -134,7 +140,7 @@ public interface IComputerAccess * @throws RuntimeException If the peripheral has been detached. * @see dan200.computercraft.api.peripheral.IPeripheral#callMethod */ - public void queueEvent( String event, Object[] arguments ); + void queueEvent( @Nonnull String event, @Nullable Object[] arguments ); /** * Get a string, unique to the computer, by which the computer refers to this peripheral. @@ -146,5 +152,6 @@ public interface IComputerAccess * @return A string unique to the computer, but not globally. * @throws RuntimeException If the peripheral has been detached. */ - public String getAttachmentName(); + @Nonnull + String getAttachmentName(); } diff --git a/src/main/java/dan200/computercraft/api/peripheral/IPeripheral.java b/src/main/java/dan200/computercraft/api/peripheral/IPeripheral.java index bd9311dd7..8dc11655d 100644 --- a/src/main/java/dan200/computercraft/api/peripheral/IPeripheral.java +++ b/src/main/java/dan200/computercraft/api/peripheral/IPeripheral.java @@ -9,6 +9,9 @@ package dan200.computercraft.api.peripheral; import dan200.computercraft.api.lua.ILuaContext; import dan200.computercraft.api.lua.LuaException; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + /** * The interface that defines a peripheral. See {@link IPeripheralProvider} for how to associate blocks with peripherals. */ @@ -20,7 +23,8 @@ public interface IPeripheral * * @return A string identifying the type of peripheral. */ - public String getType(); + @Nonnull + String getType(); /** * Should return an array of strings that identify the methods that this @@ -30,7 +34,8 @@ public interface IPeripheral * @return An array of strings representing method names. * @see #callMethod */ - public String[] getMethodNames(); + @Nonnull + String[] getMethodNames(); /** * This is called when a lua program on an attached computer calls {@code peripheral.call()} with @@ -66,7 +71,8 @@ public interface IPeripheral * intercepted, or the computer will leak memory and end up in a broken state. * @see #getMethodNames */ - public Object[] callMethod( IComputerAccess computer, ILuaContext context, int method, Object[] arguments ) throws LuaException, InterruptedException; + @Nullable + Object[] callMethod( @Nonnull IComputerAccess computer, @Nonnull ILuaContext context, int method, @Nonnull Object[] arguments ) throws LuaException, InterruptedException; /** * Is called when canAttachToSide has returned true, and a computer is attaching to the peripheral. @@ -85,7 +91,7 @@ public interface IPeripheral * computers can be attached to a peripheral at once. * @see #detach */ - public void attach( IComputerAccess computer ); + void attach( @Nonnull IComputerAccess computer ); /** * Is called when a computer is detaching from the peripheral. @@ -102,7 +108,7 @@ public interface IPeripheral * computers can be attached to a peripheral at once. * @see #detach */ - public void detach( IComputerAccess computer ); + void detach( @Nonnull IComputerAccess computer ); /** * Determine whether this peripheral is equivalent to another one. @@ -113,5 +119,5 @@ public interface IPeripheral * @param other The peripheral to compare against. This may be {@code null}. * @return Whether these peripherals are equivalent. */ - public boolean equals( IPeripheral other ); + boolean equals( @Nullable IPeripheral other ); } diff --git a/src/main/java/dan200/computercraft/api/peripheral/IPeripheralProvider.java b/src/main/java/dan200/computercraft/api/peripheral/IPeripheralProvider.java index 51fde616b..8df256961 100644 --- a/src/main/java/dan200/computercraft/api/peripheral/IPeripheralProvider.java +++ b/src/main/java/dan200/computercraft/api/peripheral/IPeripheralProvider.java @@ -10,6 +10,9 @@ import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + /** * This interface is used to create peripheral implementations for blocks. * @@ -26,5 +29,6 @@ public interface IPeripheralProvider * @return A peripheral, or {@code null} if there is not a peripheral here you'd like to handle. * @see dan200.computercraft.api.ComputerCraftAPI#registerPeripheralProvider(IPeripheralProvider) */ - public IPeripheral getPeripheral( World world, BlockPos pos, EnumFacing side ); + @Nullable + IPeripheral getPeripheral( @Nonnull World world, @Nonnull BlockPos pos, @Nonnull EnumFacing side ); } diff --git a/src/main/java/dan200/computercraft/api/permissions/ITurtlePermissionProvider.java b/src/main/java/dan200/computercraft/api/permissions/ITurtlePermissionProvider.java index 7ce60290d..ee2373819 100644 --- a/src/main/java/dan200/computercraft/api/permissions/ITurtlePermissionProvider.java +++ b/src/main/java/dan200/computercraft/api/permissions/ITurtlePermissionProvider.java @@ -9,6 +9,8 @@ package dan200.computercraft.api.permissions; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import javax.annotation.Nonnull; + /** * This interface is used to restrict where turtles can move or build. * @@ -25,7 +27,7 @@ public interface ITurtlePermissionProvider * @param pos The location of the block. * @return Whether the turtle can move into this block. */ - public boolean isBlockEnterable( World world, BlockPos pos ); + boolean isBlockEnterable( @Nonnull World world, @Nonnull BlockPos pos ); /** * Determine whether a block can be modified by a turtle. @@ -36,5 +38,5 @@ public interface ITurtlePermissionProvider * @param pos The location of the block. * @return Whether the turtle can modify this block. */ - public boolean isBlockEditable( World world, BlockPos pos ); + boolean isBlockEditable( @Nonnull World world, @Nonnull BlockPos pos ); } diff --git a/src/main/java/dan200/computercraft/api/redstone/IBundledRedstoneProvider.java b/src/main/java/dan200/computercraft/api/redstone/IBundledRedstoneProvider.java index 8447f0016..8a940c4b1 100644 --- a/src/main/java/dan200/computercraft/api/redstone/IBundledRedstoneProvider.java +++ b/src/main/java/dan200/computercraft/api/redstone/IBundledRedstoneProvider.java @@ -10,6 +10,8 @@ import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import javax.annotation.Nonnull; + /** * This interface is used to provide bundled redstone output for blocks. * @@ -27,5 +29,5 @@ public interface IBundledRedstoneProvider * handle this block. * @see dan200.computercraft.api.ComputerCraftAPI#registerBundledRedstoneProvider(IBundledRedstoneProvider) */ - public int getBundledRedstoneOutput( World world, BlockPos pos, EnumFacing side ); + int getBundledRedstoneOutput( @Nonnull World world, @Nonnull BlockPos pos, @Nonnull EnumFacing side ); } diff --git a/src/main/java/dan200/computercraft/api/turtle/ITurtleAccess.java b/src/main/java/dan200/computercraft/api/turtle/ITurtleAccess.java index efe0202fd..0b00b6945 100644 --- a/src/main/java/dan200/computercraft/api/turtle/ITurtleAccess.java +++ b/src/main/java/dan200/computercraft/api/turtle/ITurtleAccess.java @@ -16,6 +16,9 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + /** * The interface passed to turtle by turtles, providing methods that they can call. * @@ -29,14 +32,16 @@ public interface ITurtleAccess * * @return the world in which the turtle resides. */ - public World getWorld(); + @Nonnull + World getWorld(); /** * Returns a vector containing the integer co-ordinates at which the turtle resides. * * @return a vector containing the integer co-ordinates at which the turtle resides. */ - public BlockPos getPosition(); + @Nonnull + BlockPos getPosition(); /** * Attempt to move this turtle to a new position. @@ -51,7 +56,7 @@ public interface ITurtleAccess * {@link dan200.computercraft.api.permissions.ITurtlePermissionProvider#isBlockEnterable(World, BlockPos)}. * @throws UnsupportedOperationException When attempting to teleport on the client side. */ - public boolean teleportTo( World world, BlockPos pos ); + boolean teleportTo( @Nonnull World world, @Nonnull BlockPos pos ); /** * Returns a vector containing the floating point co-ordinates at which the turtle is rendered. @@ -61,7 +66,8 @@ public interface ITurtleAccess * @return A vector containing the floating point co-ordinates at which the turtle resides. * @see #getVisualYaw(float) */ - public Vec3d getVisualPosition( float f ); + @Nonnull + Vec3d getVisualPosition( float f ); /** * Returns the yaw the turtle is facing when it is rendered. @@ -70,7 +76,7 @@ public interface ITurtleAccess * @return The yaw the turtle is facing. * @see #getVisualPosition(float) */ - public float getVisualYaw( float f ); + float getVisualYaw( float f ); /** * Returns the world direction the turtle is currently facing. @@ -78,7 +84,8 @@ public interface ITurtleAccess * @return The world direction the turtle is currently facing. * @see #setDirection(EnumFacing) */ - public EnumFacing getDirection(); + @Nonnull + EnumFacing getDirection(); /** * Set the direction the turtle is facing. Note that this will not play a rotation animation, you will also need to @@ -87,7 +94,7 @@ public interface ITurtleAccess * @param dir The new direction to set. This should be on either the x or z axis (so north, south, east or west). * @see #getDirection() */ - public void setDirection( EnumFacing dir ); + void setDirection( @Nonnull EnumFacing dir ); /** * Get the currently selected slot in the turtle's inventory. @@ -96,7 +103,7 @@ public interface ITurtleAccess * @see #getInventory() * @see #setSelectedSlot(int) */ - public int getSelectedSlot(); + int getSelectedSlot(); /** * Set the currently selected slot in the turtle's inventory. @@ -107,7 +114,7 @@ public interface ITurtleAccess * @see #getInventory() * @see #getSelectedSlot() */ - public void setSelectedSlot( int slot ); + void setSelectedSlot( int slot ); /** * Sets the colour of the turtle, as if the player had dyed it with a dye item. @@ -116,7 +123,7 @@ public interface ITurtleAccess * the dye from the turtle. * @see #getDyeColour() */ - public void setDyeColour( int dyeColour ); + void setDyeColour( int dyeColour ); /** * Gets the colour the turtle has been dyed. @@ -125,14 +132,15 @@ public interface ITurtleAccess * is clean. * @see #getDyeColour() */ - public int getDyeColour(); + int getDyeColour(); /** * Get the inventory of this turtle * * @return This turtle's inventory */ - public IInventory getInventory(); + @Nonnull + IInventory getInventory(); /** * Determine whether this turtle will require fuel when performing actions. @@ -141,7 +149,7 @@ public interface ITurtleAccess * @see #getFuelLevel() * @see #setFuelLevel(int) */ - public boolean isFuelNeeded(); + boolean isFuelNeeded(); /** * Get the current fuel level of this turtle. @@ -150,7 +158,7 @@ public interface ITurtleAccess * @see #isFuelNeeded() * @see #setFuelLevel(int) */ - public int getFuelLevel(); + int getFuelLevel(); /** * Set the fuel level to a new value. It is generally preferred to use {@link #consumeFuel(int)}} or {@link #addFuel(int)} @@ -162,14 +170,14 @@ public interface ITurtleAccess * @see #addFuel(int) * @see #consumeFuel(int) */ - public void setFuelLevel( int fuel ); + void setFuelLevel( int fuel ); /** * Get the maximum amount of fuel a turtle can hold. * * @return The turtle's fuel limit. */ - public int getFuelLimit(); + int getFuelLimit(); /** * Removes some fuel from the turtles fuel supply. Negative numbers can be passed in to INCREASE the fuel level of the turtle. @@ -179,7 +187,7 @@ public interface ITurtleAccess * greater than the current fuel level of the turtle. No fuel will be consumed if {@code false} is returned. * @throws UnsupportedOperationException When attempting to consume fuel on the client side. */ - public boolean consumeFuel( int fuel ); + boolean consumeFuel( int fuel ); /** * Increase the turtle's fuel level by the given amount. @@ -187,7 +195,7 @@ public interface ITurtleAccess * @param fuel The amount to refuel with. * @throws UnsupportedOperationException When attempting to refuel on the client side. */ - public void addFuel( int fuel ); + void addFuel( int fuel ); /** * Adds a custom command to the turtles command queue. Unlike peripheral methods, these custom commands will be executed @@ -209,7 +217,8 @@ public interface ITurtleAccess * @see ITurtleCommand * @see ILuaContext#pullEvent(String) */ - public Object[] executeCommand( ILuaContext context, ITurtleCommand command ) throws LuaException, InterruptedException; + @Nonnull + Object[] executeCommand( @Nonnull ILuaContext context, @Nonnull ITurtleCommand command ) throws LuaException, InterruptedException; /** * Start playing a specific animation. This will prevent other turtle commands from executing until @@ -219,7 +228,7 @@ public interface ITurtleAccess * @throws UnsupportedOperationException When attempting to execute play an animation on the client side. * @see TurtleAnimation */ - public void playAnimation( TurtleAnimation animation ); + void playAnimation( @Nonnull TurtleAnimation animation ); /** * Returns the turtle on the specified side of the turtle, if there is one. @@ -228,7 +237,8 @@ public interface ITurtleAccess * @return The upgrade on the specified side of the turtle, if there is one. * @see #setUpgrade(TurtleSide, ITurtleUpgrade) */ - public ITurtleUpgrade getUpgrade( TurtleSide side ); + @Nullable + ITurtleUpgrade getUpgrade( @Nonnull TurtleSide side ); /** * Set the upgrade for a given side, resetting peripherals and clearing upgrade specific data. @@ -237,7 +247,7 @@ public interface ITurtleAccess * @param upgrade The upgrade to set, may be {@code null} to clear. * @see #getUpgrade(TurtleSide) */ - public void setUpgrade( TurtleSide side, ITurtleUpgrade upgrade ); + void setUpgrade( @Nonnull TurtleSide side, @Nullable ITurtleUpgrade upgrade ); /** * Returns the peripheral created by the upgrade on the specified side of the turtle, if there is one. @@ -245,7 +255,8 @@ public interface ITurtleAccess * @param side The side to get the peripheral from. * @return The peripheral created by the upgrade on the specified side of the turtle, {@code null} if none exists. */ - public IPeripheral getPeripheral( TurtleSide side ); + @Nullable + IPeripheral getPeripheral( @Nonnull TurtleSide side ); /** * Get an upgrade-specific NBT compound, which can be used to store arbitrary data. @@ -257,7 +268,8 @@ public interface ITurtleAccess * @return The upgrade-specific data. * @see #updateUpgradeNBTData(TurtleSide) */ - public NBTTagCompound getUpgradeNBTData( TurtleSide side ); + @Nonnull + NBTTagCompound getUpgradeNBTData( @Nullable TurtleSide side ); /** * Mark the upgrade-specific data as dirty on a specific side. This is required for the data to be synced to the @@ -266,5 +278,5 @@ public interface ITurtleAccess * @param side The side to mark dirty. * @see #updateUpgradeNBTData(TurtleSide) */ - public void updateUpgradeNBTData( TurtleSide side ); + void updateUpgradeNBTData( @Nonnull TurtleSide side ); } diff --git a/src/main/java/dan200/computercraft/api/turtle/ITurtleCommand.java b/src/main/java/dan200/computercraft/api/turtle/ITurtleCommand.java index 1e7827827..e873900bb 100644 --- a/src/main/java/dan200/computercraft/api/turtle/ITurtleCommand.java +++ b/src/main/java/dan200/computercraft/api/turtle/ITurtleCommand.java @@ -8,6 +8,8 @@ package dan200.computercraft.api.turtle; import dan200.computercraft.api.lua.ILuaContext; +import javax.annotation.Nonnull; + /** * An interface for objects executing custom turtle commands, used with {@link ITurtleAccess#executeCommand(ILuaContext, ITurtleCommand)}. * @@ -28,5 +30,6 @@ public interface ITurtleCommand * @see TurtleCommandResult#failure(String) * @see TurtleCommandResult */ - public TurtleCommandResult execute( ITurtleAccess turtle ); + @Nonnull + TurtleCommandResult execute( @Nonnull ITurtleAccess turtle ); } diff --git a/src/main/java/dan200/computercraft/api/turtle/ITurtleUpgrade.java b/src/main/java/dan200/computercraft/api/turtle/ITurtleUpgrade.java index 8020235f0..b1b3fb5b9 100644 --- a/src/main/java/dan200/computercraft/api/turtle/ITurtleUpgrade.java +++ b/src/main/java/dan200/computercraft/api/turtle/ITurtleUpgrade.java @@ -17,6 +17,8 @@ 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.annotation.Nullable; import javax.vecmath.Matrix4f; @@ -36,7 +38,8 @@ public interface ITurtleUpgrade * @return The unique ID for this upgrade. * @see ComputerCraftAPI#registerTurtleUpgrade(ITurtleUpgrade) */ - public ResourceLocation getUpgradeID(); + @Nonnull + ResourceLocation getUpgradeID(); /** * Gets a numerical identifier representing this type of turtle upgrade, @@ -47,7 +50,7 @@ public interface ITurtleUpgrade * @return The legacy ID, or -1 if is needed. * @see ComputerCraftAPI#registerTurtleUpgrade(ITurtleUpgrade) */ - public int getLegacyUpgradeID(); + int getLegacyUpgradeID(); /** * Return an unlocalised string to describe this type of turtle in turtle item names. @@ -56,7 +59,8 @@ public interface ITurtleUpgrade * * @return The localisation key for this upgrade's adjective. */ - public String getUnlocalisedAdjective(); + @Nonnull + String getUnlocalisedAdjective(); /** * Return whether this turtle adds a tool or a peripheral to the turtle. @@ -64,7 +68,8 @@ public interface ITurtleUpgrade * @return The type of upgrade this is. * @see TurtleUpgradeType for the differences between them. */ - public TurtleUpgradeType getType(); + @Nonnull + TurtleUpgradeType getType(); /** * Return an item stack representing the type of item that a turtle must be crafted @@ -73,7 +78,8 @@ public interface ITurtleUpgrade * * @return The item stack to craft with, or {@code null} if it cannot be crafted. */ - public ItemStack getCraftingItem(); + @Nullable + ItemStack getCraftingItem(); /** * Will only be called for peripheral upgrades. Creates a peripheral for a turtle being placed using this upgrade. @@ -87,7 +93,8 @@ public interface ITurtleUpgrade * @return The newly created peripheral. You may return {@code null} if this upgrade is a Tool * and this method is not expected to be called. */ - public IPeripheral createPeripheral( ITurtleAccess turtle, TurtleSide side ); + @Nullable + IPeripheral createPeripheral( @Nonnull ITurtleAccess turtle, @Nonnull TurtleSide side ); /** * Will only be called for Tool turtle. Called when turtle.dig() or turtle.attack() is called @@ -104,7 +111,8 @@ public interface ITurtleUpgrade * a swinging animation. You may return {@code null} if this turtle is a Peripheral and this method is not expected * to be called. */ - public TurtleCommandResult useTool( ITurtleAccess turtle, TurtleSide side, TurtleVerb verb, EnumFacing direction ); + @Nonnull + TurtleCommandResult useTool( @Nonnull ITurtleAccess turtle, @Nonnull TurtleSide side, @Nonnull TurtleVerb verb, @Nonnull EnumFacing direction ); /** * Called to obtain the model to be used when rendering a turtle peripheral. @@ -119,7 +127,8 @@ public interface ITurtleUpgrade * a transformation of {@code null} has the same effect as the identify matrix. */ @SideOnly(Side.CLIENT) - public Pair getModel( ITurtleAccess turtle, TurtleSide side ); + @Nonnull + Pair getModel( @Nullable ITurtleAccess turtle, @Nonnull TurtleSide side ); /** * Called once per tick for each turtle which has the upgrade equipped. @@ -127,5 +136,5 @@ public interface ITurtleUpgrade * @param turtle Access to the turtle that the upgrade resides on. * @param side Which side of the turtle (left or right) the upgrade resides on. */ - public void update( ITurtleAccess turtle, TurtleSide side ); + void update( @Nonnull ITurtleAccess turtle, @Nonnull TurtleSide side ); } diff --git a/src/main/java/dan200/computercraft/api/turtle/TurtleCommandResult.java b/src/main/java/dan200/computercraft/api/turtle/TurtleCommandResult.java index c72dd9fab..e89d8b993 100644 --- a/src/main/java/dan200/computercraft/api/turtle/TurtleCommandResult.java +++ b/src/main/java/dan200/computercraft/api/turtle/TurtleCommandResult.java @@ -8,6 +8,9 @@ package dan200.computercraft.api.turtle; import net.minecraft.util.EnumFacing; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + /** * Used to indicate the result of executing a turtle command. * @@ -24,6 +27,7 @@ public final class TurtleCommandResult * * @return A successful command result with no values. */ + @Nonnull public static TurtleCommandResult success() { return success( null ); @@ -35,7 +39,8 @@ public final class TurtleCommandResult * @param results The results of executing this command. * @return A successful command result with the given values. */ - public static TurtleCommandResult success( Object[] results ) + @Nonnull + public static TurtleCommandResult success( @Nullable Object[] results ) { if( results == null || results.length == 0 ) { @@ -52,6 +57,7 @@ public final class TurtleCommandResult * * @return A failed command result with no message. */ + @Nonnull public static TurtleCommandResult failure() { return failure( null ); @@ -63,7 +69,8 @@ public final class TurtleCommandResult * @param errorMessage The error message to provide. * @return A failed command result with a message. */ - public static TurtleCommandResult failure( String errorMessage ) + @Nonnull + public static TurtleCommandResult failure( @Nullable String errorMessage ) { if( errorMessage == null ) { @@ -101,6 +108,7 @@ public final class TurtleCommandResult * * @return The command's error message, or {@code null} if it was a success. */ + @Nullable public String getErrorMessage() { return m_errorMessage; @@ -111,6 +119,7 @@ public final class TurtleCommandResult * * @return The command's result, or {@code null} if it was a failure. */ + @Nullable public Object[] getResults() { return m_results; diff --git a/src/main/java/dan200/computercraft/client/proxy/CCTurtleProxyClient.java b/src/main/java/dan200/computercraft/client/proxy/CCTurtleProxyClient.java index 9a1e686a0..921c9dbc3 100644 --- a/src/main/java/dan200/computercraft/client/proxy/CCTurtleProxyClient.java +++ b/src/main/java/dan200/computercraft/client/proxy/CCTurtleProxyClient.java @@ -38,6 +38,8 @@ import net.minecraftforge.fml.client.registry.ClientRegistry; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; +import javax.annotation.Nonnull; + public class CCTurtleProxyClient extends CCTurtleProxyCommon { public CCTurtleProxyClient() @@ -56,8 +58,9 @@ public class CCTurtleProxyClient extends CCTurtleProxyCommon { private ModelResourceLocation turtle_dynamic = new ModelResourceLocation( "computercraft:turtle_dynamic", "inventory" ); + @Nonnull @Override - public ModelResourceLocation getModelLocation( ItemStack stack ) + public ModelResourceLocation getModelLocation( @Nonnull ItemStack stack ) { return turtle_dynamic; } @@ -188,7 +191,7 @@ public class CCTurtleProxyClient extends CCTurtleProxyCommon private static class TurtleItemColour implements IItemColor { @Override - public int getColorFromItemstack( ItemStack stack, int tintIndex ) + public int getColorFromItemstack( @Nonnull ItemStack stack, int tintIndex ) { if( tintIndex == 0 ) { diff --git a/src/main/java/dan200/computercraft/client/proxy/ComputerCraftProxyClient.java b/src/main/java/dan200/computercraft/client/proxy/ComputerCraftProxyClient.java index 7dab83860..b53aa38dd 100644 --- a/src/main/java/dan200/computercraft/client/proxy/ComputerCraftProxyClient.java +++ b/src/main/java/dan200/computercraft/client/proxy/ComputerCraftProxyClient.java @@ -55,6 +55,7 @@ import net.minecraftforge.fml.common.gameevent.TickEvent; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import javax.annotation.Nonnull; import java.io.File; import java.util.ArrayList; import java.util.List; @@ -88,8 +89,9 @@ public class ComputerCraftProxyClient extends ComputerCraftProxyCommon private ModelResourceLocation computer = new ModelResourceLocation( "computercraft:CC-Computer", "inventory" ); private ModelResourceLocation advanced_computer = new ModelResourceLocation( "computercraft:advanced_computer", "inventory" ); + @Nonnull @Override - public ModelResourceLocation getModelLocation( ItemStack stack ) + public ModelResourceLocation getModelLocation( @Nonnull ItemStack stack ) { ItemComputer itemComputer = (ItemComputer) stack.getItem(); ComputerFamily family = itemComputer.getFamily( stack.getItemDamage() ); @@ -121,8 +123,9 @@ public class ComputerCraftProxyClient extends ComputerCraftProxyCommon private ModelResourceLocation advanced_pocket_computer_on = new ModelResourceLocation( "computercraft:advanced_pocket_computer_on", "inventory" ); private ModelResourceLocation advanced_pocket_computer_blinking = new ModelResourceLocation( "computercraft:advanced_pocket_computer_blinking", "inventory" ); + @Nonnull @Override - public ModelResourceLocation getModelLocation( ItemStack stack ) + public ModelResourceLocation getModelLocation( @Nonnull ItemStack stack ) { ItemPocketComputer itemPocketComputer = (ItemPocketComputer)stack.getItem(); switch( itemPocketComputer.getFamily( stack ) ) @@ -180,7 +183,7 @@ public class ComputerCraftProxyClient extends ComputerCraftProxyCommon mc.getItemColors().registerItemColorHandler( new IItemColor() { @Override - public int getColorFromItemstack( ItemStack stack, int layout ) + public int getColorFromItemstack( @Nonnull ItemStack stack, int layout ) { if( layout != 1 ) return 0xFFFFFF; @@ -219,8 +222,9 @@ public class ComputerCraftProxyClient extends ComputerCraftProxyCommon ModelBakery.registerItemVariants( item, new ResourceLocation( "computercraft", name ) ); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register( item, new ItemMeshDefinition() { + @Nonnull @Override - public ModelResourceLocation getModelLocation( ItemStack stack ) + public ModelResourceLocation getModelLocation( @Nonnull ItemStack stack ) { return res; } @@ -519,7 +523,7 @@ public class ComputerCraftProxyClient extends ComputerCraftProxyCommon } @Override - public int getColorFromItemstack(ItemStack stack, int layer) + public int getColorFromItemstack( @Nonnull ItemStack stack, int layer) { return layer == 0 ? 0xFFFFFF : disk.getColor(stack); } diff --git a/src/main/java/dan200/computercraft/client/render/TileEntityMonitorRenderer.java b/src/main/java/dan200/computercraft/client/render/TileEntityMonitorRenderer.java index 31ba8ef6f..34020aeb8 100644 --- a/src/main/java/dan200/computercraft/client/render/TileEntityMonitorRenderer.java +++ b/src/main/java/dan200/computercraft/client/render/TileEntityMonitorRenderer.java @@ -24,6 +24,8 @@ import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import org.lwjgl.opengl.GL11; +import javax.annotation.Nonnull; + public class TileEntityMonitorRenderer extends TileEntitySpecialRenderer { public TileEntityMonitorRenderer() @@ -31,7 +33,7 @@ public class TileEntityMonitorRenderer extends TileEntitySpecialRenderer getQuads( IBlockState state, EnumFacing side, long rand ) { @@ -107,18 +109,21 @@ public class TurtleMultiModel implements IBakedModel return m_baseModel.isBuiltInRenderer(); } + @Nonnull @Override public TextureAtlasSprite getParticleTexture() { return m_baseModel.getParticleTexture(); } + @Nonnull @Override public ItemCameraTransforms getItemCameraTransforms() { return m_baseModel.getItemCameraTransforms(); } + @Nonnull @Override public ItemOverrideList getOverrides() { diff --git a/src/main/java/dan200/computercraft/client/render/TurtleSmartItemModel.java b/src/main/java/dan200/computercraft/client/render/TurtleSmartItemModel.java index 1e5f247ff..8cd1a095e 100644 --- a/src/main/java/dan200/computercraft/client/render/TurtleSmartItemModel.java +++ b/src/main/java/dan200/computercraft/client/render/TurtleSmartItemModel.java @@ -30,6 +30,7 @@ import net.minecraftforge.client.model.IModel; import net.minecraftforge.client.model.ISmartVariant; import org.apache.commons.lang3.tuple.Pair; +import javax.annotation.Nonnull; import javax.vecmath.Matrix4f; import java.util.ArrayList; import java.util.HashMap; @@ -102,8 +103,9 @@ public class TurtleSmartItemModel implements IBakedModel, IResourceManagerReload m_cachedModels = new HashMap(); m_overrides = new ItemOverrideList( new ArrayList() ) { + @Nonnull @Override - public IBakedModel handleItemState(IBakedModel originalModel, ItemStack stack, World world, EntityLivingBase entity) + public IBakedModel handleItemState( @Nonnull IBakedModel originalModel, ItemStack stack, @Nonnull World world, @Nonnull EntityLivingBase entity) { ItemTurtleBase turtle = (ItemTurtleBase) stack.getItem(); ComputerFamily family = turtle.getFamily( stack ); @@ -127,6 +129,7 @@ public class TurtleSmartItemModel implements IBakedModel, IResourceManagerReload }; } + @Nonnull @Override public ItemOverrideList getOverrides() { @@ -134,7 +137,7 @@ public class TurtleSmartItemModel implements IBakedModel, IResourceManagerReload } @Override - public void onResourceManagerReload( IResourceManager resourceManager ) + public void onResourceManagerReload( @Nonnull IResourceManager resourceManager ) { m_cachedModels.clear(); } @@ -173,6 +176,7 @@ public class TurtleSmartItemModel implements IBakedModel, IResourceManagerReload // These should not be called: + @Nonnull @Override public List getQuads( IBlockState state, EnumFacing facing, long rand ) { @@ -197,12 +201,14 @@ public class TurtleSmartItemModel implements IBakedModel, IResourceManagerReload return getDefaultModel().isBuiltInRenderer(); } + @Nonnull @Override public TextureAtlasSprite getParticleTexture() { return getDefaultModel().getParticleTexture(); } + @Nonnull @Override public ItemCameraTransforms getItemCameraTransforms() { diff --git a/src/main/java/dan200/computercraft/core/apis/BitAPI.java b/src/main/java/dan200/computercraft/core/apis/BitAPI.java index b3a2cfdea..0aba24f0b 100644 --- a/src/main/java/dan200/computercraft/core/apis/BitAPI.java +++ b/src/main/java/dan200/computercraft/core/apis/BitAPI.java @@ -9,6 +9,8 @@ package dan200.computercraft.core.apis; import dan200.computercraft.api.lua.ILuaContext; import dan200.computercraft.api.lua.LuaException; +import javax.annotation.Nonnull; + // Contributed by Nia // Based on LuaBit (http://luaforge.net/projects/bit) @@ -68,6 +70,7 @@ public class BitAPI implements ILuaAPI { } + @Nonnull @Override public String[] getMethodNames() { return new String[] { @@ -77,7 +80,7 @@ public class BitAPI implements ILuaAPI } @Override - public Object[] callMethod( ILuaContext context, int method, Object[] args ) throws LuaException + public Object[] callMethod( @Nonnull ILuaContext context, int method, @Nonnull Object[] args ) throws LuaException { Object a = args.length>0?args[0]:null; Object b = args.length>1?args[1]:null; diff --git a/src/main/java/dan200/computercraft/core/apis/BufferAPI.java b/src/main/java/dan200/computercraft/core/apis/BufferAPI.java index 546f7037b..0fa8b2923 100644 --- a/src/main/java/dan200/computercraft/core/apis/BufferAPI.java +++ b/src/main/java/dan200/computercraft/core/apis/BufferAPI.java @@ -11,6 +11,8 @@ import dan200.computercraft.api.lua.ILuaObject; import dan200.computercraft.api.lua.LuaException; import dan200.computercraft.core.terminal.TextBuffer; +import javax.annotation.Nonnull; + public class BufferAPI implements ILuaAPI { private static class BufferLuaObject implements ILuaObject @@ -22,6 +24,7 @@ public class BufferAPI implements ILuaAPI m_buffer = buffer; } + @Nonnull @Override public String[] getMethodNames() { @@ -35,7 +38,7 @@ public class BufferAPI implements ILuaAPI } @Override - public Object[] callMethod( ILuaContext context, int method, Object[] arguments ) throws LuaException, InterruptedException + public Object[] callMethod( @Nonnull ILuaContext context, int method, @Nonnull Object[] arguments ) throws LuaException, InterruptedException { switch( method ) { @@ -165,6 +168,7 @@ public class BufferAPI implements ILuaAPI { } + @Nonnull @Override public String[] getMethodNames() { @@ -174,7 +178,7 @@ public class BufferAPI implements ILuaAPI } @Override - public Object[] callMethod( ILuaContext context, int method, Object[] arguments ) throws LuaException, InterruptedException + public Object[] callMethod( @Nonnull ILuaContext context, int method, @Nonnull Object[] arguments ) throws LuaException, InterruptedException { switch( method ) { diff --git a/src/main/java/dan200/computercraft/core/apis/FSAPI.java b/src/main/java/dan200/computercraft/core/apis/FSAPI.java index e244353a9..ca5a7eecb 100644 --- a/src/main/java/dan200/computercraft/core/apis/FSAPI.java +++ b/src/main/java/dan200/computercraft/core/apis/FSAPI.java @@ -14,6 +14,7 @@ import dan200.computercraft.core.filesystem.FileSystemException; import dan200.computercraft.core.filesystem.IMountedFileBinary; import dan200.computercraft.core.filesystem.IMountedFileNormal; +import javax.annotation.Nonnull; import java.io.IOException; import java.util.HashMap; import java.util.Map; @@ -54,6 +55,7 @@ public class FSAPI implements ILuaAPI m_fileSystem = null; } + @Nonnull @Override public String[] getMethodNames() { @@ -78,7 +80,7 @@ public class FSAPI implements ILuaAPI } @Override - public Object[] callMethod( ILuaContext context, int method, Object[] args ) throws LuaException + public Object[] callMethod( @Nonnull ILuaContext context, int method, @Nonnull Object[] args ) throws LuaException { switch( method ) { @@ -370,6 +372,7 @@ public class FSAPI implements ILuaAPI private static Object[] wrapBufferedReader( final IMountedFileNormal reader ) { return new Object[] { new ILuaObject() { + @Nonnull @Override public String[] getMethodNames() { @@ -381,7 +384,7 @@ public class FSAPI implements ILuaAPI } @Override - public Object[] callMethod( ILuaContext context, int method, Object[] args ) throws LuaException + public Object[] callMethod( @Nonnull ILuaContext context, int method, @Nonnull Object[] args ) throws LuaException { switch( method ) { @@ -439,6 +442,7 @@ public class FSAPI implements ILuaAPI private static Object[] wrapBufferedWriter( final IMountedFileNormal writer ) { return new Object[] { new ILuaObject() { + @Nonnull @Override public String[] getMethodNames() { @@ -451,7 +455,7 @@ public class FSAPI implements ILuaAPI } @Override - public Object[] callMethod( ILuaContext context, int method, Object[] args ) throws LuaException + public Object[] callMethod( @Nonnull ILuaContext context, int method, @Nonnull Object[] args ) throws LuaException { switch( method ) { @@ -521,6 +525,7 @@ public class FSAPI implements ILuaAPI return new Object[] { new ILuaObject() { + @Nonnull @Override public String[] getMethodNames() { return new String[] { @@ -530,7 +535,7 @@ public class FSAPI implements ILuaAPI } @Override - public Object[] callMethod( ILuaContext context, int method, Object[] args) throws LuaException { + public Object[] callMethod( @Nonnull ILuaContext context, int method, @Nonnull Object[] args) throws LuaException { switch( method ) { case 0: @@ -572,6 +577,7 @@ public class FSAPI implements ILuaAPI return new Object[] { new ILuaObject() { + @Nonnull @Override public String[] getMethodNames() { return new String[] { @@ -582,7 +588,7 @@ public class FSAPI implements ILuaAPI } @Override - public Object[] callMethod( ILuaContext context, int method, Object[] args) throws LuaException { + public Object[] callMethod( @Nonnull ILuaContext context, int method, @Nonnull Object[] args) throws LuaException { switch( method ) { case 0: diff --git a/src/main/java/dan200/computercraft/core/apis/HTTPAPI.java b/src/main/java/dan200/computercraft/core/apis/HTTPAPI.java index fd9b5de26..941d833ae 100644 --- a/src/main/java/dan200/computercraft/core/apis/HTTPAPI.java +++ b/src/main/java/dan200/computercraft/core/apis/HTTPAPI.java @@ -10,6 +10,7 @@ import dan200.computercraft.api.lua.ILuaContext; import dan200.computercraft.api.lua.ILuaObject; import dan200.computercraft.api.lua.LuaException; +import javax.annotation.Nonnull; import java.io.BufferedReader; import java.io.IOException; import java.util.*; @@ -72,6 +73,7 @@ public class HTTPAPI implements ILuaAPI private static ILuaObject wrapBufferedReader( final BufferedReader reader, final int responseCode, final Map responseHeaders ) { return new ILuaObject() { + @Nonnull @Override public String[] getMethodNames() { @@ -85,7 +87,7 @@ public class HTTPAPI implements ILuaAPI } @Override - public Object[] callMethod( ILuaContext context, int method, Object[] args ) throws LuaException + public Object[] callMethod( @Nonnull ILuaContext context, int method, @Nonnull Object[] args ) throws LuaException { switch( method ) { @@ -164,6 +166,7 @@ public class HTTPAPI implements ILuaAPI } } + @Nonnull @Override public String[] getMethodNames() { @@ -174,7 +177,7 @@ public class HTTPAPI implements ILuaAPI } @Override - public Object[] callMethod( ILuaContext context, int method, Object[] args ) throws LuaException + public Object[] callMethod( @Nonnull ILuaContext context, int method, @Nonnull Object[] args ) throws LuaException { switch( method ) { diff --git a/src/main/java/dan200/computercraft/core/apis/OSAPI.java b/src/main/java/dan200/computercraft/core/apis/OSAPI.java index 1e17d44f1..c83318f8e 100644 --- a/src/main/java/dan200/computercraft/core/apis/OSAPI.java +++ b/src/main/java/dan200/computercraft/core/apis/OSAPI.java @@ -10,6 +10,7 @@ import dan200.computercraft.api.lua.ILuaContext; import dan200.computercraft.api.lua.LuaException; import dan200.computercraft.shared.util.StringUtil; +import javax.annotation.Nonnull; import java.util.*; public class OSAPI implements ILuaAPI @@ -47,7 +48,7 @@ public class OSAPI implements ILuaAPI } @Override - public int compareTo( Alarm o ) + public int compareTo( @Nonnull Alarm o ) { double t = (double)m_day * 24.0 + m_time; double ot = (double)m_day * 24.0 + m_time; @@ -166,6 +167,7 @@ public class OSAPI implements ILuaAPI } } + @Nonnull @Override public String[] getMethodNames() { @@ -216,7 +218,7 @@ public class OSAPI implements ILuaAPI } @Override - public Object[] callMethod( ILuaContext context, int method, Object[] args ) throws LuaException + public Object[] callMethod( @Nonnull ILuaContext context, int method, @Nonnull Object[] args ) throws LuaException { switch( method ) { diff --git a/src/main/java/dan200/computercraft/core/apis/PeripheralAPI.java b/src/main/java/dan200/computercraft/core/apis/PeripheralAPI.java index 8f5f64586..e3a249bb4 100644 --- a/src/main/java/dan200/computercraft/core/apis/PeripheralAPI.java +++ b/src/main/java/dan200/computercraft/core/apis/PeripheralAPI.java @@ -18,6 +18,7 @@ import dan200.computercraft.core.computer.ITask; import dan200.computercraft.core.filesystem.FileSystem; import dan200.computercraft.core.filesystem.FileSystemException; +import javax.annotation.Nonnull; import java.util.*; public class PeripheralAPI implements ILuaAPI, IAPIEnvironment.IPeripheralChangeListener @@ -118,13 +119,13 @@ public class PeripheralAPI implements ILuaAPI, IAPIEnvironment.IPeripheralChange // IComputerAccess implementation @Override - public String mount( String desiredLoc, IMount mount ) + public String mount( @Nonnull String desiredLoc, @Nonnull IMount mount ) { return mount( desiredLoc, mount, m_side ); } @Override - public synchronized String mount( String desiredLoc, IMount mount, String driveName ) + public synchronized String mount( @Nonnull String desiredLoc, @Nonnull IMount mount, @Nonnull String driveName ) { if( !m_attached ) { @@ -153,13 +154,13 @@ public class PeripheralAPI implements ILuaAPI, IAPIEnvironment.IPeripheralChange } @Override - public String mountWritable( String desiredLoc, IWritableMount mount ) + public String mountWritable( @Nonnull String desiredLoc, @Nonnull IWritableMount mount ) { return mountWritable( desiredLoc, mount, m_side ); } @Override - public synchronized String mountWritable( String desiredLoc, IWritableMount mount, String driveName ) + public synchronized String mountWritable( @Nonnull String desiredLoc, @Nonnull IWritableMount mount, @Nonnull String driveName ) { if( !m_attached ) { @@ -215,7 +216,7 @@ public class PeripheralAPI implements ILuaAPI, IAPIEnvironment.IPeripheralChange } @Override - public synchronized void queueEvent( final String event, final Object[] arguments ) + public synchronized void queueEvent( @Nonnull final String event, final Object[] arguments ) { if( !m_attached ) { throw new RuntimeException( "You are not attached to this Computer" ); @@ -223,6 +224,7 @@ public class PeripheralAPI implements ILuaAPI, IAPIEnvironment.IPeripheralChange m_environment.queueEvent( event, arguments ); } + @Nonnull @Override public synchronized String getAttachmentName() { @@ -372,6 +374,7 @@ public class PeripheralAPI implements ILuaAPI, IAPIEnvironment.IPeripheralChange } } + @Nonnull @Override public String[] getMethodNames() { @@ -384,7 +387,7 @@ public class PeripheralAPI implements ILuaAPI, IAPIEnvironment.IPeripheralChange } @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 ) { diff --git a/src/main/java/dan200/computercraft/core/apis/RedstoneAPI.java b/src/main/java/dan200/computercraft/core/apis/RedstoneAPI.java index 25f79f729..8a99c39b8 100644 --- a/src/main/java/dan200/computercraft/core/apis/RedstoneAPI.java +++ b/src/main/java/dan200/computercraft/core/apis/RedstoneAPI.java @@ -10,6 +10,7 @@ import dan200.computercraft.api.lua.ILuaContext; import dan200.computercraft.api.lua.LuaException; import dan200.computercraft.core.computer.Computer; +import javax.annotation.Nonnull; import java.util.HashMap; import java.util.Map; @@ -45,6 +46,7 @@ public class RedstoneAPI implements ILuaAPI { } + @Nonnull @Override public String[] getMethodNames() { @@ -67,7 +69,7 @@ public class RedstoneAPI implements ILuaAPI } @Override - public Object[] callMethod( ILuaContext context, int method, Object[] args ) throws LuaException + public Object[] callMethod( @Nonnull ILuaContext context, int method, @Nonnull Object[] args ) throws LuaException { switch( method ) { diff --git a/src/main/java/dan200/computercraft/core/apis/TermAPI.java b/src/main/java/dan200/computercraft/core/apis/TermAPI.java index 453f77dc5..91a4e7044 100644 --- a/src/main/java/dan200/computercraft/core/apis/TermAPI.java +++ b/src/main/java/dan200/computercraft/core/apis/TermAPI.java @@ -11,6 +11,8 @@ import dan200.computercraft.api.lua.LuaException; import dan200.computercraft.core.computer.IComputerEnvironment; import dan200.computercraft.core.terminal.Terminal; +import javax.annotation.Nonnull; + public class TermAPI implements ILuaAPI { private Terminal m_terminal; @@ -45,6 +47,7 @@ public class TermAPI implements ILuaAPI { } + @Nonnull @Override public String[] getMethodNames() { @@ -102,7 +105,7 @@ public class TermAPI implements ILuaAPI } @Override - public Object[] callMethod( ILuaContext context, int method, Object[] args ) throws LuaException + public Object[] callMethod( @Nonnull ILuaContext context, int method, @Nonnull Object[] args ) throws LuaException { switch( method ) { diff --git a/src/main/java/dan200/computercraft/core/filesystem/ComboMount.java b/src/main/java/dan200/computercraft/core/filesystem/ComboMount.java index b02494f22..32260baff 100644 --- a/src/main/java/dan200/computercraft/core/filesystem/ComboMount.java +++ b/src/main/java/dan200/computercraft/core/filesystem/ComboMount.java @@ -8,6 +8,7 @@ package dan200.computercraft.core.filesystem; import dan200.computercraft.api.filesystem.IMount; +import javax.annotation.Nonnull; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; @@ -27,7 +28,7 @@ public class ComboMount implements IMount // IMount implementation @Override - public boolean exists( String path ) throws IOException + public boolean exists( @Nonnull String path ) throws IOException { for( int i=m_parts.length-1; i>=0; --i ) { @@ -41,7 +42,7 @@ public class ComboMount implements IMount } @Override - public boolean isDirectory( String path ) throws IOException + public boolean isDirectory( @Nonnull String path ) throws IOException { for( int i=m_parts.length-1; i>=0; --i ) { @@ -55,7 +56,7 @@ public class ComboMount implements IMount } @Override - public void list( String path, List contents ) throws IOException + public void list( @Nonnull String path, @Nonnull List contents ) throws IOException { // Combine the lists from all the mounts List foundFiles = null; @@ -99,7 +100,7 @@ public class ComboMount implements IMount } @Override - public long getSize( String path ) throws IOException + public long getSize( @Nonnull String path ) throws IOException { for( int i=m_parts.length-1; i>=0; --i ) { @@ -112,8 +113,9 @@ public class ComboMount implements IMount throw new IOException( "No such file" ); } + @Nonnull @Override - public InputStream openForRead( String path ) throws IOException + public InputStream openForRead( @Nonnull String path ) throws IOException { for( int i=m_parts.length-1; i>=0; --i ) { diff --git a/src/main/java/dan200/computercraft/core/filesystem/EmptyMount.java b/src/main/java/dan200/computercraft/core/filesystem/EmptyMount.java index 4239762b5..bd788e26a 100644 --- a/src/main/java/dan200/computercraft/core/filesystem/EmptyMount.java +++ b/src/main/java/dan200/computercraft/core/filesystem/EmptyMount.java @@ -8,6 +8,7 @@ package dan200.computercraft.core.filesystem; import dan200.computercraft.api.filesystem.IMount; +import javax.annotation.Nonnull; import java.io.IOException; import java.io.InputStream; import java.util.List; @@ -21,30 +22,31 @@ public class EmptyMount implements IMount // IMount implementation @Override - public boolean exists( String path ) throws IOException + public boolean exists( @Nonnull String path ) throws IOException { return path.isEmpty(); } @Override - public boolean isDirectory( String path ) throws IOException + public boolean isDirectory( @Nonnull String path ) throws IOException { return path.isEmpty(); } @Override - public void list( String path, List contents ) throws IOException + public void list( @Nonnull String path, @Nonnull List contents ) throws IOException { } @Override - public long getSize( String path ) throws IOException + public long getSize( @Nonnull String path ) throws IOException { return 0; } + @Nonnull @Override - public InputStream openForRead( String path ) throws IOException + public InputStream openForRead( @Nonnull String path ) throws IOException { return null; } diff --git a/src/main/java/dan200/computercraft/core/filesystem/FileMount.java b/src/main/java/dan200/computercraft/core/filesystem/FileMount.java index 704702c03..f6a6d69be 100644 --- a/src/main/java/dan200/computercraft/core/filesystem/FileMount.java +++ b/src/main/java/dan200/computercraft/core/filesystem/FileMount.java @@ -8,6 +8,7 @@ package dan200.computercraft.core.filesystem; import dan200.computercraft.api.filesystem.IWritableMount; +import javax.annotation.Nonnull; import java.io.*; import java.util.List; @@ -39,14 +40,14 @@ public class FileMount implements IWritableMount } @Override - public void write( byte[] b ) throws IOException + public void write( @Nonnull byte[] b ) throws IOException { count( b.length ); m_innerStream.write( b ); } @Override - public void write( byte[] b, int off, int len ) throws IOException + public void write( @Nonnull byte[] b, int off, int len ) throws IOException { count( len ); m_innerStream.write( b, off, len ); @@ -94,7 +95,7 @@ public class FileMount implements IWritableMount // IMount implementation @Override - public boolean exists( String path ) throws IOException + public boolean exists( @Nonnull String path ) throws IOException { if( !created() ) { @@ -108,7 +109,7 @@ public class FileMount implements IWritableMount } @Override - public boolean isDirectory( String path ) throws IOException + public boolean isDirectory( @Nonnull String path ) throws IOException { if( !created() ) { @@ -122,7 +123,7 @@ public class FileMount implements IWritableMount } @Override - public void list( String path, List contents ) throws IOException + public void list( @Nonnull String path, @Nonnull List contents ) throws IOException { if( !created() ) { @@ -153,7 +154,7 @@ public class FileMount implements IWritableMount } @Override - public long getSize( String path ) throws IOException + public long getSize( @Nonnull String path ) throws IOException { if( !created() ) { @@ -180,8 +181,9 @@ public class FileMount implements IWritableMount throw new IOException( "No such file" ); } + @Nonnull @Override - public InputStream openForRead( String path ) throws IOException + public InputStream openForRead( @Nonnull String path ) throws IOException { if( created() ) { @@ -197,7 +199,7 @@ public class FileMount implements IWritableMount // IWritableMount implementation @Override - public void makeDirectory( String path ) throws IOException + public void makeDirectory( @Nonnull String path ) throws IOException { create(); File file = getRealPath( path ); @@ -236,7 +238,7 @@ public class FileMount implements IWritableMount } @Override - public void delete( String path ) throws IOException + public void delete( @Nonnull String path ) throws IOException { if( path.length() == 0 ) { @@ -278,8 +280,9 @@ public class FileMount implements IWritableMount } } + @Nonnull @Override - public OutputStream openForWrite( String path ) throws IOException + public OutputStream openForWrite( @Nonnull String path ) throws IOException { create(); File file = getRealPath( path ); @@ -309,8 +312,9 @@ public class FileMount implements IWritableMount } } + @Nonnull @Override - public OutputStream openForAppend( String path ) throws IOException + public OutputStream openForAppend( @Nonnull String path ) throws IOException { if( created() ) { diff --git a/src/main/java/dan200/computercraft/core/filesystem/JarMount.java b/src/main/java/dan200/computercraft/core/filesystem/JarMount.java index c82085a63..41c6b7bfa 100644 --- a/src/main/java/dan200/computercraft/core/filesystem/JarMount.java +++ b/src/main/java/dan200/computercraft/core/filesystem/JarMount.java @@ -8,6 +8,7 @@ package dan200.computercraft.core.filesystem; import dan200.computercraft.api.filesystem.IMount; +import javax.annotation.Nonnull; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; @@ -178,14 +179,14 @@ public class JarMount implements IMount // IMount implementation @Override - public boolean exists( String path ) throws IOException + public boolean exists( @Nonnull String path ) throws IOException { FileInZip file = m_root.getFile( path ); return file != null; } @Override - public boolean isDirectory( String path ) throws IOException + public boolean isDirectory( @Nonnull String path ) throws IOException { FileInZip file = m_root.getFile( path ); if( file != null ) @@ -196,7 +197,7 @@ public class JarMount implements IMount } @Override - public void list( String path, List contents ) throws IOException + public void list( @Nonnull String path, @Nonnull List contents ) throws IOException { FileInZip file = m_root.getFile( path ); if( file != null && file.isDirectory() ) @@ -210,7 +211,7 @@ public class JarMount implements IMount } @Override - public long getSize( String path ) throws IOException + public long getSize( @Nonnull String path ) throws IOException { FileInZip file = m_root.getFile( path ); if( file != null ) @@ -220,8 +221,9 @@ public class JarMount implements IMount throw new IOException( "No such file" ); } + @Nonnull @Override - public InputStream openForRead( String path ) throws IOException + public InputStream openForRead( @Nonnull String path ) throws IOException { FileInZip file = m_root.getFile( path ); if( file != null && !file.isDirectory() ) diff --git a/src/main/java/dan200/computercraft/core/filesystem/SubMount.java b/src/main/java/dan200/computercraft/core/filesystem/SubMount.java index fecdbd7dd..f62405fdf 100644 --- a/src/main/java/dan200/computercraft/core/filesystem/SubMount.java +++ b/src/main/java/dan200/computercraft/core/filesystem/SubMount.java @@ -8,6 +8,7 @@ package dan200.computercraft.core.filesystem; import dan200.computercraft.api.filesystem.IMount; +import javax.annotation.Nonnull; import java.io.IOException; import java.io.InputStream; import java.util.List; @@ -26,31 +27,32 @@ public class SubMount implements IMount // IMount implementation @Override - public boolean exists( String path ) throws IOException + public boolean exists( @Nonnull String path ) throws IOException { return m_parent.exists( getFullPath( path ) ); } @Override - public boolean isDirectory( String path ) throws IOException + public boolean isDirectory( @Nonnull String path ) throws IOException { return m_parent.isDirectory( getFullPath( path ) ); } @Override - public void list( String path, List contents ) throws IOException + public void list( @Nonnull String path, @Nonnull List contents ) throws IOException { m_parent.list( getFullPath( path ), contents ); } @Override - public long getSize( String path ) throws IOException + public long getSize( @Nonnull String path ) throws IOException { return m_parent.getSize( getFullPath( path ) ); } + @Nonnull @Override - public InputStream openForRead( String path ) throws IOException + public InputStream openForRead( @Nonnull String path ) throws IOException { return m_parent.openForRead( getFullPath( path ) ); } diff --git a/src/main/java/dan200/computercraft/core/lua/LuaJLuaMachine.java b/src/main/java/dan200/computercraft/core/lua/LuaJLuaMachine.java index 16cefb4b8..ec7fcb62c 100644 --- a/src/main/java/dan200/computercraft/core/lua/LuaJLuaMachine.java +++ b/src/main/java/dan200/computercraft/core/lua/LuaJLuaMachine.java @@ -21,6 +21,7 @@ import org.luaj.vm2.lib.VarArgFunction; import org.luaj.vm2.lib.ZeroArgFunction; import org.luaj.vm2.lib.jse.JsePlatform; +import javax.annotation.Nonnull; import java.io.*; import java.util.HashMap; import java.util.IdentityHashMap; @@ -339,6 +340,7 @@ public class LuaJLuaMachine implements ILuaMachine try { results = apiObject.callMethod( new ILuaContext() { + @Nonnull @Override public Object[] pullEvent( String filter ) throws LuaException, InterruptedException { @@ -350,12 +352,14 @@ public class LuaJLuaMachine implements ILuaMachine return results; } + @Nonnull @Override public Object[] pullEventRaw( String filter ) throws InterruptedException { return yield( new Object[] { filter } ); } + @Nonnull @Override public Object[] yield( Object[] yieldArgs ) throws InterruptedException { @@ -372,7 +376,7 @@ public class LuaJLuaMachine implements ILuaMachine } @Override - public long issueMainThreadTask( final ILuaTask task ) throws LuaException + public long issueMainThreadTask( @Nonnull final ILuaTask task ) throws LuaException { // Issue command final long taskID = MainThread.getUniqueTaskID(); @@ -431,7 +435,7 @@ public class LuaJLuaMachine implements ILuaMachine } @Override - public Object[] executeMainThreadTask( final ILuaTask task ) throws LuaException, InterruptedException + public Object[] executeMainThreadTask( @Nonnull final ILuaTask task ) throws LuaException, InterruptedException { // Issue task final long taskID = issueMainThreadTask( task ); diff --git a/src/main/java/dan200/computercraft/shared/common/BlockGeneric.java b/src/main/java/dan200/computercraft/shared/common/BlockGeneric.java index 8c024785c..f15b07e47 100644 --- a/src/main/java/dan200/computercraft/shared/common/BlockGeneric.java +++ b/src/main/java/dan200/computercraft/shared/common/BlockGeneric.java @@ -25,6 +25,7 @@ import net.minecraft.world.Explosion; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -43,12 +44,13 @@ public abstract class BlockGeneric extends Block implements protected abstract TileGeneric createTile( int damage ); @Override - public final void dropBlockAsItemWithChance( World world, BlockPos pos, IBlockState state, float chance, int fortune ) + public final void dropBlockAsItemWithChance( World world, @Nonnull BlockPos pos, @Nonnull IBlockState state, float chance, int fortune ) { } + @Nonnull @Override - public final List getDrops( IBlockAccess world, BlockPos pos, IBlockState state, int fortune ) + public final List getDrops( IBlockAccess world, BlockPos pos, @Nonnull IBlockState state, int fortune ) { ArrayList drops = new ArrayList( 1 ); TileEntity tile = world.getTileEntity( pos ); @@ -60,6 +62,7 @@ public abstract class BlockGeneric extends Block implements return drops; } + @Nonnull @Override public final IBlockState onBlockPlaced( World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, int damage, EntityLivingBase placer ) { @@ -67,7 +70,7 @@ public abstract class BlockGeneric extends Block implements } @Override - public final boolean removedByPlayer( IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest ) + public final boolean removedByPlayer( @Nonnull IBlockState state, World world, @Nonnull BlockPos pos, @Nonnull EntityPlayer player, boolean willHarvest ) { if( !world.isRemote ) { @@ -109,7 +112,7 @@ public abstract class BlockGeneric extends Block implements } @Override - public final void breakBlock( World world, BlockPos pos, IBlockState newState ) + public final void breakBlock( @Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState newState ) { TileEntity tile = world.getTileEntity( pos ); if( tile != null && tile instanceof TileGeneric ) @@ -121,8 +124,9 @@ public abstract class BlockGeneric extends Block implements world.removeTileEntity( pos ); } + @Nonnull @Override - public final ItemStack getPickBlock( IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player ) + public final ItemStack getPickBlock( @Nonnull IBlockState state, RayTraceResult target, @Nonnull World world, @Nonnull BlockPos pos, EntityPlayer player ) { TileEntity tile = world.getTileEntity( pos ); if( tile != null && tile instanceof TileGeneric ) @@ -134,7 +138,7 @@ public abstract class BlockGeneric extends Block implements } @Override - protected final ItemStack createStackedBlock( IBlockState state ) + protected final ItemStack createStackedBlock( @Nonnull IBlockState state ) { return null; } @@ -174,7 +178,7 @@ public abstract class BlockGeneric extends Block implements } @Override - public final boolean isSideSolid( IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side ) + public final boolean isSideSolid( IBlockState state, @Nonnull IBlockAccess world, @Nonnull BlockPos pos, EnumFacing side ) { TileEntity tile = world.getTileEntity( pos ); if( tile != null && tile instanceof TileGeneric ) @@ -192,7 +196,7 @@ public abstract class BlockGeneric extends Block implements } @Override - public float getExplosionResistance( World world, BlockPos pos, Entity exploder, Explosion explosion ) + public float getExplosionResistance( World world, BlockPos pos, @Nonnull Entity exploder, Explosion explosion ) { TileEntity tile = world.getTileEntity( pos ); if( tile != null && tile instanceof TileGeneric && tile.hasWorldObj() ) @@ -206,6 +210,7 @@ public abstract class BlockGeneric extends Block implements return super.getExplosionResistance( exploder ); } + @Nonnull @Override public final AxisAlignedBB getBoundingBox( IBlockState state, IBlockAccess world, BlockPos pos ) { @@ -218,14 +223,15 @@ public abstract class BlockGeneric extends Block implements return FULL_BLOCK_AABB; } + @Nonnull @Override - public AxisAlignedBB getSelectedBoundingBox( IBlockState state, World worldIn, BlockPos pos ) + public final AxisAlignedBB getSelectedBoundingBox( IBlockState state, @Nonnull World world, @Nonnull BlockPos pos ) { - return getBoundingBox( state, worldIn, pos ).offset( pos ); + return getBoundingBox( state, world, pos ).offset( pos ); } @Override - public final AxisAlignedBB getCollisionBoundingBox( IBlockState state, World world, BlockPos pos ) + public final AxisAlignedBB getCollisionBoundingBox( IBlockState state, @Nonnull World world, @Nonnull BlockPos pos ) { TileEntity tile = world.getTileEntity( pos ); if( tile != null && tile instanceof TileGeneric && tile.hasWorldObj() ) @@ -252,7 +258,7 @@ public abstract class BlockGeneric extends Block implements } @Override - public final void addCollisionBoxToList( IBlockState state, World world, BlockPos pos, AxisAlignedBB bigBox, List list, Entity entity ) + public final void addCollisionBoxToList( IBlockState state, @Nonnull World world, @Nonnull BlockPos pos, @Nonnull AxisAlignedBB bigBox, @Nonnull List list, Entity entity ) { TileEntity tile = world.getTileEntity( pos ); if( tile != null && tile instanceof TileGeneric && tile.hasWorldObj() ) @@ -349,14 +355,16 @@ public abstract class BlockGeneric extends Block implements return true; } + @Nonnull @Override - public final TileEntity createTileEntity( World world, IBlockState state ) + public final TileEntity createTileEntity( @Nonnull World world, @Nonnull IBlockState state ) { return createTile( state ); } + @Nonnull @Override - public final TileEntity createNewTileEntity( World world, int damage ) + public final TileEntity createNewTileEntity( @Nonnull World world, int damage ) { return createTile( damage ); } diff --git a/src/main/java/dan200/computercraft/shared/common/DefaultBundledRedstoneProvider.java b/src/main/java/dan200/computercraft/shared/common/DefaultBundledRedstoneProvider.java index dc4db1091..df18aa3bf 100644 --- a/src/main/java/dan200/computercraft/shared/common/DefaultBundledRedstoneProvider.java +++ b/src/main/java/dan200/computercraft/shared/common/DefaultBundledRedstoneProvider.java @@ -12,6 +12,8 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; +import javax.annotation.Nonnull; + public class DefaultBundledRedstoneProvider implements IBundledRedstoneProvider { public DefaultBundledRedstoneProvider() @@ -19,7 +21,7 @@ public class DefaultBundledRedstoneProvider implements IBundledRedstoneProvider } @Override - public int getBundledRedstoneOutput( World world, BlockPos pos, EnumFacing side ) + public int getBundledRedstoneOutput( @Nonnull World world, @Nonnull BlockPos pos, @Nonnull EnumFacing side ) { return getDefaultBundledRedstoneOutput( world, pos, side ); } diff --git a/src/main/java/dan200/computercraft/shared/common/TileGeneric.java b/src/main/java/dan200/computercraft/shared/common/TileGeneric.java index a8709b73a..7934b1ff2 100644 --- a/src/main/java/dan200/computercraft/shared/common/TileGeneric.java +++ b/src/main/java/dan200/computercraft/shared/common/TileGeneric.java @@ -23,6 +23,8 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; import java.util.List; public abstract class TileGeneric extends TileEntity @@ -48,6 +50,7 @@ public abstract class TileGeneric extends TileEntity { } + @Nullable public BlockGeneric getBlock() { Block block = worldObj.getBlockState( getPos() ).getBlock(); @@ -77,7 +80,7 @@ public abstract class TileGeneric extends TileEntity worldObj.setBlockState( getPos(), newState, 3 ); } - public void getDroppedItems( List drops, boolean creative ) + public void getDroppedItems( @Nonnull List drops, boolean creative ) { } @@ -95,7 +98,7 @@ public abstract class TileGeneric extends TileEntity { } - public void onNeighbourTileEntityChange( BlockPos neighbour ) + public void onNeighbourTileEntityChange( @Nonnull BlockPos neighbour ) { } @@ -109,12 +112,13 @@ public abstract class TileGeneric extends TileEntity return false; } + @Nonnull public AxisAlignedBB getBounds() { return new AxisAlignedBB( 0.0, 0.0, 0.0, 1.0, 1.0, 1.0 ); } - public void getCollisionBounds( List bounds ) + public void getCollisionBounds( @Nonnull List bounds ) { bounds.add( getBounds() ); } @@ -129,12 +133,12 @@ public abstract class TileGeneric extends TileEntity return 0; } - public boolean getBundledRedstoneConnectivity( EnumFacing side ) + public boolean getBundledRedstoneConnectivity( @Nonnull EnumFacing side ) { return false; } - public int getBundledRedstoneOutput( EnumFacing side ) + public int getBundledRedstoneOutput( @Nonnull EnumFacing side ) { return 0; } @@ -163,11 +167,11 @@ public abstract class TileGeneric extends TileEntity return false; } - protected void writeDescription( NBTTagCompound nbttagcompound ) + protected void writeDescription( @Nonnull NBTTagCompound nbttagcompound ) { } - protected void readDescription( NBTTagCompound nbttagcompound ) + protected void readDescription( @Nonnull NBTTagCompound nbttagcompound ) { } @@ -186,7 +190,7 @@ public abstract class TileGeneric extends TileEntity } @Override - public boolean shouldRefresh( World world, BlockPos pos, IBlockState oldState, IBlockState newState ) + public boolean shouldRefresh( World world, BlockPos pos, @Nonnull IBlockState oldState, @Nonnull IBlockState newState ) { return newState.getBlock() != oldState.getBlock(); } @@ -215,6 +219,7 @@ public abstract class TileGeneric extends TileEntity } } + @Nonnull @Override public NBTTagCompound getUpdateTag () { @@ -224,7 +229,7 @@ public abstract class TileGeneric extends TileEntity } @Override - public void handleUpdateTag (NBTTagCompound tag) + public void handleUpdateTag ( @Nonnull NBTTagCompound tag) { super.handleUpdateTag(tag); readDescription( tag ); diff --git a/src/main/java/dan200/computercraft/shared/computer/apis/CommandAPI.java b/src/main/java/dan200/computercraft/shared/computer/apis/CommandAPI.java index 189855231..8db9894e3 100644 --- a/src/main/java/dan200/computercraft/shared/computer/apis/CommandAPI.java +++ b/src/main/java/dan200/computercraft/shared/computer/apis/CommandAPI.java @@ -24,6 +24,7 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; +import javax.annotation.Nonnull; import java.util.HashMap; import java.util.Map; @@ -61,6 +62,7 @@ public class CommandAPI implements ILuaAPI { } + @Nonnull @Override public String[] getMethodNames() { @@ -139,7 +141,7 @@ public class CommandAPI implements ILuaAPI } @Override - public Object[] callMethod( ILuaContext context, int method, Object[] arguments ) throws LuaException, InterruptedException + public Object[] callMethod( @Nonnull ILuaContext context, int method, @Nonnull Object[] arguments ) throws LuaException, InterruptedException { switch( method ) { diff --git a/src/main/java/dan200/computercraft/shared/computer/blocks/BlockCommandComputer.java b/src/main/java/dan200/computercraft/shared/computer/blocks/BlockCommandComputer.java index f5db1af1f..f1f92210a 100644 --- a/src/main/java/dan200/computercraft/shared/computer/blocks/BlockCommandComputer.java +++ b/src/main/java/dan200/computercraft/shared/computer/blocks/BlockCommandComputer.java @@ -25,6 +25,8 @@ import net.minecraft.util.EnumFacing; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import javax.annotation.Nonnull; + public class BlockCommandComputer extends BlockComputerBase { // Statics @@ -50,6 +52,7 @@ public class BlockCommandComputer extends BlockComputerBase ); } + @Nonnull @Override protected BlockStateContainer createBlockState() { @@ -59,6 +62,7 @@ public class BlockCommandComputer extends BlockComputerBase }); } + @Nonnull @Override public IBlockState getStateFromMeta( int meta ) { @@ -76,8 +80,9 @@ public class BlockCommandComputer extends BlockComputerBase return ((EnumFacing)state.getValue( Properties.FACING )).getIndex(); } + @Nonnull @Override - public IBlockState getActualState( IBlockState state, IBlockAccess world, BlockPos pos ) + public IBlockState getActualState( @Nonnull IBlockState state, IBlockAccess world, BlockPos pos ) { TileEntity tile = world.getTileEntity( pos ); if( tile != null && tile instanceof IComputerTile ) diff --git a/src/main/java/dan200/computercraft/shared/computer/blocks/BlockComputer.java b/src/main/java/dan200/computercraft/shared/computer/blocks/BlockComputer.java index 6beb393ec..203e662ec 100644 --- a/src/main/java/dan200/computercraft/shared/computer/blocks/BlockComputer.java +++ b/src/main/java/dan200/computercraft/shared/computer/blocks/BlockComputer.java @@ -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 BlockComputer extends BlockComputerBase { // Statics @@ -52,6 +54,7 @@ public class BlockComputer extends BlockComputerBase ); } + @Nonnull @Override protected BlockStateContainer createBlockState() { @@ -62,6 +65,7 @@ public class BlockComputer extends BlockComputerBase }); } + @Nonnull @Override public IBlockState getStateFromMeta( int meta ) { @@ -117,8 +121,9 @@ public class BlockComputer extends BlockComputerBase } } + @Nonnull @Override - public IBlockState getActualState( IBlockState state, IBlockAccess world, BlockPos pos ) + public IBlockState getActualState( @Nonnull IBlockState state, IBlockAccess world, BlockPos pos ) { TileEntity tile = world.getTileEntity( pos ); if( tile != null && tile instanceof IComputerTile ) diff --git a/src/main/java/dan200/computercraft/shared/computer/blocks/ComputerPeripheral.java b/src/main/java/dan200/computercraft/shared/computer/blocks/ComputerPeripheral.java index d0bb9ffc4..6140918e4 100644 --- a/src/main/java/dan200/computercraft/shared/computer/blocks/ComputerPeripheral.java +++ b/src/main/java/dan200/computercraft/shared/computer/blocks/ComputerPeripheral.java @@ -12,6 +12,8 @@ import dan200.computercraft.api.peripheral.IComputerAccess; import dan200.computercraft.api.peripheral.IPeripheral; import dan200.computercraft.shared.computer.core.ServerComputer; +import javax.annotation.Nonnull; + public class ComputerPeripheral implements IPeripheral { @@ -26,12 +28,14 @@ public class ComputerPeripheral // IPeripheral implementation + @Nonnull @Override public String getType() { return m_type; } + @Nonnull @Override public String[] getMethodNames() { @@ -45,7 +49,7 @@ public class ComputerPeripheral } @Override - public Object[] callMethod( IComputerAccess computer, ILuaContext context, int method, Object[] arguments ) throws LuaException + public Object[] callMethod( @Nonnull IComputerAccess computer, @Nonnull ILuaContext context, int method, @Nonnull Object[] arguments ) throws LuaException { switch( method ) { @@ -87,12 +91,12 @@ public class ComputerPeripheral } @Override - public void attach( IComputerAccess computer ) + public void attach( @Nonnull IComputerAccess computer ) { } @Override - public void detach( IComputerAccess computer ) + public void detach( @Nonnull IComputerAccess computer ) { } diff --git a/src/main/java/dan200/computercraft/shared/computer/blocks/ComputerState.java b/src/main/java/dan200/computercraft/shared/computer/blocks/ComputerState.java index bcebed315..37c4d4873 100644 --- a/src/main/java/dan200/computercraft/shared/computer/blocks/ComputerState.java +++ b/src/main/java/dan200/computercraft/shared/computer/blocks/ComputerState.java @@ -8,6 +8,8 @@ package dan200.computercraft.shared.computer.blocks; import net.minecraft.util.IStringSerializable; +import javax.annotation.Nonnull; + public enum ComputerState implements IStringSerializable { Off( "off" ), @@ -21,6 +23,7 @@ public enum ComputerState implements IStringSerializable m_name = name; } + @Nonnull @Override public String getName() { diff --git a/src/main/java/dan200/computercraft/shared/computer/blocks/TileCommandComputer.java b/src/main/java/dan200/computercraft/shared/computer/blocks/TileCommandComputer.java index 045be5934..1847a4782 100644 --- a/src/main/java/dan200/computercraft/shared/computer/blocks/TileCommandComputer.java +++ b/src/main/java/dan200/computercraft/shared/computer/blocks/TileCommandComputer.java @@ -21,6 +21,7 @@ import net.minecraft.util.text.*; import net.minecraft.util.*; import net.minecraft.world.World; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.HashMap; import java.util.Map; @@ -53,6 +54,7 @@ public class TileCommandComputer extends TileComputer // ICommandSender + @Nonnull @Override public ITextComponent getDisplayName() { @@ -69,7 +71,7 @@ public class TileCommandComputer extends TileComputer } @Override - public void addChatMessage( ITextComponent chatComponent ) + public void addChatMessage( @Nonnull ITextComponent chatComponent ) { m_outputTable.put( m_outputTable.size() + 1, chatComponent.getUnformattedText() ); } @@ -80,12 +82,14 @@ public class TileCommandComputer extends TileComputer return level <= 2; } + @Nonnull @Override public BlockPos getPosition() { return TileCommandComputer.this.getPos(); } + @Nonnull @Override public Vec3d getPositionVector() { @@ -93,6 +97,7 @@ public class TileCommandComputer extends TileComputer return new Vec3d( pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5 ); } + @Nonnull @Override public World getEntityWorld() { @@ -126,7 +131,7 @@ public class TileCommandComputer extends TileComputer } @Override - public void fillInInfo( ByteBuf buf ) + public void fillInInfo( @Nonnull ByteBuf buf ) { } } diff --git a/src/main/java/dan200/computercraft/shared/computer/blocks/TileComputer.java b/src/main/java/dan200/computercraft/shared/computer/blocks/TileComputer.java index 476453203..0cccd8544 100644 --- a/src/main/java/dan200/computercraft/shared/computer/blocks/TileComputer.java +++ b/src/main/java/dan200/computercraft/shared/computer/blocks/TileComputer.java @@ -17,6 +17,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; +import javax.annotation.Nonnull; import java.util.List; public class TileComputer extends TileComputerBase @@ -47,7 +48,7 @@ public class TileComputer extends TileComputerBase } @Override - public void getDroppedItems( List drops, boolean creative ) + public void getDroppedItems( @Nonnull List drops, boolean creative ) { IComputer computer = getComputer(); if( !creative || (computer != null && computer.getLabel() != null) ) @@ -69,7 +70,7 @@ public class TileComputer extends TileComputerBase } @Override - public final void readDescription( NBTTagCompound nbttagcompound ) + public final void readDescription( @Nonnull NBTTagCompound nbttagcompound ) { super.readDescription( nbttagcompound ); updateBlock(); diff --git a/src/main/java/dan200/computercraft/shared/computer/blocks/TileComputerBase.java b/src/main/java/dan200/computercraft/shared/computer/blocks/TileComputerBase.java index baeec3720..6eca63d78 100644 --- a/src/main/java/dan200/computercraft/shared/computer/blocks/TileComputerBase.java +++ b/src/main/java/dan200/computercraft/shared/computer/blocks/TileComputerBase.java @@ -27,6 +27,8 @@ import net.minecraft.util.EnumHand; import net.minecraft.util.ITickable; import net.minecraft.util.math.BlockPos; +import javax.annotation.Nonnull; + public abstract class TileComputerBase extends TileGeneric implements IComputerTile, IDirectionalTile, ITickable { @@ -167,14 +169,14 @@ public abstract class TileComputerBase extends TileGeneric } @Override - public boolean getBundledRedstoneConnectivity( EnumFacing side ) + public boolean getBundledRedstoneConnectivity( @Nonnull EnumFacing side ) { int localDir = remapLocalSide( DirectionUtil.toLocal( this, side ) ); return !isRedstoneBlockedOnSide( localDir ); } @Override - public int getBundledRedstoneOutput( EnumFacing side ) + public int getBundledRedstoneOutput( @Nonnull EnumFacing side ) { int localDir = remapLocalSide( DirectionUtil.toLocal( this, side ) ); if( !isRedstoneBlockedOnSide( localDir ) ) @@ -198,7 +200,7 @@ public abstract class TileComputerBase extends TileGeneric } @Override - public void onNeighbourTileEntityChange( BlockPos neighbour ) + public void onNeighbourTileEntityChange( @Nonnull BlockPos neighbour ) { updateInput( neighbour ); } @@ -239,6 +241,7 @@ public abstract class TileComputerBase extends TileGeneric } } + @Nonnull @Override public NBTTagCompound writeToNBT( NBTTagCompound nbttagcompound ) { @@ -517,14 +520,14 @@ public abstract class TileComputerBase extends TileGeneric // Networking stuff @Override - public void writeDescription( NBTTagCompound nbttagcompound ) + public void writeDescription( @Nonnull NBTTagCompound nbttagcompound ) { super.writeDescription( nbttagcompound ); nbttagcompound.setInteger( "instanceID", createServerComputer().getInstanceID() ); } @Override - public void readDescription( NBTTagCompound nbttagcompound ) + public void readDescription( @Nonnull NBTTagCompound nbttagcompound ) { super.readDescription( nbttagcompound ); m_instanceID = nbttagcompound.getInteger( "instanceID" ); diff --git a/src/main/java/dan200/computercraft/shared/computer/inventory/ContainerComputer.java b/src/main/java/dan200/computercraft/shared/computer/inventory/ContainerComputer.java index d99c4ca8a..fd52c775b 100644 --- a/src/main/java/dan200/computercraft/shared/computer/inventory/ContainerComputer.java +++ b/src/main/java/dan200/computercraft/shared/computer/inventory/ContainerComputer.java @@ -12,6 +12,7 @@ import dan200.computercraft.shared.computer.core.IContainerComputer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; +import javax.annotation.Nonnull; import javax.annotation.Nullable; public class ContainerComputer extends Container @@ -25,7 +26,7 @@ public class ContainerComputer extends Container } @Override - public boolean canInteractWith( EntityPlayer player ) + public boolean canInteractWith( @Nonnull EntityPlayer player ) { return m_computer.isUseableByPlayer( player ); } diff --git a/src/main/java/dan200/computercraft/shared/computer/items/ItemCommandComputer.java b/src/main/java/dan200/computercraft/shared/computer/items/ItemCommandComputer.java index bfe63c328..80ce67891 100644 --- a/src/main/java/dan200/computercraft/shared/computer/items/ItemCommandComputer.java +++ b/src/main/java/dan200/computercraft/shared/computer/items/ItemCommandComputer.java @@ -14,6 +14,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import javax.annotation.Nonnull; import java.util.List; public class ItemCommandComputer extends ItemComputer @@ -51,7 +52,7 @@ public class ItemCommandComputer extends ItemComputer } @Override - public void getSubItems( Item itemID, CreativeTabs tabs, List list ) + public void getSubItems( @Nonnull Item itemID, @Nonnull CreativeTabs tabs, @Nonnull List list ) { list.add( ComputerItemFactory.create( -1, null, ComputerFamily.Command ) ); } diff --git a/src/main/java/dan200/computercraft/shared/computer/items/ItemComputer.java b/src/main/java/dan200/computercraft/shared/computer/items/ItemComputer.java index 463181623..c1519f597 100644 --- a/src/main/java/dan200/computercraft/shared/computer/items/ItemComputer.java +++ b/src/main/java/dan200/computercraft/shared/computer/items/ItemComputer.java @@ -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 ItemComputer extends ItemComputerBase @@ -71,14 +72,14 @@ public class ItemComputer extends ItemComputerBase } @Override - public void getSubItems( Item itemID, CreativeTabs tabs, List list ) + public void getSubItems( @Nonnull Item itemID, @Nonnull CreativeTabs tabs, @Nonnull List list ) { list.add( ComputerItemFactory.create( -1, null, ComputerFamily.Normal ) ); list.add( ComputerItemFactory.create( -1, null, ComputerFamily.Advanced ) ); } @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 ) ) { @@ -110,6 +111,7 @@ public class ItemComputer extends ItemComputerBase } } + @Nonnull @Override public String getUnlocalizedName( ItemStack stack ) { diff --git a/src/main/java/dan200/computercraft/shared/computer/items/ItemComputerBase.java b/src/main/java/dan200/computercraft/shared/computer/items/ItemComputerBase.java index b3ce17fd5..8d4fc730b 100644 --- a/src/main/java/dan200/computercraft/shared/computer/items/ItemComputerBase.java +++ b/src/main/java/dan200/computercraft/shared/computer/items/ItemComputerBase.java @@ -18,6 +18,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.SoundEvent; import net.minecraft.world.World; +import javax.annotation.Nonnull; import java.util.List; public abstract class ItemComputerBase extends ItemBlock implements IComputerItem, IMedia @@ -36,7 +37,7 @@ public abstract class ItemComputerBase extends ItemBlock implements IComputerIte } @Override - public void addInformation( ItemStack stack, EntityPlayer player, List list, boolean debug ) + public void addInformation( @Nonnull ItemStack stack, @Nonnull EntityPlayer player, @Nonnull List list, boolean debug ) { if( debug ) { @@ -54,7 +55,7 @@ public abstract class ItemComputerBase extends ItemBlock implements IComputerIte public abstract int getComputerID( ItemStack stack ); @Override - public String getLabel( ItemStack stack ) + public String getLabel( @Nonnull ItemStack stack ) { if( stack.hasDisplayName() ) { @@ -73,7 +74,7 @@ public abstract class ItemComputerBase extends ItemBlock implements IComputerIte // IMedia implementation @Override - public boolean setLabel( ItemStack stack, String label ) + public boolean setLabel( @Nonnull ItemStack stack, String label ) { if( label != null ) { @@ -87,19 +88,19 @@ public abstract class ItemComputerBase extends ItemBlock implements IComputerIte } @Override - public String getAudioTitle( ItemStack stack ) + public String getAudioTitle( @Nonnull ItemStack stack ) { return null; } @Override - public SoundEvent getAudio( ItemStack stack ) + public SoundEvent getAudio( @Nonnull ItemStack stack ) { return null; } @Override - public IMount createDataMount( ItemStack stack, World world ) + public IMount createDataMount( @Nonnull ItemStack stack, @Nonnull World world ) { ComputerFamily family = getFamily( stack ); if( family != ComputerFamily.Command ) diff --git a/src/main/java/dan200/computercraft/shared/media/common/DefaultMediaProvider.java b/src/main/java/dan200/computercraft/shared/media/common/DefaultMediaProvider.java index 50bbc57f2..d005a7758 100644 --- a/src/main/java/dan200/computercraft/shared/media/common/DefaultMediaProvider.java +++ b/src/main/java/dan200/computercraft/shared/media/common/DefaultMediaProvider.java @@ -7,6 +7,8 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemRecord; import net.minecraft.item.ItemStack; +import javax.annotation.Nonnull; + public class DefaultMediaProvider implements IMediaProvider { public DefaultMediaProvider() @@ -14,7 +16,7 @@ public class DefaultMediaProvider implements IMediaProvider } @Override - public IMedia getMedia( ItemStack stack ) + public IMedia getMedia( @Nonnull ItemStack stack ) { Item item = stack.getItem(); if( item instanceof IMedia ) diff --git a/src/main/java/dan200/computercraft/shared/media/inventory/ContainerHeldItem.java b/src/main/java/dan200/computercraft/shared/media/inventory/ContainerHeldItem.java index d19b9b7c5..43fbdf656 100644 --- a/src/main/java/dan200/computercraft/shared/media/inventory/ContainerHeldItem.java +++ b/src/main/java/dan200/computercraft/shared/media/inventory/ContainerHeldItem.java @@ -12,6 +12,8 @@ import net.minecraft.inventory.Container; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumHand; +import javax.annotation.Nonnull; + public class ContainerHeldItem extends Container { private final ItemStack m_stack; @@ -29,7 +31,7 @@ public class ContainerHeldItem extends Container } @Override - public boolean canInteractWith( EntityPlayer player ) + public boolean canInteractWith( @Nonnull EntityPlayer player ) { if( player != null && player.isEntityAlive() ) { diff --git a/src/main/java/dan200/computercraft/shared/media/items/ItemDiskLegacy.java b/src/main/java/dan200/computercraft/shared/media/items/ItemDiskLegacy.java index 348faa531..ad47a2703 100644 --- a/src/main/java/dan200/computercraft/shared/media/items/ItemDiskLegacy.java +++ b/src/main/java/dan200/computercraft/shared/media/items/ItemDiskLegacy.java @@ -20,6 +20,7 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import javax.annotation.Nonnull; import java.util.List; public class ItemDiskLegacy extends Item @@ -34,7 +35,7 @@ public class ItemDiskLegacy extends Item } @Override - public void getSubItems( Item itemID, CreativeTabs tabs, List list ) + public void getSubItems( @Nonnull Item itemID, CreativeTabs tabs, List list ) { for( int colour=0; colour<16; ++colour ) { @@ -94,7 +95,7 @@ public class ItemDiskLegacy extends Item // IMedia implementation @Override - public String getLabel( ItemStack stack ) + public String getLabel( @Nonnull ItemStack stack ) { if( stack.hasDisplayName() ) { @@ -104,7 +105,7 @@ public class ItemDiskLegacy extends Item } @Override - public boolean setLabel( ItemStack stack, String label ) + public boolean setLabel( @Nonnull ItemStack stack, String label ) { if( label != null ) { @@ -118,19 +119,19 @@ public class ItemDiskLegacy extends Item } @Override - public String getAudioTitle( ItemStack stack ) + public String getAudioTitle( @Nonnull ItemStack stack ) { return null; } @Override - public SoundEvent getAudio( ItemStack stack ) + public SoundEvent getAudio( @Nonnull ItemStack stack ) { return null; } @Override - public IMount createDataMount( ItemStack stack, World world ) + public IMount createDataMount( @Nonnull ItemStack stack, @Nonnull World world ) { int diskID = getDiskID( stack ); if( diskID < 0 ) diff --git a/src/main/java/dan200/computercraft/shared/media/items/ItemPrintout.java b/src/main/java/dan200/computercraft/shared/media/items/ItemPrintout.java index 336a6edc0..685818177 100644 --- a/src/main/java/dan200/computercraft/shared/media/items/ItemPrintout.java +++ b/src/main/java/dan200/computercraft/shared/media/items/ItemPrintout.java @@ -17,6 +17,7 @@ import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumHand; import net.minecraft.world.World; +import javax.annotation.Nonnull; import java.util.List; public class ItemPrintout extends Item @@ -41,7 +42,7 @@ public class ItemPrintout extends Item } @Override - public void getSubItems( Item itemID, CreativeTabs tabs, List list ) + public void getSubItems( @Nonnull Item itemID, CreativeTabs tabs, List list ) { list.add( createSingleFromTitleAndText( null, new String[ LINES_PER_PAGE ], new String[ LINES_PER_PAGE ] ) ); list.add( createMultipleFromTitleAndText( null, new String[ 2*LINES_PER_PAGE ], new String[ 2*LINES_PER_PAGE ] ) ); @@ -58,6 +59,7 @@ public class ItemPrintout extends Item } } + @Nonnull @Override public String getUnlocalizedName( ItemStack stack ) { @@ -80,8 +82,9 @@ public class ItemPrintout extends Item } } + @Nonnull @Override - public ActionResult onItemRightClick( ItemStack stack, World world, EntityPlayer player, EnumHand hand ) + public ActionResult onItemRightClick( @Nonnull ItemStack stack, World world, EntityPlayer player, EnumHand hand ) { if( !world.isRemote ) { diff --git a/src/main/java/dan200/computercraft/shared/media/items/ItemTreasureDisk.java b/src/main/java/dan200/computercraft/shared/media/items/ItemTreasureDisk.java index 4e9953419..77aab3aa2 100644 --- a/src/main/java/dan200/computercraft/shared/media/items/ItemTreasureDisk.java +++ b/src/main/java/dan200/computercraft/shared/media/items/ItemTreasureDisk.java @@ -21,6 +21,7 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import javax.annotation.Nonnull; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; @@ -38,7 +39,7 @@ public class ItemTreasureDisk extends Item } @Override - public void getSubItems( Item itemID, CreativeTabs tabs, List list ) + public void getSubItems( @Nonnull Item itemID, CreativeTabs tabs, List list ) { } @@ -61,31 +62,31 @@ public class ItemTreasureDisk extends Item // IMedia implementation @Override - public String getLabel( ItemStack stack ) + public String getLabel( @Nonnull ItemStack stack ) { return getTitle( stack ); } @Override - public boolean setLabel( ItemStack stack, String label ) + public boolean setLabel( @Nonnull ItemStack stack, String label ) { return false; } @Override - public String getAudioTitle( ItemStack stack ) + public String getAudioTitle( @Nonnull ItemStack stack ) { return null; } @Override - public SoundEvent getAudio( ItemStack stack ) + public SoundEvent getAudio( @Nonnull ItemStack stack ) { return null; } @Override - public IMount createDataMount( ItemStack stack, World world ) + public IMount createDataMount( @Nonnull ItemStack stack, @Nonnull World world ) { IMount rootTreasure = getTreasureMount(); String subPath = getSubPath( stack ); diff --git a/src/main/java/dan200/computercraft/shared/media/items/RecordMedia.java b/src/main/java/dan200/computercraft/shared/media/items/RecordMedia.java index ffaf433ed..8bb519929 100644 --- a/src/main/java/dan200/computercraft/shared/media/items/RecordMedia.java +++ b/src/main/java/dan200/computercraft/shared/media/items/RecordMedia.java @@ -15,6 +15,8 @@ import net.minecraft.util.SoundEvent; import net.minecraft.world.World; import net.minecraftforge.fml.common.ObfuscationReflectionHelper; +import javax.annotation.Nonnull; + // An implementation of IMedia for ItemRecord's public class RecordMedia implements IMedia { @@ -23,32 +25,32 @@ public class RecordMedia implements IMedia } @Override - public String getLabel( ItemStack stack ) + public String getLabel( @Nonnull ItemStack stack ) { return getAudioTitle( stack ); } @Override - public boolean setLabel( ItemStack stack, String label ) + public boolean setLabel( @Nonnull ItemStack stack, String label ) { return false; } @Override - public String getAudioTitle( ItemStack stack ) + public String getAudioTitle( @Nonnull ItemStack stack ) { return ComputerCraft.getRecordInfo( stack ); } @Override - public SoundEvent getAudio( ItemStack stack ) + public SoundEvent getAudio( @Nonnull ItemStack stack ) { ItemRecord itemRecord = (ItemRecord)stack.getItem(); return ObfuscationReflectionHelper.getPrivateValue(ItemRecord.class, itemRecord, "field_185076_b"); } @Override - public IMount createDataMount( ItemStack stack, World world ) + public IMount createDataMount( @Nonnull ItemStack stack, @Nonnull World world ) { return null; } diff --git a/src/main/java/dan200/computercraft/shared/media/recipes/DiskRecipe.java b/src/main/java/dan200/computercraft/shared/media/recipes/DiskRecipe.java index 5d0cad320..89a6533f9 100644 --- a/src/main/java/dan200/computercraft/shared/media/recipes/DiskRecipe.java +++ b/src/main/java/dan200/computercraft/shared/media/recipes/DiskRecipe.java @@ -14,6 +14,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.world.World; +import javax.annotation.Nonnull; + public class DiskRecipe implements IRecipe { public DiskRecipe() @@ -21,7 +23,7 @@ public class DiskRecipe implements IRecipe } @Override - public boolean matches( InventoryCrafting inventory, World world ) + public boolean matches( @Nonnull InventoryCrafting inventory, @Nonnull World world ) { boolean diskFound = false; boolean paperFound = false; @@ -75,7 +77,7 @@ public class DiskRecipe implements IRecipe } @Override - public ItemStack getCraftingResult(InventoryCrafting par1InventoryCrafting) + public ItemStack getCraftingResult( @Nonnull InventoryCrafting par1InventoryCrafting) { int diskID = -1; String diskLabel = null; @@ -153,8 +155,9 @@ public class DiskRecipe implements IRecipe return ItemDiskLegacy.createFromIDAndColour( -1, null, Colour.Blue.getHex() ); } + @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) diff --git a/src/main/java/dan200/computercraft/shared/media/recipes/PrintoutRecipe.java b/src/main/java/dan200/computercraft/shared/media/recipes/PrintoutRecipe.java index 36638e011..bc72ce56b 100644 --- a/src/main/java/dan200/computercraft/shared/media/recipes/PrintoutRecipe.java +++ b/src/main/java/dan200/computercraft/shared/media/recipes/PrintoutRecipe.java @@ -14,6 +14,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.world.World; +import javax.annotation.Nonnull; + public class PrintoutRecipe implements IRecipe { public PrintoutRecipe( ) @@ -33,13 +35,13 @@ public class PrintoutRecipe 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 disk ID and dye colour int numPages = 0; @@ -146,8 +148,9 @@ public class PrintoutRecipe implements IRecipe return null; } + @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) diff --git a/src/main/java/dan200/computercraft/shared/peripheral/PeripheralType.java b/src/main/java/dan200/computercraft/shared/peripheral/PeripheralType.java index 6c7cb1455..c714b9a40 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/PeripheralType.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/PeripheralType.java @@ -8,6 +8,8 @@ package dan200.computercraft.shared.peripheral; import net.minecraft.util.IStringSerializable; +import javax.annotation.Nonnull; + public enum PeripheralType implements IStringSerializable { DiskDrive( "disk_drive" ), @@ -27,6 +29,7 @@ public enum PeripheralType implements IStringSerializable m_name = name; } + @Nonnull @Override public String getName() { diff --git a/src/main/java/dan200/computercraft/shared/peripheral/commandblock/CommandBlockPeripheral.java b/src/main/java/dan200/computercraft/shared/peripheral/commandblock/CommandBlockPeripheral.java index f491b5f49..3cb943da8 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/commandblock/CommandBlockPeripheral.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/commandblock/CommandBlockPeripheral.java @@ -14,6 +14,8 @@ import dan200.computercraft.api.peripheral.IPeripheral; import net.minecraft.tileentity.TileEntityCommandBlock; import net.minecraft.util.math.BlockPos; +import javax.annotation.Nonnull; + public class CommandBlockPeripheral implements IPeripheral { private final TileEntityCommandBlock m_commandBlock; @@ -25,12 +27,14 @@ public class CommandBlockPeripheral implements IPeripheral // IPeripheral methods + @Nonnull @Override public String getType() { return "command"; } + @Nonnull @Override public String[] getMethodNames() { @@ -42,7 +46,7 @@ public class CommandBlockPeripheral implements IPeripheral } @Override - public Object[] callMethod( IComputerAccess computer, ILuaContext context, int method, final Object[] arguments ) throws LuaException, InterruptedException + public Object[] callMethod( @Nonnull IComputerAccess computer, @Nonnull ILuaContext context, int method, @Nonnull final Object[] arguments ) throws LuaException, InterruptedException { switch (method) { @@ -108,12 +112,12 @@ public class CommandBlockPeripheral implements IPeripheral } @Override - public void attach( IComputerAccess computer ) + public void attach( @Nonnull IComputerAccess computer ) { } @Override - public void detach( IComputerAccess computer ) + public void detach( @Nonnull IComputerAccess computer ) { } diff --git a/src/main/java/dan200/computercraft/shared/peripheral/commandblock/CommandBlockPeripheralProvider.java b/src/main/java/dan200/computercraft/shared/peripheral/commandblock/CommandBlockPeripheralProvider.java index 88f76cb1d..c50228efc 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/commandblock/CommandBlockPeripheralProvider.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/commandblock/CommandBlockPeripheralProvider.java @@ -14,10 +14,12 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; +import javax.annotation.Nonnull; + public class CommandBlockPeripheralProvider implements IPeripheralProvider { @Override - public IPeripheral getPeripheral( World world, BlockPos pos, EnumFacing side ) + public IPeripheral getPeripheral( @Nonnull World world, @Nonnull BlockPos pos, @Nonnull EnumFacing side ) { TileEntity tile = world.getTileEntity( pos ); if( tile != null && tile instanceof TileEntityCommandBlock ) diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockCable.java b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockCable.java index 629c8ef19..eac9ee1c7 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockCable.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockCable.java @@ -21,6 +21,8 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.IBlockAccess; +import javax.annotation.Nonnull; + public class BlockCable extends BlockPeripheralBase { // Statics @@ -73,6 +75,7 @@ public class BlockCable extends BlockPeripheralBase ); } + @Nonnull @Override protected BlockStateContainer createBlockState() { @@ -88,6 +91,7 @@ public class BlockCable extends BlockPeripheralBase }); } + @Nonnull @Override public IBlockState getStateFromMeta( int meta ) { @@ -174,8 +178,9 @@ public class BlockCable extends BlockPeripheralBase } } + @Nonnull @Override - public IBlockState getActualState( IBlockState state, IBlockAccess world, BlockPos pos ) + public IBlockState getActualState( @Nonnull IBlockState state, IBlockAccess world, BlockPos pos ) { state = state.withProperty( Properties.NORTH, doesConnect( state, world, pos, EnumFacing.NORTH ) ); state = state.withProperty( Properties.SOUTH, doesConnect( state, world, pos, EnumFacing.SOUTH ) ); @@ -209,7 +214,7 @@ public class BlockCable extends BlockPeripheralBase } @Override - public boolean shouldSideBeRendered( IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side ) + public boolean shouldSideBeRendered( IBlockState state, @Nonnull IBlockAccess world, @Nonnull BlockPos pos, EnumFacing side ) { return true; } diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockCableModemVariant.java b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockCableModemVariant.java index ffb572ac6..ec95e4a74 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockCableModemVariant.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockCableModemVariant.java @@ -9,6 +9,8 @@ package dan200.computercraft.shared.peripheral.common; import net.minecraft.util.EnumFacing; import net.minecraft.util.IStringSerializable; +import javax.annotation.Nonnull; + public enum BlockCableModemVariant implements IStringSerializable { None( "none", null ), @@ -60,6 +62,7 @@ public enum BlockCableModemVariant implements IStringSerializable m_facing = facing; } + @Nonnull @Override public String getName() { diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheral.java b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheral.java index 2a0047881..e825dbbed 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheral.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheral.java @@ -30,6 +30,8 @@ import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import javax.annotation.Nonnull; + public class BlockPeripheral extends BlockPeripheralBase { public static class Properties @@ -49,12 +51,14 @@ public class BlockPeripheral extends BlockPeripheralBase ); } + @Nonnull @SideOnly( Side.CLIENT) public BlockRenderLayer getBlockLayer() { return BlockRenderLayer.CUTOUT; } + @Nonnull @Override protected BlockStateContainer createBlockState() { @@ -64,6 +68,7 @@ public class BlockPeripheral extends BlockPeripheralBase }); } + @Nonnull @Override public IBlockState getStateFromMeta( int meta ) { @@ -166,8 +171,9 @@ public class BlockPeripheral extends BlockPeripheralBase return meta; } + @Nonnull @Override - public IBlockState getActualState( IBlockState state, IBlockAccess world, BlockPos pos ) + public IBlockState getActualState( @Nonnull IBlockState state, IBlockAccess world, BlockPos pos ) { int anim; EnumFacing dir; diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheralBase.java b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheralBase.java index a96c3dc0a..3a8bdc1bb 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheralBase.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheralBase.java @@ -17,6 +17,8 @@ import net.minecraft.util.EnumFacing; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import javax.annotation.Nonnull; + public abstract class BlockPeripheralBase extends BlockDirectional { public BlockPeripheralBase() @@ -42,7 +44,7 @@ public abstract class BlockPeripheralBase extends BlockDirectional } @Override - public final boolean canPlaceBlockOnSide( World world, BlockPos pos, EnumFacing side ) + public final boolean canPlaceBlockOnSide( @Nonnull World world, @Nonnull BlockPos pos, EnumFacing side ) { return true; // ItemPeripheralBase handles this } diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheralVariant.java b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheralVariant.java index 15e403c17..5e9e48ef3 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheralVariant.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheralVariant.java @@ -9,6 +9,8 @@ package dan200.computercraft.shared.peripheral.common; import dan200.computercraft.shared.peripheral.PeripheralType; import net.minecraft.util.IStringSerializable; +import javax.annotation.Nonnull; + public enum BlockPeripheralVariant implements IStringSerializable { DiskDriveEmpty( "disk_drive_empty", PeripheralType.DiskDrive ), @@ -130,6 +132,7 @@ public enum BlockPeripheralVariant implements IStringSerializable m_peripheralType = peripheralType; } + @Nonnull @Override public String getName() { diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/DefaultPeripheralProvider.java b/src/main/java/dan200/computercraft/shared/peripheral/common/DefaultPeripheralProvider.java index 91f85a545..f6929e9f6 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/DefaultPeripheralProvider.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/DefaultPeripheralProvider.java @@ -16,6 +16,8 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; +import javax.annotation.Nonnull; + public class DefaultPeripheralProvider implements IPeripheralProvider { public DefaultPeripheralProvider() @@ -23,7 +25,7 @@ public class DefaultPeripheralProvider implements IPeripheralProvider } @Override - public IPeripheral getPeripheral( World world, BlockPos pos, EnumFacing side ) + public IPeripheral getPeripheral( @Nonnull World world, @Nonnull BlockPos pos, @Nonnull EnumFacing side ) { TileEntity tile = world.getTileEntity( pos ); if( tile != null ) diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/ItemAdvancedModem.java b/src/main/java/dan200/computercraft/shared/peripheral/common/ItemAdvancedModem.java index dd40f9a6f..b772216c6 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/ItemAdvancedModem.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/ItemAdvancedModem.java @@ -13,6 +13,7 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import javax.annotation.Nonnull; import java.util.List; public class ItemAdvancedModem extends ItemPeripheralBase @@ -48,7 +49,7 @@ public class ItemAdvancedModem extends ItemPeripheralBase } @Override - public void getSubItems( Item itemID, CreativeTabs tabs, List list ) + public void getSubItems( @Nonnull Item itemID, @Nonnull CreativeTabs tabs, @Nonnull List list ) { list.add( PeripheralItemFactory.create( PeripheralType.AdvancedModem, null, 1 ) ); } diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/ItemCable.java b/src/main/java/dan200/computercraft/shared/peripheral/common/ItemCable.java index c98e0d41c..69241381e 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/ItemCable.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/ItemCable.java @@ -24,6 +24,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 ItemCable extends ItemPeripheralBase @@ -63,14 +64,15 @@ public class ItemCable extends ItemPeripheralBase } @Override - public void getSubItems( Item itemID, CreativeTabs tabs, List list ) + public void getSubItems( @Nonnull Item itemID, @Nonnull CreativeTabs tabs, @Nonnull List list ) { list.add( PeripheralItemFactory.create( PeripheralType.WiredModem, null, 1 ) ); list.add( PeripheralItemFactory.create( PeripheralType.Cable, null, 1 ) ); } + @Nonnull @Override - public EnumActionResult onItemUse( ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float fx, float fy, float fz ) + public EnumActionResult onItemUse( ItemStack stack, @Nonnull EntityPlayer player, World world, @Nonnull BlockPos pos, EnumHand hand, @Nonnull EnumFacing side, float fx, float fy, float fz ) { if( !canPlaceBlockOnSide( world, pos, side, player, stack ) ) { diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/ItemPeripheral.java b/src/main/java/dan200/computercraft/shared/peripheral/common/ItemPeripheral.java index 5e5660795..c09364cf3 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/ItemPeripheral.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/ItemPeripheral.java @@ -13,6 +13,7 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import javax.annotation.Nonnull; import java.util.List; public class ItemPeripheral extends ItemPeripheralBase @@ -68,7 +69,7 @@ public class ItemPeripheral extends ItemPeripheralBase } @Override - public void getSubItems( Item itemID, CreativeTabs tabs, List list ) + public void getSubItems( @Nonnull Item itemID, @Nonnull CreativeTabs tabs, @Nonnull List list ) { list.add( PeripheralItemFactory.create( PeripheralType.DiskDrive, null, 1 ) ); list.add( PeripheralItemFactory.create( PeripheralType.Printer, null, 1 ) ); diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/ItemPeripheralBase.java b/src/main/java/dan200/computercraft/shared/peripheral/common/ItemPeripheralBase.java index 640cebab3..b3b62c2f0 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/ItemPeripheralBase.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/ItemPeripheralBase.java @@ -15,6 +15,8 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; +import javax.annotation.Nonnull; + public abstract class ItemPeripheralBase extends ItemBlock implements IPeripheralItem { protected ItemPeripheralBase( Block block ) @@ -33,7 +35,7 @@ public abstract class ItemPeripheralBase extends ItemBlock implements IPeriphera } @Override - public boolean canPlaceBlockOnSide( World world, BlockPos pos, EnumFacing side, EntityPlayer player, ItemStack stack ) // canPlaceItemBlockOnSide + public boolean canPlaceBlockOnSide( World world, @Nonnull BlockPos pos, @Nonnull EnumFacing side, EntityPlayer player, @Nonnull ItemStack stack ) // canPlaceItemBlockOnSide { PeripheralType type = getPeripheralType( stack ); switch( type ) @@ -55,6 +57,7 @@ public abstract class ItemPeripheralBase extends ItemBlock implements IPeriphera } } + @Nonnull @Override public String getUnlocalizedName( ItemStack stack ) { diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/TilePeripheralBase.java b/src/main/java/dan200/computercraft/shared/peripheral/common/TilePeripheralBase.java index 2544d0af6..b4c893ea9 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/TilePeripheralBase.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/TilePeripheralBase.java @@ -15,6 +15,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ITickable; import net.minecraft.util.EnumFacing; +import javax.annotation.Nonnull; import java.util.List; public abstract class TilePeripheralBase extends TileGeneric @@ -45,7 +46,7 @@ public abstract class TilePeripheralBase extends TileGeneric } @Override - public void getDroppedItems( List drops, boolean creative ) + public void getDroppedItems( @Nonnull List drops, boolean creative ) { if( !creative ) { @@ -149,7 +150,8 @@ public abstract class TilePeripheralBase extends TileGeneric } } - @Override + @Nonnull + @Override public NBTTagCompound writeToNBT( NBTTagCompound nbttagcompound ) { // Write properties @@ -164,7 +166,7 @@ public abstract class TilePeripheralBase extends TileGeneric } @Override - public void readDescription( NBTTagCompound nbttagcompound ) + public void readDescription( @Nonnull NBTTagCompound nbttagcompound ) { super.readDescription( nbttagcompound ); m_dir = EnumFacing.getFront( nbttagcompound.getInteger( "dir" ) ); @@ -180,7 +182,7 @@ public abstract class TilePeripheralBase extends TileGeneric } @Override - public void writeDescription( NBTTagCompound nbttagcompound ) + public void writeDescription( @Nonnull NBTTagCompound nbttagcompound ) { super.writeDescription( nbttagcompound ); nbttagcompound.setInteger( "dir", m_dir.getIndex() ); diff --git a/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/ContainerDiskDrive.java b/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/ContainerDiskDrive.java index 7c9139343..d3af4e45d 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/ContainerDiskDrive.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/ContainerDiskDrive.java @@ -12,6 +12,8 @@ import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; +import javax.annotation.Nonnull; + public class ContainerDiskDrive extends Container { private final TileDiskDrive m_diskDrive; @@ -36,7 +38,7 @@ public class ContainerDiskDrive extends Container } @Override - public boolean canInteractWith( EntityPlayer player ) + public boolean canInteractWith( @Nonnull EntityPlayer player ) { return m_diskDrive.isUseableByPlayer( player ); } diff --git a/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/DiskDrivePeripheral.java b/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/DiskDrivePeripheral.java index 36a945456..1e9347aa7 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/DiskDrivePeripheral.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/DiskDrivePeripheral.java @@ -16,6 +16,8 @@ import dan200.computercraft.shared.util.StringUtil; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import javax.annotation.Nonnull; + public class DiskDrivePeripheral implements IPeripheral { private final TileDiskDrive m_diskDrive; @@ -25,12 +27,14 @@ public class DiskDrivePeripheral implements IPeripheral m_diskDrive = diskDrive; } + @Nonnull @Override public String getType() { return "drive"; } + @Nonnull @Override public String[] getMethodNames() { @@ -50,7 +54,7 @@ public class DiskDrivePeripheral implements IPeripheral } @Override - public Object[] callMethod( IComputerAccess computer, ILuaContext context, int method, Object[] arguments ) throws LuaException + public Object[] callMethod( @Nonnull IComputerAccess computer, @Nonnull ILuaContext context, int method, @Nonnull Object[] arguments ) throws LuaException { switch( method ) { @@ -174,13 +178,13 @@ public class DiskDrivePeripheral implements IPeripheral } @Override - public void attach( IComputerAccess computer ) + public void attach( @Nonnull IComputerAccess computer ) { m_diskDrive.mount( computer ); } @Override - public void detach( IComputerAccess computer ) + public void detach( @Nonnull IComputerAccess computer ) { m_diskDrive.unmount( computer ); } diff --git a/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/TileDiskDrive.java b/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/TileDiskDrive.java index 65f0be7da..cb472d525 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/TileDiskDrive.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/TileDiskDrive.java @@ -29,6 +29,7 @@ import net.minecraft.util.math.*; import net.minecraft.util.text.*; import net.minecraft.world.World; +import javax.annotation.Nonnull; import java.util.HashMap; import java.util.Iterator; import java.util.Map; @@ -145,6 +146,7 @@ public class TileDiskDrive extends TilePeripheralBase } } + @Nonnull @Override public NBTTagCompound writeToNBT(NBTTagCompound nbttagcompound) { @@ -320,6 +322,7 @@ public class TileDiskDrive extends TilePeripheralBase return getLabel() != null; } + @Nonnull @Override public String getName() { @@ -334,6 +337,7 @@ public class TileDiskDrive extends TilePeripheralBase } } + @Nonnull @Override public ITextComponent getDisplayName() { @@ -354,23 +358,23 @@ public class TileDiskDrive extends TilePeripheralBase } @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 i, ItemStack itemstack) + public boolean isItemValidForSlot( int i, @Nonnull ItemStack itemstack) { return true; } @Override - public boolean isUseableByPlayer( EntityPlayer player ) + public boolean isUseableByPlayer( @Nonnull EntityPlayer player ) { return isUsable( player, false ); } @@ -613,7 +617,7 @@ public class TileDiskDrive extends TilePeripheralBase } @Override - public final void readDescription( NBTTagCompound nbttagcompound ) + public final void readDescription( @Nonnull NBTTagCompound nbttagcompound ) { super.readDescription( nbttagcompound ); if( nbttagcompound.hasKey( "item" ) ) @@ -628,7 +632,7 @@ public class TileDiskDrive extends TilePeripheralBase } @Override - public void writeDescription( NBTTagCompound nbttagcompound ) + public void writeDescription( @Nonnull NBTTagCompound nbttagcompound ) { super.writeDescription( nbttagcompound ); if( m_diskStack != null ) @@ -659,7 +663,7 @@ public class TileDiskDrive extends TilePeripheralBase } @Override - public boolean shouldRefresh( World world, BlockPos pos, IBlockState oldState, IBlockState newState ) + public boolean shouldRefresh( World world, BlockPos pos, @Nonnull IBlockState oldState, @Nonnull IBlockState newState ) { return super.shouldRefresh( world, pos, oldState, newState ) || ComputerCraft.Blocks.peripheral.getPeripheralType( newState ) != PeripheralType.DiskDrive; } diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/BlockAdvancedModem.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/BlockAdvancedModem.java index f5b4dcce9..af8f27724 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/BlockAdvancedModem.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/BlockAdvancedModem.java @@ -23,6 +23,8 @@ import net.minecraft.util.EnumFacing; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import javax.annotation.Nonnull; + public class BlockAdvancedModem extends BlockPeripheralBase { public static class Properties @@ -42,6 +44,7 @@ public class BlockAdvancedModem extends BlockPeripheralBase ); } + @Nonnull @Override protected BlockStateContainer createBlockState() { @@ -51,6 +54,7 @@ public class BlockAdvancedModem extends BlockPeripheralBase }); } + @Nonnull @Override public IBlockState getStateFromMeta( int meta ) { @@ -63,12 +67,13 @@ public class BlockAdvancedModem extends BlockPeripheralBase @Override public int getMetaFromState( IBlockState state ) { - EnumFacing dir = (EnumFacing) state.getValue( Properties.FACING ); + EnumFacing dir = state.getValue( Properties.FACING ); return dir.getIndex(); } + @Nonnull @Override - public IBlockState getActualState( IBlockState state, IBlockAccess world, BlockPos pos ) + public IBlockState getActualState( @Nonnull IBlockState state, IBlockAccess world, BlockPos pos ) { int anim; EnumFacing dir; diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/ModemPeripheral.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/ModemPeripheral.java index c3c92781a..a1853b68d 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/ModemPeripheral.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/ModemPeripheral.java @@ -13,6 +13,7 @@ import dan200.computercraft.api.peripheral.IPeripheral; import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; +import javax.annotation.Nonnull; import java.util.HashMap; import java.util.Iterator; import java.util.Map; @@ -203,12 +204,14 @@ public abstract class ModemPeripheral // IPeripheral implementation + @Nonnull @Override public String getType() { return "modem"; } + @Nonnull @Override public String[] getMethodNames() { @@ -237,7 +240,7 @@ public abstract class ModemPeripheral } @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 ) { @@ -366,7 +369,7 @@ public abstract class ModemPeripheral } @Override - public synchronized void attach( IComputerAccess computer ) + public synchronized void attach( @Nonnull IComputerAccess computer ) { m_computer = computer; setNetwork( getNetwork() ); @@ -374,7 +377,7 @@ public abstract class ModemPeripheral } @Override - public synchronized void detach( IComputerAccess computer ) + public synchronized void detach( @Nonnull IComputerAccess computer ) { if( m_network != null ) { diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/TileCable.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/TileCable.java index fcfca3d17..34b26139a 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/TileCable.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/TileCable.java @@ -31,6 +31,7 @@ import net.minecraft.util.math.*; import net.minecraft.util.text.*; import net.minecraft.world.World; +import javax.annotation.Nonnull; import java.io.File; import java.util.*; @@ -93,6 +94,7 @@ public class TileCable extends TileModemBase return new Vec3d( (double)pos.getX() + 0.5, (double)pos.getY() + 0.5, (double)pos.getZ() + 0.5 ); } + @Nonnull @Override public String[] getMethodNames() { @@ -117,7 +119,7 @@ public class TileCable extends TileModemBase } @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 { String[] methods = super.getMethodNames(); switch( method - methods.length ) @@ -186,7 +188,7 @@ public class TileCable extends TileModemBase } @Override - public void attach( IComputerAccess computer ) + public void attach( @Nonnull IComputerAccess computer ) { super.attach( computer ); synchronized( m_entity.m_peripheralsByName ) @@ -205,7 +207,7 @@ public class TileCable extends TileModemBase } @Override - public synchronized void detach( IComputerAccess computer ) + public synchronized void detach( @Nonnull IComputerAccess computer ) { synchronized( m_entity.m_peripheralsByName ) { @@ -302,7 +304,7 @@ public class TileCable extends TileModemBase } @Override - public void getDroppedItems( List drops, boolean creative ) + public void getDroppedItems( @Nonnull List drops, boolean creative ) { if( !creative ) { @@ -409,6 +411,7 @@ public class TileCable extends TileModemBase return new AxisAlignedBB( xMin, yMin, zMin, xMax, yMax, zMax ); } + @Nonnull @Override public AxisAlignedBB getBounds() { @@ -434,7 +437,7 @@ public class TileCable extends TileModemBase } @Override - public void getCollisionBounds( List bounds ) + public void getCollisionBounds( @Nonnull List bounds ) { PeripheralType type = getPeripheralType(); if( type == PeripheralType.WiredModem || type == PeripheralType.WiredModemWithCable ) @@ -503,7 +506,8 @@ public class TileCable extends TileModemBase m_attachedPeripheralID = nbttagcompound.getInteger( "peripheralID" ); } - @Override + @Nonnull + @Override public NBTTagCompound writeToNBT(NBTTagCompound nbttagcompound) { // Write properties @@ -828,25 +832,25 @@ public class TileCable extends TileModemBase // IComputerAccess implementation @Override - public String mount( String desiredLocation, IMount mount ) + public String mount( @Nonnull String desiredLocation, @Nonnull IMount mount ) { return m_computer.mount( desiredLocation, mount, m_name ); } @Override - public String mount( String desiredLocation, IMount mount, String driveName ) + public String mount( @Nonnull String desiredLocation, @Nonnull IMount mount, @Nonnull String driveName ) { return m_computer.mount( desiredLocation, mount, driveName ); } @Override - public String mountWritable( String desiredLocation, IWritableMount mount ) + public String mountWritable( @Nonnull String desiredLocation, @Nonnull IWritableMount mount ) { return m_computer.mountWritable( desiredLocation, mount, m_name ); } @Override - public String mountWritable( String desiredLocation, IWritableMount mount, String driveName ) + public String mountWritable( @Nonnull String desiredLocation, @Nonnull IWritableMount mount, @Nonnull String driveName ) { return m_computer.mountWritable( desiredLocation, mount, driveName ); } @@ -864,11 +868,12 @@ public class TileCable extends TileModemBase } @Override - public void queueEvent( String event, Object[] arguments ) + public void queueEvent( @Nonnull String event, Object[] arguments ) { m_computer.queueEvent( event, arguments ); } + @Nonnull @Override public String getAttachmentName() { diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/TileModemBase.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/TileModemBase.java index 0ac40d1e6..9036afaf0 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/TileModemBase.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/TileModemBase.java @@ -14,6 +14,8 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.AxisAlignedBB; +import javax.annotation.Nonnull; + public abstract class TileModemBase extends TilePeripheralBase { private static final AxisAlignedBB[] BOXES = new AxisAlignedBB[] { @@ -65,6 +67,7 @@ public abstract class TileModemBase extends TilePeripheralBase } } + @Nonnull @Override public AxisAlignedBB getBounds() { @@ -95,7 +98,7 @@ public abstract class TileModemBase extends TilePeripheralBase } @Override - public final void readDescription( NBTTagCompound nbttagcompound ) + public final void readDescription( @Nonnull NBTTagCompound nbttagcompound ) { super.readDescription( nbttagcompound ); updateBlock(); diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/TileWirelessModem.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/TileWirelessModem.java index e68788dd7..7e3ad828c 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/TileWirelessModem.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/TileWirelessModem.java @@ -17,6 +17,8 @@ import net.minecraft.util.EnumFacing; import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; +import javax.annotation.Nonnull; + public class TileWirelessModem extends TileModemBase { // Statics @@ -120,7 +122,7 @@ public class TileWirelessModem extends TileModemBase } @Override - public boolean shouldRefresh( World world, BlockPos pos, IBlockState oldState, IBlockState newState ) + public boolean shouldRefresh( World world, BlockPos pos, @Nonnull IBlockState oldState, @Nonnull IBlockState newState ) { return super.shouldRefresh( world, pos, oldState, newState ) || ComputerCraft.Blocks.peripheral.getPeripheralType( newState ) != PeripheralType.WirelessModem; } diff --git a/src/main/java/dan200/computercraft/shared/peripheral/monitor/MonitorPeripheral.java b/src/main/java/dan200/computercraft/shared/peripheral/monitor/MonitorPeripheral.java index 366794271..00d499bf4 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/monitor/MonitorPeripheral.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/monitor/MonitorPeripheral.java @@ -12,6 +12,8 @@ import dan200.computercraft.api.peripheral.IComputerAccess; import dan200.computercraft.api.peripheral.IPeripheral; import dan200.computercraft.core.terminal.Terminal; +import javax.annotation.Nonnull; + public class MonitorPeripheral implements IPeripheral { private final TileMonitor m_monitor; @@ -23,12 +25,14 @@ public class MonitorPeripheral implements IPeripheral // IPeripheral implementation + @Nonnull @Override public String getType() { return "monitor"; } + @Nonnull @Override public String[] getMethodNames() { @@ -57,7 +61,7 @@ public class MonitorPeripheral implements IPeripheral } @Override - public Object[] callMethod( IComputerAccess computer, ILuaContext context, int method, Object args[] ) throws LuaException + public Object[] callMethod( @Nonnull IComputerAccess computer, @Nonnull ILuaContext context, int method, @Nonnull Object args[] ) throws LuaException { switch( method ) { @@ -223,13 +227,13 @@ public class MonitorPeripheral implements IPeripheral } @Override - public void attach( IComputerAccess computer ) + public void attach( @Nonnull IComputerAccess computer ) { m_monitor.addComputer( computer ); } @Override - public void detach( IComputerAccess computer ) + public void detach( @Nonnull IComputerAccess computer ) { m_monitor.removeComputer( computer ); } diff --git a/src/main/java/dan200/computercraft/shared/peripheral/monitor/TileMonitor.java b/src/main/java/dan200/computercraft/shared/peripheral/monitor/TileMonitor.java index 59c33035f..ccb742da2 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/monitor/TileMonitor.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/monitor/TileMonitor.java @@ -25,6 +25,7 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; +import javax.annotation.Nonnull; import java.util.HashSet; import java.util.Set; @@ -111,6 +112,7 @@ public class TileMonitor extends TilePeripheralBase return false; } + @Nonnull @Override public NBTTagCompound writeToNBT( NBTTagCompound nbttagcompound ) { @@ -206,7 +208,7 @@ public class TileMonitor extends TilePeripheralBase // Networking stuff @Override - public void writeDescription( NBTTagCompound nbttagcompound ) + public void writeDescription( @Nonnull NBTTagCompound nbttagcompound ) { super.writeDescription( nbttagcompound ); nbttagcompound.setInteger( "xIndex", m_xIndex ); @@ -219,7 +221,7 @@ public class TileMonitor extends TilePeripheralBase } @Override - public final void readDescription( NBTTagCompound nbttagcompound ) + public final void readDescription( @Nonnull NBTTagCompound nbttagcompound ) { super.readDescription( nbttagcompound ); @@ -815,6 +817,7 @@ public class TileMonitor extends TilePeripheralBase } } + @Nonnull @Override public AxisAlignedBB getRenderBoundingBox() { @@ -840,7 +843,7 @@ public class TileMonitor extends TilePeripheralBase } @Override - public boolean shouldRefresh( World world, BlockPos pos, IBlockState oldState, IBlockState newState ) + public boolean shouldRefresh( World world, BlockPos pos, @Nonnull IBlockState oldState, @Nonnull IBlockState newState ) { if( super.shouldRefresh( world, pos, oldState, newState ) ) { diff --git a/src/main/java/dan200/computercraft/shared/peripheral/printer/ContainerPrinter.java b/src/main/java/dan200/computercraft/shared/peripheral/printer/ContainerPrinter.java index 52c6f2cc6..3da3915fe 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/printer/ContainerPrinter.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/printer/ContainerPrinter.java @@ -14,6 +14,8 @@ import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; +import javax.annotation.Nonnull; + public class ContainerPrinter extends Container { private TilePrinter m_printer; @@ -97,7 +99,7 @@ public class ContainerPrinter extends Container } @Override - public boolean canInteractWith( EntityPlayer player ) + public boolean canInteractWith( @Nonnull EntityPlayer player ) { return m_printer.isUseableByPlayer( player ); } diff --git a/src/main/java/dan200/computercraft/shared/peripheral/printer/PrinterPeripheral.java b/src/main/java/dan200/computercraft/shared/peripheral/printer/PrinterPeripheral.java index e489d1981..3240e0f0e 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/printer/PrinterPeripheral.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/printer/PrinterPeripheral.java @@ -12,6 +12,8 @@ import dan200.computercraft.api.peripheral.IComputerAccess; import dan200.computercraft.api.peripheral.IPeripheral; import dan200.computercraft.core.terminal.Terminal; +import javax.annotation.Nonnull; + public class PrinterPeripheral implements IPeripheral { private final TilePrinter m_printer; @@ -21,12 +23,14 @@ public class PrinterPeripheral implements IPeripheral m_printer = printer; } + @Nonnull @Override public String getType() { return "printer"; } + @Nonnull @Override public String[] getMethodNames() { @@ -44,7 +48,7 @@ public class PrinterPeripheral implements IPeripheral } @Override - public Object[] callMethod( IComputerAccess computer, ILuaContext context, int method, Object[] args ) throws LuaException + public Object[] callMethod( @Nonnull IComputerAccess computer, @Nonnull ILuaContext context, int method, @Nonnull Object[] args ) throws LuaException { switch( method ) { @@ -139,12 +143,12 @@ public class PrinterPeripheral implements IPeripheral } @Override - public void attach( IComputerAccess computer ) + public void attach( @Nonnull IComputerAccess computer ) { } @Override - public void detach( IComputerAccess computer ) + public void detach( @Nonnull IComputerAccess computer ) { } diff --git a/src/main/java/dan200/computercraft/shared/peripheral/printer/TilePrinter.java b/src/main/java/dan200/computercraft/shared/peripheral/printer/TilePrinter.java index df98be35b..50126f28c 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/printer/TilePrinter.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/printer/TilePrinter.java @@ -29,6 +29,8 @@ import net.minecraft.util.text.*; import net.minecraft.world.World; import net.minecraftforge.common.util.Constants; +import javax.annotation.Nonnull; + public class TilePrinter extends TilePeripheralBase implements IInventory, ISidedInventory { @@ -102,7 +104,8 @@ public class TilePrinter extends TilePeripheralBase } } - @Override + @Nonnull + @Override public NBTTagCompound writeToNBT(NBTTagCompound nbttagcompound) { nbttagcompound = super.writeToNBT(nbttagcompound); @@ -136,14 +139,14 @@ public class TilePrinter extends TilePeripheralBase } @Override - public final void readDescription( NBTTagCompound nbttagcompound ) + public final void readDescription( @Nonnull NBTTagCompound nbttagcompound ) { super.readDescription( nbttagcompound ); updateBlock(); } @Override - public boolean shouldRefresh( World world, BlockPos pos, IBlockState oldState, IBlockState newState ) + public boolean shouldRefresh( World world, BlockPos pos, @Nonnull IBlockState oldState, @Nonnull IBlockState newState ) { return super.shouldRefresh( world, pos, oldState, newState ) || ComputerCraft.Blocks.peripheral.getPeripheralType( newState ) != PeripheralType.Printer; } @@ -243,6 +246,7 @@ public class TilePrinter extends TilePeripheralBase return getLabel() != null; } + @Nonnull @Override public String getName() { @@ -257,6 +261,7 @@ public class TilePrinter extends TilePeripheralBase } } + @Nonnull @Override public ITextComponent getDisplayName() { @@ -277,23 +282,23 @@ public class TilePrinter extends TilePeripheralBase } @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 itemstack ) + public boolean isItemValidForSlot( int slot, @Nonnull ItemStack itemstack ) { return true; } @Override - public boolean isUseableByPlayer( EntityPlayer player ) + public boolean isUseableByPlayer( @Nonnull EntityPlayer player ) { return isUsable( player, false ); } @@ -317,8 +322,9 @@ public class TilePrinter extends TilePeripheralBase // ISidedInventory implementation - @Override - public int[] getSlotsForFace( EnumFacing side ) + @Nonnull + @Override + public int[] getSlotsForFace( @Nonnull EnumFacing side ) { switch( side ) { @@ -329,13 +335,13 @@ public class TilePrinter extends TilePeripheralBase } @Override - public boolean canInsertItem( int slot, ItemStack itemstack, EnumFacing face ) + public boolean canInsertItem( int slot, @Nonnull ItemStack itemstack, @Nonnull EnumFacing face ) { return isItemValidForSlot( slot, itemstack ); } @Override - public boolean canExtractItem( int slot, ItemStack itemstack, EnumFacing face ) + public boolean canExtractItem( int slot, @Nonnull ItemStack itemstack, @Nonnull EnumFacing face ) { return true; } diff --git a/src/main/java/dan200/computercraft/shared/pocket/apis/PocketAPI.java b/src/main/java/dan200/computercraft/shared/pocket/apis/PocketAPI.java index 8ef404c0f..b27b3f0ef 100644 --- a/src/main/java/dan200/computercraft/shared/pocket/apis/PocketAPI.java +++ b/src/main/java/dan200/computercraft/shared/pocket/apis/PocketAPI.java @@ -19,6 +19,8 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; +import javax.annotation.Nonnull; + public class PocketAPI implements ILuaAPI { private final PocketServerComputer m_computer; @@ -51,6 +53,7 @@ public class PocketAPI implements ILuaAPI { } + @Nonnull @Override public String[] getMethodNames() { @@ -61,7 +64,7 @@ public class PocketAPI implements ILuaAPI } @Override - public Object[] callMethod( ILuaContext context, int method, Object[] arguments ) throws LuaException, InterruptedException + public Object[] callMethod( @Nonnull ILuaContext context, int method, @Nonnull Object[] arguments ) throws LuaException, InterruptedException { switch( method ) { diff --git a/src/main/java/dan200/computercraft/shared/pocket/items/ItemPocketComputer.java b/src/main/java/dan200/computercraft/shared/pocket/items/ItemPocketComputer.java index 0199f92b1..45d8cee18 100644 --- a/src/main/java/dan200/computercraft/shared/pocket/items/ItemPocketComputer.java +++ b/src/main/java/dan200/computercraft/shared/pocket/items/ItemPocketComputer.java @@ -35,6 +35,7 @@ import net.minecraftforge.common.util.Constants; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import javax.annotation.Nonnull; import java.util.List; public class ItemPocketComputer extends Item implements IComputerItem, IMedia @@ -79,7 +80,7 @@ public class ItemPocketComputer extends Item implements IComputerItem, IMedia } @Override - public void getSubItems( Item itemID, CreativeTabs tabs, List list ) + public void getSubItems( @Nonnull Item itemID, CreativeTabs tabs, List list ) { getSubItems( list, ComputerFamily.Normal ); getSubItems( list, ComputerFamily.Advanced ); @@ -151,8 +152,9 @@ public class ItemPocketComputer extends Item implements IComputerItem, IMedia } } + @Nonnull @Override - public ActionResult onItemRightClick( ItemStack stack, World world, EntityPlayer player, EnumHand hand ) + public ActionResult onItemRightClick( @Nonnull ItemStack stack, World world, EntityPlayer player, EnumHand hand ) { if( !world.isRemote ) { @@ -176,6 +178,7 @@ public class ItemPocketComputer extends Item implements IComputerItem, IMedia return new ActionResult( EnumActionResult.SUCCESS, stack ); } + @Nonnull @Override public String getUnlocalizedName( ItemStack stack ) { @@ -193,8 +196,9 @@ public class ItemPocketComputer extends Item implements IComputerItem, IMedia } } + @Nonnull @Override - public String getItemStackDisplayName( ItemStack stack ) + public String getItemStackDisplayName( @Nonnull ItemStack stack ) { String baseString = getUnlocalizedName( stack ); IPocketUpgrade upgrade = getUpgrade( stack ); @@ -331,7 +335,7 @@ public class ItemPocketComputer extends Item implements IComputerItem, IMedia } @Override - public String getLabel( ItemStack stack ) + public String getLabel( @Nonnull ItemStack stack ) { if( stack.hasDisplayName() ) { @@ -361,7 +365,7 @@ public class ItemPocketComputer extends Item implements IComputerItem, IMedia // IMedia @Override - public boolean setLabel( ItemStack stack, String label ) + public boolean setLabel( @Nonnull ItemStack stack, String label ) { if( label != null ) { @@ -375,19 +379,19 @@ public class ItemPocketComputer extends Item implements IComputerItem, IMedia } @Override - public String getAudioTitle( ItemStack stack ) + public String getAudioTitle( @Nonnull ItemStack stack ) { return null; } @Override - public SoundEvent getAudio( ItemStack stack ) + public SoundEvent getAudio( @Nonnull ItemStack stack ) { return null; } @Override - public IMount createDataMount( ItemStack stack, World world ) + public IMount createDataMount( @Nonnull ItemStack stack, @Nonnull World world ) { ServerComputer computer = createServerComputer( world, null, null, stack ); if( computer != null ) diff --git a/src/main/java/dan200/computercraft/shared/pocket/recipes/PocketComputerUpgradeRecipe.java b/src/main/java/dan200/computercraft/shared/pocket/recipes/PocketComputerUpgradeRecipe.java index 7eeefef94..b61ed8ab4 100644 --- a/src/main/java/dan200/computercraft/shared/pocket/recipes/PocketComputerUpgradeRecipe.java +++ b/src/main/java/dan200/computercraft/shared/pocket/recipes/PocketComputerUpgradeRecipe.java @@ -16,6 +16,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.world.World; +import javax.annotation.Nonnull; + public class PocketComputerUpgradeRecipe implements IRecipe { public PocketComputerUpgradeRecipe() @@ -35,13 +37,13 @@ public class PocketComputerUpgradeRecipe 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 pocket computer ItemStack computer = null; @@ -112,8 +114,9 @@ public class PocketComputerUpgradeRecipe implements IRecipe return PocketComputerItemFactory.create( computerID, label, family, upgrade ); } + @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) diff --git a/src/main/java/dan200/computercraft/shared/turtle/apis/TurtleAPI.java b/src/main/java/dan200/computercraft/shared/turtle/apis/TurtleAPI.java index 0fd7f62a7..cac3a019b 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/apis/TurtleAPI.java +++ b/src/main/java/dan200/computercraft/shared/turtle/apis/TurtleAPI.java @@ -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 ) { diff --git a/src/main/java/dan200/computercraft/shared/turtle/blocks/BlockTurtle.java b/src/main/java/dan200/computercraft/shared/turtle/blocks/BlockTurtle.java index 87dc2ba5e..2c7d67cec 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/blocks/BlockTurtle.java +++ b/src/main/java/dan200/computercraft/shared/turtle/blocks/BlockTurtle.java @@ -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 ) ); } diff --git a/src/main/java/dan200/computercraft/shared/turtle/blocks/TileTurtle.java b/src/main/java/dan200/computercraft/shared/turtle/blocks/TileTurtle.java index f37afecda..ec5f6c072 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/blocks/TileTurtle.java +++ b/src/main/java/dan200/computercraft/shared/turtle/blocks/TileTurtle.java @@ -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 drops, boolean creative ) + public void getDroppedItems( @Nonnull List 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 ); diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleBrain.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleBrain.java index 6f9071cb7..0212ad618 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleBrain.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleBrain.java @@ -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(); } diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCheckRedstoneCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCheckRedstoneCommand.java index 94e5f9e1b..1c8c9e2c2 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCheckRedstoneCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCheckRedstoneCommand.java @@ -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; diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCompareCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCompareCommand.java index a68b66600..3d91209bc 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCompareCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCompareCommand.java @@ -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 ); diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCompareToCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCompareToCommand.java index 3c85c3607..11a7daf00 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCompareToCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCompareToCommand.java @@ -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 ); diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCraftCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCraftCommand.java index 8c5928f24..2a617bf71 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCraftCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCraftCommand.java @@ -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 ); diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleDetectCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleDetectCommand.java index e94028988..47955b9cc 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleDetectCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleDetectCommand.java @@ -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 ); diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleDropCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleDropCommand.java index 796413a93..ee8788a8c 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleDropCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleDropCommand.java @@ -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 ) diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleEquipCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleEquipCommand.java index d539ed347..c4bc6a83e 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleEquipCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleEquipCommand.java @@ -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; diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleInspectCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleInspectCommand.java index 6c1abb8cb..12cf3d72c 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleInspectCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleInspectCommand.java @@ -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 ); diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleMoveCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleMoveCommand.java index 6d790fc49..afea753bc 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleMoveCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleMoveCommand.java @@ -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 ); diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlaceCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlaceCommand.java index 522ecf52e..85be37a36 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlaceCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlaceCommand.java @@ -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() ); diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlayer.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlayer.java index 87e3b1b16..0e751e2e2 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlayer.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlayer.java @@ -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 ) { } diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleRefuelCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleRefuelCommand.java index d521e4877..c011e913c 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleRefuelCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleRefuelCommand.java @@ -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 ) { diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleSelectCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleSelectCommand.java index a34bd61e6..75bb97bda 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleSelectCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleSelectCommand.java @@ -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(); diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleSetRedstoneCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleSetRedstoneCommand.java index 90174f836..86f55abbc 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleSetRedstoneCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleSetRedstoneCommand.java @@ -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; diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleSuckCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleSuckCommand.java index e2d14061f..f18e863f3 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleSuckCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleSuckCommand.java @@ -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 ) diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleToolCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleToolCommand.java index 83a78c567..5c6a09705 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleToolCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleToolCommand.java @@ -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() ) diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleTransferToCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleTransferToCommand.java index 38b0275f7..dbd38ddf1 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleTransferToCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleTransferToCommand.java @@ -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() ); diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleTurnCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleTurnCommand.java index cfc2cad99..af675c9ed 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleTurnCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleTurnCommand.java @@ -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 ) { diff --git a/src/main/java/dan200/computercraft/shared/turtle/entity/TurtleVisionCamera.java b/src/main/java/dan200/computercraft/shared/turtle/entity/TurtleVisionCamera.java index 47c8a3944..2690abaaf 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/entity/TurtleVisionCamera.java +++ b/src/main/java/dan200/computercraft/shared/turtle/entity/TurtleVisionCamera.java @@ -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 getArmorInventoryList() { diff --git a/src/main/java/dan200/computercraft/shared/turtle/inventory/ContainerTurtle.java b/src/main/java/dan200/computercraft/shared/turtle/inventory/ContainerTurtle.java index 780144989..dc570169b 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/inventory/ContainerTurtle.java +++ b/src/main/java/dan200/computercraft/shared/turtle/inventory/ContainerTurtle.java @@ -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 ) diff --git a/src/main/java/dan200/computercraft/shared/turtle/items/ItemTurtleBase.java b/src/main/java/dan200/computercraft/shared/turtle/items/ItemTurtleBase.java index af4585d90..ca07fedc7 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/items/ItemTurtleBase.java +++ b/src/main/java/dan200/computercraft/shared/turtle/items/ItemTurtleBase.java @@ -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 all = new ArrayList(); 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 ); diff --git a/src/main/java/dan200/computercraft/shared/turtle/recipes/TurtleRecipe.java b/src/main/java/dan200/computercraft/shared/turtle/recipes/TurtleRecipe.java index dc306d14e..285f67b23 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/recipes/TurtleRecipe.java +++ b/src/main/java/dan200/computercraft/shared/turtle/recipes/TurtleRecipe.java @@ -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) diff --git a/src/main/java/dan200/computercraft/shared/turtle/recipes/TurtleUpgradeRecipe.java b/src/main/java/dan200/computercraft/shared/turtle/recipes/TurtleUpgradeRecipe.java index 13a9b758d..9d9c4fb6c 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/recipes/TurtleUpgradeRecipe.java +++ b/src/main/java/dan200/computercraft/shared/turtle/recipes/TurtleUpgradeRecipe.java @@ -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) diff --git a/src/main/java/dan200/computercraft/shared/turtle/upgrades/CraftingTablePeripheral.java b/src/main/java/dan200/computercraft/shared/turtle/upgrades/CraftingTablePeripheral.java index d4e9a45ab..fa9953f9e 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/upgrades/CraftingTablePeripheral.java +++ b/src/main/java/dan200/computercraft/shared/turtle/upgrades/CraftingTablePeripheral.java @@ -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 ) { } diff --git a/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleCraftingTable.java b/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleCraftingTable.java index 5533a8356..2fa7d6f51 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleCraftingTable.java +++ b/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleCraftingTable.java @@ -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 getModel( ITurtleAccess turtle, TurtleSide side ) + public Pair 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 ) { } } diff --git a/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleHoe.java b/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleHoe.java index 5fa690098..a50d9459d 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleHoe.java +++ b/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleHoe.java @@ -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 ) { diff --git a/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleInventoryCrafting.java b/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleInventoryCrafting.java index 3d1191a17..d5b9132f8 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleInventoryCrafting.java +++ b/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleInventoryCrafting.java @@ -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() { diff --git a/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleModem.java b/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleModem.java index 776080031..741a79ea3 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleModem.java +++ b/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleModem.java @@ -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 getModel( ITurtleAccess turtle, TurtleSide side ) + public Pair 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 ) diff --git a/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleTool.java b/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleTool.java index ec90134b6..9aedb8894 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleTool.java +++ b/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleTool.java @@ -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 getModel( ITurtleAccess turtle, TurtleSide side ) + public Pair 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 ) { diff --git a/src/main/java/dan200/computercraft/shared/util/CreativeTabMain.java b/src/main/java/dan200/computercraft/shared/util/CreativeTabMain.java index b9e7a914e..ac5bf933f 100644 --- a/src/main/java/dan200/computercraft/shared/util/CreativeTabMain.java +++ b/src/main/java/dan200/computercraft/shared/util/CreativeTabMain.java @@ -10,6 +10,8 @@ import dan200.computercraft.ComputerCraft; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; +import javax.annotation.Nonnull; + public class CreativeTabMain extends CreativeTabs { public CreativeTabMain( int i ) @@ -17,12 +19,14 @@ public class CreativeTabMain extends CreativeTabs super( i, "ComputerCraft" ); } + @Nonnull @Override public Item getTabIconItem() { return Item.getItemFromBlock( ComputerCraft.Blocks.computer ); } + @Nonnull @Override public String getTranslatedTabLabel() { diff --git a/src/main/java/dan200/computercraft/shared/util/CreativeTabTreasure.java b/src/main/java/dan200/computercraft/shared/util/CreativeTabTreasure.java index 74a7ac770..975af59d7 100644 --- a/src/main/java/dan200/computercraft/shared/util/CreativeTabTreasure.java +++ b/src/main/java/dan200/computercraft/shared/util/CreativeTabTreasure.java @@ -10,6 +10,8 @@ import dan200.computercraft.ComputerCraft; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; +import javax.annotation.Nonnull; + public class CreativeTabTreasure extends CreativeTabs { public CreativeTabTreasure( int i ) @@ -17,12 +19,14 @@ public class CreativeTabTreasure extends CreativeTabs super( i, "Treasure Disks" ); } + @Nonnull @Override public Item getTabIconItem() { return ComputerCraft.Items.treasureDisk; } + @Nonnull @Override public String getTranslatedTabLabel() { diff --git a/src/main/java/dan200/computercraft/shared/util/ImpostorRecipe.java b/src/main/java/dan200/computercraft/shared/util/ImpostorRecipe.java index 965d769dc..d448a4ae3 100644 --- a/src/main/java/dan200/computercraft/shared/util/ImpostorRecipe.java +++ b/src/main/java/dan200/computercraft/shared/util/ImpostorRecipe.java @@ -10,6 +10,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.ShapedRecipes; import net.minecraft.world.World; +import javax.annotation.Nonnull; + public class ImpostorRecipe extends ShapedRecipes { public ImpostorRecipe( int width, int height, ItemStack[] ingredients, ItemStack result ) @@ -18,13 +20,13 @@ public class ImpostorRecipe extends ShapedRecipes } @Override - public boolean matches( InventoryCrafting inv, World world ) + public boolean matches( @Nonnull InventoryCrafting inv, World world ) { return false; } @Override - public ItemStack getCraftingResult( InventoryCrafting _inventory ) + public ItemStack getCraftingResult( @Nonnull InventoryCrafting _inventory ) { return null; } From 9af15d1e30db7b95832b1963a60dcd88fd8846f6 Mon Sep 17 00:00:00 2001 From: SquidDev Date: Sun, 7 May 2017 00:42:00 +0100 Subject: [PATCH 2/7] Remove some unnecessary constructs - Replace for and while loops with for iterators - Remove unused casts --- .../dan200/computercraft/ComputerCraft.java | 30 ++- .../computercraft/client/gui/GuiPrintout.java | 1 - .../client/gui/widgets/Widget.java | 6 +- .../client/gui/widgets/WidgetContainer.java | 205 +++++++++--------- .../proxy/ComputerCraftProxyClient.java | 3 +- .../client/render/TurtleMultiModel.java | 3 +- .../client/render/TurtleSmartItemModel.java | 2 - .../computercraft/core/apis/HTTPAPI.java | 5 +- .../computercraft/core/apis/HTTPRequest.java | 7 +- .../core/apis/PeripheralAPI.java | 12 +- .../computercraft/core/apis/RedstoneAPI.java | 2 +- .../computercraft/core/apis/TermAPI.java | 2 +- .../computercraft/core/computer/Computer.java | 13 +- .../core/filesystem/ComboMount.java | 3 +- .../core/filesystem/FileMount.java | 8 +- .../core/filesystem/FileSystem.java | 55 +++-- .../core/filesystem/FileSystemException.java | 2 + .../core/filesystem/JarMount.java | 5 +- .../core/lua/LuaJLuaMachine.java | 26 +-- .../proxy/ComputerCraftProxyServer.java | 1 - .../shared/common/BlockGeneric.java | 10 +- .../shared/common/TileGeneric.java | 1 - .../shared/computer/apis/CommandAPI.java | 3 +- .../computer/blocks/BlockCommandComputer.java | 5 +- .../shared/computer/blocks/BlockComputer.java | 8 +- .../computer/blocks/TileCommandComputer.java | 3 +- .../shared/computer/blocks/TileComputer.java | 2 +- .../computer/items/ItemComputerBase.java | 1 - .../shared/media/items/ItemTreasureDisk.java | 3 - .../shared/media/recipes/DiskRecipe.java | 2 +- .../shared/peripheral/common/BlockCable.java | 16 +- .../peripheral/common/BlockPeripheral.java | 14 +- .../shared/peripheral/common/ItemCable.java | 1 - .../diskdrive/ContainerDiskDrive.java | 2 +- .../peripheral/diskdrive/TileDiskDrive.java | 13 +- .../peripheral/modem/BlockAdvancedModem.java | 5 +- .../peripheral/modem/ModemPeripheral.java | 21 +- .../peripheral/modem/TileAdvancedModem.java | 3 +- .../shared/peripheral/modem/TileCable.java | 34 ++- .../peripheral/modem/TileWirelessModem.java | 4 +- .../peripheral/modem/WirelessNetwork.java | 4 +- .../peripheral/monitor/MonitorPeripheral.java | 2 +- .../peripheral/printer/ContainerPrinter.java | 6 +- .../shared/proxy/CCTurtleProxyCommon.java | 33 ++- .../shared/turtle/apis/TurtleAPI.java | 3 +- .../shared/turtle/blocks/BlockTurtle.java | 3 - .../shared/turtle/blocks/TileTurtle.java | 2 - .../shared/turtle/core/TurtleBrain.java | 25 +-- .../turtle/core/TurtleCompareCommand.java | 5 +- .../turtle/core/TurtleCraftCommand.java | 3 +- .../shared/turtle/core/TurtleDropCommand.java | 3 - .../turtle/core/TurtleInspectCommand.java | 3 +- .../shared/turtle/core/TurtleMoveCommand.java | 6 +- .../shared/turtle/core/TurtleSuckCommand.java | 6 +- .../turtle/inventory/ContainerTurtle.java | 7 +- .../shared/turtle/upgrades/TurtleHoe.java | 1 - .../shared/turtle/upgrades/TurtleShovel.java | 1 - .../shared/turtle/upgrades/TurtleSword.java | 1 - .../shared/turtle/upgrades/TurtleTool.java | 6 +- .../computercraft/shared/util/IDAssigner.java | 15 +- .../shared/util/InventoryUtil.java | 8 +- .../computercraft/shared/util/NBTUtil.java | 2 +- .../shared/util/ReflectionUtil.java | 6 +- .../computercraft/shared/util/WorldUtil.java | 6 +- 64 files changed, 299 insertions(+), 400 deletions(-) diff --git a/src/main/java/dan200/computercraft/ComputerCraft.java b/src/main/java/dan200/computercraft/ComputerCraft.java index 4dad6ade6..d3f3797cf 100644 --- a/src/main/java/dan200/computercraft/ComputerCraft.java +++ b/src/main/java/dan200/computercraft/ComputerCraft.java @@ -74,7 +74,10 @@ import java.io.IOException; import java.net.MalformedURLException; import java.net.URISyntaxException; import java.net.URL; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /////////////// // UNIVERSAL // @@ -509,9 +512,8 @@ public class ComputerCraft } } - for( int i=0; i it = peripheralProviders.iterator(); - while( it.hasNext() ) + for( IPeripheralProvider peripheralProvider : peripheralProviders ) { try { - IPeripheralProvider handler = it.next(); + IPeripheralProvider handler = peripheralProvider; IPeripheral peripheral = handler.getPeripheral( world, pos, side ); if( peripheral != null ) { @@ -620,12 +620,11 @@ public class ComputerCraft // Try the handlers in order: int combinedSignal = -1; - Iterator it = bundledRedstoneProviders.iterator(); - while( it.hasNext() ) + for( IBundledRedstoneProvider bundledRedstoneProvider : bundledRedstoneProviders ) { try { - IBundledRedstoneProvider handler = it.next(); + IBundledRedstoneProvider handler = bundledRedstoneProvider; int signal = handler.getBundledRedstoneOutput( world, pos, side ); if( signal >= 0 ) { @@ -652,12 +651,11 @@ public class ComputerCraft if( stack != null ) { // Try the handlers in order: - Iterator it = mediaProviders.iterator(); - while( it.hasNext() ) + for( IMediaProvider mediaProvider : mediaProviders ) { try { - IMediaProvider handler = it.next(); + IMediaProvider handler = mediaProvider; IMedia media = handler.getMedia( stack ); if( media != null ) { @@ -760,11 +758,11 @@ public class ComputerCraft if( resourcePackDir.exists() && resourcePackDir.isDirectory() ) { String[] resourcePacks = resourcePackDir.list(); - for( int i=0; i output = new ArrayList( input.size() ); - for( int i=0; i it = m_httpRequests.iterator(); - while( it.hasNext() ) { - HTTPRequest r = it.next(); + for( HTTPRequest r : m_httpRequests ) + { r.cancel(); } m_httpRequests.clear(); diff --git a/src/main/java/dan200/computercraft/core/apis/HTTPRequest.java b/src/main/java/dan200/computercraft/core/apis/HTTPRequest.java index 68177f218..c54e20497 100644 --- a/src/main/java/dan200/computercraft/core/apis/HTTPRequest.java +++ b/src/main/java/dan200/computercraft/core/apis/HTTPRequest.java @@ -19,6 +19,8 @@ import java.util.Map; import java.util.regex.Pattern; class HTTPRequestException extends Exception { + private static final long serialVersionUID = 7591208619422744652L; + public HTTPRequestException( String s ) { super( s ); } @@ -49,9 +51,8 @@ public class HTTPRequest boolean allowed = false; String whitelistString = ComputerCraft.http_whitelist; String[] allowedURLs = whitelistString.split( ";" ); - for( int i=0; i it = m_mounts.iterator(); - while( it.hasNext() ) { - m_fileSystem.unmount( it.next() ); + for( String m_mount : m_mounts ) + { + m_fileSystem.unmount( m_mount ); } m_mounts.clear(); } @@ -133,7 +133,7 @@ public class PeripheralAPI implements ILuaAPI, IAPIEnvironment.IPeripheralChange } // Mount the location - String location = null; + String location; synchronized( m_fileSystem ) { location = findFreeLocation( desiredLoc ); @@ -168,7 +168,7 @@ public class PeripheralAPI implements ILuaAPI, IAPIEnvironment.IPeripheralChange } // Mount the location - String location = null; + String location; synchronized( m_fileSystem ) { location = findFreeLocation( desiredLoc ); @@ -470,7 +470,7 @@ public class PeripheralAPI implements ILuaAPI, IAPIEnvironment.IPeripheralChange int side = parseSide( args ); if( side >= 0 ) { - PeripheralWrapper p = null; + PeripheralWrapper p; synchronized( m_peripherals ) { p = m_peripherals[ side ]; diff --git a/src/main/java/dan200/computercraft/core/apis/RedstoneAPI.java b/src/main/java/dan200/computercraft/core/apis/RedstoneAPI.java index 8a99c39b8..6f3893676 100644 --- a/src/main/java/dan200/computercraft/core/apis/RedstoneAPI.java +++ b/src/main/java/dan200/computercraft/core/apis/RedstoneAPI.java @@ -91,7 +91,7 @@ public class RedstoneAPI implements ILuaAPI throw new LuaException( "Expected string, boolean" ); } int side = parseSide( args ); - boolean output = ((Boolean)args[1]).booleanValue(); + boolean output = (Boolean) args[ 1 ]; m_environment.setOutput( side, output ? 15 : 0 ); return null; } diff --git a/src/main/java/dan200/computercraft/core/apis/TermAPI.java b/src/main/java/dan200/computercraft/core/apis/TermAPI.java index 91a4e7044..3afeab9ec 100644 --- a/src/main/java/dan200/computercraft/core/apis/TermAPI.java +++ b/src/main/java/dan200/computercraft/core/apis/TermAPI.java @@ -163,7 +163,7 @@ public class TermAPI implements ILuaAPI { throw new LuaException( "Expected boolean" ); } - boolean b = ((Boolean)args[0]).booleanValue(); + boolean b = (Boolean) args[ 0 ]; synchronized( m_terminal ) { m_terminal.setCursorBlink( b ); diff --git a/src/main/java/dan200/computercraft/core/computer/Computer.java b/src/main/java/dan200/computercraft/core/computer/Computer.java index 847d49d1c..0697eab39 100644 --- a/src/main/java/dan200/computercraft/core/computer/Computer.java +++ b/src/main/java/dan200/computercraft/core/computer/Computer.java @@ -21,7 +21,6 @@ import dan200.computercraft.core.terminal.Terminal; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; -import java.util.Iterator; import java.util.List; public class Computer @@ -370,10 +369,8 @@ public class Computer // Advance our APIs synchronized( m_apis ) { - Iterator it = m_apis.iterator(); - while( it.hasNext() ) + for(ILuaAPI api : m_apis) { - ILuaAPI api = it.next(); api.advance( _dt ); } } @@ -628,10 +625,8 @@ public class Computer ILuaMachine machine = new LuaJLuaMachine( this ); // Add the APIs - Iterator it = m_apis.iterator(); - while( it.hasNext() ) + for(ILuaAPI api : m_apis) { - ILuaAPI api = it.next(); machine.addAPI( api ); api.startup(); } @@ -794,10 +789,8 @@ public class Computer // Shutdown our APIs synchronized( m_apis ) { - Iterator it = m_apis.iterator(); - while( it.hasNext() ) + for(ILuaAPI api : m_apis) { - ILuaAPI api = it.next(); api.shutdown(); } } diff --git a/src/main/java/dan200/computercraft/core/filesystem/ComboMount.java b/src/main/java/dan200/computercraft/core/filesystem/ComboMount.java index 32260baff..54a28dc5b 100644 --- a/src/main/java/dan200/computercraft/core/filesystem/ComboMount.java +++ b/src/main/java/dan200/computercraft/core/filesystem/ComboMount.java @@ -84,9 +84,8 @@ public class ComboMount implements IMount { // We found multiple directories, so filter for duplicates Set seen = new HashSet(); - for( int i=0; i it = m_mounts.values().iterator(); - while( it.hasNext() ) { - MountWrapper otherMount = it.next(); - if( getDirectory( otherMount.getLocation() ).equals( path ) ) { + for( MountWrapper otherMount : m_mounts.values() ) + { + if( getDirectory( otherMount.getLocation() ).equals( path ) ) + { list.add( getName( otherMount.getLocation() ) ); } } @@ -445,9 +445,8 @@ public class FileSystem private void findIn( String dir, List matches, Pattern wildPattern ) throws FileSystemException { String[] list = list( dir ); - for( int i=0; i= 32 && Arrays.binarySearch( specialChars, c ) < 0 && (allowWildcards || c != '*') ) { - cleanName.append((char)c); + cleanName.append( c ); } } path = cleanName.toString(); @@ -918,30 +917,42 @@ public class FileSystem // Collapse the string into its component parts, removing ..'s String[] parts = path.split("/"); Stack outputParts = new Stack(); - for( int n=0; n= 255) { + else + { + outputParts.push( ".." ); + } + } + else if( part.length() >= 255 ) + { // If part length > 255 and it is the last part - outputParts.push( part.substring(0, 255) ); - } else { + outputParts.push( part.substring( 0, 255 ) ); + } + else + { // Anything else we add to the stack - outputParts.push(part); + outputParts.push( part ); } } diff --git a/src/main/java/dan200/computercraft/core/filesystem/FileSystemException.java b/src/main/java/dan200/computercraft/core/filesystem/FileSystemException.java index cbf970ebf..f522d2592 100644 --- a/src/main/java/dan200/computercraft/core/filesystem/FileSystemException.java +++ b/src/main/java/dan200/computercraft/core/filesystem/FileSystemException.java @@ -7,6 +7,8 @@ package dan200.computercraft.core.filesystem; public class FileSystemException extends Exception { + private static final long serialVersionUID = -2500631644868104029L; + FileSystemException( String s ) { super( s ); } diff --git a/src/main/java/dan200/computercraft/core/filesystem/JarMount.java b/src/main/java/dan200/computercraft/core/filesystem/JarMount.java index 41c6b7bfa..a8ca08f95 100644 --- a/src/main/java/dan200/computercraft/core/filesystem/JarMount.java +++ b/src/main/java/dan200/computercraft/core/filesystem/JarMount.java @@ -54,10 +54,7 @@ public class JarMount implements IMount public void list( List contents ) { - for( String child : m_children.keySet() ) - { - contents.add( child ); - } + contents.addAll( m_children.keySet() ); } public void insertChild( FileInZip child ) diff --git a/src/main/java/dan200/computercraft/core/lua/LuaJLuaMachine.java b/src/main/java/dan200/computercraft/core/lua/LuaJLuaMachine.java index ec7fcb62c..ce08aa276 100644 --- a/src/main/java/dan200/computercraft/core/lua/LuaJLuaMachine.java +++ b/src/main/java/dan200/computercraft/core/lua/LuaJLuaMachine.java @@ -25,7 +25,6 @@ import javax.annotation.Nonnull; import java.io.*; import java.util.HashMap; import java.util.IdentityHashMap; -import java.util.Iterator; import java.util.Map; public class LuaJLuaMachine implements ILuaMachine @@ -129,9 +128,9 @@ public class LuaJLuaMachine implements ILuaMachine // Add the methods of an API to the global table LuaTable table = wrapLuaObject( api ); String[] names = api.getNames(); - for( int i=0; i 0 ) { - Iterator it = drops.iterator(); - while( it.hasNext() ) + for (ItemStack item : drops) { - ItemStack item = it.next(); dropItem( world, pos, item ); } } @@ -272,10 +268,8 @@ public abstract class BlockGeneric extends Block implements // Add collision bounds to list if( collision.size() > 0 ) { - Iterator it = collision.iterator(); - while( it.hasNext() ) + for (AxisAlignedBB localBounds : collision) { - AxisAlignedBB localBounds = it.next(); addCollisionBoxToList( pos, bigBox, list, localBounds ); } } diff --git a/src/main/java/dan200/computercraft/shared/common/TileGeneric.java b/src/main/java/dan200/computercraft/shared/common/TileGeneric.java index 7934b1ff2..5d2a3314b 100644 --- a/src/main/java/dan200/computercraft/shared/common/TileGeneric.java +++ b/src/main/java/dan200/computercraft/shared/common/TileGeneric.java @@ -15,7 +15,6 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; import net.minecraft.network.play.server.SPacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.AxisAlignedBB; diff --git a/src/main/java/dan200/computercraft/shared/computer/apis/CommandAPI.java b/src/main/java/dan200/computercraft/shared/computer/apis/CommandAPI.java index 8db9894e3..b02fb3b96 100644 --- a/src/main/java/dan200/computercraft/shared/computer/apis/CommandAPI.java +++ b/src/main/java/dan200/computercraft/shared/computer/apis/CommandAPI.java @@ -21,7 +21,6 @@ import net.minecraft.command.ICommandManager; import net.minecraft.command.ICommandSender; import net.minecraft.server.MinecraftServer; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import javax.annotation.Nonnull; @@ -113,7 +112,7 @@ public class CommandAPI implements ILuaAPI // Get the details of the block IBlockState state = world.getBlockState( pos ); Block block = state.getBlock(); - String name = ((ResourceLocation)Block.REGISTRY.getNameForObject( block )).toString(); + String name = Block.REGISTRY.getNameForObject( block ).toString(); int metadata = block.getMetaFromState( state ); Map table = new HashMap(); diff --git a/src/main/java/dan200/computercraft/shared/computer/blocks/BlockCommandComputer.java b/src/main/java/dan200/computercraft/shared/computer/blocks/BlockCommandComputer.java index f1f92210a..0f387cec8 100644 --- a/src/main/java/dan200/computercraft/shared/computer/blocks/BlockCommandComputer.java +++ b/src/main/java/dan200/computercraft/shared/computer/blocks/BlockCommandComputer.java @@ -9,7 +9,6 @@ package dan200.computercraft.shared.computer.blocks; import dan200.computercraft.ComputerCraft; import dan200.computercraft.shared.computer.core.ComputerFamily; import dan200.computercraft.shared.computer.core.IComputer; -import dan200.computercraft.shared.peripheral.common.TilePeripheralBase; import dan200.computercraft.shared.util.DirectionUtil; import net.minecraft.block.material.Material; import net.minecraft.block.properties.IProperty; @@ -34,7 +33,7 @@ public class BlockCommandComputer extends BlockComputerBase public static class Properties { public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); - public static final PropertyEnum STATE = PropertyEnum.create("state", ComputerState.class); + public static final PropertyEnum STATE = PropertyEnum.create("state", ComputerState.class); } // Members @@ -77,7 +76,7 @@ public class BlockCommandComputer extends BlockComputerBase @Override public int getMetaFromState( IBlockState state ) { - return ((EnumFacing)state.getValue( Properties.FACING )).getIndex(); + return state.getValue( Properties.FACING ).getIndex(); } @Nonnull diff --git a/src/main/java/dan200/computercraft/shared/computer/blocks/BlockComputer.java b/src/main/java/dan200/computercraft/shared/computer/blocks/BlockComputer.java index 203e662ec..40a23b700 100644 --- a/src/main/java/dan200/computercraft/shared/computer/blocks/BlockComputer.java +++ b/src/main/java/dan200/computercraft/shared/computer/blocks/BlockComputer.java @@ -36,7 +36,7 @@ public class BlockComputer extends BlockComputerBase { public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); public static final PropertyBool ADVANCED = PropertyBool.create("advanced"); - public static final PropertyEnum STATE = PropertyEnum.create("state", ComputerState.class); + public static final PropertyEnum STATE = PropertyEnum.create("state", ComputerState.class); } // Members @@ -90,8 +90,8 @@ public class BlockComputer extends BlockComputerBase @Override public int getMetaFromState( IBlockState state ) { - int meta = ((EnumFacing)state.getValue( Properties.FACING )).getIndex(); - if( (Boolean)state.getValue( Properties.ADVANCED ) ) + int meta = state.getValue( Properties.FACING ).getIndex(); + if( state.getValue( Properties.ADVANCED ) ) { meta += 8; } @@ -153,7 +153,7 @@ public class BlockComputer extends BlockComputerBase @Override public ComputerFamily getFamily( IBlockState state ) { - if( (Boolean)state.getValue( Properties.ADVANCED ) ) { + if( state.getValue( Properties.ADVANCED ) ) { return ComputerFamily.Advanced; } else { return ComputerFamily.Normal; diff --git a/src/main/java/dan200/computercraft/shared/computer/blocks/TileCommandComputer.java b/src/main/java/dan200/computercraft/shared/computer/blocks/TileCommandComputer.java index 1847a4782..01032e5cd 100644 --- a/src/main/java/dan200/computercraft/shared/computer/blocks/TileCommandComputer.java +++ b/src/main/java/dan200/computercraft/shared/computer/blocks/TileCommandComputer.java @@ -22,7 +22,6 @@ import net.minecraft.util.*; import net.minecraft.world.World; import javax.annotation.Nonnull; -import javax.annotation.Nullable; import java.util.HashMap; import java.util.Map; @@ -147,7 +146,7 @@ public class TileCommandComputer extends TileComputer public EnumFacing getDirection() { IBlockState state = getBlockState(); - return (EnumFacing)state.getValue( BlockCommandComputer.Properties.FACING ); + return state.getValue( BlockCommandComputer.Properties.FACING ); } @Override diff --git a/src/main/java/dan200/computercraft/shared/computer/blocks/TileComputer.java b/src/main/java/dan200/computercraft/shared/computer/blocks/TileComputer.java index 0cccd8544..2e002f359 100644 --- a/src/main/java/dan200/computercraft/shared/computer/blocks/TileComputer.java +++ b/src/main/java/dan200/computercraft/shared/computer/blocks/TileComputer.java @@ -87,7 +87,7 @@ public class TileComputer extends TileComputerBase public EnumFacing getDirection() { IBlockState state = getBlockState(); - return (EnumFacing)state.getValue( BlockComputer.Properties.FACING ); + return state.getValue( BlockComputer.Properties.FACING ); } @Override diff --git a/src/main/java/dan200/computercraft/shared/computer/items/ItemComputerBase.java b/src/main/java/dan200/computercraft/shared/computer/items/ItemComputerBase.java index 8d4fc730b..8f4e63ca6 100644 --- a/src/main/java/dan200/computercraft/shared/computer/items/ItemComputerBase.java +++ b/src/main/java/dan200/computercraft/shared/computer/items/ItemComputerBase.java @@ -10,7 +10,6 @@ import dan200.computercraft.ComputerCraft; import dan200.computercraft.api.filesystem.IMount; import dan200.computercraft.api.media.IMedia; import dan200.computercraft.shared.computer.core.ComputerFamily; -import dan200.computercraft.shared.computer.core.ServerComputer; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; diff --git a/src/main/java/dan200/computercraft/shared/media/items/ItemTreasureDisk.java b/src/main/java/dan200/computercraft/shared/media/items/ItemTreasureDisk.java index 77aab3aa2..bcdf2bc3c 100644 --- a/src/main/java/dan200/computercraft/shared/media/items/ItemTreasureDisk.java +++ b/src/main/java/dan200/computercraft/shared/media/items/ItemTreasureDisk.java @@ -23,10 +23,7 @@ import net.minecraft.world.World; import javax.annotation.Nonnull; import java.io.IOException; -import java.util.ArrayList; -import java.util.Collections; import java.util.List; -import java.util.Random; public class ItemTreasureDisk extends Item implements IMedia diff --git a/src/main/java/dan200/computercraft/shared/media/recipes/DiskRecipe.java b/src/main/java/dan200/computercraft/shared/media/recipes/DiskRecipe.java index 89a6533f9..aed43021c 100644 --- a/src/main/java/dan200/computercraft/shared/media/recipes/DiskRecipe.java +++ b/src/main/java/dan200/computercraft/shared/media/recipes/DiskRecipe.java @@ -85,7 +85,7 @@ public class DiskRecipe implements IRecipe int[] var3 = new int[3]; int var4 = 0; int var5 = 0; - ItemDiskLegacy var6 = null; + ItemDiskLegacy var6; int var7; int var9; float var10; diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockCable.java b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockCable.java index eac9ee1c7..8489c2c52 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockCable.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockCable.java @@ -29,7 +29,7 @@ public class BlockCable extends BlockPeripheralBase public static class Properties { - public static final PropertyEnum MODEM = PropertyEnum.create( "modem", BlockCableModemVariant.class ); + public static final PropertyEnum MODEM = PropertyEnum.create( "modem", BlockCableModemVariant.class ); public static final PropertyBool CABLE = PropertyBool.create( "cable" ); public static final PropertyBool NORTH = PropertyBool.create( "north" ); public static final PropertyBool SOUTH = PropertyBool.create( "south" ); @@ -118,8 +118,8 @@ public class BlockCable extends BlockPeripheralBase public int getMetaFromState( IBlockState state ) { int meta = 0; - boolean cable = (Boolean)state.getValue( Properties.CABLE ); - BlockCableModemVariant modem = (BlockCableModemVariant)state.getValue( Properties.MODEM ); + boolean cable = state.getValue( Properties.CABLE ); + BlockCableModemVariant modem = state.getValue( Properties.MODEM ); if( cable && modem != BlockCableModemVariant.None ) { meta = 6 + modem.getFacing().getIndex(); @@ -164,11 +164,11 @@ public class BlockCable extends BlockPeripheralBase private boolean doesConnect( IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing dir ) { - if( !((Boolean)state.getValue( Properties.CABLE )) ) + if( !state.getValue( Properties.CABLE ) ) { return false; } - else if( ((BlockCableModemVariant)state.getValue( Properties.MODEM )).getFacing() == dir ) + else if( state.getValue( Properties.MODEM ).getFacing() == dir ) { return true; } @@ -201,7 +201,7 @@ public class BlockCable extends BlockPeripheralBase anim = 0; } - BlockCableModemVariant modem = ((BlockCableModemVariant)state.getValue( Properties.MODEM )); + BlockCableModemVariant modem = state.getValue( Properties.MODEM ); if( modem != BlockCableModemVariant.None ) { modem = BlockCableModemVariant.values()[ @@ -228,8 +228,8 @@ public class BlockCable extends BlockPeripheralBase @Override public PeripheralType getPeripheralType( IBlockState state ) { - boolean cable = (Boolean)state.getValue( Properties.CABLE ); - BlockCableModemVariant modem = (BlockCableModemVariant)state.getValue( Properties.MODEM ); + boolean cable = state.getValue( Properties.CABLE ); + BlockCableModemVariant modem = state.getValue( Properties.MODEM ); if( cable && modem != BlockCableModemVariant.None ) { return PeripheralType.WiredModemWithCable; diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheral.java b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheral.java index e825dbbed..f8e831e17 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheral.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheral.java @@ -37,7 +37,7 @@ public class BlockPeripheral extends BlockPeripheralBase public static class Properties { public static final PropertyDirection FACING = PropertyDirection.create( "facing", EnumFacing.Plane.HORIZONTAL ); - public static final PropertyEnum VARIANT = PropertyEnum.create( "variant", BlockPeripheralVariant.class ); + public static final PropertyEnum VARIANT = PropertyEnum.create( "variant", BlockPeripheralVariant.class ); } public BlockPeripheral() @@ -115,12 +115,12 @@ public class BlockPeripheral extends BlockPeripheralBase public int getMetaFromState( IBlockState state ) { int meta = 0; - BlockPeripheralVariant variant = (BlockPeripheralVariant)state.getValue( Properties.VARIANT ); + BlockPeripheralVariant variant = state.getValue( Properties.VARIANT ); switch( variant.getPeripheralType() ) { case DiskDrive: { - EnumFacing dir = (EnumFacing)state.getValue( Properties.FACING ); + EnumFacing dir = state.getValue( Properties.FACING ); if( dir.getAxis() == EnumFacing.Axis.Y ) { dir = EnumFacing.NORTH; } @@ -145,7 +145,7 @@ public class BlockPeripheral extends BlockPeripheralBase } default: { - EnumFacing dir = (EnumFacing)state.getValue( Properties.FACING ); + EnumFacing dir = state.getValue( Properties.FACING ); meta = dir.getIndex() + 4; break; } @@ -187,8 +187,8 @@ public class BlockPeripheral extends BlockPeripheralBase else { anim = 0; - dir = (EnumFacing)state.getValue( Properties.FACING ); - switch( (BlockPeripheralVariant)state.getValue( BlockPeripheral.Properties.VARIANT ) ) + dir = state.getValue( Properties.FACING ); + switch( state.getValue( Properties.VARIANT ) ) { case WirelessModemDownOff: case WirelessModemDownOn: @@ -503,7 +503,7 @@ public class BlockPeripheral extends BlockPeripheralBase @Override public PeripheralType getPeripheralType( IBlockState state ) { - return ((BlockPeripheralVariant)state.getValue( Properties.VARIANT )).getPeripheralType(); + return state.getValue( Properties.VARIANT ).getPeripheralType(); } @Override diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/ItemCable.java b/src/main/java/dan200/computercraft/shared/peripheral/common/ItemCable.java index 69241381e..37374af60 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/ItemCable.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/ItemCable.java @@ -13,7 +13,6 @@ import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; diff --git a/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/ContainerDiskDrive.java b/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/ContainerDiskDrive.java index d3af4e45d..964288255 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/ContainerDiskDrive.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/ContainerDiskDrive.java @@ -47,7 +47,7 @@ public class ContainerDiskDrive extends Container public ItemStack transferStackInSlot( EntityPlayer player, int i ) { ItemStack itemstack = null; - Slot slot = (Slot)inventorySlots.get(i); + Slot slot = inventorySlots.get(i); if(slot != null && slot.getHasStack()) { ItemStack itemstack1 = slot.getStack(); diff --git a/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/TileDiskDrive.java b/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/TileDiskDrive.java index cb472d525..0323cf81e 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/TileDiskDrive.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/TileDiskDrive.java @@ -17,13 +17,11 @@ import dan200.computercraft.shared.peripheral.common.BlockPeripheral; import dan200.computercraft.shared.peripheral.common.TilePeripheralBase; import dan200.computercraft.shared.util.InventoryUtil; import net.minecraft.block.state.IBlockState; -import net.minecraft.client.audio.Sound; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ITickable; import net.minecraft.util.*; import net.minecraft.util.math.*; import net.minecraft.util.text.*; @@ -31,7 +29,6 @@ import net.minecraft.world.World; import javax.annotation.Nonnull; import java.util.HashMap; -import java.util.Iterator; import java.util.Map; import java.util.Set; @@ -121,7 +118,7 @@ public class TileDiskDrive extends TilePeripheralBase public EnumFacing getDirection() { IBlockState state = getBlockState(); - return (EnumFacing)state.getValue( BlockPeripheral.Properties.FACING ); + return state.getValue( BlockPeripheral.Properties.FACING ); } @Override @@ -278,10 +275,8 @@ public class TileDiskDrive extends TilePeripheralBase if( m_diskStack != null ) { Set computers = m_computers.keySet(); - Iterator it = computers.iterator(); - while( it.hasNext() ) + for( IComputerAccess computer : computers ) { - IComputerAccess computer = it.next(); unmountDisk( computer ); } } @@ -306,10 +301,8 @@ public class TileDiskDrive extends TilePeripheralBase if( m_diskStack != null ) { Set computers = m_computers.keySet(); - Iterator it = computers.iterator(); - while( it.hasNext() ) + for( IComputerAccess computer : computers ) { - IComputerAccess computer = it.next(); mountDisk( computer ); } } diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/BlockAdvancedModem.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/BlockAdvancedModem.java index af8f27724..c26241ce0 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/BlockAdvancedModem.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/BlockAdvancedModem.java @@ -15,13 +15,10 @@ import net.minecraft.block.properties.PropertyBool; import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; import javax.annotation.Nonnull; @@ -87,7 +84,7 @@ public class BlockAdvancedModem extends BlockPeripheralBase else { anim = 0; - dir = (EnumFacing)state.getValue( Properties.FACING ); + dir = state.getValue( Properties.FACING ); } state = state.withProperty( Properties.FACING, dir ); diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/ModemPeripheral.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/ModemPeripheral.java index a1853b68d..211053844 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/ModemPeripheral.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/ModemPeripheral.java @@ -15,7 +15,6 @@ import net.minecraft.world.World; import javax.annotation.Nonnull; import java.util.HashMap; -import java.util.Iterator; import java.util.Map; public abstract class ModemPeripheral @@ -107,10 +106,9 @@ public abstract class ModemPeripheral // Leave old network if( m_network != null ) { - Iterator it = m_channels.values().iterator(); - while( it.hasNext() ) + for( IReceiver iReceiver : m_channels.values() ) { - m_network.removeReceiver( it.next() ); + m_network.removeReceiver( iReceiver ); } } @@ -120,10 +118,9 @@ public abstract class ModemPeripheral // Join new network if( m_network != null ) { - Iterator it = m_channels.values().iterator(); - while( it.hasNext() ) + for( IReceiver iReceiver : m_channels.values() ) { - m_network.addReceiver( it.next() ); + m_network.addReceiver( iReceiver ); } } } @@ -315,10 +312,9 @@ public abstract class ModemPeripheral { if( m_network != null ) { - Iterator it = m_channels.values().iterator(); - while( it.hasNext() ) + for( IReceiver iReceiver : m_channels.values() ) { - m_network.removeReceiver( it.next() ); + m_network.removeReceiver( iReceiver ); } } m_channels.clear(); @@ -381,10 +377,9 @@ public abstract class ModemPeripheral { if( m_network != null ) { - Iterator it = m_channels.values().iterator(); - while( it.hasNext() ) + for( IReceiver iReceiver : m_channels.values() ) { - m_network.removeReceiver( it.next() ); + m_network.removeReceiver( iReceiver ); } m_channels.clear(); m_network = null; diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/TileAdvancedModem.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/TileAdvancedModem.java index c8c5dfb52..a90dd7bc6 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/TileAdvancedModem.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/TileAdvancedModem.java @@ -7,7 +7,6 @@ package dan200.computercraft.shared.peripheral.modem; import dan200.computercraft.api.peripheral.IPeripheral; -import dan200.computercraft.shared.peripheral.common.BlockPeripheral; import net.minecraft.block.state.IBlockState; import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; @@ -64,7 +63,7 @@ public class TileAdvancedModem extends TileModemBase { // Wireless Modem IBlockState state = getBlockState(); - return (EnumFacing)state.getValue( BlockAdvancedModem.Properties.FACING ); + return state.getValue( BlockAdvancedModem.Properties.FACING ); } @Override diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/TileCable.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/TileCable.java index 34b26139a..d25ed9420 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/TileCable.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/TileCable.java @@ -26,9 +26,11 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.*; -import net.minecraft.util.math.*; -import net.minecraft.util.text.*; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Vec3d; +import net.minecraft.util.text.TextComponentTranslation; import net.minecraft.world.World; import javax.annotation.Nonnull; @@ -131,10 +133,8 @@ public class TileCable extends TileModemBase { int idx = 1; Map table = new HashMap(); - Iterator it = m_entity.m_peripheralWrappersByName.keySet().iterator(); - while( it.hasNext() ) + for( String name : m_entity.m_peripheralWrappersByName.keySet() ) { - String name = it.next(); table.put( idx++, name ); } return new Object[] { table }; @@ -193,10 +193,8 @@ public class TileCable extends TileModemBase super.attach( computer ); synchronized( m_entity.m_peripheralsByName ) { - Iterator it = m_entity.m_peripheralsByName.keySet().iterator(); - while( it.hasNext() ) + for (String periphName : m_entity.m_peripheralsByName.keySet()) { - String periphName = it.next(); IPeripheral peripheral = m_entity.m_peripheralsByName.get( periphName ); if( peripheral != null ) { @@ -211,10 +209,8 @@ public class TileCable extends TileModemBase { synchronized( m_entity.m_peripheralsByName ) { - Iterator it = m_entity.m_peripheralsByName.keySet().iterator(); - while( it.hasNext() ) + for (String periphName : m_entity.m_peripheralsByName.keySet()) { - String periphName = it.next(); m_entity.detachPeripheral( periphName ); } } @@ -281,7 +277,7 @@ public class TileCable extends TileModemBase public EnumFacing getDirection() { IBlockState state = getBlockState(); - BlockCableModemVariant modem = (BlockCableModemVariant)state.getValue( BlockCable.Properties.MODEM ); + BlockCableModemVariant modem = state.getValue( BlockCable.Properties.MODEM ); if( modem != BlockCableModemVariant.None ) { return modem.getFacing(); @@ -296,7 +292,7 @@ public class TileCable extends TileModemBase public void setDirection( EnumFacing dir ) { IBlockState state = getBlockState(); - BlockCableModemVariant modem = ( BlockCableModemVariant )state.getValue( BlockCable.Properties.MODEM ); + BlockCableModemVariant modem = state.getValue( BlockCable.Properties.MODEM ); if( modem != BlockCableModemVariant.None ) { setBlockState( state.withProperty( BlockCable.Properties.MODEM, BlockCableModemVariant.fromFacing( dir ) ) ); @@ -756,11 +752,9 @@ public class TileCable extends TileModemBase Set receivers = m_receivers.get( packet.channel ); if( receivers != null ) { - Iterator it = receivers.iterator(); - while( it.hasNext() ) + for( IReceiver receiver : receivers ) { - IReceiver receiver = it.next(); - receiver.receiveSameDimension( packet.replyChannel, packet.payload, (double)distanceTravelled, packet.senderObject ); + receiver.receiveSameDimension( packet.replyChannel, packet.payload, (double) distanceTravelled, packet.senderObject ); } } } @@ -920,10 +914,8 @@ public class TileCable extends TileModemBase } // Attach all the new peripherals - Iterator it2 = newPeripheralsByName.keySet().iterator(); - while( it2.hasNext() ) + for( String periphName : newPeripheralsByName.keySet() ) { - String periphName = it2.next(); if( !m_peripheralsByName.containsKey( periphName ) ) { IPeripheral peripheral = newPeripheralsByName.get( periphName ); diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/TileWirelessModem.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/TileWirelessModem.java index 7e3ad828c..44ebe3ef6 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/TileWirelessModem.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/TileWirelessModem.java @@ -69,7 +69,7 @@ public class TileWirelessModem extends TileModemBase { // Wireless Modem IBlockState state = getBlockState(); - switch( (BlockPeripheralVariant)state.getValue( BlockPeripheral.Properties.VARIANT ) ) + switch( state.getValue( BlockPeripheral.Properties.VARIANT ) ) { case WirelessModemDownOff: case WirelessModemDownOn: @@ -83,7 +83,7 @@ public class TileWirelessModem extends TileModemBase } default: { - return (EnumFacing)state.getValue( BlockPeripheral.Properties.FACING ); + return state.getValue( BlockPeripheral.Properties.FACING ); } } } diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/WirelessNetwork.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/WirelessNetwork.java index 24f462974..255ba7e74 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/WirelessNetwork.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/WirelessNetwork.java @@ -66,10 +66,8 @@ public class WirelessNetwork implements INetwork Set receivers = m_receivers.get( channel ); if( receivers != null ) { - Iterator it = receivers.iterator(); - while( it.hasNext() ) + for( IReceiver receiver : receivers ) { - IReceiver receiver = it.next(); tryTransmit( receiver, replyChannel, payload, world, pos, range, interdimensional, senderObject ); } } diff --git a/src/main/java/dan200/computercraft/shared/peripheral/monitor/MonitorPeripheral.java b/src/main/java/dan200/computercraft/shared/peripheral/monitor/MonitorPeripheral.java index 00d499bf4..07ea732a1 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/monitor/MonitorPeripheral.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/monitor/MonitorPeripheral.java @@ -111,7 +111,7 @@ public class MonitorPeripheral implements IPeripheral throw new LuaException( "Expected boolean" ); } Terminal terminal = m_monitor.getTerminal().getTerminal(); - terminal.setCursorBlink( ((Boolean)args[0]).booleanValue() ); + terminal.setCursorBlink( (Boolean) args[ 0 ] ); return null; } case 4: diff --git a/src/main/java/dan200/computercraft/shared/peripheral/printer/ContainerPrinter.java b/src/main/java/dan200/computercraft/shared/peripheral/printer/ContainerPrinter.java index 3da3915fe..8306d3a78 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/printer/ContainerPrinter.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/printer/ContainerPrinter.java @@ -77,9 +77,9 @@ public class ContainerPrinter extends Container if( !m_printer.getWorld().isRemote ) { boolean printing = m_printer.isPrinting(); - for (int i=0; igetPrivateValue( Entity.class, - entity, + entity, "captureDrops" - ).booleanValue(); + ); if( !captured ) { ObfuscationReflectionHelper.setPrivateValue( - Entity.class, - entity, - new Boolean( true ), - "captureDrops" + Entity.class, + entity, + Boolean.TRUE, + "captureDrops" ); ArrayList items = ObfuscationReflectionHelper.getPrivateValue( - Entity.class, - entity, - "capturedDrops" + Entity.class, + entity, + "capturedDrops" ); if( items == null || items.size() == 0 ) @@ -219,15 +218,15 @@ public abstract class CCTurtleProxyCommon implements ICCTurtleProxy { ObfuscationReflectionHelper.setPrivateValue( Entity.class, - entity, - new Boolean( false ), + entity, + Boolean.FALSE, "captureDrops" ); ArrayList items = ObfuscationReflectionHelper.getPrivateValue( - Entity.class, - entity, - "capturedDrops" + Entity.class, + entity, + "capturedDrops" ); if( items != null ) @@ -437,10 +436,8 @@ public abstract class CCTurtleProxyCommon implements ICCTurtleProxy if( consumer != null ) { // All checks have passed, lets dispatch the drops - Iterator it = drops.iterator(); - while( it.hasNext() ) + for(EntityItem entityItem : drops) { - EntityItem entityItem = (EntityItem)it.next(); consumer.consumeDrop( entity, entityItem.getEntityItem() ); } drops.clear(); diff --git a/src/main/java/dan200/computercraft/shared/turtle/apis/TurtleAPI.java b/src/main/java/dan200/computercraft/shared/turtle/apis/TurtleAPI.java index cac3a019b..7ea834e97 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/apis/TurtleAPI.java +++ b/src/main/java/dan200/computercraft/shared/turtle/apis/TurtleAPI.java @@ -17,7 +17,6 @@ import dan200.computercraft.core.apis.ILuaAPI; import dan200.computercraft.shared.turtle.core.*; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; import javax.annotation.Nonnull; import java.util.HashMap; @@ -480,7 +479,7 @@ public class TurtleAPI implements ILuaAPI if( stack != null && stack.stackSize > 0 ) { Item item = stack.getItem(); - String name = ((ResourceLocation)Item.REGISTRY.getNameForObject( item )).toString(); + String name = Item.REGISTRY.getNameForObject( item ).toString(); int damage = stack.getItemDamage(); int count = stack.stackSize; diff --git a/src/main/java/dan200/computercraft/shared/turtle/blocks/BlockTurtle.java b/src/main/java/dan200/computercraft/shared/turtle/blocks/BlockTurtle.java index 2c7d67cec..207d7ba8d 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/blocks/BlockTurtle.java +++ b/src/main/java/dan200/computercraft/shared/turtle/blocks/BlockTurtle.java @@ -8,14 +8,11 @@ package dan200.computercraft.shared.turtle.blocks; import dan200.computercraft.ComputerCraft; import dan200.computercraft.shared.computer.blocks.BlockComputerBase; -import dan200.computercraft.shared.computer.blocks.TileCommandComputer; import dan200.computercraft.shared.computer.blocks.TileComputerBase; import dan200.computercraft.shared.computer.core.ComputerFamily; import dan200.computercraft.shared.util.DirectionUtil; import net.minecraft.block.material.Material; -import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyDirection; -import net.minecraft.block.properties.PropertyEnum; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; diff --git a/src/main/java/dan200/computercraft/shared/turtle/blocks/TileTurtle.java b/src/main/java/dan200/computercraft/shared/turtle/blocks/TileTurtle.java index ec5f6c072..170f00a65 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/blocks/TileTurtle.java +++ b/src/main/java/dan200/computercraft/shared/turtle/blocks/TileTurtle.java @@ -10,7 +10,6 @@ import dan200.computercraft.ComputerCraft; import dan200.computercraft.api.turtle.ITurtleAccess; import dan200.computercraft.api.turtle.ITurtleUpgrade; import dan200.computercraft.api.turtle.TurtleSide; -import dan200.computercraft.api.turtle.TurtleUpgradeType; import dan200.computercraft.shared.computer.blocks.TileComputerBase; import dan200.computercraft.shared.computer.core.ComputerFamily; import dan200.computercraft.shared.computer.core.IComputer; @@ -28,7 +27,6 @@ import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; -import net.minecraft.util.ITickable; import net.minecraft.util.*; import net.minecraft.util.math.*; import net.minecraft.util.text.*; diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleBrain.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleBrain.java index 0212ad618..6c2ec921f 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleBrain.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleBrain.java @@ -28,7 +28,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.*; import net.minecraft.util.math.*; -import net.minecraft.util.text.*; import net.minecraft.world.World; import net.minecraftforge.common.util.Constants; @@ -335,11 +334,11 @@ public class TurtleBrain implements ITurtleAccess // Write NBT if( m_upgradeNBTData.containsKey( TurtleSide.Left ) ) { - nbttagcompound.setTag( "leftUpgradeNBT", (NBTTagCompound) getUpgradeNBTData( TurtleSide.Left ).copy() ); + nbttagcompound.setTag( "leftUpgradeNBT", getUpgradeNBTData( TurtleSide.Left ).copy() ); } if( m_upgradeNBTData.containsKey( TurtleSide.Right ) ) { - nbttagcompound.setTag( "rightUpgradeNBT", (NBTTagCompound) getUpgradeNBTData( TurtleSide.Right ).copy() ); + nbttagcompound.setTag( "rightUpgradeNBT", getUpgradeNBTData( TurtleSide.Right ).copy() ); } return nbttagcompound; @@ -371,11 +370,11 @@ public class TurtleBrain implements ITurtleAccess // NBT if( m_upgradeNBTData.containsKey( TurtleSide.Left ) ) { - nbttagcompound.setTag( "leftUpgradeNBT", (NBTTagCompound) getUpgradeNBTData( TurtleSide.Left ).copy() ); + nbttagcompound.setTag( "leftUpgradeNBT", getUpgradeNBTData( TurtleSide.Left ).copy() ); } if( m_upgradeNBTData.containsKey( TurtleSide.Right ) ) { - nbttagcompound.setTag( "rightUpgradeNBT", (NBTTagCompound) getUpgradeNBTData( TurtleSide.Right ).copy() ); + nbttagcompound.setTag( "rightUpgradeNBT", getUpgradeNBTData( TurtleSide.Right ).copy() ); } // Colour @@ -738,10 +737,7 @@ public class TurtleBrain implements ITurtleAccess if( ( (Number) response[ 1 ] ).intValue() == commandID ) { Object[] returnValues = new Object[ response.length - 2 ]; - for( int i = 0; i < returnValues.length; ++i ) - { - returnValues[ i ] = response[ i + 2 ]; - } + System.arraycopy( response, 2, returnValues, 0, returnValues.length ); return returnValues; } } @@ -1033,10 +1029,7 @@ public class TurtleBrain implements ITurtleAccess Object[] arguments = new Object[ results.length + 2 ]; arguments[0] = callbackID; arguments[1] = true; - for( int i=0; i drops = lookAtBlock.getDrops( world, newPosition, lookAtState, 0 ); if( drops != null && drops.size() > 0 ) { - Iterator it = drops.iterator(); - while( it.hasNext() ) + for( ItemStack drop : drops ) { - ItemStack drop = it.next(); if( drop.getItem() == Item.getItemFromBlock( lookAtBlock ) ) { lookAtStack = drop; diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCraftCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCraftCommand.java index 2a617bf71..4e3022664 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCraftCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCraftCommand.java @@ -38,9 +38,8 @@ public class TurtleCraftCommand implements ITurtleCommand if( results != null ) { // Store the results - for( int i=0; i table = new HashMap(); diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleMoveCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleMoveCommand.java index afea753bc..26e654ae5 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleMoveCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleMoveCommand.java @@ -72,10 +72,10 @@ public class TurtleMoveCommand implements ITurtleCommand if( ComputerCraft.turtlesCanPush && m_direction != MoveDirection.Up && m_direction != MoveDirection.Down ) { // Check there is space for all the pushable entities to be pushed - List list = oldWorld.getEntitiesWithinAABBExcludingEntity( (Entity)null, aabb ); - for( int i=0; i items = getBlockDropped( world, newPosition ); if( items != null && items.size() > 0 ) { - Iterator it = items.iterator(); - while( it.hasNext() ) + for( ItemStack stack : items ) { - ItemStack stack = it.next(); ItemStack remainder = InventoryUtil.storeItems( stack, turtle.getInventory(), 0, turtle.getInventory().getSizeInventory(), turtle.getSelectedSlot() ); if( remainder != null ) { diff --git a/src/main/java/dan200/computercraft/shared/util/IDAssigner.java b/src/main/java/dan200/computercraft/shared/util/IDAssigner.java index 15d665bfe..d6eda9687 100644 --- a/src/main/java/dan200/computercraft/shared/util/IDAssigner.java +++ b/src/main/java/dan200/computercraft/shared/util/IDAssigner.java @@ -21,7 +21,7 @@ public class IDAssigner private static int getNextID( File location, boolean directory ) { // Determine where to locate ID file - File lastidFile = null; + File lastidFile; if( directory ) { location.mkdirs(); @@ -41,12 +41,15 @@ public class IDAssigner if( directory && location.exists() && location.isDirectory() ) { String[] contents = location.list(); - for( int i=0; i 0 ) { ItemStack stack = inventory.getStackInSlot( slot ); diff --git a/src/main/java/dan200/computercraft/shared/util/NBTUtil.java b/src/main/java/dan200/computercraft/shared/util/NBTUtil.java index ea4a08884..d9468e8ee 100644 --- a/src/main/java/dan200/computercraft/shared/util/NBTUtil.java +++ b/src/main/java/dan200/computercraft/shared/util/NBTUtil.java @@ -20,7 +20,7 @@ public class NBTUtil { if( object instanceof Boolean ) { - boolean b = ((Boolean)object).booleanValue(); + boolean b = (Boolean) object; return new NBTTagByte( b ? (byte)1 : (byte)0 ); } else if( object instanceof Number ) diff --git a/src/main/java/dan200/computercraft/shared/util/ReflectionUtil.java b/src/main/java/dan200/computercraft/shared/util/ReflectionUtil.java index 758898d1b..72d378343 100644 --- a/src/main/java/dan200/computercraft/shared/util/ReflectionUtil.java +++ b/src/main/java/dan200/computercraft/shared/util/ReflectionUtil.java @@ -35,11 +35,11 @@ public class ReflectionUtil Class[] declaredClasses = enclosingClass.getDeclaredClasses(); if( declaredClasses != null ) { - for( int i=0; i Date: Sun, 7 May 2017 01:16:08 +0100 Subject: [PATCH 3/7] Remove most raw types This means we can remove even more casts and what not. --- .../dan200/computercraft/ComputerCraft.java | 9 +++---- .../computercraft/api/ComputerCraftAPI.java | 24 ++++++++--------- .../proxy/ComputerCraftProxyClient.java | 4 +-- .../client/render/TurtleMultiModel.java | 2 +- .../dan200/computercraft/core/apis/FSAPI.java | 4 +-- .../computercraft/core/apis/HTTPAPI.java | 2 +- .../core/apis/PeripheralAPI.java | 3 +-- .../core/lua/LuaJLuaMachine.java | 10 +++---- .../shared/computer/apis/CommandAPI.java | 12 ++++----- .../computer/blocks/BlockCommandComputer.java | 6 +---- .../shared/computer/blocks/BlockComputer.java | 9 ++----- .../computer/items/ItemCommandComputer.java | 2 +- .../shared/computer/items/ItemComputer.java | 2 +- .../computer/items/ItemComputerBase.java | 2 +- .../shared/media/items/ItemDiskLegacy.java | 4 +-- .../shared/media/items/ItemPrintout.java | 4 +-- .../shared/media/items/ItemTreasureDisk.java | 4 +-- .../shared/peripheral/common/BlockCable.java | 9 +++---- .../peripheral/common/BlockPeripheral.java | 10 +++---- .../peripheral/common/ItemAdvancedModem.java | 2 +- .../shared/peripheral/common/ItemCable.java | 2 +- .../peripheral/common/ItemPeripheral.java | 2 +- .../peripheral/modem/BlockAdvancedModem.java | 6 +---- .../peripheral/printer/ContainerPrinter.java | 3 +-- .../pocket/items/ItemPocketComputer.java | 4 +-- .../shared/proxy/CCTurtleProxyCommon.java | 3 ++- .../proxy/ComputerCraftProxyCommon.java | 14 +++++----- .../shared/turtle/core/TurtleBrain.java | 20 +++++++------- .../turtle/core/TurtleInspectCommand.java | 3 +-- .../shared/turtle/core/TurtleMoveCommand.java | 5 ++-- .../turtle/core/TurtlePlaceCommand.java | 3 +-- .../shared/turtle/core/TurtleSuckCommand.java | 5 ++-- .../shared/turtle/items/ItemTurtleBase.java | 2 +- .../shared/turtle/upgrades/TurtleTool.java | 3 +-- .../shared/util/ImpostorShapelessRecipe.java | 4 +-- .../computercraft/shared/util/NBTUtil.java | 13 ++++------ .../shared/util/ReflectionUtil.java | 26 ++++++++++--------- .../computercraft/shared/util/WorldUtil.java | 5 ++-- 38 files changed, 106 insertions(+), 141 deletions(-) diff --git a/src/main/java/dan200/computercraft/ComputerCraft.java b/src/main/java/dan200/computercraft/ComputerCraft.java index d3f3797cf..5c3a071b8 100644 --- a/src/main/java/dan200/computercraft/ComputerCraft.java +++ b/src/main/java/dan200/computercraft/ComputerCraft.java @@ -586,8 +586,7 @@ public class ComputerCraft { try { - IPeripheralProvider handler = peripheralProvider; - IPeripheral peripheral = handler.getPeripheral( world, pos, side ); + IPeripheral peripheral = peripheralProvider.getPeripheral( world, pos, side ); if( peripheral != null ) { return peripheral; @@ -624,8 +623,7 @@ public class ComputerCraft { try { - IBundledRedstoneProvider handler = bundledRedstoneProvider; - int signal = handler.getBundledRedstoneOutput( world, pos, side ); + int signal = bundledRedstoneProvider.getBundledRedstoneOutput( world, pos, side ); if( signal >= 0 ) { if( combinedSignal < 0 ) @@ -655,8 +653,7 @@ public class ComputerCraft { try { - IMediaProvider handler = mediaProvider; - IMedia media = handler.getMedia( stack ); + IMedia media = mediaProvider.getMedia( stack ); if( media != null ) { return media; diff --git a/src/main/java/dan200/computercraft/api/ComputerCraftAPI.java b/src/main/java/dan200/computercraft/api/ComputerCraftAPI.java index 9c4adfcdf..84747f644 100644 --- a/src/main/java/dan200/computercraft/api/ComputerCraftAPI.java +++ b/src/main/java/dan200/computercraft/api/ComputerCraftAPI.java @@ -298,36 +298,36 @@ public final class ComputerCraftAPI if( !ccSearched ) { try { computerCraft = Class.forName( "dan200.computercraft.ComputerCraft" ); - computerCraft_getVersion = findCCMethod( "getVersion", new Class[]{ + computerCraft_getVersion = findCCMethod( "getVersion", new Class[]{ } ); - computerCraft_createUniqueNumberedSaveDir = findCCMethod( "createUniqueNumberedSaveDir", new Class[]{ + computerCraft_createUniqueNumberedSaveDir = findCCMethod( "createUniqueNumberedSaveDir", new Class[]{ World.class, String.class } ); - computerCraft_createSaveDirMount = findCCMethod( "createSaveDirMount", new Class[] { + computerCraft_createSaveDirMount = findCCMethod( "createSaveDirMount", new Class[] { World.class, String.class, Long.TYPE } ); - computerCraft_createResourceMount = findCCMethod( "createResourceMount", new Class[] { + computerCraft_createResourceMount = findCCMethod( "createResourceMount", new Class[] { Class.class, String.class, String.class } ); - computerCraft_registerPeripheralProvider = findCCMethod( "registerPeripheralProvider", new Class[] { + computerCraft_registerPeripheralProvider = findCCMethod( "registerPeripheralProvider", new Class[] { IPeripheralProvider.class } ); - computerCraft_registerTurtleUpgrade = findCCMethod( "registerTurtleUpgrade", new Class[] { + computerCraft_registerTurtleUpgrade = findCCMethod( "registerTurtleUpgrade", new Class[] { ITurtleUpgrade.class } ); - computerCraft_registerBundledRedstoneProvider = findCCMethod( "registerBundledRedstoneProvider", new Class[] { + computerCraft_registerBundledRedstoneProvider = findCCMethod( "registerBundledRedstoneProvider", new Class[] { IBundledRedstoneProvider.class } ); - computerCraft_getDefaultBundledRedstoneOutput = findCCMethod( "getDefaultBundledRedstoneOutput", new Class[] { + computerCraft_getDefaultBundledRedstoneOutput = findCCMethod( "getDefaultBundledRedstoneOutput", new Class[] { World.class, BlockPos.class, EnumFacing.class } ); - computerCraft_registerMediaProvider = findCCMethod( "registerMediaProvider", new Class[] { + computerCraft_registerMediaProvider = findCCMethod( "registerMediaProvider", new Class[] { IMediaProvider.class } ); - computerCraft_registerPermissionProvider = findCCMethod( "registerPermissionProvider", new Class[] { + computerCraft_registerPermissionProvider = findCCMethod( "registerPermissionProvider", new Class[] { ITurtlePermissionProvider.class } ); - computerCraft_registerPocketUpgrade = findCCMethod( "registerPocketUpgrade", new Class[] { + computerCraft_registerPocketUpgrade = findCCMethod( "registerPocketUpgrade", new Class[] { IPocketUpgrade.class } ); } catch( Exception e ) { @@ -353,7 +353,7 @@ public final class ComputerCraftAPI } private static boolean ccSearched = false; - private static Class computerCraft = null; + private static Class computerCraft = null; private static Method computerCraft_getVersion = null; private static Method computerCraft_createUniqueNumberedSaveDir = null; private static Method computerCraft_createSaveDirMount = null; diff --git a/src/main/java/dan200/computercraft/client/proxy/ComputerCraftProxyClient.java b/src/main/java/dan200/computercraft/client/proxy/ComputerCraftProxyClient.java index 0882c23da..6cb63b055 100644 --- a/src/main/java/dan200/computercraft/client/proxy/ComputerCraftProxyClient.java +++ b/src/main/java/dan200/computercraft/client/proxy/ComputerCraftProxyClient.java @@ -279,10 +279,10 @@ public class ComputerCraftProxyClient extends ComputerCraftProxyCommon @Override public String getRecordInfo( ItemStack recordStack ) { - List info = new ArrayList(1); + List info = new ArrayList( 1 ); recordStack.getItem().addInformation( recordStack, null, info, false ); if( info.size() > 0 ) { - return info.get(0).toString(); + return info.get( 0 ); } else { return super.getRecordInfo( recordStack ); } diff --git a/src/main/java/dan200/computercraft/client/render/TurtleMultiModel.java b/src/main/java/dan200/computercraft/client/render/TurtleMultiModel.java index 5308bea48..eefc6fd04 100644 --- a/src/main/java/dan200/computercraft/client/render/TurtleMultiModel.java +++ b/src/main/java/dan200/computercraft/client/render/TurtleMultiModel.java @@ -25,7 +25,7 @@ public class TurtleMultiModel implements IBakedModel private IBakedModel m_rightUpgradeModel; private Matrix4f m_rightUpgradeTransform; private List m_generalQuads; - private List m_faceQuads[]; + private List[] m_faceQuads; public TurtleMultiModel( IBakedModel baseModel, IBakedModel overlayModel, IBakedModel leftUpgradeModel, Matrix4f leftUpgradeTransform, IBakedModel rightUpgradeModel, Matrix4f rightUpgradeTransform ) { diff --git a/src/main/java/dan200/computercraft/core/apis/FSAPI.java b/src/main/java/dan200/computercraft/core/apis/FSAPI.java index ca5a7eecb..75946c681 100644 --- a/src/main/java/dan200/computercraft/core/apis/FSAPI.java +++ b/src/main/java/dan200/computercraft/core/apis/FSAPI.java @@ -124,7 +124,7 @@ public class FSAPI implements ILuaAPI throw new LuaException( "Expected string" ); } String path = (String)args[0]; - return new Object[]{ m_fileSystem.getName( path ) }; + return new Object[]{ FileSystem.getName( path ) }; } case 3: { @@ -359,7 +359,7 @@ public class FSAPI implements ILuaAPI throw new LuaException( "Expected string" ); } String path = (String)args[0]; - return new Object[]{ m_fileSystem.getDirectory( path ) }; + return new Object[]{ FileSystem.getDirectory( path ) }; } default: { diff --git a/src/main/java/dan200/computercraft/core/apis/HTTPAPI.java b/src/main/java/dan200/computercraft/core/apis/HTTPAPI.java index 4a4275469..b6e9c46e4 100644 --- a/src/main/java/dan200/computercraft/core/apis/HTTPAPI.java +++ b/src/main/java/dan200/computercraft/core/apis/HTTPAPI.java @@ -201,7 +201,7 @@ public class HTTPAPI implements ILuaAPI Map headers = null; if( args.length >= 3 && args[2] instanceof Map ) { - Map table = (Map)args[2]; + Map table = (Map)args[2]; headers = new HashMap( table.size() ); for( Object key : table.keySet() ) { diff --git a/src/main/java/dan200/computercraft/core/apis/PeripheralAPI.java b/src/main/java/dan200/computercraft/core/apis/PeripheralAPI.java index a5343b95f..afbb4521f 100644 --- a/src/main/java/dan200/computercraft/core/apis/PeripheralAPI.java +++ b/src/main/java/dan200/computercraft/core/apis/PeripheralAPI.java @@ -477,8 +477,7 @@ public class PeripheralAPI implements ILuaAPI, IAPIEnvironment.IPeripheralChange } if( p != null ) { - Object[] results = p.call( context, methodName, methodArgs ); - return results; + return p.call( context, methodName, methodArgs ); } } throw new LuaException( "No peripheral attached" ); diff --git a/src/main/java/dan200/computercraft/core/lua/LuaJLuaMachine.java b/src/main/java/dan200/computercraft/core/lua/LuaJLuaMachine.java index ce08aa276..1e84bdaac 100644 --- a/src/main/java/dan200/computercraft/core/lua/LuaJLuaMachine.java +++ b/src/main/java/dan200/computercraft/core/lua/LuaJLuaMachine.java @@ -316,8 +316,6 @@ public class LuaJLuaMachine implements ILuaMachine throw new LuaError( abortMessage ); } } - - private static long s_nextUnusedTaskID = 0; private LuaTable wrapLuaObject( ILuaObject object ) { @@ -531,9 +529,8 @@ public class LuaJLuaMachine implements ILuaMachine m_valuesInProgress.put( object, table ); // Convert all keys - for( Object o : ((Map) object).entrySet() ) + for( Map.Entry pair : ((Map) object).entrySet() ) { - Map.Entry pair = (Map.Entry) o; LuaValue key = toValue( pair.getKey() ); LuaValue value = toValue( pair.getValue() ); if( !key.isnil() && !value.isnil() ) @@ -554,8 +551,7 @@ public class LuaJLuaMachine implements ILuaMachine } else if( object instanceof ILuaObject ) { - LuaValue table = wrapLuaObject( (ILuaObject)object ); - return table; + return wrapLuaObject( (ILuaObject)object ); } else { @@ -623,7 +619,7 @@ public class LuaJLuaMachine implements ILuaMachine { return m_objectsInProgress.get( value ); } - Map table = new HashMap(); + Map table = new HashMap(); m_objectsInProgress.put( value, table ); // Convert all keys diff --git a/src/main/java/dan200/computercraft/shared/computer/apis/CommandAPI.java b/src/main/java/dan200/computercraft/shared/computer/apis/CommandAPI.java index b02fb3b96..bbed290b9 100644 --- a/src/main/java/dan200/computercraft/shared/computer/apis/CommandAPI.java +++ b/src/main/java/dan200/computercraft/shared/computer/apis/CommandAPI.java @@ -120,9 +120,8 @@ public class CommandAPI implements ILuaAPI table.put( "metadata", metadata ); Map stateTable = new HashMap(); - for( Object o : state.getActualState( world, pos ).getProperties().entrySet() ) + for( ImmutableMap.Entry, Comparable> entry : state.getActualState( world, pos ).getProperties().entrySet() ) { - ImmutableMap.Entry entry = (ImmutableMap.Entry)o; String propertyName = entry.getKey().getName(); Object value = entry.getValue(); if( value instanceof String || value instanceof Number || value instanceof Boolean ) @@ -194,12 +193,11 @@ public class CommandAPI implements ILuaAPI { ICommandManager commandManager = server.getCommandManager(); ICommandSender commmandSender = m_computer.getCommandSender(); - Map commands = commandManager.getCommands(); - for( Object entryObject : commands.entrySet() ) + Map commands = commandManager.getCommands(); + for( Map.Entry entry : commands.entrySet() ) { - Map.Entry entry = (Map.Entry)entryObject; - String name = (String)entry.getKey(); - ICommand command = (ICommand)entry.getValue(); + String name = entry.getKey(); + ICommand command = entry.getValue(); try { if( command.checkPermission( server, commmandSender ) ) diff --git a/src/main/java/dan200/computercraft/shared/computer/blocks/BlockCommandComputer.java b/src/main/java/dan200/computercraft/shared/computer/blocks/BlockCommandComputer.java index 0f387cec8..be3f4230d 100644 --- a/src/main/java/dan200/computercraft/shared/computer/blocks/BlockCommandComputer.java +++ b/src/main/java/dan200/computercraft/shared/computer/blocks/BlockCommandComputer.java @@ -11,7 +11,6 @@ import dan200.computercraft.shared.computer.core.ComputerFamily; import dan200.computercraft.shared.computer.core.IComputer; import dan200.computercraft.shared.util.DirectionUtil; import net.minecraft.block.material.Material; -import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.properties.PropertyEnum; import net.minecraft.block.state.BlockStateContainer; @@ -55,10 +54,7 @@ public class BlockCommandComputer extends BlockComputerBase @Override protected BlockStateContainer createBlockState() { - return new BlockStateContainer(this, new IProperty[] { - Properties.FACING, - Properties.STATE - }); + return new BlockStateContainer(this, Properties.FACING, Properties.STATE ); } @Nonnull diff --git a/src/main/java/dan200/computercraft/shared/computer/blocks/BlockComputer.java b/src/main/java/dan200/computercraft/shared/computer/blocks/BlockComputer.java index 40a23b700..e7105186c 100644 --- a/src/main/java/dan200/computercraft/shared/computer/blocks/BlockComputer.java +++ b/src/main/java/dan200/computercraft/shared/computer/blocks/BlockComputer.java @@ -12,7 +12,6 @@ import dan200.computercraft.shared.computer.core.IComputer; import dan200.computercraft.shared.computer.items.ItemComputer; import dan200.computercraft.shared.util.DirectionUtil; import net.minecraft.block.material.Material; -import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyBool; import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.properties.PropertyEnum; @@ -22,8 +21,8 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; @@ -58,11 +57,7 @@ public class BlockComputer extends BlockComputerBase @Override protected BlockStateContainer createBlockState() { - return new BlockStateContainer(this, new IProperty[] { - Properties.FACING, - Properties.ADVANCED, - Properties.STATE - }); + return new BlockStateContainer( this, Properties.FACING, Properties.ADVANCED, Properties.STATE ); } @Nonnull diff --git a/src/main/java/dan200/computercraft/shared/computer/items/ItemCommandComputer.java b/src/main/java/dan200/computercraft/shared/computer/items/ItemCommandComputer.java index 80ce67891..2282b2f4a 100644 --- a/src/main/java/dan200/computercraft/shared/computer/items/ItemCommandComputer.java +++ b/src/main/java/dan200/computercraft/shared/computer/items/ItemCommandComputer.java @@ -52,7 +52,7 @@ public class ItemCommandComputer extends ItemComputer } @Override - public void getSubItems( @Nonnull Item itemID, @Nonnull CreativeTabs tabs, @Nonnull List list ) + public void getSubItems( @Nonnull Item itemID, @Nonnull CreativeTabs tabs, @Nonnull List list ) { list.add( ComputerItemFactory.create( -1, null, ComputerFamily.Command ) ); } diff --git a/src/main/java/dan200/computercraft/shared/computer/items/ItemComputer.java b/src/main/java/dan200/computercraft/shared/computer/items/ItemComputer.java index c1519f597..0bb44b0fe 100644 --- a/src/main/java/dan200/computercraft/shared/computer/items/ItemComputer.java +++ b/src/main/java/dan200/computercraft/shared/computer/items/ItemComputer.java @@ -72,7 +72,7 @@ public class ItemComputer extends ItemComputerBase } @Override - public void getSubItems( @Nonnull Item itemID, @Nonnull CreativeTabs tabs, @Nonnull List list ) + public void getSubItems( @Nonnull Item itemID, @Nonnull CreativeTabs tabs, @Nonnull List list ) { list.add( ComputerItemFactory.create( -1, null, ComputerFamily.Normal ) ); list.add( ComputerItemFactory.create( -1, null, ComputerFamily.Advanced ) ); diff --git a/src/main/java/dan200/computercraft/shared/computer/items/ItemComputerBase.java b/src/main/java/dan200/computercraft/shared/computer/items/ItemComputerBase.java index 8f4e63ca6..29e9ca7e3 100644 --- a/src/main/java/dan200/computercraft/shared/computer/items/ItemComputerBase.java +++ b/src/main/java/dan200/computercraft/shared/computer/items/ItemComputerBase.java @@ -36,7 +36,7 @@ public abstract class ItemComputerBase extends ItemBlock implements IComputerIte } @Override - public void addInformation( @Nonnull ItemStack stack, @Nonnull EntityPlayer player, @Nonnull List list, boolean debug ) + public void addInformation( @Nonnull ItemStack stack, @Nonnull EntityPlayer player, @Nonnull List list, boolean debug ) { if( debug ) { diff --git a/src/main/java/dan200/computercraft/shared/media/items/ItemDiskLegacy.java b/src/main/java/dan200/computercraft/shared/media/items/ItemDiskLegacy.java index ad47a2703..749784ccd 100644 --- a/src/main/java/dan200/computercraft/shared/media/items/ItemDiskLegacy.java +++ b/src/main/java/dan200/computercraft/shared/media/items/ItemDiskLegacy.java @@ -35,7 +35,7 @@ public class ItemDiskLegacy extends Item } @Override - public void getSubItems( @Nonnull Item itemID, CreativeTabs tabs, List list ) + public void getSubItems( @Nonnull Item itemID, CreativeTabs tabs, List list ) { for( int colour=0; colour<16; ++colour ) { @@ -80,7 +80,7 @@ public class ItemDiskLegacy extends Item } @Override - public void addInformation( ItemStack stack, EntityPlayer player, List list, boolean debug ) + public void addInformation( ItemStack stack, EntityPlayer player, List list, boolean debug ) { if( debug ) { diff --git a/src/main/java/dan200/computercraft/shared/media/items/ItemPrintout.java b/src/main/java/dan200/computercraft/shared/media/items/ItemPrintout.java index 685818177..167460f81 100644 --- a/src/main/java/dan200/computercraft/shared/media/items/ItemPrintout.java +++ b/src/main/java/dan200/computercraft/shared/media/items/ItemPrintout.java @@ -42,7 +42,7 @@ public class ItemPrintout extends Item } @Override - public void getSubItems( @Nonnull Item itemID, CreativeTabs tabs, List list ) + public void getSubItems( @Nonnull Item itemID, CreativeTabs tabs, List list ) { list.add( createSingleFromTitleAndText( null, new String[ LINES_PER_PAGE ], new String[ LINES_PER_PAGE ] ) ); list.add( createMultipleFromTitleAndText( null, new String[ 2*LINES_PER_PAGE ], new String[ 2*LINES_PER_PAGE ] ) ); @@ -50,7 +50,7 @@ public class ItemPrintout extends Item } @Override - public void addInformation( ItemStack itemstack, EntityPlayer par2EntityPlayer, List list, boolean flag ) + public void addInformation( ItemStack itemstack, EntityPlayer par2EntityPlayer, List list, boolean flag ) { String title = getTitle( itemstack ); if( title != null && title.length() > 0 ) diff --git a/src/main/java/dan200/computercraft/shared/media/items/ItemTreasureDisk.java b/src/main/java/dan200/computercraft/shared/media/items/ItemTreasureDisk.java index bcdf2bc3c..5f9a97915 100644 --- a/src/main/java/dan200/computercraft/shared/media/items/ItemTreasureDisk.java +++ b/src/main/java/dan200/computercraft/shared/media/items/ItemTreasureDisk.java @@ -36,12 +36,12 @@ public class ItemTreasureDisk extends Item } @Override - public void getSubItems( @Nonnull Item itemID, CreativeTabs tabs, List list ) + public void getSubItems( @Nonnull Item itemID, CreativeTabs tabs, List list ) { } @Override - public void addInformation( ItemStack stack, EntityPlayer player, List list, boolean bool ) + public void addInformation( ItemStack stack, EntityPlayer player, List list, boolean bool ) { String label = getTitle( stack ); if( label != null && label.length() > 0 ) diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockCable.java b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockCable.java index 8489c2c52..c63906528 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockCable.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockCable.java @@ -10,15 +10,14 @@ import dan200.computercraft.ComputerCraft; import dan200.computercraft.shared.peripheral.PeripheralType; import dan200.computercraft.shared.peripheral.modem.TileCable; import net.minecraft.block.Block; -import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyBool; import net.minecraft.block.properties.PropertyEnum; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.item.Item; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import javax.annotation.Nonnull; @@ -79,7 +78,7 @@ public class BlockCable extends BlockPeripheralBase @Override protected BlockStateContainer createBlockState() { - return new BlockStateContainer(this, new IProperty[] { + return new BlockStateContainer( this, Properties.MODEM, Properties.CABLE, Properties.NORTH, @@ -87,8 +86,8 @@ public class BlockCable extends BlockPeripheralBase Properties.EAST, Properties.WEST, Properties.UP, - Properties.DOWN, - }); + Properties.DOWN + ); } @Nonnull diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheral.java b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheral.java index f8e831e17..886bc0a59 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheral.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheral.java @@ -13,7 +13,6 @@ import dan200.computercraft.shared.peripheral.modem.TileWirelessModem; import dan200.computercraft.shared.peripheral.monitor.TileMonitor; import dan200.computercraft.shared.peripheral.printer.TilePrinter; import dan200.computercraft.shared.util.DirectionUtil; -import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.properties.PropertyEnum; import net.minecraft.block.state.BlockStateContainer; @@ -22,9 +21,9 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.EnumFacing; import net.minecraft.util.BlockRenderLayer; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; @@ -62,10 +61,7 @@ public class BlockPeripheral extends BlockPeripheralBase @Override protected BlockStateContainer createBlockState() { - return new BlockStateContainer(this, new IProperty[] { - Properties.FACING, - Properties.VARIANT - }); + return new BlockStateContainer( this, Properties.FACING, Properties.VARIANT ); } @Nonnull diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/ItemAdvancedModem.java b/src/main/java/dan200/computercraft/shared/peripheral/common/ItemAdvancedModem.java index b772216c6..faf9686a2 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/ItemAdvancedModem.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/ItemAdvancedModem.java @@ -49,7 +49,7 @@ public class ItemAdvancedModem extends ItemPeripheralBase } @Override - public void getSubItems( @Nonnull Item itemID, @Nonnull CreativeTabs tabs, @Nonnull List list ) + public void getSubItems( @Nonnull Item itemID, @Nonnull CreativeTabs tabs, @Nonnull List list ) { list.add( PeripheralItemFactory.create( PeripheralType.AdvancedModem, null, 1 ) ); } diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/ItemCable.java b/src/main/java/dan200/computercraft/shared/peripheral/common/ItemCable.java index 37374af60..ae555f386 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/ItemCable.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/ItemCable.java @@ -63,7 +63,7 @@ public class ItemCable extends ItemPeripheralBase } @Override - public void getSubItems( @Nonnull Item itemID, @Nonnull CreativeTabs tabs, @Nonnull List list ) + public void getSubItems( @Nonnull Item itemID, @Nonnull CreativeTabs tabs, @Nonnull List list ) { list.add( PeripheralItemFactory.create( PeripheralType.WiredModem, null, 1 ) ); list.add( PeripheralItemFactory.create( PeripheralType.Cable, null, 1 ) ); diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/ItemPeripheral.java b/src/main/java/dan200/computercraft/shared/peripheral/common/ItemPeripheral.java index c09364cf3..23eaf2834 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/ItemPeripheral.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/ItemPeripheral.java @@ -69,7 +69,7 @@ public class ItemPeripheral extends ItemPeripheralBase } @Override - public void getSubItems( @Nonnull Item itemID, @Nonnull CreativeTabs tabs, @Nonnull List list ) + public void getSubItems( @Nonnull Item itemID, @Nonnull CreativeTabs tabs, @Nonnull List list ) { list.add( PeripheralItemFactory.create( PeripheralType.DiskDrive, null, 1 ) ); list.add( PeripheralItemFactory.create( PeripheralType.Printer, null, 1 ) ); diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/BlockAdvancedModem.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/BlockAdvancedModem.java index c26241ce0..470a9e711 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/BlockAdvancedModem.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/BlockAdvancedModem.java @@ -10,7 +10,6 @@ import dan200.computercraft.ComputerCraft; import dan200.computercraft.shared.peripheral.PeripheralType; import dan200.computercraft.shared.peripheral.common.BlockPeripheralBase; import dan200.computercraft.shared.peripheral.common.TilePeripheralBase; -import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyBool; import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.state.BlockStateContainer; @@ -45,10 +44,7 @@ public class BlockAdvancedModem extends BlockPeripheralBase @Override protected BlockStateContainer createBlockState() { - return new BlockStateContainer(this, new IProperty[] { - Properties.FACING, - Properties.ON - }); + return new BlockStateContainer(this, Properties.FACING, Properties.ON ); } @Nonnull diff --git a/src/main/java/dan200/computercraft/shared/peripheral/printer/ContainerPrinter.java b/src/main/java/dan200/computercraft/shared/peripheral/printer/ContainerPrinter.java index 8306d3a78..37a4a90ca 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/printer/ContainerPrinter.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/printer/ContainerPrinter.java @@ -79,10 +79,9 @@ public class ContainerPrinter extends Container boolean printing = m_printer.isPrinting(); for( IContainerListener listener : listeners ) { - IContainerListener icrafting = listener; if( printing != m_lastPrinting ) { - icrafting.sendProgressBarUpdate( this, 0, printing ? 1 : 0 ); + listener.sendProgressBarUpdate( this, 0, printing ? 1 : 0 ); } } m_lastPrinting = printing; diff --git a/src/main/java/dan200/computercraft/shared/pocket/items/ItemPocketComputer.java b/src/main/java/dan200/computercraft/shared/pocket/items/ItemPocketComputer.java index 45d8cee18..79370bebb 100644 --- a/src/main/java/dan200/computercraft/shared/pocket/items/ItemPocketComputer.java +++ b/src/main/java/dan200/computercraft/shared/pocket/items/ItemPocketComputer.java @@ -80,7 +80,7 @@ public class ItemPocketComputer extends Item implements IComputerItem, IMedia } @Override - public void getSubItems( @Nonnull Item itemID, CreativeTabs tabs, List list ) + public void getSubItems( @Nonnull Item itemID, CreativeTabs tabs, List list ) { getSubItems( list, ComputerFamily.Normal ); getSubItems( list, ComputerFamily.Advanced ); @@ -216,7 +216,7 @@ public class ItemPocketComputer extends Item implements IComputerItem, IMedia } @Override - public void addInformation( ItemStack stack, EntityPlayer player, List list, boolean debug ) + public void addInformation( ItemStack stack, EntityPlayer player, List list, boolean debug ) { if( debug ) { diff --git a/src/main/java/dan200/computercraft/shared/proxy/CCTurtleProxyCommon.java b/src/main/java/dan200/computercraft/shared/proxy/CCTurtleProxyCommon.java index 75ee68ccb..2f6e4c721 100644 --- a/src/main/java/dan200/computercraft/shared/proxy/CCTurtleProxyCommon.java +++ b/src/main/java/dan200/computercraft/shared/proxy/CCTurtleProxyCommon.java @@ -31,6 +31,7 @@ import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.living.LivingDropsEvent; @@ -275,7 +276,7 @@ public abstract class CCTurtleProxyCommon implements ICCTurtleProxy if( isUpgradeVanilla( upgrade ) ) { // Add fake recipes to fool NEI - List recipeList = CraftingManager.getInstance().getRecipeList(); + List recipeList = CraftingManager.getInstance().getRecipeList(); ItemStack craftingItem = upgrade.getCraftingItem(); // A turtle just containing this upgrade diff --git a/src/main/java/dan200/computercraft/shared/proxy/ComputerCraftProxyCommon.java b/src/main/java/dan200/computercraft/shared/proxy/ComputerCraftProxyCommon.java index 369d8f94e..ada5ca7c6 100644 --- a/src/main/java/dan200/computercraft/shared/proxy/ComputerCraftProxyCommon.java +++ b/src/main/java/dan200/computercraft/shared/proxy/ComputerCraftProxyCommon.java @@ -61,7 +61,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemRecord; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.Packet; +import net.minecraft.network.play.server.SPacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumHand; import net.minecraft.util.IThreadListener; @@ -212,7 +212,7 @@ public abstract class ComputerCraftProxyCommon implements IComputerCraftProxy if (tileEntity != null && tileEntity instanceof TileGeneric) { TileGeneric generic = (TileGeneric) tileEntity; - Packet description = generic.getUpdatePacket(); + SPacketUpdateTileEntity description = generic.getUpdatePacket(); if (description != null) { ((EntityPlayerMP) player).connection.sendPacket( description ); @@ -376,7 +376,7 @@ public abstract class ComputerCraftProxyCommon implements IComputerCraftProxy ItemStack paper = new ItemStack( Items.PAPER, 1 ); ItemStack redstone = new ItemStack( Items.REDSTONE, 1 ); ItemStack basicDisk = ItemDiskLegacy.createFromIDAndColour( -1, null, Colour.Blue.getHex() ); - GameRegistry.addRecipe( new ImpostorShapelessRecipe( basicDisk, new Object[]{redstone, paper} ) ); + GameRegistry.addRecipe( new ImpostorShapelessRecipe( basicDisk, new ItemStack[]{redstone, paper} ) ); for (int colour = 0; colour < 16; ++colour) { @@ -387,12 +387,12 @@ public abstract class ComputerCraftProxyCommon implements IComputerCraftProxy if (colour != otherColour) { ItemStack otherDisk = ItemDiskLegacy.createFromIDAndColour( -1, null, Colour.values()[colour].getHex() ); - GameRegistry.addRecipe( new ImpostorShapelessRecipe( disk, new Object[]{ + GameRegistry.addRecipe( new ImpostorShapelessRecipe( disk, new ItemStack[]{ otherDisk, dye } ) ); } } - GameRegistry.addRecipe( new ImpostorShapelessRecipe( disk, new Object[]{ + GameRegistry.addRecipe( new ImpostorShapelessRecipe( disk, new ItemStack[]{ redstone, paper, dye } ) ); } @@ -406,10 +406,10 @@ public abstract class ComputerCraftProxyCommon implements IComputerCraftProxy // Impostor Printout recipes (to fool NEI) ItemStack string = new ItemStack( Items.STRING, 1, 0 ); - GameRegistry.addRecipe( new ImpostorShapelessRecipe( multiplePrintout, new Object[]{singlePrintout, singlePrintout, string} ) ); + GameRegistry.addRecipe( new ImpostorShapelessRecipe( multiplePrintout, new ItemStack[]{singlePrintout, singlePrintout, string} ) ); ItemStack leather = new ItemStack( Items.LEATHER, 1, 0 ); - GameRegistry.addRecipe( new ImpostorShapelessRecipe( bookPrintout, new Object[]{leather, singlePrintout, string} ) ); + GameRegistry.addRecipe( new ImpostorShapelessRecipe( bookPrintout, new ItemStack[]{leather, singlePrintout, string} ) ); // Pocket Computer ItemStack pocketComputer = PocketComputerItemFactory.create( -1, null, ComputerFamily.Normal, null ); diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleBrain.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleBrain.java index 6c2ec921f..594e1e89b 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleBrain.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleBrain.java @@ -26,8 +26,12 @@ import net.minecraft.entity.Entity; import net.minecraft.inventory.IInventory; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.*; -import net.minecraft.util.math.*; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; import net.minecraftforge.common.util.Constants; @@ -573,8 +577,7 @@ public class TurtleBrain implements ITurtleAccess @Override public float getVisualYaw( float f ) { - float forward = DirectionUtil.toYawAngle( getDirection() ); - float yaw = forward; + float yaw = DirectionUtil.toYawAngle( getDirection() ); switch( m_animation ) { case TurnLeft: @@ -1133,19 +1136,16 @@ public class TurtleBrain implements ITurtleAccess } AxisAlignedBB aabb = new AxisAlignedBB( minX, minY, minZ, maxX, maxY, maxZ ); - List list = world.getEntitiesWithinAABBExcludingEntity( null, aabb ); + List list = world.getEntitiesWithinAABBExcludingEntity( null, aabb ); if( !list.isEmpty() ) { double pushStep = 1.0f / (float) ANIM_DURATION; double pushStepX = (double) moveDir.getFrontOffsetX() * pushStep; double pushStepY = (double) moveDir.getFrontOffsetY() * pushStep; double pushStepZ = (double) moveDir.getFrontOffsetZ() * pushStep; - for (Object aList : list) + for (Entity entity : list) { - Entity entity = (Entity) aList; - entity.moveEntity( - pushStepX, pushStepY, pushStepZ - ); + entity.moveEntity( pushStepX, pushStepY, pushStepZ ); } } } diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleInspectCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleInspectCommand.java index dac77510a..60cdaf84a 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleInspectCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleInspectCommand.java @@ -58,9 +58,8 @@ public class TurtleInspectCommand implements ITurtleCommand table.put( "metadata", metadata ); Map stateTable = new HashMap(); - for( Object o : state.getActualState( world, newPosition ).getProperties().entrySet() ) + for( ImmutableMap.Entry, ?> entry : state.getActualState( world, newPosition ).getProperties().entrySet() ) { - ImmutableMap.Entry entry = (ImmutableMap.Entry)o; String propertyName = entry.getKey().getName(); Object value = entry.getValue(); if( value instanceof String || value instanceof Number || value instanceof Boolean ) diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleMoveCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleMoveCommand.java index 26e654ae5..5df8f1f18 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleMoveCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleMoveCommand.java @@ -72,10 +72,9 @@ public class TurtleMoveCommand implements ITurtleCommand if( ComputerCraft.turtlesCanPush && m_direction != MoveDirection.Up && m_direction != MoveDirection.Down ) { // Check there is space for all the pushable entities to be pushed - List list = oldWorld.getEntitiesWithinAABBExcludingEntity( null, aabb ); - for( Object aList : list ) + List list = oldWorld.getEntitiesWithinAABBExcludingEntity( null, aabb ); + for( Entity entity : list ) { - Entity entity = (Entity) aList; if( !entity.isDead && entity.preventEntitySpawning ) { AxisAlignedBB entityBB = entity.getEntityBoundingBox(); diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlaceCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlaceCommand.java index 85be37a36..eb9fe5373 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlaceCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlaceCommand.java @@ -208,8 +208,7 @@ public class TurtlePlaceCommand implements ITurtleCommand final BlockPos position = turtle.getPosition(); Vec3d turtlePos = new Vec3d( turtlePlayer.posX, turtlePlayer.posY, turtlePlayer.posZ ); Vec3d rayDir = turtlePlayer.getLook( 1.0f ); - Vec3d rayStart = turtlePos; - Pair hit = WorldUtil.rayTraceEntities( world, rayStart, rayDir, 1.5 ); + Pair hit = WorldUtil.rayTraceEntities( world, turtlePos, rayDir, 1.5 ); if( hit == null ) { return stack; diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleSuckCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleSuckCommand.java index 9d11ddda1..736e5c3b6 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleSuckCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleSuckCommand.java @@ -90,14 +90,13 @@ public class TurtleSuckCommand implements ITurtleCommand newPosition.getX(), newPosition.getY(), newPosition.getZ(), newPosition.getX() + 1.0, newPosition.getY() + 1.0, newPosition.getZ() + 1.0 ); - List list = world.getEntitiesWithinAABBExcludingEntity( null, aabb ); + List list = world.getEntitiesWithinAABBExcludingEntity( null, aabb ); if( list.size() > 0 ) { boolean foundItems = false; boolean storedItems = false; - for( Object aList : list ) + for( Entity entity : list ) { - Entity entity = (Entity) aList; if( entity != null && entity instanceof EntityItem && !entity.isDead ) { // Suck up the item diff --git a/src/main/java/dan200/computercraft/shared/turtle/items/ItemTurtleBase.java b/src/main/java/dan200/computercraft/shared/turtle/items/ItemTurtleBase.java index ca07fedc7..61f840605 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/items/ItemTurtleBase.java +++ b/src/main/java/dan200/computercraft/shared/turtle/items/ItemTurtleBase.java @@ -43,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( @Nonnull Item itemID, @Nonnull CreativeTabs tabs, @Nonnull List list ) + public void getSubItems( @Nonnull Item itemID, @Nonnull CreativeTabs tabs, @Nonnull List list ) { List all = new ArrayList(); ComputerCraft.addAllUpgradedTurtles( all ); diff --git a/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleTool.java b/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleTool.java index 8b46fff0b..fa7287792 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleTool.java +++ b/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleTool.java @@ -170,8 +170,7 @@ public class TurtleTool implements ITurtleUpgrade // See if there is an entity present Vec3d turtlePos = new Vec3d( turtlePlayer.posX, turtlePlayer.posY, turtlePlayer.posZ ); Vec3d rayDir = turtlePlayer.getLook( 1.0f ); - Vec3d rayStart = turtlePos; - Pair hit = WorldUtil.rayTraceEntities( world, rayStart, rayDir, 1.5 ); + Pair hit = WorldUtil.rayTraceEntities( world, turtlePos, rayDir, 1.5 ); if( hit != null ) { // Load up the turtle's inventory diff --git a/src/main/java/dan200/computercraft/shared/util/ImpostorShapelessRecipe.java b/src/main/java/dan200/computercraft/shared/util/ImpostorShapelessRecipe.java index 6f4a350d4..50c96d2e6 100644 --- a/src/main/java/dan200/computercraft/shared/util/ImpostorShapelessRecipe.java +++ b/src/main/java/dan200/computercraft/shared/util/ImpostorShapelessRecipe.java @@ -16,9 +16,9 @@ import java.util.Arrays; public class ImpostorShapelessRecipe extends ShapelessRecipes { - public ImpostorShapelessRecipe( ItemStack result, Object[] ingredients ) + public ImpostorShapelessRecipe( ItemStack result, ItemStack[] ingredients ) { - super( result, new ArrayList(Arrays.asList( ingredients ))); + super( result, new ArrayList(Arrays.asList( ingredients ))); } @Override diff --git a/src/main/java/dan200/computercraft/shared/util/NBTUtil.java b/src/main/java/dan200/computercraft/shared/util/NBTUtil.java index d9468e8ee..e0a066529 100644 --- a/src/main/java/dan200/computercraft/shared/util/NBTUtil.java +++ b/src/main/java/dan200/computercraft/shared/util/NBTUtil.java @@ -35,10 +35,10 @@ public class NBTUtil } else if( object instanceof Map ) { - Map m = (Map)object; + Map m = (Map)object; NBTTagCompound nbt = new NBTTagCompound(); int i=0; - for( Map.Entry entry : m.entrySet() ) + for( Map.Entry entry : m.entrySet() ) { NBTBase key = toNBTTag( entry.getKey() ); NBTBase value = toNBTTag( entry.getKey() ); @@ -85,18 +85,15 @@ public class NBTUtil { case Constants.NBT.TAG_BYTE: // byte { - boolean b = (((NBTTagByte)tag).getByte() > 0); - return b; + return (((NBTTagByte)tag).getByte() > 0); } case Constants.NBT.TAG_DOUBLE: // Double { - double d = ((NBTTagDouble)tag).getDouble(); - return d; + return ((NBTTagDouble)tag).getDouble(); } case Constants.NBT.TAG_STRING: // String { - String s = ((NBTTagString)tag).getString(); - return s; + return ((NBTTagString)tag).getString(); } case Constants.NBT.TAG_COMPOUND: // Compound { diff --git a/src/main/java/dan200/computercraft/shared/util/ReflectionUtil.java b/src/main/java/dan200/computercraft/shared/util/ReflectionUtil.java index 72d378343..93be71ddf 100644 --- a/src/main/java/dan200/computercraft/shared/util/ReflectionUtil.java +++ b/src/main/java/dan200/computercraft/shared/util/ReflectionUtil.java @@ -13,7 +13,7 @@ import java.lang.reflect.Modifier; public class ReflectionUtil { - public static Class getOptionalClass( String name ) + public static Class getOptionalClass( String name ) { try { @@ -26,16 +26,16 @@ public class ReflectionUtil return null; } - public static Class getOptionalInnerClass( Class enclosingClass, String name ) + public static Class getOptionalInnerClass( Class enclosingClass, String name ) { if( enclosingClass != null ) { try { - Class[] declaredClasses = enclosingClass.getDeclaredClasses(); + Class[] declaredClasses = enclosingClass.getDeclaredClasses(); if( declaredClasses != null ) { - for( Class declaredClass : declaredClasses ) + for( Class declaredClass : declaredClasses ) { if( declaredClass.getSimpleName().equals( name ) ) { @@ -52,7 +52,7 @@ public class ReflectionUtil return null; } - public static Method getOptionalMethod( Class clazz, String name, Class[] arguments ) + public static Method getOptionalMethod( Class clazz, String name, Class[] arguments ) { if( clazz != null ) { @@ -68,7 +68,7 @@ public class ReflectionUtil return null; } - public static Constructor getOptionalConstructor( Class clazz, Class[] arguments ) + public static Constructor getOptionalConstructor( Class clazz, Class[] arguments ) { if( clazz != null ) { @@ -84,7 +84,7 @@ public class ReflectionUtil return null; } - public static Field getOptionalField( Class clazz, String name ) + public static Field getOptionalField( Class clazz, String name ) { if( clazz != null ) { @@ -97,7 +97,7 @@ public class ReflectionUtil { field.setAccessible( true ); } - catch( Exception e ) + catch( Exception ignored ) { } } @@ -111,16 +111,16 @@ public class ReflectionUtil return null; } - public static T safeNew( Constructor constructor, Object[] arguments, Class resultClass ) + public static T safeNew( Constructor constructor, Object[] arguments, Class resultClass ) { if( constructor != null ) { try { - Object result = constructor.newInstance( arguments ); + T result = constructor.newInstance( arguments ); if( result != null && resultClass.isInstance( result ) ) { - return (T)result; + return result; } } catch( Exception e ) @@ -131,7 +131,7 @@ public class ReflectionUtil return null; } - public static boolean safeInstanceOf( Object object, Class clazz ) + public static boolean safeInstanceOf( Object object, Class clazz ) { if( clazz != null ) { @@ -158,6 +158,7 @@ public class ReflectionUtil } } + @SuppressWarnings("unchecked") public static T safeInvoke( Method method, Object object, Object[] arguments, Class resultClass ) { if( method != null ) @@ -182,6 +183,7 @@ public class ReflectionUtil return null; } + @SuppressWarnings("unchecked") public static T safeGet( Field field, Object object, Class resultClass ) { if( field != null ) diff --git a/src/main/java/dan200/computercraft/shared/util/WorldUtil.java b/src/main/java/dan200/computercraft/shared/util/WorldUtil.java index cb424a517..71ad07db6 100644 --- a/src/main/java/dan200/computercraft/shared/util/WorldUtil.java +++ b/src/main/java/dan200/computercraft/shared/util/WorldUtil.java @@ -60,10 +60,9 @@ public class WorldUtil Entity closest = null; double closestDist = 99.0; - List list = world.getEntitiesWithinAABBExcludingEntity( null, bigBox ); - for( Object aList : list ) + List list = world.getEntitiesWithinAABBExcludingEntity( null, bigBox ); + for( Entity entity : list ) { - Entity entity = (Entity) aList; if( entity.isDead || !entity.canBeCollidedWith() ) { continue; From a2fd0b1f7f70714d21d5293373b16516d68c2f30 Mon Sep 17 00:00:00 2001 From: SquidDev Date: Sun, 7 May 2017 01:18:59 +0100 Subject: [PATCH 4/7] Use block comment instead of Javadoc for license --- src/main/java/dan200/computercraft/ComputerCraft.java | 2 +- .../dan200/computercraft/client/gui/FixedWidthFontRenderer.java | 2 +- src/main/java/dan200/computercraft/client/gui/GuiComputer.java | 2 +- src/main/java/dan200/computercraft/client/gui/GuiDiskDrive.java | 2 +- .../java/dan200/computercraft/client/gui/GuiPocketComputer.java | 2 +- src/main/java/dan200/computercraft/client/gui/GuiPrinter.java | 2 +- src/main/java/dan200/computercraft/client/gui/GuiPrintout.java | 2 +- src/main/java/dan200/computercraft/client/gui/GuiTurtle.java | 2 +- .../java/dan200/computercraft/client/gui/widgets/MousePos.java | 2 +- .../java/dan200/computercraft/client/gui/widgets/Widget.java | 2 +- .../computercraft/client/gui/widgets/WidgetContainer.java | 2 +- .../dan200/computercraft/client/gui/widgets/WidgetTerminal.java | 2 +- .../dan200/computercraft/client/proxy/CCTurtleProxyClient.java | 2 +- .../computercraft/client/proxy/ComputerCraftProxyClient.java | 2 +- .../computercraft/client/render/TileEntityMonitorRenderer.java | 2 +- .../computercraft/client/render/TileEntityTurtleRenderer.java | 2 +- .../computercraft/client/render/TurtleSmartItemModel.java | 2 +- src/main/java/dan200/computercraft/core/apis/BitAPI.java | 2 +- src/main/java/dan200/computercraft/core/apis/BufferAPI.java | 2 +- src/main/java/dan200/computercraft/core/apis/FSAPI.java | 2 +- src/main/java/dan200/computercraft/core/apis/HTTPAPI.java | 2 +- src/main/java/dan200/computercraft/core/apis/HTTPRequest.java | 2 +- .../java/dan200/computercraft/core/apis/IAPIEnvironment.java | 2 +- src/main/java/dan200/computercraft/core/apis/ILuaAPI.java | 2 +- src/main/java/dan200/computercraft/core/apis/OSAPI.java | 2 +- src/main/java/dan200/computercraft/core/apis/PeripheralAPI.java | 2 +- src/main/java/dan200/computercraft/core/apis/RedstoneAPI.java | 2 +- src/main/java/dan200/computercraft/core/apis/TermAPI.java | 2 +- src/main/java/dan200/computercraft/core/computer/Computer.java | 2 +- .../java/dan200/computercraft/core/computer/ComputerThread.java | 2 +- .../computercraft/core/computer/IComputerEnvironment.java | 2 +- src/main/java/dan200/computercraft/core/computer/ITask.java | 2 +- .../java/dan200/computercraft/core/computer/MainThread.java | 2 +- .../java/dan200/computercraft/core/filesystem/ComboMount.java | 2 +- .../java/dan200/computercraft/core/filesystem/EmptyMount.java | 2 +- .../java/dan200/computercraft/core/filesystem/FileMount.java | 2 +- .../java/dan200/computercraft/core/filesystem/FileSystem.java | 2 +- .../computercraft/core/filesystem/FileSystemException.java | 2 +- .../java/dan200/computercraft/core/filesystem/IMountedFile.java | 2 +- .../computercraft/core/filesystem/IMountedFileBinary.java | 2 +- .../computercraft/core/filesystem/IMountedFileNormal.java | 2 +- .../java/dan200/computercraft/core/filesystem/JarMount.java | 2 +- .../java/dan200/computercraft/core/filesystem/SubMount.java | 2 +- src/main/java/dan200/computercraft/core/lua/ILuaMachine.java | 2 +- src/main/java/dan200/computercraft/core/lua/LuaJLuaMachine.java | 2 +- src/main/java/dan200/computercraft/core/terminal/Terminal.java | 2 +- .../java/dan200/computercraft/core/terminal/TextBuffer.java | 2 +- .../dan200/computercraft/server/proxy/CCTurtleProxyServer.java | 2 +- .../computercraft/server/proxy/ComputerCraftProxyServer.java | 2 +- .../dan200/computercraft/shared/common/BlockDirectional.java | 2 +- .../java/dan200/computercraft/shared/common/BlockGeneric.java | 2 +- .../java/dan200/computercraft/shared/common/ClientTerminal.java | 2 +- .../shared/common/DefaultBundledRedstoneProvider.java | 2 +- .../dan200/computercraft/shared/common/IDirectionalTile.java | 2 +- src/main/java/dan200/computercraft/shared/common/ITerminal.java | 2 +- .../java/dan200/computercraft/shared/common/ITerminalTile.java | 2 +- .../java/dan200/computercraft/shared/common/ServerTerminal.java | 2 +- .../java/dan200/computercraft/shared/common/TileGeneric.java | 2 +- .../dan200/computercraft/shared/computer/apis/CommandAPI.java | 2 +- .../shared/computer/blocks/BlockCommandComputer.java | 2 +- .../computercraft/shared/computer/blocks/BlockComputer.java | 2 +- .../computercraft/shared/computer/blocks/BlockComputerBase.java | 2 +- .../shared/computer/blocks/ComputerPeripheral.java | 2 +- .../computercraft/shared/computer/blocks/ComputerState.java | 2 +- .../computercraft/shared/computer/blocks/IComputerTile.java | 2 +- .../shared/computer/blocks/TileCommandComputer.java | 2 +- .../computercraft/shared/computer/blocks/TileComputer.java | 2 +- .../computercraft/shared/computer/blocks/TileComputerBase.java | 2 +- .../computercraft/shared/computer/core/ClientComputer.java | 2 +- .../shared/computer/core/ClientComputerRegistry.java | 2 +- .../computercraft/shared/computer/core/ComputerFamily.java | 2 +- .../computercraft/shared/computer/core/ComputerRegistry.java | 2 +- .../dan200/computercraft/shared/computer/core/IComputer.java | 2 +- .../computercraft/shared/computer/core/IComputerContainer.java | 2 +- .../computercraft/shared/computer/core/ServerComputer.java | 2 +- .../shared/computer/core/ServerComputerRegistry.java | 2 +- .../shared/computer/inventory/ContainerComputer.java | 2 +- .../shared/computer/items/ComputerItemFactory.java | 2 +- .../computercraft/shared/computer/items/IComputerItem.java | 2 +- .../shared/computer/items/ItemCommandComputer.java | 2 +- .../computercraft/shared/computer/items/ItemComputer.java | 2 +- .../computercraft/shared/computer/items/ItemComputerBase.java | 2 +- .../computercraft/shared/media/inventory/ContainerHeldItem.java | 2 +- .../computercraft/shared/media/items/ItemDiskExpanded.java | 2 +- .../dan200/computercraft/shared/media/items/ItemDiskLegacy.java | 2 +- .../dan200/computercraft/shared/media/items/ItemPrintout.java | 2 +- .../computercraft/shared/media/items/ItemTreasureDisk.java | 2 +- .../dan200/computercraft/shared/media/items/RecordMedia.java | 2 +- .../dan200/computercraft/shared/media/recipes/DiskRecipe.java | 2 +- .../computercraft/shared/media/recipes/PrintoutRecipe.java | 2 +- .../computercraft/shared/network/ComputerCraftPacket.java | 2 +- .../dan200/computercraft/shared/network/INetworkedThing.java | 2 +- .../java/dan200/computercraft/shared/network/PacketHandler.java | 2 +- .../dan200/computercraft/shared/peripheral/PeripheralType.java | 2 +- .../shared/peripheral/commandblock/CommandBlockPeripheral.java | 2 +- .../peripheral/commandblock/CommandBlockPeripheralProvider.java | 2 +- .../computercraft/shared/peripheral/common/BlockCable.java | 2 +- .../shared/peripheral/common/BlockCableModemVariant.java | 2 +- .../computercraft/shared/peripheral/common/BlockPeripheral.java | 2 +- .../shared/peripheral/common/BlockPeripheralBase.java | 2 +- .../shared/peripheral/common/BlockPeripheralVariant.java | 2 +- .../shared/peripheral/common/DefaultPeripheralProvider.java | 2 +- .../computercraft/shared/peripheral/common/IPeripheralItem.java | 2 +- .../computercraft/shared/peripheral/common/IPeripheralTile.java | 2 +- .../shared/peripheral/common/ItemAdvancedModem.java | 2 +- .../computercraft/shared/peripheral/common/ItemCable.java | 2 +- .../computercraft/shared/peripheral/common/ItemPeripheral.java | 2 +- .../shared/peripheral/common/ItemPeripheralBase.java | 2 +- .../shared/peripheral/common/PeripheralItemFactory.java | 2 +- .../shared/peripheral/common/TilePeripheralBase.java | 2 +- .../shared/peripheral/diskdrive/ContainerDiskDrive.java | 2 +- .../shared/peripheral/diskdrive/DiskDrivePeripheral.java | 2 +- .../shared/peripheral/diskdrive/TileDiskDrive.java | 2 +- .../shared/peripheral/modem/BlockAdvancedModem.java | 2 +- .../dan200/computercraft/shared/peripheral/modem/INetwork.java | 2 +- .../dan200/computercraft/shared/peripheral/modem/IReceiver.java | 2 +- .../computercraft/shared/peripheral/modem/ModemPeripheral.java | 2 +- .../shared/peripheral/modem/TileAdvancedModem.java | 2 +- .../dan200/computercraft/shared/peripheral/modem/TileCable.java | 2 +- .../computercraft/shared/peripheral/modem/TileModemBase.java | 2 +- .../shared/peripheral/modem/TileWirelessModem.java | 2 +- .../shared/peripheral/modem/WirelessModemPeripheral.java | 2 +- .../computercraft/shared/peripheral/modem/WirelessNetwork.java | 2 +- .../shared/peripheral/monitor/MonitorPeripheral.java | 2 +- .../computercraft/shared/peripheral/monitor/TileMonitor.java | 2 +- .../shared/peripheral/printer/ContainerPrinter.java | 2 +- .../shared/peripheral/printer/PrinterPeripheral.java | 2 +- .../computercraft/shared/peripheral/printer/TilePrinter.java | 2 +- .../java/dan200/computercraft/shared/pocket/apis/PocketAPI.java | 2 +- .../computercraft/shared/pocket/items/ItemPocketComputer.java | 2 +- .../shared/pocket/items/PocketComputerItemFactory.java | 2 +- .../shared/pocket/peripherals/PocketModemPeripheral.java | 2 +- .../shared/pocket/recipes/PocketComputerUpgradeRecipe.java | 2 +- .../dan200/computercraft/shared/proxy/CCTurtleProxyCommon.java | 2 +- .../computercraft/shared/proxy/ComputerCraftProxyCommon.java | 2 +- .../java/dan200/computercraft/shared/proxy/ICCTurtleProxy.java | 2 +- .../dan200/computercraft/shared/proxy/IComputerCraftProxy.java | 2 +- .../java/dan200/computercraft/shared/turtle/apis/TurtleAPI.java | 2 +- .../dan200/computercraft/shared/turtle/blocks/BlockTurtle.java | 2 +- .../dan200/computercraft/shared/turtle/blocks/ITurtleTile.java | 2 +- .../dan200/computercraft/shared/turtle/blocks/TileTurtle.java | 2 +- .../computercraft/shared/turtle/blocks/TileTurtleAdvanced.java | 2 +- .../computercraft/shared/turtle/blocks/TileTurtleExpanded.java | 2 +- .../computercraft/shared/turtle/core/InteractDirection.java | 2 +- .../dan200/computercraft/shared/turtle/core/MoveDirection.java | 2 +- .../dan200/computercraft/shared/turtle/core/TurnDirection.java | 2 +- .../computercraft/shared/turtle/core/TurtleAttackCommand.java | 2 +- .../dan200/computercraft/shared/turtle/core/TurtleBrain.java | 2 +- .../shared/turtle/core/TurtleCheckRedstoneCommand.java | 2 +- .../shared/turtle/core/TurtleCommandQueueEntry.java | 2 +- .../computercraft/shared/turtle/core/TurtleCompareCommand.java | 2 +- .../shared/turtle/core/TurtleCompareToCommand.java | 2 +- .../computercraft/shared/turtle/core/TurtleCraftCommand.java | 2 +- .../computercraft/shared/turtle/core/TurtleDetectCommand.java | 2 +- .../computercraft/shared/turtle/core/TurtleDigCommand.java | 2 +- .../computercraft/shared/turtle/core/TurtleDropCommand.java | 2 +- .../computercraft/shared/turtle/core/TurtleEquipCommand.java | 2 +- .../computercraft/shared/turtle/core/TurtleInspectCommand.java | 2 +- .../computercraft/shared/turtle/core/TurtleMoveCommand.java | 2 +- .../computercraft/shared/turtle/core/TurtlePlaceCommand.java | 2 +- .../dan200/computercraft/shared/turtle/core/TurtlePlayer.java | 2 +- .../computercraft/shared/turtle/core/TurtleRefuelCommand.java | 2 +- .../computercraft/shared/turtle/core/TurtleSelectCommand.java | 2 +- .../shared/turtle/core/TurtleSetRedstoneCommand.java | 2 +- .../computercraft/shared/turtle/core/TurtleSuckCommand.java | 2 +- .../computercraft/shared/turtle/core/TurtleToolCommand.java | 2 +- .../shared/turtle/core/TurtleTransferToCommand.java | 2 +- .../computercraft/shared/turtle/core/TurtleTurnCommand.java | 2 +- .../computercraft/shared/turtle/entity/TurtleVisionCamera.java | 2 +- .../computercraft/shared/turtle/inventory/ContainerTurtle.java | 2 +- .../dan200/computercraft/shared/turtle/items/ITurtleItem.java | 2 +- .../computercraft/shared/turtle/items/ItemTurtleAdvanced.java | 2 +- .../computercraft/shared/turtle/items/ItemTurtleBase.java | 2 +- .../computercraft/shared/turtle/items/ItemTurtleLegacy.java | 2 +- .../computercraft/shared/turtle/items/ItemTurtleNormal.java | 2 +- .../computercraft/shared/turtle/items/TurtleItemFactory.java | 2 +- .../computercraft/shared/turtle/recipes/TurtleRecipe.java | 2 +- .../shared/turtle/recipes/TurtleUpgradeRecipe.java | 2 +- .../shared/turtle/upgrades/CraftingTablePeripheral.java | 2 +- .../dan200/computercraft/shared/turtle/upgrades/TurtleAxe.java | 2 +- .../shared/turtle/upgrades/TurtleCraftingTable.java | 2 +- .../dan200/computercraft/shared/turtle/upgrades/TurtleHoe.java | 2 +- .../shared/turtle/upgrades/TurtleInventoryCrafting.java | 2 +- .../computercraft/shared/turtle/upgrades/TurtleModem.java | 2 +- .../computercraft/shared/turtle/upgrades/TurtleShovel.java | 2 +- .../computercraft/shared/turtle/upgrades/TurtleSword.java | 2 +- .../dan200/computercraft/shared/turtle/upgrades/TurtleTool.java | 2 +- src/main/java/dan200/computercraft/shared/util/Colour.java | 2 +- .../java/dan200/computercraft/shared/util/CreativeTabMain.java | 2 +- .../dan200/computercraft/shared/util/CreativeTabTreasure.java | 2 +- .../java/dan200/computercraft/shared/util/DirectionUtil.java | 2 +- src/main/java/dan200/computercraft/shared/util/Holiday.java | 2 +- src/main/java/dan200/computercraft/shared/util/HolidayUtil.java | 2 +- .../dan200/computercraft/shared/util/IEntityDropConsumer.java | 2 +- .../java/dan200/computercraft/shared/util/ImpostorRecipe.java | 2 +- .../computercraft/shared/util/ImpostorShapelessRecipe.java | 2 +- .../java/dan200/computercraft/shared/util/InventoryUtil.java | 2 +- src/main/java/dan200/computercraft/shared/util/NBTUtil.java | 2 +- .../java/dan200/computercraft/shared/util/RedstoneUtil.java | 2 +- .../java/dan200/computercraft/shared/util/ReflectionUtil.java | 2 +- src/main/java/dan200/computercraft/shared/util/WorldUtil.java | 2 +- 201 files changed, 201 insertions(+), 201 deletions(-) diff --git a/src/main/java/dan200/computercraft/ComputerCraft.java b/src/main/java/dan200/computercraft/ComputerCraft.java index 5c3a071b8..82208e241 100644 --- a/src/main/java/dan200/computercraft/ComputerCraft.java +++ b/src/main/java/dan200/computercraft/ComputerCraft.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/client/gui/FixedWidthFontRenderer.java b/src/main/java/dan200/computercraft/client/gui/FixedWidthFontRenderer.java index 12335f9f5..a20817081 100644 --- a/src/main/java/dan200/computercraft/client/gui/FixedWidthFontRenderer.java +++ b/src/main/java/dan200/computercraft/client/gui/FixedWidthFontRenderer.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/client/gui/GuiComputer.java b/src/main/java/dan200/computercraft/client/gui/GuiComputer.java index 6df2721ed..ef42aa498 100644 --- a/src/main/java/dan200/computercraft/client/gui/GuiComputer.java +++ b/src/main/java/dan200/computercraft/client/gui/GuiComputer.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/client/gui/GuiDiskDrive.java b/src/main/java/dan200/computercraft/client/gui/GuiDiskDrive.java index 51f5f554e..f2089553e 100644 --- a/src/main/java/dan200/computercraft/client/gui/GuiDiskDrive.java +++ b/src/main/java/dan200/computercraft/client/gui/GuiDiskDrive.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/client/gui/GuiPocketComputer.java b/src/main/java/dan200/computercraft/client/gui/GuiPocketComputer.java index 9e8b169d7..54cdb382c 100644 --- a/src/main/java/dan200/computercraft/client/gui/GuiPocketComputer.java +++ b/src/main/java/dan200/computercraft/client/gui/GuiPocketComputer.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/client/gui/GuiPrinter.java b/src/main/java/dan200/computercraft/client/gui/GuiPrinter.java index 053505d0d..db9d9a422 100644 --- a/src/main/java/dan200/computercraft/client/gui/GuiPrinter.java +++ b/src/main/java/dan200/computercraft/client/gui/GuiPrinter.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/client/gui/GuiPrintout.java b/src/main/java/dan200/computercraft/client/gui/GuiPrintout.java index a139e2fcd..d03d9c64e 100644 --- a/src/main/java/dan200/computercraft/client/gui/GuiPrintout.java +++ b/src/main/java/dan200/computercraft/client/gui/GuiPrintout.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/client/gui/GuiTurtle.java b/src/main/java/dan200/computercraft/client/gui/GuiTurtle.java index c326e3cb0..61c3f83e3 100644 --- a/src/main/java/dan200/computercraft/client/gui/GuiTurtle.java +++ b/src/main/java/dan200/computercraft/client/gui/GuiTurtle.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/client/gui/widgets/MousePos.java b/src/main/java/dan200/computercraft/client/gui/widgets/MousePos.java index 40b1b2287..746c6cf7e 100644 --- a/src/main/java/dan200/computercraft/client/gui/widgets/MousePos.java +++ b/src/main/java/dan200/computercraft/client/gui/widgets/MousePos.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/client/gui/widgets/Widget.java b/src/main/java/dan200/computercraft/client/gui/widgets/Widget.java index 826d1c8eb..3c5a76cc1 100644 --- a/src/main/java/dan200/computercraft/client/gui/widgets/Widget.java +++ b/src/main/java/dan200/computercraft/client/gui/widgets/Widget.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/client/gui/widgets/WidgetContainer.java b/src/main/java/dan200/computercraft/client/gui/widgets/WidgetContainer.java index 6252692aa..3995c534a 100644 --- a/src/main/java/dan200/computercraft/client/gui/widgets/WidgetContainer.java +++ b/src/main/java/dan200/computercraft/client/gui/widgets/WidgetContainer.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/client/gui/widgets/WidgetTerminal.java b/src/main/java/dan200/computercraft/client/gui/widgets/WidgetTerminal.java index 7325c9944..9a7ec0b1c 100644 --- a/src/main/java/dan200/computercraft/client/gui/widgets/WidgetTerminal.java +++ b/src/main/java/dan200/computercraft/client/gui/widgets/WidgetTerminal.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/client/proxy/CCTurtleProxyClient.java b/src/main/java/dan200/computercraft/client/proxy/CCTurtleProxyClient.java index 921c9dbc3..dda3f88de 100644 --- a/src/main/java/dan200/computercraft/client/proxy/CCTurtleProxyClient.java +++ b/src/main/java/dan200/computercraft/client/proxy/CCTurtleProxyClient.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/client/proxy/ComputerCraftProxyClient.java b/src/main/java/dan200/computercraft/client/proxy/ComputerCraftProxyClient.java index 6cb63b055..a3803715f 100644 --- a/src/main/java/dan200/computercraft/client/proxy/ComputerCraftProxyClient.java +++ b/src/main/java/dan200/computercraft/client/proxy/ComputerCraftProxyClient.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/client/render/TileEntityMonitorRenderer.java b/src/main/java/dan200/computercraft/client/render/TileEntityMonitorRenderer.java index 34020aeb8..6b4e76532 100644 --- a/src/main/java/dan200/computercraft/client/render/TileEntityMonitorRenderer.java +++ b/src/main/java/dan200/computercraft/client/render/TileEntityMonitorRenderer.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/client/render/TileEntityTurtleRenderer.java b/src/main/java/dan200/computercraft/client/render/TileEntityTurtleRenderer.java index 524133a75..4df31cbe6 100644 --- a/src/main/java/dan200/computercraft/client/render/TileEntityTurtleRenderer.java +++ b/src/main/java/dan200/computercraft/client/render/TileEntityTurtleRenderer.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/client/render/TurtleSmartItemModel.java b/src/main/java/dan200/computercraft/client/render/TurtleSmartItemModel.java index 1a3a3936a..327a25348 100644 --- a/src/main/java/dan200/computercraft/client/render/TurtleSmartItemModel.java +++ b/src/main/java/dan200/computercraft/client/render/TurtleSmartItemModel.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/core/apis/BitAPI.java b/src/main/java/dan200/computercraft/core/apis/BitAPI.java index 0aba24f0b..bbf8148c2 100644 --- a/src/main/java/dan200/computercraft/core/apis/BitAPI.java +++ b/src/main/java/dan200/computercraft/core/apis/BitAPI.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/core/apis/BufferAPI.java b/src/main/java/dan200/computercraft/core/apis/BufferAPI.java index 0fa8b2923..e7cf9acb8 100644 --- a/src/main/java/dan200/computercraft/core/apis/BufferAPI.java +++ b/src/main/java/dan200/computercraft/core/apis/BufferAPI.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/core/apis/FSAPI.java b/src/main/java/dan200/computercraft/core/apis/FSAPI.java index 75946c681..bd0968bde 100644 --- a/src/main/java/dan200/computercraft/core/apis/FSAPI.java +++ b/src/main/java/dan200/computercraft/core/apis/FSAPI.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/core/apis/HTTPAPI.java b/src/main/java/dan200/computercraft/core/apis/HTTPAPI.java index b6e9c46e4..2f531723f 100644 --- a/src/main/java/dan200/computercraft/core/apis/HTTPAPI.java +++ b/src/main/java/dan200/computercraft/core/apis/HTTPAPI.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/core/apis/HTTPRequest.java b/src/main/java/dan200/computercraft/core/apis/HTTPRequest.java index c54e20497..35ff94525 100644 --- a/src/main/java/dan200/computercraft/core/apis/HTTPRequest.java +++ b/src/main/java/dan200/computercraft/core/apis/HTTPRequest.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/core/apis/IAPIEnvironment.java b/src/main/java/dan200/computercraft/core/apis/IAPIEnvironment.java index cc2f9bc7f..bd0e3e7c5 100644 --- a/src/main/java/dan200/computercraft/core/apis/IAPIEnvironment.java +++ b/src/main/java/dan200/computercraft/core/apis/IAPIEnvironment.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/core/apis/ILuaAPI.java b/src/main/java/dan200/computercraft/core/apis/ILuaAPI.java index 9e4acf31c..0ebf7155b 100644 --- a/src/main/java/dan200/computercraft/core/apis/ILuaAPI.java +++ b/src/main/java/dan200/computercraft/core/apis/ILuaAPI.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/core/apis/OSAPI.java b/src/main/java/dan200/computercraft/core/apis/OSAPI.java index c83318f8e..cdf349cfa 100644 --- a/src/main/java/dan200/computercraft/core/apis/OSAPI.java +++ b/src/main/java/dan200/computercraft/core/apis/OSAPI.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/core/apis/PeripheralAPI.java b/src/main/java/dan200/computercraft/core/apis/PeripheralAPI.java index afbb4521f..01edb43a6 100644 --- a/src/main/java/dan200/computercraft/core/apis/PeripheralAPI.java +++ b/src/main/java/dan200/computercraft/core/apis/PeripheralAPI.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/core/apis/RedstoneAPI.java b/src/main/java/dan200/computercraft/core/apis/RedstoneAPI.java index 6f3893676..adb68a2d1 100644 --- a/src/main/java/dan200/computercraft/core/apis/RedstoneAPI.java +++ b/src/main/java/dan200/computercraft/core/apis/RedstoneAPI.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/core/apis/TermAPI.java b/src/main/java/dan200/computercraft/core/apis/TermAPI.java index 3afeab9ec..926cc51b9 100644 --- a/src/main/java/dan200/computercraft/core/apis/TermAPI.java +++ b/src/main/java/dan200/computercraft/core/apis/TermAPI.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/core/computer/Computer.java b/src/main/java/dan200/computercraft/core/computer/Computer.java index 0697eab39..51c38eb29 100644 --- a/src/main/java/dan200/computercraft/core/computer/Computer.java +++ b/src/main/java/dan200/computercraft/core/computer/Computer.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/core/computer/ComputerThread.java b/src/main/java/dan200/computercraft/core/computer/ComputerThread.java index c9adedc20..98297fe23 100644 --- a/src/main/java/dan200/computercraft/core/computer/ComputerThread.java +++ b/src/main/java/dan200/computercraft/core/computer/ComputerThread.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/core/computer/IComputerEnvironment.java b/src/main/java/dan200/computercraft/core/computer/IComputerEnvironment.java index 8e740b21a..d62fe0e59 100644 --- a/src/main/java/dan200/computercraft/core/computer/IComputerEnvironment.java +++ b/src/main/java/dan200/computercraft/core/computer/IComputerEnvironment.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/core/computer/ITask.java b/src/main/java/dan200/computercraft/core/computer/ITask.java index 30b0d69ca..b6426405d 100644 --- a/src/main/java/dan200/computercraft/core/computer/ITask.java +++ b/src/main/java/dan200/computercraft/core/computer/ITask.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/core/computer/MainThread.java b/src/main/java/dan200/computercraft/core/computer/MainThread.java index 3ffca8497..7868f150c 100644 --- a/src/main/java/dan200/computercraft/core/computer/MainThread.java +++ b/src/main/java/dan200/computercraft/core/computer/MainThread.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/core/filesystem/ComboMount.java b/src/main/java/dan200/computercraft/core/filesystem/ComboMount.java index 54a28dc5b..d80fd9c75 100644 --- a/src/main/java/dan200/computercraft/core/filesystem/ComboMount.java +++ b/src/main/java/dan200/computercraft/core/filesystem/ComboMount.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/core/filesystem/EmptyMount.java b/src/main/java/dan200/computercraft/core/filesystem/EmptyMount.java index bd788e26a..1b5cd5664 100644 --- a/src/main/java/dan200/computercraft/core/filesystem/EmptyMount.java +++ b/src/main/java/dan200/computercraft/core/filesystem/EmptyMount.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/core/filesystem/FileMount.java b/src/main/java/dan200/computercraft/core/filesystem/FileMount.java index 70faa7750..3852cb000 100644 --- a/src/main/java/dan200/computercraft/core/filesystem/FileMount.java +++ b/src/main/java/dan200/computercraft/core/filesystem/FileMount.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/core/filesystem/FileSystem.java b/src/main/java/dan200/computercraft/core/filesystem/FileSystem.java index 9ccbd3bbb..671047fc9 100644 --- a/src/main/java/dan200/computercraft/core/filesystem/FileSystem.java +++ b/src/main/java/dan200/computercraft/core/filesystem/FileSystem.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/core/filesystem/FileSystemException.java b/src/main/java/dan200/computercraft/core/filesystem/FileSystemException.java index f522d2592..5f75b64f1 100644 --- a/src/main/java/dan200/computercraft/core/filesystem/FileSystemException.java +++ b/src/main/java/dan200/computercraft/core/filesystem/FileSystemException.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/core/filesystem/IMountedFile.java b/src/main/java/dan200/computercraft/core/filesystem/IMountedFile.java index 58a5b43c6..a475f7fb8 100644 --- a/src/main/java/dan200/computercraft/core/filesystem/IMountedFile.java +++ b/src/main/java/dan200/computercraft/core/filesystem/IMountedFile.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/core/filesystem/IMountedFileBinary.java b/src/main/java/dan200/computercraft/core/filesystem/IMountedFileBinary.java index a382203dc..242d5384e 100644 --- a/src/main/java/dan200/computercraft/core/filesystem/IMountedFileBinary.java +++ b/src/main/java/dan200/computercraft/core/filesystem/IMountedFileBinary.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/core/filesystem/IMountedFileNormal.java b/src/main/java/dan200/computercraft/core/filesystem/IMountedFileNormal.java index 78a02961a..b7cc71299 100644 --- a/src/main/java/dan200/computercraft/core/filesystem/IMountedFileNormal.java +++ b/src/main/java/dan200/computercraft/core/filesystem/IMountedFileNormal.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/core/filesystem/JarMount.java b/src/main/java/dan200/computercraft/core/filesystem/JarMount.java index a8ca08f95..a7a77e03a 100644 --- a/src/main/java/dan200/computercraft/core/filesystem/JarMount.java +++ b/src/main/java/dan200/computercraft/core/filesystem/JarMount.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/core/filesystem/SubMount.java b/src/main/java/dan200/computercraft/core/filesystem/SubMount.java index f62405fdf..8da2836ea 100644 --- a/src/main/java/dan200/computercraft/core/filesystem/SubMount.java +++ b/src/main/java/dan200/computercraft/core/filesystem/SubMount.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/core/lua/ILuaMachine.java b/src/main/java/dan200/computercraft/core/lua/ILuaMachine.java index 45a5f3644..5c9c355b0 100644 --- a/src/main/java/dan200/computercraft/core/lua/ILuaMachine.java +++ b/src/main/java/dan200/computercraft/core/lua/ILuaMachine.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/core/lua/LuaJLuaMachine.java b/src/main/java/dan200/computercraft/core/lua/LuaJLuaMachine.java index 1e84bdaac..ccc9d3d20 100644 --- a/src/main/java/dan200/computercraft/core/lua/LuaJLuaMachine.java +++ b/src/main/java/dan200/computercraft/core/lua/LuaJLuaMachine.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/core/terminal/Terminal.java b/src/main/java/dan200/computercraft/core/terminal/Terminal.java index 5505d50a5..97090a89f 100644 --- a/src/main/java/dan200/computercraft/core/terminal/Terminal.java +++ b/src/main/java/dan200/computercraft/core/terminal/Terminal.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/core/terminal/TextBuffer.java b/src/main/java/dan200/computercraft/core/terminal/TextBuffer.java index 9cc54e5b5..135bab194 100644 --- a/src/main/java/dan200/computercraft/core/terminal/TextBuffer.java +++ b/src/main/java/dan200/computercraft/core/terminal/TextBuffer.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/server/proxy/CCTurtleProxyServer.java b/src/main/java/dan200/computercraft/server/proxy/CCTurtleProxyServer.java index a5fa5b905..caaf61400 100644 --- a/src/main/java/dan200/computercraft/server/proxy/CCTurtleProxyServer.java +++ b/src/main/java/dan200/computercraft/server/proxy/CCTurtleProxyServer.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/server/proxy/ComputerCraftProxyServer.java b/src/main/java/dan200/computercraft/server/proxy/ComputerCraftProxyServer.java index fa563dc4e..d9b4c9f00 100644 --- a/src/main/java/dan200/computercraft/server/proxy/ComputerCraftProxyServer.java +++ b/src/main/java/dan200/computercraft/server/proxy/ComputerCraftProxyServer.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/common/BlockDirectional.java b/src/main/java/dan200/computercraft/shared/common/BlockDirectional.java index 376a97aa0..025115f22 100644 --- a/src/main/java/dan200/computercraft/shared/common/BlockDirectional.java +++ b/src/main/java/dan200/computercraft/shared/common/BlockDirectional.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/common/BlockGeneric.java b/src/main/java/dan200/computercraft/shared/common/BlockGeneric.java index 916d16e37..4ef335d22 100644 --- a/src/main/java/dan200/computercraft/shared/common/BlockGeneric.java +++ b/src/main/java/dan200/computercraft/shared/common/BlockGeneric.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/common/ClientTerminal.java b/src/main/java/dan200/computercraft/shared/common/ClientTerminal.java index 37177a019..b5c8a2a83 100644 --- a/src/main/java/dan200/computercraft/shared/common/ClientTerminal.java +++ b/src/main/java/dan200/computercraft/shared/common/ClientTerminal.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/common/DefaultBundledRedstoneProvider.java b/src/main/java/dan200/computercraft/shared/common/DefaultBundledRedstoneProvider.java index df18aa3bf..1b433c204 100644 --- a/src/main/java/dan200/computercraft/shared/common/DefaultBundledRedstoneProvider.java +++ b/src/main/java/dan200/computercraft/shared/common/DefaultBundledRedstoneProvider.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/common/IDirectionalTile.java b/src/main/java/dan200/computercraft/shared/common/IDirectionalTile.java index 494486ba9..012147b93 100644 --- a/src/main/java/dan200/computercraft/shared/common/IDirectionalTile.java +++ b/src/main/java/dan200/computercraft/shared/common/IDirectionalTile.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/common/ITerminal.java b/src/main/java/dan200/computercraft/shared/common/ITerminal.java index 3b10da9a9..2e9a3a77c 100644 --- a/src/main/java/dan200/computercraft/shared/common/ITerminal.java +++ b/src/main/java/dan200/computercraft/shared/common/ITerminal.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/common/ITerminalTile.java b/src/main/java/dan200/computercraft/shared/common/ITerminalTile.java index f7bbc022a..97135232e 100644 --- a/src/main/java/dan200/computercraft/shared/common/ITerminalTile.java +++ b/src/main/java/dan200/computercraft/shared/common/ITerminalTile.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/common/ServerTerminal.java b/src/main/java/dan200/computercraft/shared/common/ServerTerminal.java index b8755a208..e4838bf3f 100644 --- a/src/main/java/dan200/computercraft/shared/common/ServerTerminal.java +++ b/src/main/java/dan200/computercraft/shared/common/ServerTerminal.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/common/TileGeneric.java b/src/main/java/dan200/computercraft/shared/common/TileGeneric.java index 5d2a3314b..09fcef63e 100644 --- a/src/main/java/dan200/computercraft/shared/common/TileGeneric.java +++ b/src/main/java/dan200/computercraft/shared/common/TileGeneric.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/computer/apis/CommandAPI.java b/src/main/java/dan200/computercraft/shared/computer/apis/CommandAPI.java index bbed290b9..692353b83 100644 --- a/src/main/java/dan200/computercraft/shared/computer/apis/CommandAPI.java +++ b/src/main/java/dan200/computercraft/shared/computer/apis/CommandAPI.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/computer/blocks/BlockCommandComputer.java b/src/main/java/dan200/computercraft/shared/computer/blocks/BlockCommandComputer.java index be3f4230d..c4e64e593 100644 --- a/src/main/java/dan200/computercraft/shared/computer/blocks/BlockCommandComputer.java +++ b/src/main/java/dan200/computercraft/shared/computer/blocks/BlockCommandComputer.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/computer/blocks/BlockComputer.java b/src/main/java/dan200/computercraft/shared/computer/blocks/BlockComputer.java index e7105186c..3ce0281d6 100644 --- a/src/main/java/dan200/computercraft/shared/computer/blocks/BlockComputer.java +++ b/src/main/java/dan200/computercraft/shared/computer/blocks/BlockComputer.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/computer/blocks/BlockComputerBase.java b/src/main/java/dan200/computercraft/shared/computer/blocks/BlockComputerBase.java index 4c4a099f9..93cd938c0 100644 --- a/src/main/java/dan200/computercraft/shared/computer/blocks/BlockComputerBase.java +++ b/src/main/java/dan200/computercraft/shared/computer/blocks/BlockComputerBase.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/computer/blocks/ComputerPeripheral.java b/src/main/java/dan200/computercraft/shared/computer/blocks/ComputerPeripheral.java index 6140918e4..d2ef39602 100644 --- a/src/main/java/dan200/computercraft/shared/computer/blocks/ComputerPeripheral.java +++ b/src/main/java/dan200/computercraft/shared/computer/blocks/ComputerPeripheral.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/computer/blocks/ComputerState.java b/src/main/java/dan200/computercraft/shared/computer/blocks/ComputerState.java index 37c4d4873..7e8a68a95 100644 --- a/src/main/java/dan200/computercraft/shared/computer/blocks/ComputerState.java +++ b/src/main/java/dan200/computercraft/shared/computer/blocks/ComputerState.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/computer/blocks/IComputerTile.java b/src/main/java/dan200/computercraft/shared/computer/blocks/IComputerTile.java index c2d8173c9..7aaab9dff 100644 --- a/src/main/java/dan200/computercraft/shared/computer/blocks/IComputerTile.java +++ b/src/main/java/dan200/computercraft/shared/computer/blocks/IComputerTile.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/computer/blocks/TileCommandComputer.java b/src/main/java/dan200/computercraft/shared/computer/blocks/TileCommandComputer.java index 01032e5cd..1c1e90fe0 100644 --- a/src/main/java/dan200/computercraft/shared/computer/blocks/TileCommandComputer.java +++ b/src/main/java/dan200/computercraft/shared/computer/blocks/TileCommandComputer.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/computer/blocks/TileComputer.java b/src/main/java/dan200/computercraft/shared/computer/blocks/TileComputer.java index 2e002f359..acb1c7f0c 100644 --- a/src/main/java/dan200/computercraft/shared/computer/blocks/TileComputer.java +++ b/src/main/java/dan200/computercraft/shared/computer/blocks/TileComputer.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/computer/blocks/TileComputerBase.java b/src/main/java/dan200/computercraft/shared/computer/blocks/TileComputerBase.java index 6eca63d78..143d65df0 100644 --- a/src/main/java/dan200/computercraft/shared/computer/blocks/TileComputerBase.java +++ b/src/main/java/dan200/computercraft/shared/computer/blocks/TileComputerBase.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/computer/core/ClientComputer.java b/src/main/java/dan200/computercraft/shared/computer/core/ClientComputer.java index 812f0c204..eca8eadc9 100644 --- a/src/main/java/dan200/computercraft/shared/computer/core/ClientComputer.java +++ b/src/main/java/dan200/computercraft/shared/computer/core/ClientComputer.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/computer/core/ClientComputerRegistry.java b/src/main/java/dan200/computercraft/shared/computer/core/ClientComputerRegistry.java index 1b009eb4d..c5bfd4c3b 100644 --- a/src/main/java/dan200/computercraft/shared/computer/core/ClientComputerRegistry.java +++ b/src/main/java/dan200/computercraft/shared/computer/core/ClientComputerRegistry.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/computer/core/ComputerFamily.java b/src/main/java/dan200/computercraft/shared/computer/core/ComputerFamily.java index c57b30689..7317ef02e 100644 --- a/src/main/java/dan200/computercraft/shared/computer/core/ComputerFamily.java +++ b/src/main/java/dan200/computercraft/shared/computer/core/ComputerFamily.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/computer/core/ComputerRegistry.java b/src/main/java/dan200/computercraft/shared/computer/core/ComputerRegistry.java index d8e500805..164e150b4 100644 --- a/src/main/java/dan200/computercraft/shared/computer/core/ComputerRegistry.java +++ b/src/main/java/dan200/computercraft/shared/computer/core/ComputerRegistry.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/computer/core/IComputer.java b/src/main/java/dan200/computercraft/shared/computer/core/IComputer.java index dfc5718c9..e5afc6b16 100644 --- a/src/main/java/dan200/computercraft/shared/computer/core/IComputer.java +++ b/src/main/java/dan200/computercraft/shared/computer/core/IComputer.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/computer/core/IComputerContainer.java b/src/main/java/dan200/computercraft/shared/computer/core/IComputerContainer.java index 28ed13e33..e320f737e 100644 --- a/src/main/java/dan200/computercraft/shared/computer/core/IComputerContainer.java +++ b/src/main/java/dan200/computercraft/shared/computer/core/IComputerContainer.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/computer/core/ServerComputer.java b/src/main/java/dan200/computercraft/shared/computer/core/ServerComputer.java index 4161afb7d..c1cf5312f 100644 --- a/src/main/java/dan200/computercraft/shared/computer/core/ServerComputer.java +++ b/src/main/java/dan200/computercraft/shared/computer/core/ServerComputer.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/computer/core/ServerComputerRegistry.java b/src/main/java/dan200/computercraft/shared/computer/core/ServerComputerRegistry.java index 131add5f4..932b63352 100644 --- a/src/main/java/dan200/computercraft/shared/computer/core/ServerComputerRegistry.java +++ b/src/main/java/dan200/computercraft/shared/computer/core/ServerComputerRegistry.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/computer/inventory/ContainerComputer.java b/src/main/java/dan200/computercraft/shared/computer/inventory/ContainerComputer.java index fd52c775b..bf3952aac 100644 --- a/src/main/java/dan200/computercraft/shared/computer/inventory/ContainerComputer.java +++ b/src/main/java/dan200/computercraft/shared/computer/inventory/ContainerComputer.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/computer/items/ComputerItemFactory.java b/src/main/java/dan200/computercraft/shared/computer/items/ComputerItemFactory.java index ea7b0d284..27b23c3ea 100644 --- a/src/main/java/dan200/computercraft/shared/computer/items/ComputerItemFactory.java +++ b/src/main/java/dan200/computercraft/shared/computer/items/ComputerItemFactory.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/computer/items/IComputerItem.java b/src/main/java/dan200/computercraft/shared/computer/items/IComputerItem.java index 4ca1bae03..fb6c3fe6c 100644 --- a/src/main/java/dan200/computercraft/shared/computer/items/IComputerItem.java +++ b/src/main/java/dan200/computercraft/shared/computer/items/IComputerItem.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/computer/items/ItemCommandComputer.java b/src/main/java/dan200/computercraft/shared/computer/items/ItemCommandComputer.java index 2282b2f4a..1f6ec1000 100644 --- a/src/main/java/dan200/computercraft/shared/computer/items/ItemCommandComputer.java +++ b/src/main/java/dan200/computercraft/shared/computer/items/ItemCommandComputer.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/computer/items/ItemComputer.java b/src/main/java/dan200/computercraft/shared/computer/items/ItemComputer.java index 0bb44b0fe..2d9d290bd 100644 --- a/src/main/java/dan200/computercraft/shared/computer/items/ItemComputer.java +++ b/src/main/java/dan200/computercraft/shared/computer/items/ItemComputer.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/computer/items/ItemComputerBase.java b/src/main/java/dan200/computercraft/shared/computer/items/ItemComputerBase.java index 29e9ca7e3..4656a4a5d 100644 --- a/src/main/java/dan200/computercraft/shared/computer/items/ItemComputerBase.java +++ b/src/main/java/dan200/computercraft/shared/computer/items/ItemComputerBase.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/media/inventory/ContainerHeldItem.java b/src/main/java/dan200/computercraft/shared/media/inventory/ContainerHeldItem.java index 43fbdf656..a5d84b317 100644 --- a/src/main/java/dan200/computercraft/shared/media/inventory/ContainerHeldItem.java +++ b/src/main/java/dan200/computercraft/shared/media/inventory/ContainerHeldItem.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/media/items/ItemDiskExpanded.java b/src/main/java/dan200/computercraft/shared/media/items/ItemDiskExpanded.java index a3643e5c2..c6624ad64 100644 --- a/src/main/java/dan200/computercraft/shared/media/items/ItemDiskExpanded.java +++ b/src/main/java/dan200/computercraft/shared/media/items/ItemDiskExpanded.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/media/items/ItemDiskLegacy.java b/src/main/java/dan200/computercraft/shared/media/items/ItemDiskLegacy.java index 749784ccd..76d703f2f 100644 --- a/src/main/java/dan200/computercraft/shared/media/items/ItemDiskLegacy.java +++ b/src/main/java/dan200/computercraft/shared/media/items/ItemDiskLegacy.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/media/items/ItemPrintout.java b/src/main/java/dan200/computercraft/shared/media/items/ItemPrintout.java index 167460f81..0014dc2f1 100644 --- a/src/main/java/dan200/computercraft/shared/media/items/ItemPrintout.java +++ b/src/main/java/dan200/computercraft/shared/media/items/ItemPrintout.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/media/items/ItemTreasureDisk.java b/src/main/java/dan200/computercraft/shared/media/items/ItemTreasureDisk.java index 5f9a97915..f7407f084 100644 --- a/src/main/java/dan200/computercraft/shared/media/items/ItemTreasureDisk.java +++ b/src/main/java/dan200/computercraft/shared/media/items/ItemTreasureDisk.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/media/items/RecordMedia.java b/src/main/java/dan200/computercraft/shared/media/items/RecordMedia.java index 8bb519929..b01c1c458 100644 --- a/src/main/java/dan200/computercraft/shared/media/items/RecordMedia.java +++ b/src/main/java/dan200/computercraft/shared/media/items/RecordMedia.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/media/recipes/DiskRecipe.java b/src/main/java/dan200/computercraft/shared/media/recipes/DiskRecipe.java index aed43021c..4c9a59468 100644 --- a/src/main/java/dan200/computercraft/shared/media/recipes/DiskRecipe.java +++ b/src/main/java/dan200/computercraft/shared/media/recipes/DiskRecipe.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/media/recipes/PrintoutRecipe.java b/src/main/java/dan200/computercraft/shared/media/recipes/PrintoutRecipe.java index bc72ce56b..f3c703695 100644 --- a/src/main/java/dan200/computercraft/shared/media/recipes/PrintoutRecipe.java +++ b/src/main/java/dan200/computercraft/shared/media/recipes/PrintoutRecipe.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/network/ComputerCraftPacket.java b/src/main/java/dan200/computercraft/shared/network/ComputerCraftPacket.java index fdb16f8d9..f20368895 100644 --- a/src/main/java/dan200/computercraft/shared/network/ComputerCraftPacket.java +++ b/src/main/java/dan200/computercraft/shared/network/ComputerCraftPacket.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/network/INetworkedThing.java b/src/main/java/dan200/computercraft/shared/network/INetworkedThing.java index 7773e4a19..671e18966 100644 --- a/src/main/java/dan200/computercraft/shared/network/INetworkedThing.java +++ b/src/main/java/dan200/computercraft/shared/network/INetworkedThing.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/network/PacketHandler.java b/src/main/java/dan200/computercraft/shared/network/PacketHandler.java index 84fc18a0a..ad64d6757 100644 --- a/src/main/java/dan200/computercraft/shared/network/PacketHandler.java +++ b/src/main/java/dan200/computercraft/shared/network/PacketHandler.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/peripheral/PeripheralType.java b/src/main/java/dan200/computercraft/shared/peripheral/PeripheralType.java index c714b9a40..6c99aba40 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/PeripheralType.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/PeripheralType.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/peripheral/commandblock/CommandBlockPeripheral.java b/src/main/java/dan200/computercraft/shared/peripheral/commandblock/CommandBlockPeripheral.java index 3cb943da8..29b99708d 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/commandblock/CommandBlockPeripheral.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/commandblock/CommandBlockPeripheral.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/peripheral/commandblock/CommandBlockPeripheralProvider.java b/src/main/java/dan200/computercraft/shared/peripheral/commandblock/CommandBlockPeripheralProvider.java index c50228efc..3800ceee1 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/commandblock/CommandBlockPeripheralProvider.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/commandblock/CommandBlockPeripheralProvider.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockCable.java b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockCable.java index c63906528..59b650f50 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockCable.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockCable.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockCableModemVariant.java b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockCableModemVariant.java index ec95e4a74..ba520a33f 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockCableModemVariant.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockCableModemVariant.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheral.java b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheral.java index 886bc0a59..4f58a8457 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheral.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheral.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheralBase.java b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheralBase.java index 3a8bdc1bb..3e713d073 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheralBase.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheralBase.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheralVariant.java b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheralVariant.java index 5e9e48ef3..336d7173d 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheralVariant.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheralVariant.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/DefaultPeripheralProvider.java b/src/main/java/dan200/computercraft/shared/peripheral/common/DefaultPeripheralProvider.java index f6929e9f6..5564b1ecd 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/DefaultPeripheralProvider.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/DefaultPeripheralProvider.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/IPeripheralItem.java b/src/main/java/dan200/computercraft/shared/peripheral/common/IPeripheralItem.java index ae5b199f7..57e74ed22 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/IPeripheralItem.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/IPeripheralItem.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/IPeripheralTile.java b/src/main/java/dan200/computercraft/shared/peripheral/common/IPeripheralTile.java index d3052e995..62d3bbcb5 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/IPeripheralTile.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/IPeripheralTile.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/ItemAdvancedModem.java b/src/main/java/dan200/computercraft/shared/peripheral/common/ItemAdvancedModem.java index faf9686a2..4ed99cc39 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/ItemAdvancedModem.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/ItemAdvancedModem.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/ItemCable.java b/src/main/java/dan200/computercraft/shared/peripheral/common/ItemCable.java index ae555f386..5228c8ec8 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/ItemCable.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/ItemCable.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/ItemPeripheral.java b/src/main/java/dan200/computercraft/shared/peripheral/common/ItemPeripheral.java index 23eaf2834..df3dbba5a 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/ItemPeripheral.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/ItemPeripheral.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/ItemPeripheralBase.java b/src/main/java/dan200/computercraft/shared/peripheral/common/ItemPeripheralBase.java index b3b62c2f0..d5841e62e 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/ItemPeripheralBase.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/ItemPeripheralBase.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/PeripheralItemFactory.java b/src/main/java/dan200/computercraft/shared/peripheral/common/PeripheralItemFactory.java index 55768d3bf..d0fe8ffb3 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/PeripheralItemFactory.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/PeripheralItemFactory.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/TilePeripheralBase.java b/src/main/java/dan200/computercraft/shared/peripheral/common/TilePeripheralBase.java index b4c893ea9..1a33d54c0 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/TilePeripheralBase.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/TilePeripheralBase.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/ContainerDiskDrive.java b/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/ContainerDiskDrive.java index 964288255..115325889 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/ContainerDiskDrive.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/ContainerDiskDrive.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/DiskDrivePeripheral.java b/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/DiskDrivePeripheral.java index 1e9347aa7..92a813f3d 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/DiskDrivePeripheral.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/DiskDrivePeripheral.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/TileDiskDrive.java b/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/TileDiskDrive.java index 0323cf81e..7bad34116 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/TileDiskDrive.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/TileDiskDrive.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/BlockAdvancedModem.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/BlockAdvancedModem.java index 470a9e711..916b22a6e 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/BlockAdvancedModem.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/BlockAdvancedModem.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/INetwork.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/INetwork.java index 91fbcb394..926ecd607 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/INetwork.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/INetwork.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/IReceiver.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/IReceiver.java index 869c1ea15..039988e75 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/IReceiver.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/IReceiver.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/ModemPeripheral.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/ModemPeripheral.java index 211053844..b26a59440 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/ModemPeripheral.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/ModemPeripheral.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/TileAdvancedModem.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/TileAdvancedModem.java index a90dd7bc6..bf2eb5613 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/TileAdvancedModem.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/TileAdvancedModem.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/TileCable.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/TileCable.java index d25ed9420..c1dcd71f4 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/TileCable.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/TileCable.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/TileModemBase.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/TileModemBase.java index 9036afaf0..a865f383a 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/TileModemBase.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/TileModemBase.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/TileWirelessModem.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/TileWirelessModem.java index 44ebe3ef6..e20c0f228 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/TileWirelessModem.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/TileWirelessModem.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/WirelessModemPeripheral.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/WirelessModemPeripheral.java index ba1ed8e4a..ac61fa6d8 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/WirelessModemPeripheral.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/WirelessModemPeripheral.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/WirelessNetwork.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/WirelessNetwork.java index 255ba7e74..95417a8e0 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/WirelessNetwork.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/WirelessNetwork.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/peripheral/monitor/MonitorPeripheral.java b/src/main/java/dan200/computercraft/shared/peripheral/monitor/MonitorPeripheral.java index 07ea732a1..855c5dde4 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/monitor/MonitorPeripheral.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/monitor/MonitorPeripheral.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/peripheral/monitor/TileMonitor.java b/src/main/java/dan200/computercraft/shared/peripheral/monitor/TileMonitor.java index ccb742da2..6f228da88 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/monitor/TileMonitor.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/monitor/TileMonitor.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/peripheral/printer/ContainerPrinter.java b/src/main/java/dan200/computercraft/shared/peripheral/printer/ContainerPrinter.java index 37a4a90ca..c64f5abdb 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/printer/ContainerPrinter.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/printer/ContainerPrinter.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/peripheral/printer/PrinterPeripheral.java b/src/main/java/dan200/computercraft/shared/peripheral/printer/PrinterPeripheral.java index 3240e0f0e..c258018a1 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/printer/PrinterPeripheral.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/printer/PrinterPeripheral.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/peripheral/printer/TilePrinter.java b/src/main/java/dan200/computercraft/shared/peripheral/printer/TilePrinter.java index 50126f28c..78ad00e5a 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/printer/TilePrinter.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/printer/TilePrinter.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/pocket/apis/PocketAPI.java b/src/main/java/dan200/computercraft/shared/pocket/apis/PocketAPI.java index b27b3f0ef..6b8576db0 100644 --- a/src/main/java/dan200/computercraft/shared/pocket/apis/PocketAPI.java +++ b/src/main/java/dan200/computercraft/shared/pocket/apis/PocketAPI.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/pocket/items/ItemPocketComputer.java b/src/main/java/dan200/computercraft/shared/pocket/items/ItemPocketComputer.java index 79370bebb..29afeebaf 100644 --- a/src/main/java/dan200/computercraft/shared/pocket/items/ItemPocketComputer.java +++ b/src/main/java/dan200/computercraft/shared/pocket/items/ItemPocketComputer.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/pocket/items/PocketComputerItemFactory.java b/src/main/java/dan200/computercraft/shared/pocket/items/PocketComputerItemFactory.java index 2fa08d038..1f7424b14 100644 --- a/src/main/java/dan200/computercraft/shared/pocket/items/PocketComputerItemFactory.java +++ b/src/main/java/dan200/computercraft/shared/pocket/items/PocketComputerItemFactory.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/pocket/peripherals/PocketModemPeripheral.java b/src/main/java/dan200/computercraft/shared/pocket/peripherals/PocketModemPeripheral.java index 07371dc93..de8b2669e 100644 --- a/src/main/java/dan200/computercraft/shared/pocket/peripherals/PocketModemPeripheral.java +++ b/src/main/java/dan200/computercraft/shared/pocket/peripherals/PocketModemPeripheral.java @@ -5,7 +5,7 @@ import dan200.computercraft.shared.peripheral.modem.WirelessModemPeripheral; import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/pocket/recipes/PocketComputerUpgradeRecipe.java b/src/main/java/dan200/computercraft/shared/pocket/recipes/PocketComputerUpgradeRecipe.java index b61ed8ab4..5f2faa764 100644 --- a/src/main/java/dan200/computercraft/shared/pocket/recipes/PocketComputerUpgradeRecipe.java +++ b/src/main/java/dan200/computercraft/shared/pocket/recipes/PocketComputerUpgradeRecipe.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/proxy/CCTurtleProxyCommon.java b/src/main/java/dan200/computercraft/shared/proxy/CCTurtleProxyCommon.java index 2f6e4c721..b821be9df 100644 --- a/src/main/java/dan200/computercraft/shared/proxy/CCTurtleProxyCommon.java +++ b/src/main/java/dan200/computercraft/shared/proxy/CCTurtleProxyCommon.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/proxy/ComputerCraftProxyCommon.java b/src/main/java/dan200/computercraft/shared/proxy/ComputerCraftProxyCommon.java index ada5ca7c6..b7ec14a51 100644 --- a/src/main/java/dan200/computercraft/shared/proxy/ComputerCraftProxyCommon.java +++ b/src/main/java/dan200/computercraft/shared/proxy/ComputerCraftProxyCommon.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/proxy/ICCTurtleProxy.java b/src/main/java/dan200/computercraft/shared/proxy/ICCTurtleProxy.java index 6c6b3ca25..8f3fa4c92 100644 --- a/src/main/java/dan200/computercraft/shared/proxy/ICCTurtleProxy.java +++ b/src/main/java/dan200/computercraft/shared/proxy/ICCTurtleProxy.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/proxy/IComputerCraftProxy.java b/src/main/java/dan200/computercraft/shared/proxy/IComputerCraftProxy.java index 31101b609..25505b5ea 100644 --- a/src/main/java/dan200/computercraft/shared/proxy/IComputerCraftProxy.java +++ b/src/main/java/dan200/computercraft/shared/proxy/IComputerCraftProxy.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/apis/TurtleAPI.java b/src/main/java/dan200/computercraft/shared/turtle/apis/TurtleAPI.java index 7ea834e97..0af561f25 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/apis/TurtleAPI.java +++ b/src/main/java/dan200/computercraft/shared/turtle/apis/TurtleAPI.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/blocks/BlockTurtle.java b/src/main/java/dan200/computercraft/shared/turtle/blocks/BlockTurtle.java index 207d7ba8d..ece09e646 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/blocks/BlockTurtle.java +++ b/src/main/java/dan200/computercraft/shared/turtle/blocks/BlockTurtle.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/blocks/ITurtleTile.java b/src/main/java/dan200/computercraft/shared/turtle/blocks/ITurtleTile.java index 2f7907d48..f2dc62ef8 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/blocks/ITurtleTile.java +++ b/src/main/java/dan200/computercraft/shared/turtle/blocks/ITurtleTile.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/blocks/TileTurtle.java b/src/main/java/dan200/computercraft/shared/turtle/blocks/TileTurtle.java index 170f00a65..a2c8e4953 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/blocks/TileTurtle.java +++ b/src/main/java/dan200/computercraft/shared/turtle/blocks/TileTurtle.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/blocks/TileTurtleAdvanced.java b/src/main/java/dan200/computercraft/shared/turtle/blocks/TileTurtleAdvanced.java index 9332a2521..9fba1cdbd 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/blocks/TileTurtleAdvanced.java +++ b/src/main/java/dan200/computercraft/shared/turtle/blocks/TileTurtleAdvanced.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/blocks/TileTurtleExpanded.java b/src/main/java/dan200/computercraft/shared/turtle/blocks/TileTurtleExpanded.java index 8218bffe0..0a83052f4 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/blocks/TileTurtleExpanded.java +++ b/src/main/java/dan200/computercraft/shared/turtle/blocks/TileTurtleExpanded.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/InteractDirection.java b/src/main/java/dan200/computercraft/shared/turtle/core/InteractDirection.java index e38de691a..da7b21363 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/InteractDirection.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/InteractDirection.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/MoveDirection.java b/src/main/java/dan200/computercraft/shared/turtle/core/MoveDirection.java index 3df018026..aaf6a1601 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/MoveDirection.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/MoveDirection.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurnDirection.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurnDirection.java index ef04e25b8..edf8e4b6b 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurnDirection.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurnDirection.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleAttackCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleAttackCommand.java index 361dab384..94e0329eb 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleAttackCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleAttackCommand.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleBrain.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleBrain.java index 594e1e89b..594a51cc3 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleBrain.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleBrain.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCheckRedstoneCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCheckRedstoneCommand.java index 1c8c9e2c2..c864f4307 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCheckRedstoneCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCheckRedstoneCommand.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCommandQueueEntry.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCommandQueueEntry.java index a25081308..35ece2f6b 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCommandQueueEntry.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCommandQueueEntry.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCompareCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCompareCommand.java index 4cdb1b1c0..ef7309697 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCompareCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCompareCommand.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCompareToCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCompareToCommand.java index 11a7daf00..fe93a0db4 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCompareToCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCompareToCommand.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCraftCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCraftCommand.java index 4e3022664..d358db525 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCraftCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCraftCommand.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleDetectCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleDetectCommand.java index 47955b9cc..ac4eaae2a 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleDetectCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleDetectCommand.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleDigCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleDigCommand.java index d781ad77c..84328310d 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleDigCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleDigCommand.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleDropCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleDropCommand.java index 6953649f1..892d522c1 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleDropCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleDropCommand.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleEquipCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleEquipCommand.java index c4bc6a83e..966b24c56 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleEquipCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleEquipCommand.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleInspectCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleInspectCommand.java index 60cdaf84a..5320b3f5c 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleInspectCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleInspectCommand.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleMoveCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleMoveCommand.java index 5df8f1f18..fd68a8818 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleMoveCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleMoveCommand.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlaceCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlaceCommand.java index eb9fe5373..4d02774d1 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlaceCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlaceCommand.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlayer.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlayer.java index 0e751e2e2..25fb5b7a1 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlayer.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlayer.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleRefuelCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleRefuelCommand.java index c011e913c..0ade611a2 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleRefuelCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleRefuelCommand.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleSelectCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleSelectCommand.java index 75bb97bda..6fec07da7 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleSelectCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleSelectCommand.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleSetRedstoneCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleSetRedstoneCommand.java index 86f55abbc..310ddef80 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleSetRedstoneCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleSetRedstoneCommand.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleSuckCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleSuckCommand.java index 736e5c3b6..2d5271647 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleSuckCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleSuckCommand.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleToolCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleToolCommand.java index 5c6a09705..832bbc3dc 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleToolCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleToolCommand.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleTransferToCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleTransferToCommand.java index dbd38ddf1..37bf17ee1 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleTransferToCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleTransferToCommand.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleTurnCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleTurnCommand.java index af675c9ed..2618b0753 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleTurnCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleTurnCommand.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/entity/TurtleVisionCamera.java b/src/main/java/dan200/computercraft/shared/turtle/entity/TurtleVisionCamera.java index 2690abaaf..31bae6bff 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/entity/TurtleVisionCamera.java +++ b/src/main/java/dan200/computercraft/shared/turtle/entity/TurtleVisionCamera.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/inventory/ContainerTurtle.java b/src/main/java/dan200/computercraft/shared/turtle/inventory/ContainerTurtle.java index 0ad031a9d..99a20c0f1 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/inventory/ContainerTurtle.java +++ b/src/main/java/dan200/computercraft/shared/turtle/inventory/ContainerTurtle.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/items/ITurtleItem.java b/src/main/java/dan200/computercraft/shared/turtle/items/ITurtleItem.java index 9c7e5e2e5..7b9dfdb61 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/items/ITurtleItem.java +++ b/src/main/java/dan200/computercraft/shared/turtle/items/ITurtleItem.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/items/ItemTurtleAdvanced.java b/src/main/java/dan200/computercraft/shared/turtle/items/ItemTurtleAdvanced.java index 908b12e7c..d0247a013 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/items/ItemTurtleAdvanced.java +++ b/src/main/java/dan200/computercraft/shared/turtle/items/ItemTurtleAdvanced.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/items/ItemTurtleBase.java b/src/main/java/dan200/computercraft/shared/turtle/items/ItemTurtleBase.java index 61f840605..146631f91 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/items/ItemTurtleBase.java +++ b/src/main/java/dan200/computercraft/shared/turtle/items/ItemTurtleBase.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/items/ItemTurtleLegacy.java b/src/main/java/dan200/computercraft/shared/turtle/items/ItemTurtleLegacy.java index 595558af7..c514a9e24 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/items/ItemTurtleLegacy.java +++ b/src/main/java/dan200/computercraft/shared/turtle/items/ItemTurtleLegacy.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/items/ItemTurtleNormal.java b/src/main/java/dan200/computercraft/shared/turtle/items/ItemTurtleNormal.java index 8ae57682f..4496b4046 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/items/ItemTurtleNormal.java +++ b/src/main/java/dan200/computercraft/shared/turtle/items/ItemTurtleNormal.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/items/TurtleItemFactory.java b/src/main/java/dan200/computercraft/shared/turtle/items/TurtleItemFactory.java index 56d195ced..2a72a1685 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/items/TurtleItemFactory.java +++ b/src/main/java/dan200/computercraft/shared/turtle/items/TurtleItemFactory.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/recipes/TurtleRecipe.java b/src/main/java/dan200/computercraft/shared/turtle/recipes/TurtleRecipe.java index 285f67b23..cba296587 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/recipes/TurtleRecipe.java +++ b/src/main/java/dan200/computercraft/shared/turtle/recipes/TurtleRecipe.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/recipes/TurtleUpgradeRecipe.java b/src/main/java/dan200/computercraft/shared/turtle/recipes/TurtleUpgradeRecipe.java index 9d9c4fb6c..f49054585 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/recipes/TurtleUpgradeRecipe.java +++ b/src/main/java/dan200/computercraft/shared/turtle/recipes/TurtleUpgradeRecipe.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/upgrades/CraftingTablePeripheral.java b/src/main/java/dan200/computercraft/shared/turtle/upgrades/CraftingTablePeripheral.java index fa9953f9e..69bf92302 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/upgrades/CraftingTablePeripheral.java +++ b/src/main/java/dan200/computercraft/shared/turtle/upgrades/CraftingTablePeripheral.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleAxe.java b/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleAxe.java index e9be49357..e0abeb674 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleAxe.java +++ b/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleAxe.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleCraftingTable.java b/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleCraftingTable.java index 2fa7d6f51..25f08a10b 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleCraftingTable.java +++ b/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleCraftingTable.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleHoe.java b/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleHoe.java index 61159c26d..4bf30bb97 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleHoe.java +++ b/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleHoe.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleInventoryCrafting.java b/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleInventoryCrafting.java index d5b9132f8..7d94267e2 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleInventoryCrafting.java +++ b/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleInventoryCrafting.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleModem.java b/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleModem.java index 741a79ea3..ff0ad8251 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleModem.java +++ b/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleModem.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleShovel.java b/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleShovel.java index 7d3736952..551420713 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleShovel.java +++ b/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleShovel.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleSword.java b/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleSword.java index 31d80d01d..6eef57226 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleSword.java +++ b/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleSword.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleTool.java b/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleTool.java index fa7287792..48ce2d373 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleTool.java +++ b/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleTool.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/util/Colour.java b/src/main/java/dan200/computercraft/shared/util/Colour.java index 957735324..b9ba6711a 100644 --- a/src/main/java/dan200/computercraft/shared/util/Colour.java +++ b/src/main/java/dan200/computercraft/shared/util/Colour.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/util/CreativeTabMain.java b/src/main/java/dan200/computercraft/shared/util/CreativeTabMain.java index ac5bf933f..2ec9fcd7b 100644 --- a/src/main/java/dan200/computercraft/shared/util/CreativeTabMain.java +++ b/src/main/java/dan200/computercraft/shared/util/CreativeTabMain.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/util/CreativeTabTreasure.java b/src/main/java/dan200/computercraft/shared/util/CreativeTabTreasure.java index 975af59d7..f30197f6e 100644 --- a/src/main/java/dan200/computercraft/shared/util/CreativeTabTreasure.java +++ b/src/main/java/dan200/computercraft/shared/util/CreativeTabTreasure.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/util/DirectionUtil.java b/src/main/java/dan200/computercraft/shared/util/DirectionUtil.java index 318acba53..cf727a1ab 100644 --- a/src/main/java/dan200/computercraft/shared/util/DirectionUtil.java +++ b/src/main/java/dan200/computercraft/shared/util/DirectionUtil.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/util/Holiday.java b/src/main/java/dan200/computercraft/shared/util/Holiday.java index e77b365b9..83ee42566 100644 --- a/src/main/java/dan200/computercraft/shared/util/Holiday.java +++ b/src/main/java/dan200/computercraft/shared/util/Holiday.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/util/HolidayUtil.java b/src/main/java/dan200/computercraft/shared/util/HolidayUtil.java index a31652a53..376cf9e73 100644 --- a/src/main/java/dan200/computercraft/shared/util/HolidayUtil.java +++ b/src/main/java/dan200/computercraft/shared/util/HolidayUtil.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/util/IEntityDropConsumer.java b/src/main/java/dan200/computercraft/shared/util/IEntityDropConsumer.java index 3dfb49834..a3df0f4e5 100644 --- a/src/main/java/dan200/computercraft/shared/util/IEntityDropConsumer.java +++ b/src/main/java/dan200/computercraft/shared/util/IEntityDropConsumer.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/util/ImpostorRecipe.java b/src/main/java/dan200/computercraft/shared/util/ImpostorRecipe.java index d448a4ae3..20aef655a 100644 --- a/src/main/java/dan200/computercraft/shared/util/ImpostorRecipe.java +++ b/src/main/java/dan200/computercraft/shared/util/ImpostorRecipe.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/util/ImpostorShapelessRecipe.java b/src/main/java/dan200/computercraft/shared/util/ImpostorShapelessRecipe.java index 50c96d2e6..ed8df7993 100644 --- a/src/main/java/dan200/computercraft/shared/util/ImpostorShapelessRecipe.java +++ b/src/main/java/dan200/computercraft/shared/util/ImpostorShapelessRecipe.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/util/InventoryUtil.java b/src/main/java/dan200/computercraft/shared/util/InventoryUtil.java index 3a27f191f..5e37ef95c 100644 --- a/src/main/java/dan200/computercraft/shared/util/InventoryUtil.java +++ b/src/main/java/dan200/computercraft/shared/util/InventoryUtil.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/util/NBTUtil.java b/src/main/java/dan200/computercraft/shared/util/NBTUtil.java index e0a066529..9ef46a315 100644 --- a/src/main/java/dan200/computercraft/shared/util/NBTUtil.java +++ b/src/main/java/dan200/computercraft/shared/util/NBTUtil.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/util/RedstoneUtil.java b/src/main/java/dan200/computercraft/shared/util/RedstoneUtil.java index 1a99f300d..85129cc8d 100644 --- a/src/main/java/dan200/computercraft/shared/util/RedstoneUtil.java +++ b/src/main/java/dan200/computercraft/shared/util/RedstoneUtil.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/util/ReflectionUtil.java b/src/main/java/dan200/computercraft/shared/util/ReflectionUtil.java index 93be71ddf..ef7cd7071 100644 --- a/src/main/java/dan200/computercraft/shared/util/ReflectionUtil.java +++ b/src/main/java/dan200/computercraft/shared/util/ReflectionUtil.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com diff --git a/src/main/java/dan200/computercraft/shared/util/WorldUtil.java b/src/main/java/dan200/computercraft/shared/util/WorldUtil.java index 71ad07db6..096f8f32a 100644 --- a/src/main/java/dan200/computercraft/shared/util/WorldUtil.java +++ b/src/main/java/dan200/computercraft/shared/util/WorldUtil.java @@ -1,4 +1,4 @@ -/** +/* * This file is part of ComputerCraft - http://www.computercraft.info * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. * Send enquiries to dratcliffe@gmail.com From a3400ecf2601def826c9ec3ca0c450a495bfc62d Mon Sep 17 00:00:00 2001 From: SquidDev Date: Sun, 7 May 2017 01:42:32 +0100 Subject: [PATCH 5/7] Fix all the deprecated warnings --- build.gradle | 5 ++++ .../dan200/computercraft/ComputerCraft.java | 6 ++-- .../computercraft/client/gui/GuiConfigCC.java | 2 +- .../client/render/TurtleMultiModel.java | 1 + .../client/render/TurtleSmartItemModel.java | 1 + .../computercraft/core/apis/HTTPRequest.java | 8 ----- .../core/apis/HTTPRequestException.java | 11 +++++++ .../shared/common/BlockGeneric.java | 9 ++++++ .../computer/blocks/BlockCommandComputer.java | 2 ++ .../shared/computer/blocks/BlockComputer.java | 2 ++ .../shared/peripheral/common/BlockCable.java | 3 ++ .../peripheral/common/BlockPeripheral.java | 2 ++ .../common/BlockPeripheralBase.java | 2 ++ .../peripheral/modem/BlockAdvancedModem.java | 2 ++ .../shared/proxy/CCTurtleProxyCommon.java | 12 ++++++-- .../proxy/ComputerCraftProxyCommon.java | 30 ++++++++++++------- .../shared/turtle/blocks/BlockTurtle.java | 5 ++++ .../shared/turtle/blocks/TileTurtle.java | 21 +++++++++---- 18 files changed, 94 insertions(+), 30 deletions(-) create mode 100644 src/main/java/dan200/computercraft/core/apis/HTTPRequestException.java diff --git a/build.gradle b/build.gradle index 8f54cb981..a31b6f92f 100644 --- a/build.gradle +++ b/build.gradle @@ -83,3 +83,8 @@ processResources } } +gradle.projectsEvaluated { + tasks.withType(JavaCompile) { + options.compilerArgs << "-Xlint" + } +} diff --git a/src/main/java/dan200/computercraft/ComputerCraft.java b/src/main/java/dan200/computercraft/ComputerCraft.java index 82208e241..1e279a93b 100644 --- a/src/main/java/dan200/computercraft/ComputerCraft.java +++ b/src/main/java/dan200/computercraft/ComputerCraft.java @@ -84,11 +84,13 @@ import java.util.Map; /////////////// @Mod( - modid = "ComputerCraft", name = "ComputerCraft", version = "${version}", + modid = ComputerCraft.MOD_ID, name = "ComputerCraft", version = "${version}", guiFactory = "dan200.computercraft.client.gui.GuiConfigCC$Factory" ) public class ComputerCraft { + public static final String MOD_ID = "ComputerCraft"; + // GUI IDs public static final int diskDriveGUIID = 100; public static final int computerGUIID = 101; @@ -212,7 +214,7 @@ public class ComputerCraft private static final Map pocketUpgrades = new HashMap(); // Implementation - @Mod.Instance( value = "ComputerCraft" ) + @Mod.Instance( value = ComputerCraft.MOD_ID ) public static ComputerCraft instance; @SidedProxy( clientSide = "dan200.computercraft.client.proxy.ComputerCraftProxyClient", serverSide = "dan200.computercraft.server.proxy.ComputerCraftProxyServer" ) diff --git a/src/main/java/dan200/computercraft/client/gui/GuiConfigCC.java b/src/main/java/dan200/computercraft/client/gui/GuiConfigCC.java index d7df2a233..28d8d9bc3 100644 --- a/src/main/java/dan200/computercraft/client/gui/GuiConfigCC.java +++ b/src/main/java/dan200/computercraft/client/gui/GuiConfigCC.java @@ -18,7 +18,7 @@ public class GuiConfigCC extends GuiConfig { public GuiConfigCC( GuiScreen parentScreen ) { - super( parentScreen, getConfigElements(), "ComputerCraft", false, false, "ComputerCraft" ); + super( parentScreen, getConfigElements(), ComputerCraft.MOD_ID, false, false, "ComputerCraft" ); } private static List getConfigElements() diff --git a/src/main/java/dan200/computercraft/client/render/TurtleMultiModel.java b/src/main/java/dan200/computercraft/client/render/TurtleMultiModel.java index eefc6fd04..938dbab9f 100644 --- a/src/main/java/dan200/computercraft/client/render/TurtleMultiModel.java +++ b/src/main/java/dan200/computercraft/client/render/TurtleMultiModel.java @@ -118,6 +118,7 @@ public class TurtleMultiModel implements IBakedModel @Nonnull @Override + @Deprecated public ItemCameraTransforms getItemCameraTransforms() { return m_baseModel.getItemCameraTransforms(); diff --git a/src/main/java/dan200/computercraft/client/render/TurtleSmartItemModel.java b/src/main/java/dan200/computercraft/client/render/TurtleSmartItemModel.java index 327a25348..2a261d838 100644 --- a/src/main/java/dan200/computercraft/client/render/TurtleSmartItemModel.java +++ b/src/main/java/dan200/computercraft/client/render/TurtleSmartItemModel.java @@ -208,6 +208,7 @@ public class TurtleSmartItemModel implements IBakedModel, IResourceManagerReload @Nonnull @Override + @Deprecated public ItemCameraTransforms getItemCameraTransforms() { return getDefaultModel().getItemCameraTransforms(); diff --git a/src/main/java/dan200/computercraft/core/apis/HTTPRequest.java b/src/main/java/dan200/computercraft/core/apis/HTTPRequest.java index 35ff94525..55390c262 100644 --- a/src/main/java/dan200/computercraft/core/apis/HTTPRequest.java +++ b/src/main/java/dan200/computercraft/core/apis/HTTPRequest.java @@ -18,14 +18,6 @@ import java.util.List; import java.util.Map; import java.util.regex.Pattern; -class HTTPRequestException extends Exception { - private static final long serialVersionUID = 7591208619422744652L; - - public HTTPRequestException( String s ) { - super( s ); - } -} - public class HTTPRequest { public static URL checkURL( String urlString ) throws HTTPRequestException diff --git a/src/main/java/dan200/computercraft/core/apis/HTTPRequestException.java b/src/main/java/dan200/computercraft/core/apis/HTTPRequestException.java new file mode 100644 index 000000000..d7832bdf1 --- /dev/null +++ b/src/main/java/dan200/computercraft/core/apis/HTTPRequestException.java @@ -0,0 +1,11 @@ +package dan200.computercraft.core.apis; + +public class HTTPRequestException extends Exception +{ + private static final long serialVersionUID = 7591208619422744652L; + + public HTTPRequestException( String s ) + { + super( s ); + } +} diff --git a/src/main/java/dan200/computercraft/shared/common/BlockGeneric.java b/src/main/java/dan200/computercraft/shared/common/BlockGeneric.java index 4ef335d22..d9d379151 100644 --- a/src/main/java/dan200/computercraft/shared/common/BlockGeneric.java +++ b/src/main/java/dan200/computercraft/shared/common/BlockGeneric.java @@ -152,6 +152,7 @@ public abstract class BlockGeneric extends Block implements } @Override + @Deprecated public final void neighborChanged( IBlockState state, World world, BlockPos pos, Block block ) { TileEntity tile = world.getTileEntity( pos ); @@ -208,6 +209,7 @@ public abstract class BlockGeneric extends Block implements @Nonnull @Override + @Deprecated public final AxisAlignedBB getBoundingBox( IBlockState state, IBlockAccess world, BlockPos pos ) { TileEntity tile = world.getTileEntity( pos ); @@ -221,12 +223,14 @@ public abstract class BlockGeneric extends Block implements @Nonnull @Override + @Deprecated public final AxisAlignedBB getSelectedBoundingBox( IBlockState state, @Nonnull World world, @Nonnull BlockPos pos ) { return getBoundingBox( state, world, pos ).offset( pos ); } @Override + @Deprecated public final AxisAlignedBB getCollisionBoundingBox( IBlockState state, @Nonnull World world, @Nonnull BlockPos pos ) { TileEntity tile = world.getTileEntity( pos ); @@ -254,6 +258,7 @@ public abstract class BlockGeneric extends Block implements } @Override + @Deprecated public final void addCollisionBoxToList( IBlockState state, @Nonnull World world, @Nonnull BlockPos pos, @Nonnull AxisAlignedBB bigBox, @Nonnull List list, Entity entity ) { TileEntity tile = world.getTileEntity( pos ); @@ -277,6 +282,7 @@ public abstract class BlockGeneric extends Block implements } @Override + @Deprecated public final boolean canProvidePower( IBlockState state ) { return true; @@ -295,6 +301,7 @@ public abstract class BlockGeneric extends Block implements } @Override + @Deprecated public final int getStrongPower( IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing oppositeSide ) { TileEntity tile = world.getTileEntity( pos ); @@ -307,6 +314,7 @@ public abstract class BlockGeneric extends Block implements } @Override + @Deprecated public final int getWeakPower( IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing oppositeSide ) { return getStrongPower( state, world, pos, oppositeSide ); @@ -335,6 +343,7 @@ public abstract class BlockGeneric extends Block implements } @Override + @Deprecated public boolean eventReceived( IBlockState state, World world, BlockPos pos, int eventID, int eventParameter ) { if( world.isRemote ) diff --git a/src/main/java/dan200/computercraft/shared/computer/blocks/BlockCommandComputer.java b/src/main/java/dan200/computercraft/shared/computer/blocks/BlockCommandComputer.java index c4e64e593..ab0aaf7ab 100644 --- a/src/main/java/dan200/computercraft/shared/computer/blocks/BlockCommandComputer.java +++ b/src/main/java/dan200/computercraft/shared/computer/blocks/BlockCommandComputer.java @@ -59,6 +59,7 @@ public class BlockCommandComputer extends BlockComputerBase @Nonnull @Override + @Deprecated public IBlockState getStateFromMeta( int meta ) { EnumFacing dir = EnumFacing.getFront( meta & 0x7 ); @@ -77,6 +78,7 @@ public class BlockCommandComputer extends BlockComputerBase @Nonnull @Override + @Deprecated public IBlockState getActualState( @Nonnull IBlockState state, IBlockAccess world, BlockPos pos ) { TileEntity tile = world.getTileEntity( pos ); diff --git a/src/main/java/dan200/computercraft/shared/computer/blocks/BlockComputer.java b/src/main/java/dan200/computercraft/shared/computer/blocks/BlockComputer.java index 3ce0281d6..9db8a672c 100644 --- a/src/main/java/dan200/computercraft/shared/computer/blocks/BlockComputer.java +++ b/src/main/java/dan200/computercraft/shared/computer/blocks/BlockComputer.java @@ -62,6 +62,7 @@ public class BlockComputer extends BlockComputerBase @Nonnull @Override + @Deprecated public IBlockState getStateFromMeta( int meta ) { EnumFacing dir = EnumFacing.getFront( meta & 0x7 ); @@ -118,6 +119,7 @@ public class BlockComputer extends BlockComputerBase @Nonnull @Override + @Deprecated public IBlockState getActualState( @Nonnull IBlockState state, IBlockAccess world, BlockPos pos ) { TileEntity tile = world.getTileEntity( pos ); diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockCable.java b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockCable.java index 59b650f50..bcedb4024 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockCable.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockCable.java @@ -92,6 +92,7 @@ public class BlockCable extends BlockPeripheralBase @Nonnull @Override + @Deprecated public IBlockState getStateFromMeta( int meta ) { IBlockState state = getDefaultState(); @@ -179,6 +180,7 @@ public class BlockCable extends BlockPeripheralBase @Nonnull @Override + @Deprecated public IBlockState getActualState( @Nonnull IBlockState state, IBlockAccess world, BlockPos pos ) { state = state.withProperty( Properties.NORTH, doesConnect( state, world, pos, EnumFacing.NORTH ) ); @@ -213,6 +215,7 @@ public class BlockCable extends BlockPeripheralBase } @Override + @Deprecated public boolean shouldSideBeRendered( IBlockState state, @Nonnull IBlockAccess world, @Nonnull BlockPos pos, EnumFacing side ) { return true; diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheral.java b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheral.java index 4f58a8457..9c31ab39f 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheral.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheral.java @@ -66,6 +66,7 @@ public class BlockPeripheral extends BlockPeripheralBase @Nonnull @Override + @Deprecated public IBlockState getStateFromMeta( int meta ) { IBlockState state = getDefaultState(); @@ -169,6 +170,7 @@ public class BlockPeripheral extends BlockPeripheralBase @Nonnull @Override + @Deprecated public IBlockState getActualState( @Nonnull IBlockState state, IBlockAccess world, BlockPos pos ) { int anim; diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheralBase.java b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheralBase.java index 3e713d073..2da659042 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheralBase.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheralBase.java @@ -32,12 +32,14 @@ public abstract class BlockPeripheralBase extends BlockDirectional protected abstract TilePeripheralBase createTile( PeripheralType type ); @Override + @Deprecated public final boolean isOpaqueCube( IBlockState state ) { return false; } @Override + @Deprecated public final boolean isFullCube( IBlockState state ) { return false; diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/BlockAdvancedModem.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/BlockAdvancedModem.java index 916b22a6e..4482e5ce2 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/BlockAdvancedModem.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/BlockAdvancedModem.java @@ -49,6 +49,7 @@ public class BlockAdvancedModem extends BlockPeripheralBase @Nonnull @Override + @Deprecated public IBlockState getStateFromMeta( int meta ) { IBlockState state = getDefaultState(); @@ -66,6 +67,7 @@ public class BlockAdvancedModem extends BlockPeripheralBase @Nonnull @Override + @Deprecated public IBlockState getActualState( @Nonnull IBlockState state, IBlockAccess world, BlockPos pos ) { int anim; diff --git a/src/main/java/dan200/computercraft/shared/proxy/CCTurtleProxyCommon.java b/src/main/java/dan200/computercraft/shared/proxy/CCTurtleProxyCommon.java index b821be9df..86dd2adb5 100644 --- a/src/main/java/dan200/computercraft/shared/proxy/CCTurtleProxyCommon.java +++ b/src/main/java/dan200/computercraft/shared/proxy/CCTurtleProxyCommon.java @@ -24,6 +24,7 @@ import dan200.computercraft.shared.turtle.upgrades.*; import dan200.computercraft.shared.util.IEntityDropConsumer; import dan200.computercraft.shared.util.ImpostorRecipe; import dan200.computercraft.shared.util.InventoryUtil; +import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.init.Blocks; @@ -326,14 +327,14 @@ public abstract class CCTurtleProxyCommon implements ICCTurtleProxy // Blocks // Turtle ComputerCraft.Blocks.turtle = BlockTurtle.createTurtleBlock(); - GameRegistry.registerBlock( ComputerCraft.Blocks.turtle, ItemTurtleLegacy.class, "CC-Turtle" ); + registerBlock( ComputerCraft.Blocks.turtle, new ItemTurtleLegacy(ComputerCraft.Blocks.turtle), "CC-Turtle" ); ComputerCraft.Blocks.turtleExpanded = BlockTurtle.createTurtleBlock(); - GameRegistry.registerBlock( ComputerCraft.Blocks.turtleExpanded, ItemTurtleNormal.class, "CC-TurtleExpanded" ); + registerBlock( ComputerCraft.Blocks.turtleExpanded, new ItemTurtleNormal( ComputerCraft.Blocks.turtleExpanded ), "CC-TurtleExpanded" ); // Advanced Turtle ComputerCraft.Blocks.turtleAdvanced = BlockTurtle.createTurtleBlock(); - GameRegistry.registerBlock( ComputerCraft.Blocks.turtleAdvanced, ItemTurtleAdvanced.class, "CC-TurtleAdvanced" ); + registerBlock( ComputerCraft.Blocks.turtleAdvanced, new ItemTurtleAdvanced( ComputerCraft.Blocks.turtleAdvanced ), "CC-TurtleAdvanced" ); // Recipe types RecipeSorter.register( "computercraft:turtle", TurtleRecipe.class, RecipeSorter.Category.SHAPED, "after:minecraft:shapeless" ); @@ -403,6 +404,11 @@ public abstract class CCTurtleProxyCommon implements ICCTurtleProxy registerTurtleUpgradeInternal( ComputerCraft.Upgrades.advancedModem ); } + private void registerBlock( Block block, Item item, String name) { + GameRegistry.register( block.setRegistryName( new ResourceLocation( ComputerCraft.MOD_ID, name ) ) ); + GameRegistry.register( item.setRegistryName( new ResourceLocation( ComputerCraft.MOD_ID, name ) ) ); + } + private void registerTileEntities() { // TileEntities diff --git a/src/main/java/dan200/computercraft/shared/proxy/ComputerCraftProxyCommon.java b/src/main/java/dan200/computercraft/shared/proxy/ComputerCraftProxyCommon.java index b7ec14a51..b3a780c0e 100644 --- a/src/main/java/dan200/computercraft/shared/proxy/ComputerCraftProxyCommon.java +++ b/src/main/java/dan200/computercraft/shared/proxy/ComputerCraftProxyCommon.java @@ -9,6 +9,7 @@ package dan200.computercraft.shared.proxy; import dan200.computercraft.ComputerCraft; import dan200.computercraft.api.ComputerCraftAPI; import dan200.computercraft.api.pocket.IPocketUpgrade; +import dan200.computercraft.core.computer.Computer; import dan200.computercraft.core.computer.MainThread; import dan200.computercraft.shared.common.DefaultBundledRedstoneProvider; import dan200.computercraft.shared.common.TileGeneric; @@ -51,6 +52,7 @@ import dan200.computercraft.shared.pocket.recipes.PocketComputerUpgradeRecipe; import dan200.computercraft.shared.turtle.blocks.TileTurtle; import dan200.computercraft.shared.turtle.inventory.ContainerTurtle; import dan200.computercraft.shared.util.*; +import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; @@ -65,6 +67,7 @@ import net.minecraft.network.play.server.SPacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumHand; import net.minecraft.util.IThreadListener; +import net.minecraft.util.ResourceLocation; import net.minecraft.util.SoundEvent; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; @@ -231,43 +234,43 @@ public abstract class ComputerCraftProxyCommon implements IComputerCraftProxy // Blocks // Computer ComputerCraft.Blocks.computer = new BlockComputer(); - GameRegistry.registerBlock( ComputerCraft.Blocks.computer, ItemComputer.class, "CC-Computer" ); + registerBlock( ComputerCraft.Blocks.computer, new ItemComputer( ComputerCraft.Blocks.computer ), "CC-Computer" ); // Peripheral ComputerCraft.Blocks.peripheral = new BlockPeripheral(); - GameRegistry.registerBlock( ComputerCraft.Blocks.peripheral, ItemPeripheral.class, "CC-Peripheral" ); + registerBlock( ComputerCraft.Blocks.peripheral, new ItemPeripheral( ComputerCraft.Blocks.peripheral ), "CC-Peripheral" ); // Cable ComputerCraft.Blocks.cable = new BlockCable(); - GameRegistry.registerBlock( ComputerCraft.Blocks.cable, ItemCable.class, "CC-Cable" ); + registerBlock( ComputerCraft.Blocks.cable, new ItemCable( ComputerCraft.Blocks.cable ), "CC-Cable" ); // Command Computer ComputerCraft.Blocks.commandComputer = new BlockCommandComputer(); - GameRegistry.registerBlock( ComputerCraft.Blocks.commandComputer, ItemCommandComputer.class, "command_computer" ); + registerBlock( ComputerCraft.Blocks.commandComputer, new ItemCommandComputer( ComputerCraft.Blocks.commandComputer ), "command_computer" ); // Command Computer ComputerCraft.Blocks.advancedModem = new BlockAdvancedModem(); - GameRegistry.registerBlock( ComputerCraft.Blocks.advancedModem, ItemAdvancedModem.class, "advanced_modem" ); + registerBlock( ComputerCraft.Blocks.advancedModem, new ItemAdvancedModem( ComputerCraft.Blocks.advancedModem ), "advanced_modem" ); // Items // Floppy Disk ComputerCraft.Items.disk = new ItemDiskLegacy(); - GameRegistry.registerItem( ComputerCraft.Items.disk, "disk" ); + GameRegistry.register( ComputerCraft.Items.disk.setRegistryName( new ResourceLocation( ComputerCraft.MOD_ID, "disk" ) ) ); ComputerCraft.Items.diskExpanded = new ItemDiskExpanded(); - GameRegistry.registerItem( ComputerCraft.Items.diskExpanded, "diskExpanded" ); + GameRegistry.register( ComputerCraft.Items.diskExpanded.setRegistryName( new ResourceLocation( ComputerCraft.MOD_ID, "diskExpanded" ) ) ); // Treasure Disk ComputerCraft.Items.treasureDisk = new ItemTreasureDisk(); - GameRegistry.registerItem( ComputerCraft.Items.treasureDisk, "treasureDisk" ); + GameRegistry.register( ComputerCraft.Items.treasureDisk.setRegistryName( new ResourceLocation( ComputerCraft.MOD_ID, "treasureDisk" ) ) ); // Printout ComputerCraft.Items.printout = new ItemPrintout(); - GameRegistry.registerItem( ComputerCraft.Items.printout, "printout" ); + GameRegistry.register( ComputerCraft.Items.printout.setRegistryName( new ResourceLocation( ComputerCraft.MOD_ID, "printout" ) ) ); // Pocket computer ComputerCraft.Items.pocketComputer = new ItemPocketComputer(); - GameRegistry.registerItem( ComputerCraft.Items.pocketComputer, "pocketComputer" ); + GameRegistry.register( ComputerCraft.Items.pocketComputer.setRegistryName( new ResourceLocation( ComputerCraft.MOD_ID, "pocketComputer" ) ) ); // Recipe types RecipeSorter.register( "computercraft:impostor", ImpostorRecipe.class, RecipeSorter.Category.SHAPED, "after:minecraft:shapeless" ); @@ -470,6 +473,11 @@ public abstract class ComputerCraftProxyCommon implements IComputerCraftProxy GameRegistry.addShapelessRecipe( cloudyHead, monitor, new ItemStack( Items.SKULL, 1, 1 ) ); } + private void registerBlock( Block block, Item item, String name) { + GameRegistry.register( block.setRegistryName( new ResourceLocation( ComputerCraft.MOD_ID, name ) ) ); + GameRegistry.register( item.setRegistryName( new ResourceLocation( ComputerCraft.MOD_ID, name ) ) ); + } + private void registerTileEntities() { // Tile Entities @@ -673,7 +681,7 @@ public abstract class ComputerCraftProxyCommon implements IComputerCraftProxy @SubscribeEvent public void onConfigChanged( ConfigChangedEvent.OnConfigChangedEvent event) { - if( event.getModID().equals( "ComputerCraft" ) ) + if( event.getModID().equals( ComputerCraft.MOD_ID ) ) { ComputerCraft.syncConfig(); } diff --git a/src/main/java/dan200/computercraft/shared/turtle/blocks/BlockTurtle.java b/src/main/java/dan200/computercraft/shared/turtle/blocks/BlockTurtle.java index ece09e646..ac1a68cb9 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/blocks/BlockTurtle.java +++ b/src/main/java/dan200/computercraft/shared/turtle/blocks/BlockTurtle.java @@ -55,18 +55,21 @@ public class BlockTurtle extends BlockComputerBase @Nonnull @Override + @Deprecated public EnumBlockRenderType getRenderType( IBlockState state ) { return EnumBlockRenderType.INVISIBLE; } @Override + @Deprecated public boolean isOpaqueCube( IBlockState state ) { return false; } @Override + @Deprecated public boolean isFullCube( IBlockState state ) { return false; @@ -81,6 +84,7 @@ public class BlockTurtle extends BlockComputerBase @Nonnull @Override + @Deprecated public IBlockState getStateFromMeta( int meta ) { return getDefaultState(); @@ -94,6 +98,7 @@ public class BlockTurtle extends BlockComputerBase @Nonnull @Override + @Deprecated public IBlockState getActualState( @Nonnull IBlockState state, IBlockAccess world, BlockPos pos ) { return state.withProperty( Properties.FACING, getDirection( world, pos ) ); diff --git a/src/main/java/dan200/computercraft/shared/turtle/blocks/TileTurtle.java b/src/main/java/dan200/computercraft/shared/turtle/blocks/TileTurtle.java index a2c8e4953..edbc78a2b 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/blocks/TileTurtle.java +++ b/src/main/java/dan200/computercraft/shared/turtle/blocks/TileTurtle.java @@ -17,7 +17,10 @@ import dan200.computercraft.shared.computer.core.ServerComputer; import dan200.computercraft.shared.turtle.apis.TurtleAPI; import dan200.computercraft.shared.turtle.core.TurtleBrain; import dan200.computercraft.shared.turtle.items.TurtleItemFactory; -import dan200.computercraft.shared.util.*; +import dan200.computercraft.shared.util.Colour; +import dan200.computercraft.shared.util.InventoryUtil; +import dan200.computercraft.shared.util.RedstoneUtil; +import dan200.computercraft.shared.util.WorldUtil; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; @@ -27,9 +30,16 @@ import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; -import net.minecraft.util.*; -import net.minecraft.util.math.*; -import net.minecraft.util.text.*; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.ITickable; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Vec3d; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.TextComponentString; +import net.minecraft.util.text.TextComponentTranslation; import net.minecraftforge.common.util.Constants; import javax.annotation.Nonnull; @@ -195,7 +205,8 @@ public class TileTurtle extends TileComputerBase m_brain.setDyeColour( -1 ); if( !player.capabilities.isCreativeMode ) { - currentItem.setItem( Items.BUCKET ); + player.setHeldItem( EnumHand.MAIN_HAND, new ItemStack( Items.BUCKET ) ); + player.inventory.markDirty(); } } } From 5a60818c99c275f1515358f96787b76360ed1ca1 Mon Sep 17 00:00:00 2001 From: SquidDev Date: Sun, 7 May 2017 01:52:55 +0100 Subject: [PATCH 6/7] Make many fields final --- .../computercraft/core/apis/HTTPAPI.java | 4 ++-- .../computercraft/core/apis/HTTPRequest.java | 4 ++-- .../core/apis/PeripheralAPI.java | 4 ++-- .../computercraft/core/apis/TermAPI.java | 4 ++-- .../computercraft/core/computer/Computer.java | 20 +++++++++---------- .../core/computer/ComputerThread.java | 12 +++++------ .../peripheral/modem/ModemPeripheral.java | 2 +- .../shared/peripheral/modem/TileCable.java | 6 +++--- .../peripheral/printer/TilePrinter.java | 12 ++--------- .../peripherals/PocketModemPeripheral.java | 6 +----- .../shared/proxy/CCTurtleProxyCommon.java | 1 - .../shared/turtle/blocks/TileTurtle.java | 12 ++--------- .../shared/turtle/upgrades/TurtleTool.java | 6 +----- .../computercraft/shared/util/IDAssigner.java | 1 - 14 files changed, 34 insertions(+), 60 deletions(-) diff --git a/src/main/java/dan200/computercraft/core/apis/HTTPAPI.java b/src/main/java/dan200/computercraft/core/apis/HTTPAPI.java index 2f531723f..768afd017 100644 --- a/src/main/java/dan200/computercraft/core/apis/HTTPAPI.java +++ b/src/main/java/dan200/computercraft/core/apis/HTTPAPI.java @@ -17,8 +17,8 @@ import java.util.*; public class HTTPAPI implements ILuaAPI { - private IAPIEnvironment m_apiEnvironment; - private List m_httpRequests; + private final IAPIEnvironment m_apiEnvironment; + private final List m_httpRequests; public HTTPAPI( IAPIEnvironment environment ) { diff --git a/src/main/java/dan200/computercraft/core/apis/HTTPRequest.java b/src/main/java/dan200/computercraft/core/apis/HTTPRequest.java index 55390c262..b7f816ad7 100644 --- a/src/main/java/dan200/computercraft/core/apis/HTTPRequest.java +++ b/src/main/java/dan200/computercraft/core/apis/HTTPRequest.java @@ -278,8 +278,8 @@ public class HTTPRequest return null; } - private Object m_lock = new Object(); - private URL m_url; + private final Object m_lock = new Object(); + private final URL m_url; private final String m_urlString; private boolean m_complete; diff --git a/src/main/java/dan200/computercraft/core/apis/PeripheralAPI.java b/src/main/java/dan200/computercraft/core/apis/PeripheralAPI.java index 01edb43a6..64a39c801 100644 --- a/src/main/java/dan200/computercraft/core/apis/PeripheralAPI.java +++ b/src/main/java/dan200/computercraft/core/apis/PeripheralAPI.java @@ -235,9 +235,9 @@ public class PeripheralAPI implements ILuaAPI, IAPIEnvironment.IPeripheralChange } } - private IAPIEnvironment m_environment; + private final IAPIEnvironment m_environment; private FileSystem m_fileSystem; - private PeripheralWrapper[] m_peripherals; + private final PeripheralWrapper[] m_peripherals; private boolean m_running; public PeripheralAPI( IAPIEnvironment _environment ) diff --git a/src/main/java/dan200/computercraft/core/apis/TermAPI.java b/src/main/java/dan200/computercraft/core/apis/TermAPI.java index 926cc51b9..dfaf3afd0 100644 --- a/src/main/java/dan200/computercraft/core/apis/TermAPI.java +++ b/src/main/java/dan200/computercraft/core/apis/TermAPI.java @@ -15,8 +15,8 @@ import javax.annotation.Nonnull; public class TermAPI implements ILuaAPI { - private Terminal m_terminal; - private IComputerEnvironment m_environment; + private final Terminal m_terminal; + private final IComputerEnvironment m_environment; public TermAPI( IAPIEnvironment _environment ) { diff --git a/src/main/java/dan200/computercraft/core/computer/Computer.java b/src/main/java/dan200/computercraft/core/computer/Computer.java index 51c38eb29..460982ff1 100644 --- a/src/main/java/dan200/computercraft/core/computer/Computer.java +++ b/src/main/java/dan200/computercraft/core/computer/Computer.java @@ -186,26 +186,26 @@ public class Computer private boolean m_blinking; private ILuaMachine m_machine; - private List m_apis; - private APIEnvironment m_apiEnvironment; + private final List m_apis; + private final APIEnvironment m_apiEnvironment; - private Terminal m_terminal; + private final Terminal m_terminal; private FileSystem m_fileSystem; private IWritableMount m_rootMount; - private int[] m_internalOutput; - private int[] m_internalBundledOutput; + private final int[] m_internalOutput; + private final int[] m_internalBundledOutput; private boolean m_internalOutputChanged; - private int[] m_externalOutput; - private int[] m_externalBundledOutput; + private final int[] m_externalOutput; + private final int[] m_externalBundledOutput; private boolean m_externalOutputChanged; - private int[] m_input; - private int[] m_bundledInput; + private final int[] m_input; + private final int[] m_bundledInput; private boolean m_inputChanged; - private IPeripheral[] m_peripherals; + private final IPeripheral[] m_peripherals; public Computer( IComputerEnvironment environment, Terminal terminal, int id ) { diff --git a/src/main/java/dan200/computercraft/core/computer/ComputerThread.java b/src/main/java/dan200/computercraft/core/computer/ComputerThread.java index 98297fe23..49d739c95 100644 --- a/src/main/java/dan200/computercraft/core/computer/ComputerThread.java +++ b/src/main/java/dan200/computercraft/core/computer/ComputerThread.java @@ -13,14 +13,14 @@ import java.util.concurrent.LinkedBlockingQueue; public class ComputerThread { - private static Object m_lock; + private static final Object m_lock; private static Thread m_thread; - private static WeakHashMap > m_computerTasks; - private static ArrayList > m_computerTasksActive; - private static ArrayList > m_computerTasksPending; - private static Object m_defaultQueue; - private static Object m_monitor; + private static final WeakHashMap > m_computerTasks; + private static final ArrayList > m_computerTasksActive; + private static final ArrayList > m_computerTasksPending; + private static final Object m_defaultQueue; + private static final Object m_monitor; private static boolean m_running; private static boolean m_stopped; diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/ModemPeripheral.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/ModemPeripheral.java index b26a59440..f3033e5f8 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/ModemPeripheral.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/ModemPeripheral.java @@ -84,7 +84,7 @@ public abstract class ModemPeripheral private INetwork m_network; private IComputerAccess m_computer; - private Map m_channels; + private final Map m_channels; private boolean m_open; private boolean m_changed; diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/TileCable.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/TileCable.java index c1dcd71f4..8eb6669e3 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/TileCable.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/TileCable.java @@ -233,13 +233,13 @@ public class TileCable extends TileModemBase // Members - private Map> m_receivers; - private Queue m_transmitQueue; + private final Map> m_receivers; + private final Queue m_transmitQueue; private boolean m_peripheralAccessAllowed; private int m_attachedPeripheralID; - private Map m_peripheralsByName; + private final Map m_peripheralsByName; private Map m_peripheralWrappersByName; private boolean m_peripheralsKnown; private boolean m_destroyed; diff --git a/src/main/java/dan200/computercraft/shared/peripheral/printer/TilePrinter.java b/src/main/java/dan200/computercraft/shared/peripheral/printer/TilePrinter.java index 78ad00e5a..f54d07425 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/printer/TilePrinter.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/printer/TilePrinter.java @@ -447,16 +447,8 @@ public class TilePrinter extends TilePeripheralBase { synchronized( m_inventory ) { - ItemStack inkStack = m_inventory[0]; - if( inkStack == null || !isInk(inkStack) ) - { - return false; - } - if( getPaperLevel() > 0 ) - { - return true; - } - return false; + ItemStack inkStack = m_inventory[ 0 ]; + return inkStack != null && isInk( inkStack ) && getPaperLevel() > 0; } } diff --git a/src/main/java/dan200/computercraft/shared/pocket/peripherals/PocketModemPeripheral.java b/src/main/java/dan200/computercraft/shared/pocket/peripherals/PocketModemPeripheral.java index de8b2669e..69f100edc 100644 --- a/src/main/java/dan200/computercraft/shared/pocket/peripherals/PocketModemPeripheral.java +++ b/src/main/java/dan200/computercraft/shared/pocket/peripherals/PocketModemPeripheral.java @@ -52,10 +52,6 @@ public class PocketModemPeripheral extends WirelessModemPeripheral @Override public boolean equals( IPeripheral other ) { - if( other instanceof PocketModemPeripheral ) - { - return true; - } - return false; + return other instanceof PocketModemPeripheral; } } diff --git a/src/main/java/dan200/computercraft/shared/proxy/CCTurtleProxyCommon.java b/src/main/java/dan200/computercraft/shared/proxy/CCTurtleProxyCommon.java index 86dd2adb5..1702855f9 100644 --- a/src/main/java/dan200/computercraft/shared/proxy/CCTurtleProxyCommon.java +++ b/src/main/java/dan200/computercraft/shared/proxy/CCTurtleProxyCommon.java @@ -112,7 +112,6 @@ public abstract class CCTurtleProxyCommon implements ICCTurtleProxy } catch( Exception e ) { - continue; } } return null; diff --git a/src/main/java/dan200/computercraft/shared/turtle/blocks/TileTurtle.java b/src/main/java/dan200/computercraft/shared/turtle/blocks/TileTurtle.java index edbc78a2b..09c80c0b9 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/blocks/TileTurtle.java +++ b/src/main/java/dan200/computercraft/shared/turtle/blocks/TileTurtle.java @@ -245,11 +245,7 @@ public class TileTurtle extends TileComputerBase } else { - if( exploder != null && ( exploder instanceof EntityLivingBase || exploder instanceof EntityFireball ) ) - { - return true; - } - return false; + return exploder != null && (exploder instanceof EntityLivingBase || exploder instanceof EntityFireball); } } @@ -705,11 +701,7 @@ public class TileTurtle extends TileComputerBase case 5: upgrade = getUpgrade( TurtleSide.Left ); break; default: return false; } - if( upgrade != null && upgrade.getType().isPeripheral() ) - { - return true; - } - return false; + return upgrade != null && upgrade.getType().isPeripheral(); } public void transferStateFrom( TileTurtle copy ) diff --git a/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleTool.java b/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleTool.java index 48ce2d373..787a8532a 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleTool.java +++ b/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleTool.java @@ -140,11 +140,7 @@ public class TurtleTool implements ITurtleUpgrade { IBlockState state = world.getBlockState( pos ); Block block = state.getBlock(); - if( block.isAir( state, world, pos ) || block == Blocks.BEDROCK || state.getBlockHardness( world, pos ) <= -1.0F ) - { - return false; - } - return true; + return !block.isAir( state, world, pos ) && block != Blocks.BEDROCK && state.getBlockHardness( world, pos ) > -1.0F; } protected boolean canHarvestBlock( World world, BlockPos pos ) diff --git a/src/main/java/dan200/computercraft/shared/util/IDAssigner.java b/src/main/java/dan200/computercraft/shared/util/IDAssigner.java index d6eda9687..b1eb6910e 100644 --- a/src/main/java/dan200/computercraft/shared/util/IDAssigner.java +++ b/src/main/java/dan200/computercraft/shared/util/IDAssigner.java @@ -50,7 +50,6 @@ public class IDAssigner } catch( NumberFormatException e ) { - continue; } } } From 2e901a063d4db05ba4b4d8e925b420df0497bba6 Mon Sep 17 00:00:00 2001 From: SquidDev Date: Sun, 7 May 2017 01:53:37 +0100 Subject: [PATCH 7/7] Remove accessibility modifiers from all enums and interfaces --- .../core/apis/IAPIEnvironment.java | 40 +++++++++---------- .../computercraft/core/apis/ILuaAPI.java | 8 ++-- .../computercraft/core/computer/Computer.java | 2 +- .../core/computer/IComputerEnvironment.java | 16 ++++---- .../computercraft/core/computer/ITask.java | 4 +- .../core/filesystem/IMountedFile.java | 2 +- .../core/filesystem/IMountedFileBinary.java | 8 ++-- .../core/filesystem/IMountedFileNormal.java | 8 ++-- .../computercraft/core/lua/ILuaMachine.java | 18 ++++----- .../shared/common/IDirectionalTile.java | 4 +- .../shared/common/ITerminal.java | 4 +- .../shared/common/ITerminalTile.java | 2 +- .../shared/computer/blocks/ComputerState.java | 2 +- .../shared/computer/blocks/IComputerTile.java | 10 ++--- .../shared/computer/core/IComputer.java | 20 +++++----- .../computer/core/IComputerContainer.java | 2 +- .../shared/computer/items/IComputerItem.java | 6 +-- .../shared/network/INetworkedThing.java | 2 +- .../shared/peripheral/PeripheralType.java | 2 +- .../common/BlockCableModemVariant.java | 2 +- .../common/BlockPeripheralVariant.java | 2 +- .../peripheral/common/IPeripheralItem.java | 2 +- .../peripheral/common/IPeripheralTile.java | 6 +-- .../shared/peripheral/modem/INetwork.java | 8 ++-- .../shared/peripheral/modem/IReceiver.java | 14 +++---- .../shared/peripheral/modem/TileCable.java | 4 +- .../shared/proxy/ICCTurtleProxy.java | 18 ++++----- .../shared/proxy/IComputerCraftProxy.java | 34 ++++++++-------- .../shared/turtle/blocks/ITurtleTile.java | 14 +++---- .../shared/turtle/items/ITurtleItem.java | 8 ++-- .../computercraft/shared/util/Colour.java | 2 +- .../shared/util/IEntityDropConsumer.java | 2 +- 32 files changed, 138 insertions(+), 138 deletions(-) diff --git a/src/main/java/dan200/computercraft/core/apis/IAPIEnvironment.java b/src/main/java/dan200/computercraft/core/apis/IAPIEnvironment.java index bd0e3e7c5..49d1ac4d3 100644 --- a/src/main/java/dan200/computercraft/core/apis/IAPIEnvironment.java +++ b/src/main/java/dan200/computercraft/core/apis/IAPIEnvironment.java @@ -14,32 +14,32 @@ import dan200.computercraft.core.terminal.Terminal; public interface IAPIEnvironment { - public static interface IPeripheralChangeListener + interface IPeripheralChangeListener { - public void onPeripheralChanged( int side, IPeripheral newPeripheral ); + void onPeripheralChanged( int side, IPeripheral newPeripheral ); } - public Computer getComputer(); - public int getComputerID(); - public IComputerEnvironment getComputerEnvironment(); - public Terminal getTerminal(); - public FileSystem getFileSystem(); + Computer getComputer(); + int getComputerID(); + IComputerEnvironment getComputerEnvironment(); + Terminal getTerminal(); + FileSystem getFileSystem(); - public void shutdown(); - public void reboot(); - public void queueEvent( String event, Object[] args ); + void shutdown(); + void reboot(); + void queueEvent( String event, Object[] args ); - public void setOutput( int side, int output ); - public int getOutput( int side ); - public int getInput( int side ); + void setOutput( int side, int output ); + int getOutput( int side ); + int getInput( int side ); - public void setBundledOutput( int side, int output ); - public int getBundledOutput( int side ); - public int getBundledInput( int side ); + void setBundledOutput( int side, int output ); + int getBundledOutput( int side ); + int getBundledInput( int side ); - public void setPeripheralChangeListener( IPeripheralChangeListener listener ); - public IPeripheral getPeripheral( int side ); + void setPeripheralChangeListener( IPeripheralChangeListener listener ); + IPeripheral getPeripheral( int side ); - public String getLabel(); - public void setLabel( String label ); + String getLabel(); + void setLabel( String label ); } diff --git a/src/main/java/dan200/computercraft/core/apis/ILuaAPI.java b/src/main/java/dan200/computercraft/core/apis/ILuaAPI.java index 0ebf7155b..d1761cade 100644 --- a/src/main/java/dan200/computercraft/core/apis/ILuaAPI.java +++ b/src/main/java/dan200/computercraft/core/apis/ILuaAPI.java @@ -9,9 +9,9 @@ import dan200.computercraft.api.lua.ILuaObject; public interface ILuaAPI extends ILuaObject { - public String[] getNames(); + String[] getNames(); - public void startup(); // LT - public void advance( double _dt ); // MT - public void shutdown(); // LT + void startup(); // LT + void advance( double _dt ); // MT + void shutdown(); // LT } diff --git a/src/main/java/dan200/computercraft/core/computer/Computer.java b/src/main/java/dan200/computercraft/core/computer/Computer.java index 460982ff1..9c84e71f2 100644 --- a/src/main/java/dan200/computercraft/core/computer/Computer.java +++ b/src/main/java/dan200/computercraft/core/computer/Computer.java @@ -29,7 +29,7 @@ public class Computer "bottom", "top", "back", "front", "right", "left", }; - private static enum State + private enum State { Off, Starting, diff --git a/src/main/java/dan200/computercraft/core/computer/IComputerEnvironment.java b/src/main/java/dan200/computercraft/core/computer/IComputerEnvironment.java index d62fe0e59..2451ca140 100644 --- a/src/main/java/dan200/computercraft/core/computer/IComputerEnvironment.java +++ b/src/main/java/dan200/computercraft/core/computer/IComputerEnvironment.java @@ -10,13 +10,13 @@ import dan200.computercraft.api.filesystem.IWritableMount; public interface IComputerEnvironment { - public int getDay(); - public double getTimeOfDay(); - public boolean isColour(); - public long getComputerSpaceLimit(); - public String getHostString(); + int getDay(); + double getTimeOfDay(); + boolean isColour(); + long getComputerSpaceLimit(); + String getHostString(); - public int assignNewID(); - public IWritableMount createSaveDirMount( String subPath, long capacity ); - public IMount createResourceMount( String domain, String subPath ); + int assignNewID(); + IWritableMount createSaveDirMount( String subPath, long capacity ); + IMount createResourceMount( String domain, String subPath ); } diff --git a/src/main/java/dan200/computercraft/core/computer/ITask.java b/src/main/java/dan200/computercraft/core/computer/ITask.java index b6426405d..76dfcc17d 100644 --- a/src/main/java/dan200/computercraft/core/computer/ITask.java +++ b/src/main/java/dan200/computercraft/core/computer/ITask.java @@ -8,6 +8,6 @@ package dan200.computercraft.core.computer; public interface ITask { - public Computer getOwner(); - public void execute(); + Computer getOwner(); + void execute(); } diff --git a/src/main/java/dan200/computercraft/core/filesystem/IMountedFile.java b/src/main/java/dan200/computercraft/core/filesystem/IMountedFile.java index a475f7fb8..1d01febc8 100644 --- a/src/main/java/dan200/computercraft/core/filesystem/IMountedFile.java +++ b/src/main/java/dan200/computercraft/core/filesystem/IMountedFile.java @@ -9,5 +9,5 @@ package dan200.computercraft.core.filesystem; import java.io.IOException; public interface IMountedFile { - public void close() throws IOException; + void close() throws IOException; } diff --git a/src/main/java/dan200/computercraft/core/filesystem/IMountedFileBinary.java b/src/main/java/dan200/computercraft/core/filesystem/IMountedFileBinary.java index 242d5384e..f6581e881 100644 --- a/src/main/java/dan200/computercraft/core/filesystem/IMountedFileBinary.java +++ b/src/main/java/dan200/computercraft/core/filesystem/IMountedFileBinary.java @@ -9,8 +9,8 @@ package dan200.computercraft.core.filesystem; import java.io.IOException; public interface IMountedFileBinary extends IMountedFile { - public int read() throws IOException; - public void write(int i) throws IOException; - public void close() throws IOException; - public void flush() throws IOException; + int read() throws IOException; + void write( int i ) throws IOException; + void close() throws IOException; + void flush() throws IOException; } diff --git a/src/main/java/dan200/computercraft/core/filesystem/IMountedFileNormal.java b/src/main/java/dan200/computercraft/core/filesystem/IMountedFileNormal.java index b7cc71299..c8b956b0d 100644 --- a/src/main/java/dan200/computercraft/core/filesystem/IMountedFileNormal.java +++ b/src/main/java/dan200/computercraft/core/filesystem/IMountedFileNormal.java @@ -9,8 +9,8 @@ package dan200.computercraft.core.filesystem; import java.io.IOException; public interface IMountedFileNormal extends IMountedFile { - public String readLine() throws IOException; - public void write(String s, int off, int len, boolean newLine) throws IOException; - public void close() throws IOException; - public void flush() throws IOException; + String readLine() throws IOException; + void write( String s, int off, int len, boolean newLine ) throws IOException; + void close() throws IOException; + void flush() throws IOException; } diff --git a/src/main/java/dan200/computercraft/core/lua/ILuaMachine.java b/src/main/java/dan200/computercraft/core/lua/ILuaMachine.java index 5c9c355b0..798884678 100644 --- a/src/main/java/dan200/computercraft/core/lua/ILuaMachine.java +++ b/src/main/java/dan200/computercraft/core/lua/ILuaMachine.java @@ -12,17 +12,17 @@ import java.io.OutputStream; public interface ILuaMachine { - public void addAPI( ILuaAPI api ); + void addAPI( ILuaAPI api ); - public void loadBios( InputStream bios ); - public void handleEvent( String eventName, Object[] arguments ); - public void softAbort( String abortMessage ); - public void hardAbort( String abortMessage ); + void loadBios( InputStream bios ); + void handleEvent( String eventName, Object[] arguments ); + void softAbort( String abortMessage ); + void hardAbort( String abortMessage ); - public boolean saveState( OutputStream output ); - public boolean restoreState( InputStream input ); + boolean saveState( OutputStream output ); + boolean restoreState( InputStream input ); - public boolean isFinished(); + boolean isFinished(); - public void unload(); + void unload(); } diff --git a/src/main/java/dan200/computercraft/shared/common/IDirectionalTile.java b/src/main/java/dan200/computercraft/shared/common/IDirectionalTile.java index 012147b93..1f5c18f7b 100644 --- a/src/main/java/dan200/computercraft/shared/common/IDirectionalTile.java +++ b/src/main/java/dan200/computercraft/shared/common/IDirectionalTile.java @@ -10,6 +10,6 @@ import net.minecraft.util.EnumFacing; public interface IDirectionalTile { - public EnumFacing getDirection(); - public void setDirection( EnumFacing dir ); + EnumFacing getDirection(); + void setDirection( EnumFacing dir ); } diff --git a/src/main/java/dan200/computercraft/shared/common/ITerminal.java b/src/main/java/dan200/computercraft/shared/common/ITerminal.java index 2e9a3a77c..e3b295146 100644 --- a/src/main/java/dan200/computercraft/shared/common/ITerminal.java +++ b/src/main/java/dan200/computercraft/shared/common/ITerminal.java @@ -10,6 +10,6 @@ import dan200.computercraft.core.terminal.Terminal; public interface ITerminal { - public Terminal getTerminal(); - public boolean isColour(); + Terminal getTerminal(); + boolean isColour(); } diff --git a/src/main/java/dan200/computercraft/shared/common/ITerminalTile.java b/src/main/java/dan200/computercraft/shared/common/ITerminalTile.java index 97135232e..47d3e16bb 100644 --- a/src/main/java/dan200/computercraft/shared/common/ITerminalTile.java +++ b/src/main/java/dan200/computercraft/shared/common/ITerminalTile.java @@ -8,5 +8,5 @@ package dan200.computercraft.shared.common; public interface ITerminalTile { - public ITerminal getTerminal(); + ITerminal getTerminal(); } diff --git a/src/main/java/dan200/computercraft/shared/computer/blocks/ComputerState.java b/src/main/java/dan200/computercraft/shared/computer/blocks/ComputerState.java index 7e8a68a95..6683053cf 100644 --- a/src/main/java/dan200/computercraft/shared/computer/blocks/ComputerState.java +++ b/src/main/java/dan200/computercraft/shared/computer/blocks/ComputerState.java @@ -18,7 +18,7 @@ public enum ComputerState implements IStringSerializable private String m_name; - private ComputerState( String name ) + ComputerState( String name ) { m_name = name; } diff --git a/src/main/java/dan200/computercraft/shared/computer/blocks/IComputerTile.java b/src/main/java/dan200/computercraft/shared/computer/blocks/IComputerTile.java index 7aaab9dff..dc0917c8e 100644 --- a/src/main/java/dan200/computercraft/shared/computer/blocks/IComputerTile.java +++ b/src/main/java/dan200/computercraft/shared/computer/blocks/IComputerTile.java @@ -12,9 +12,9 @@ import dan200.computercraft.shared.computer.core.IComputer; public interface IComputerTile extends ITerminalTile { - public void setComputerID( int id ); - public void setLabel( String label ); - public IComputer getComputer(); - public IComputer createComputer(); - public ComputerFamily getFamily(); + void setComputerID( int id ); + void setLabel( String label ); + IComputer getComputer(); + IComputer createComputer(); + ComputerFamily getFamily(); } diff --git a/src/main/java/dan200/computercraft/shared/computer/core/IComputer.java b/src/main/java/dan200/computercraft/shared/computer/core/IComputer.java index e5afc6b16..fdcb5548d 100644 --- a/src/main/java/dan200/computercraft/shared/computer/core/IComputer.java +++ b/src/main/java/dan200/computercraft/shared/computer/core/IComputer.java @@ -10,16 +10,16 @@ import dan200.computercraft.shared.common.ITerminal; public interface IComputer extends ITerminal { - public int getInstanceID(); - public int getID(); - public String getLabel(); + int getInstanceID(); + int getID(); + String getLabel(); - public boolean isOn(); - public boolean isCursorDisplayed(); - public void turnOn(); - public void shutdown(); - public void reboot(); + boolean isOn(); + boolean isCursorDisplayed(); + void turnOn(); + void shutdown(); + void reboot(); - public void queueEvent( String event ); - public void queueEvent( String event, Object[] arguments ); + void queueEvent( String event ); + void queueEvent( String event, Object[] arguments ); } diff --git a/src/main/java/dan200/computercraft/shared/computer/core/IComputerContainer.java b/src/main/java/dan200/computercraft/shared/computer/core/IComputerContainer.java index e320f737e..68c19bfbb 100644 --- a/src/main/java/dan200/computercraft/shared/computer/core/IComputerContainer.java +++ b/src/main/java/dan200/computercraft/shared/computer/core/IComputerContainer.java @@ -8,5 +8,5 @@ package dan200.computercraft.shared.computer.core; public interface IComputerContainer { - public IComputer getComputer(); + IComputer getComputer(); } diff --git a/src/main/java/dan200/computercraft/shared/computer/items/IComputerItem.java b/src/main/java/dan200/computercraft/shared/computer/items/IComputerItem.java index fb6c3fe6c..c30e76012 100644 --- a/src/main/java/dan200/computercraft/shared/computer/items/IComputerItem.java +++ b/src/main/java/dan200/computercraft/shared/computer/items/IComputerItem.java @@ -11,7 +11,7 @@ import net.minecraft.item.ItemStack; public interface IComputerItem { - public int getComputerID( ItemStack stack ); - public String getLabel( ItemStack stack ); - public ComputerFamily getFamily( ItemStack stack ); + int getComputerID( ItemStack stack ); + String getLabel( ItemStack stack ); + ComputerFamily getFamily( ItemStack stack ); } diff --git a/src/main/java/dan200/computercraft/shared/network/INetworkedThing.java b/src/main/java/dan200/computercraft/shared/network/INetworkedThing.java index 671e18966..56e6f4f9f 100644 --- a/src/main/java/dan200/computercraft/shared/network/INetworkedThing.java +++ b/src/main/java/dan200/computercraft/shared/network/INetworkedThing.java @@ -9,5 +9,5 @@ import net.minecraft.entity.player.EntityPlayer; public interface INetworkedThing { - public void handlePacket( ComputerCraftPacket packet, EntityPlayer sender ); + void handlePacket( ComputerCraftPacket packet, EntityPlayer sender ); } diff --git a/src/main/java/dan200/computercraft/shared/peripheral/PeripheralType.java b/src/main/java/dan200/computercraft/shared/peripheral/PeripheralType.java index 6c99aba40..455937f96 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/PeripheralType.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/PeripheralType.java @@ -24,7 +24,7 @@ public enum PeripheralType implements IStringSerializable private String m_name; - private PeripheralType( String name ) + PeripheralType( String name ) { m_name = name; } diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockCableModemVariant.java b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockCableModemVariant.java index ba520a33f..f76ad2002 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockCableModemVariant.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockCableModemVariant.java @@ -56,7 +56,7 @@ public enum BlockCableModemVariant implements IStringSerializable private String m_name; private EnumFacing m_facing; - private BlockCableModemVariant( String name, EnumFacing facing ) + BlockCableModemVariant( String name, EnumFacing facing ) { m_name = name; m_facing = facing; diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheralVariant.java b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheralVariant.java index 336d7173d..fc2b44efa 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheralVariant.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheralVariant.java @@ -126,7 +126,7 @@ public enum BlockPeripheralVariant implements IStringSerializable private String m_name; private PeripheralType m_peripheralType; - private BlockPeripheralVariant( String name, PeripheralType peripheralType ) + BlockPeripheralVariant( String name, PeripheralType peripheralType ) { m_name = name; m_peripheralType = peripheralType; diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/IPeripheralItem.java b/src/main/java/dan200/computercraft/shared/peripheral/common/IPeripheralItem.java index 57e74ed22..cacbf304b 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/IPeripheralItem.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/IPeripheralItem.java @@ -11,5 +11,5 @@ import net.minecraft.item.ItemStack; public interface IPeripheralItem { - public PeripheralType getPeripheralType( ItemStack stack ); + PeripheralType getPeripheralType( ItemStack stack ); } diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/IPeripheralTile.java b/src/main/java/dan200/computercraft/shared/peripheral/common/IPeripheralTile.java index 62d3bbcb5..5970845bf 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/IPeripheralTile.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/IPeripheralTile.java @@ -13,7 +13,7 @@ import net.minecraft.util.EnumFacing; public interface IPeripheralTile extends IDirectionalTile { - public PeripheralType getPeripheralType(); - public IPeripheral getPeripheral( EnumFacing side ); - public String getLabel(); + PeripheralType getPeripheralType(); + IPeripheral getPeripheral( EnumFacing side ); + String getLabel(); } diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/INetwork.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/INetwork.java index 926ecd607..976037517 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/INetwork.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/INetwork.java @@ -11,8 +11,8 @@ import net.minecraft.world.World; public interface INetwork { - public void addReceiver( IReceiver receiver ); - public void removeReceiver( IReceiver receiver ); - public void transmit( int channel, int replyChannel, Object payload, World world, Vec3d pos, double range, boolean interdimensional, Object senderObject ); - public boolean isWireless(); + void addReceiver( IReceiver receiver ); + void removeReceiver( IReceiver receiver ); + void transmit( int channel, int replyChannel, Object payload, World world, Vec3d pos, double range, boolean interdimensional, Object senderObject ); + boolean isWireless(); } diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/IReceiver.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/IReceiver.java index 039988e75..1de273ee0 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/IReceiver.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/IReceiver.java @@ -10,11 +10,11 @@ import net.minecraft.world.World; public interface IReceiver { - public int getChannel(); - public World getWorld(); - public Vec3d getWorldPosition(); - public boolean isInterdimensional(); - public double getReceiveRange(); - public void receiveSameDimension( int replyChannel, Object payload, double distance, Object senderObject ); - public void receiveDifferentDimension( int replyChannel, Object payload, Object senderObject ); + int getChannel(); + World getWorld(); + Vec3d getWorldPosition(); + boolean isInterdimensional(); + double getReceiveRange(); + void receiveSameDimension( int replyChannel, Object payload, double distance, Object senderObject ); + void receiveDifferentDimension( int replyChannel, Object payload, Object senderObject ); } diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/TileCable.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/TileCable.java index 8eb6669e3..19d3bba12 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/TileCable.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/TileCable.java @@ -986,9 +986,9 @@ public class TileCable extends TileModemBase // Generic network search stuff - private static interface ICableVisitor + private interface ICableVisitor { - public void visit( TileCable modem, int distance ); + void visit( TileCable modem, int distance ); } private static class SearchLoc diff --git a/src/main/java/dan200/computercraft/shared/proxy/ICCTurtleProxy.java b/src/main/java/dan200/computercraft/shared/proxy/ICCTurtleProxy.java index 8f3fa4c92..af0b1edf8 100644 --- a/src/main/java/dan200/computercraft/shared/proxy/ICCTurtleProxy.java +++ b/src/main/java/dan200/computercraft/shared/proxy/ICCTurtleProxy.java @@ -15,15 +15,15 @@ import java.util.List; public interface ICCTurtleProxy { - public void preInit(); - public void init(); + void preInit(); + void init(); - public void registerTurtleUpgrade( ITurtleUpgrade upgrade ); - public ITurtleUpgrade getTurtleUpgrade( String id ); - public ITurtleUpgrade getTurtleUpgrade( int legacyId ); - public ITurtleUpgrade getTurtleUpgrade( ItemStack item ); - public void addAllUpgradedTurtles( List list ); + void registerTurtleUpgrade( ITurtleUpgrade upgrade ); + ITurtleUpgrade getTurtleUpgrade( String id ); + ITurtleUpgrade getTurtleUpgrade( int legacyId ); + ITurtleUpgrade getTurtleUpgrade( ItemStack item ); + void addAllUpgradedTurtles( List list ); - public void setEntityDropConsumer( Entity entity, IEntityDropConsumer consumer ); - public void clearEntityDropConsumer( Entity entity ); + void setEntityDropConsumer( Entity entity, IEntityDropConsumer consumer ); + void clearEntityDropConsumer( Entity entity ); } diff --git a/src/main/java/dan200/computercraft/shared/proxy/IComputerCraftProxy.java b/src/main/java/dan200/computercraft/shared/proxy/IComputerCraftProxy.java index 25505b5ea..fc07c2e01 100644 --- a/src/main/java/dan200/computercraft/shared/proxy/IComputerCraftProxy.java +++ b/src/main/java/dan200/computercraft/shared/proxy/IComputerCraftProxy.java @@ -23,25 +23,25 @@ import java.io.File; public interface IComputerCraftProxy { - public void preInit(); - public void init(); - public boolean isClient(); + void preInit(); + void init(); + boolean isClient(); - public boolean getGlobalCursorBlink(); - public long getRenderFrame(); - public void deleteDisplayLists( int list, int range ); - public Object getFixedWidthFontRenderer(); + boolean getGlobalCursorBlink(); + long getRenderFrame(); + void deleteDisplayLists( int list, int range ); + Object getFixedWidthFontRenderer(); - public String getRecordInfo( ItemStack item ); - public void playRecord( SoundEvent record, String recordInfo, World world, BlockPos pos ); + String getRecordInfo( ItemStack item ); + void playRecord( SoundEvent record, String recordInfo, World world, BlockPos pos ); - public Object getDiskDriveGUI( InventoryPlayer inventory, TileDiskDrive drive ); - public Object getComputerGUI( TileComputer computer ); - public Object getPrinterGUI( InventoryPlayer inventory, TilePrinter printer ); - public Object getTurtleGUI( InventoryPlayer inventory, TileTurtle turtle ); - public abstract Object getPrintoutGUI( EntityPlayer player, EnumHand hand ); - public abstract Object getPocketComputerGUI( EntityPlayer player, EnumHand hand ); + Object getDiskDriveGUI( InventoryPlayer inventory, TileDiskDrive drive ); + Object getComputerGUI( TileComputer computer ); + Object getPrinterGUI( InventoryPlayer inventory, TilePrinter printer ); + Object getTurtleGUI( InventoryPlayer inventory, TileTurtle turtle ); + Object getPrintoutGUI( EntityPlayer player, EnumHand hand ); + Object getPocketComputerGUI( EntityPlayer player, EnumHand hand ); - public File getWorldDir( World world ); - public void handlePacket( ComputerCraftPacket packet, EntityPlayer player ); + File getWorldDir( World world ); + void handlePacket( ComputerCraftPacket packet, EntityPlayer player ); } diff --git a/src/main/java/dan200/computercraft/shared/turtle/blocks/ITurtleTile.java b/src/main/java/dan200/computercraft/shared/turtle/blocks/ITurtleTile.java index f2dc62ef8..e3add1579 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/blocks/ITurtleTile.java +++ b/src/main/java/dan200/computercraft/shared/turtle/blocks/ITurtleTile.java @@ -17,12 +17,12 @@ import net.minecraft.util.math.Vec3d; public interface ITurtleTile extends IComputerTile, IDirectionalTile { - public Colour getColour(); - public ResourceLocation getOverlay(); - public ITurtleUpgrade getUpgrade( TurtleSide side ); - public ITurtleAccess getAccess(); + Colour getColour(); + ResourceLocation getOverlay(); + ITurtleUpgrade getUpgrade( TurtleSide side ); + ITurtleAccess getAccess(); - public Vec3d getRenderOffset( float f ); - public float getRenderYaw( float f ); - public float getToolRenderAngle( TurtleSide side, float f ); + Vec3d getRenderOffset( float f ); + float getRenderYaw( float f ); + float getToolRenderAngle( TurtleSide side, float f ); } diff --git a/src/main/java/dan200/computercraft/shared/turtle/items/ITurtleItem.java b/src/main/java/dan200/computercraft/shared/turtle/items/ITurtleItem.java index 7b9dfdb61..2565cb717 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/items/ITurtleItem.java +++ b/src/main/java/dan200/computercraft/shared/turtle/items/ITurtleItem.java @@ -15,8 +15,8 @@ import net.minecraft.util.ResourceLocation; public interface ITurtleItem extends IComputerItem { - public ITurtleUpgrade getUpgrade( ItemStack stack, TurtleSide side ); - public int getFuelLevel( ItemStack stack ); - public Colour getColour( ItemStack stack ); - public ResourceLocation getOverlay( ItemStack stack ); + ITurtleUpgrade getUpgrade( ItemStack stack, TurtleSide side ); + int getFuelLevel( ItemStack stack ); + Colour getColour( ItemStack stack ); + ResourceLocation getOverlay( ItemStack stack ); } diff --git a/src/main/java/dan200/computercraft/shared/util/Colour.java b/src/main/java/dan200/computercraft/shared/util/Colour.java index b9ba6711a..fe43bc915 100644 --- a/src/main/java/dan200/computercraft/shared/util/Colour.java +++ b/src/main/java/dan200/computercraft/shared/util/Colour.java @@ -37,7 +37,7 @@ public enum Colour private int m_hex; private float[] m_rgb; - private Colour( int hex ) + Colour( int hex ) { m_hex = hex; m_rgb = new float[] { diff --git a/src/main/java/dan200/computercraft/shared/util/IEntityDropConsumer.java b/src/main/java/dan200/computercraft/shared/util/IEntityDropConsumer.java index a3df0f4e5..aed7ae3f5 100644 --- a/src/main/java/dan200/computercraft/shared/util/IEntityDropConsumer.java +++ b/src/main/java/dan200/computercraft/shared/util/IEntityDropConsumer.java @@ -10,5 +10,5 @@ import net.minecraft.item.ItemStack; public interface IEntityDropConsumer { - public void consumeDrop( Entity dropper, ItemStack drop ); + void consumeDrop( Entity dropper, ItemStack drop ); }