From 2360a6e951837173ae81cc71899468271b950bd1 Mon Sep 17 00:00:00 2001 From: SquidDev Date: Fri, 10 Apr 2020 21:26:11 +0100 Subject: [PATCH] Remove several deprecated methods --- .../core/apis/ArgumentHelper.java | 117 ------------------ .../computercraft/core/apis/ILuaAPI.java | 24 ---- .../core/filesystem/EmptyMount.java | 1 - .../computercraft/core/terminal/Terminal.java | 13 -- 4 files changed, 155 deletions(-) delete mode 100644 src/main/java/dan200/computercraft/core/apis/ArgumentHelper.java delete mode 100644 src/main/java/dan200/computercraft/core/apis/ILuaAPI.java diff --git a/src/main/java/dan200/computercraft/core/apis/ArgumentHelper.java b/src/main/java/dan200/computercraft/core/apis/ArgumentHelper.java deleted file mode 100644 index f4f9d0033..000000000 --- a/src/main/java/dan200/computercraft/core/apis/ArgumentHelper.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * This file is part of ComputerCraft - http://www.computercraft.info - * Copyright Daniel Ratcliffe, 2011-2020. Do not distribute without permission. - * Send enquiries to dratcliffe@gmail.com - */ -package dan200.computercraft.core.apis; - -import dan200.computercraft.api.lua.LuaException; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.util.Map; - -/** - * A stub for any mods which depended on this version of the argument helper. - * - * @deprecated Use {@link dan200.computercraft.api.lua.ArgumentHelper}. - */ -@Deprecated -public final class ArgumentHelper -{ - private ArgumentHelper() - { - } - - @Nonnull - public static String getType( @Nullable Object type ) - { - return dan200.computercraft.api.lua.ArgumentHelper.getType( type ); - } - - @Nonnull - public static LuaException badArgument( int index, @Nonnull String expected, @Nullable Object actual ) - { - return dan200.computercraft.api.lua.ArgumentHelper.badArgumentOf( index, expected, actual ); - } - - @Nonnull - public static LuaException badArgument( int index, @Nonnull String expected, @Nonnull String actual ) - { - return dan200.computercraft.api.lua.ArgumentHelper.badArgument( index, expected, actual ); - } - - public static double getNumber( @Nonnull Object[] args, int index ) throws LuaException - { - return dan200.computercraft.api.lua.ArgumentHelper.getDouble( args, index ); - } - - public static int getInt( @Nonnull Object[] args, int index ) throws LuaException - { - return dan200.computercraft.api.lua.ArgumentHelper.getInt( args, index ); - } - - public static long getLong( @Nonnull Object[] args, int index ) throws LuaException - { - return dan200.computercraft.api.lua.ArgumentHelper.getLong( args, index ); - } - - public static double getReal( @Nonnull Object[] args, int index ) throws LuaException - { - return dan200.computercraft.api.lua.ArgumentHelper.getFiniteDouble( args, index ); - } - - public static boolean getBoolean( @Nonnull Object[] args, int index ) throws LuaException - { - return dan200.computercraft.api.lua.ArgumentHelper.getBoolean( args, index ); - } - - @Nonnull - public static String getString( @Nonnull Object[] args, int index ) throws LuaException - { - return dan200.computercraft.api.lua.ArgumentHelper.getString( args, index ); - } - - @Nonnull - @SuppressWarnings( "unchecked" ) - public static Map getTable( @Nonnull Object[] args, int index ) throws LuaException - { - return (Map) dan200.computercraft.api.lua.ArgumentHelper.getTable( args, index ); - } - - public static double optNumber( @Nonnull Object[] args, int index, double def ) throws LuaException - { - return dan200.computercraft.api.lua.ArgumentHelper.optDouble( args, index, def ); - } - - public static int optInt( @Nonnull Object[] args, int index, int def ) throws LuaException - { - return dan200.computercraft.api.lua.ArgumentHelper.optInt( args, index, def ); - } - - public static long optLong( @Nonnull Object[] args, int index, long def ) throws LuaException - { - return dan200.computercraft.api.lua.ArgumentHelper.optLong( args, index, def ); - } - - public static double optReal( @Nonnull Object[] args, int index, double def ) throws LuaException - { - return dan200.computercraft.api.lua.ArgumentHelper.optFiniteDouble( args, index, def ); - } - - public static boolean optBoolean( @Nonnull Object[] args, int index, boolean def ) throws LuaException - { - return dan200.computercraft.api.lua.ArgumentHelper.optBoolean( args, index, def ); - } - - public static String optString( @Nonnull Object[] args, int index, String def ) throws LuaException - { - return dan200.computercraft.api.lua.ArgumentHelper.optString( args, index, def ); - } - - @SuppressWarnings( "unchecked" ) - public static Map optTable( @Nonnull Object[] args, int index, Map def ) throws LuaException - { - return (Map) dan200.computercraft.api.lua.ArgumentHelper.optTable( args, index, def ); - } -} diff --git a/src/main/java/dan200/computercraft/core/apis/ILuaAPI.java b/src/main/java/dan200/computercraft/core/apis/ILuaAPI.java deleted file mode 100644 index e623feb82..000000000 --- a/src/main/java/dan200/computercraft/core/apis/ILuaAPI.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * This file is part of ComputerCraft - http://www.computercraft.info - * Copyright Daniel Ratcliffe, 2011-2020. Do not distribute without permission. - * Send enquiries to dratcliffe@gmail.com - */ -package dan200.computercraft.core.apis; - -/** - * This exists purely to ensure binary compatibility. - * - * @see dan200.computercraft.api.lua.ILuaAPI - * @deprecated Use the version in the public API. Only exists for compatibility with CCEmuX. - */ -@Deprecated -public interface ILuaAPI extends dan200.computercraft.api.lua.ILuaAPI -{ - void advance( double v ); - - @Override - default void update() - { - advance( 0.05 ); - } -} diff --git a/src/main/java/dan200/computercraft/core/filesystem/EmptyMount.java b/src/main/java/dan200/computercraft/core/filesystem/EmptyMount.java index 3fd2dd3b9..c3ba89855 100644 --- a/src/main/java/dan200/computercraft/core/filesystem/EmptyMount.java +++ b/src/main/java/dan200/computercraft/core/filesystem/EmptyMount.java @@ -40,7 +40,6 @@ public class EmptyMount implements IMount @Nonnull @Override - @Deprecated public ReadableByteChannel openForRead( @Nonnull String path ) throws IOException { throw new FileOperationException( path, "No such file" ); diff --git a/src/main/java/dan200/computercraft/core/terminal/Terminal.java b/src/main/java/dan200/computercraft/core/terminal/Terminal.java index f58af1a1c..54503a02f 100644 --- a/src/main/java/dan200/computercraft/core/terminal/Terminal.java +++ b/src/main/java/dan200/computercraft/core/terminal/Terminal.java @@ -312,19 +312,6 @@ public class Terminal return null; } - /** - * Determine whether this terminal has changed. - * - * @return If this terminal is dirty. - * @deprecated All {@code *Changed()} methods are deprecated: one should pass in a callback - * instead. - */ - @Deprecated - public final boolean getChanged() - { - return m_changed; - } - public final void setChanged() { m_changed = true;