diff --git a/src/main/java/org/auioc/mcmod/arnicalib/ArnicaLib.java b/src/main/java/org/auioc/mcmod/arnicalib/ArnicaLib.java index b0a3b9b4..7fed4a26 100644 --- a/src/main/java/org/auioc/mcmod/arnicalib/ArnicaLib.java +++ b/src/main/java/org/auioc/mcmod/arnicalib/ArnicaLib.java @@ -38,7 +38,4 @@ public static String i18n(String key) { return MOD_ID + "." + key; } - @Deprecated /** For compatibility only */ - public static final String MODID = "arnicalib"; - } diff --git a/src/main/java/org/auioc/mcmod/arnicalib/common/event/AHCommonEventFactory.java b/src/main/java/org/auioc/mcmod/arnicalib/common/event/AHCommonEventFactory.java index b89a1e3e..463f3c9a 100644 --- a/src/main/java/org/auioc/mcmod/arnicalib/common/event/AHCommonEventFactory.java +++ b/src/main/java/org/auioc/mcmod/arnicalib/common/event/AHCommonEventFactory.java @@ -15,11 +15,6 @@ public final class AHCommonEventFactory { private static final IEventBus BUS = MinecraftForge.EVENT_BUS; - @Deprecated(since = "3.1.1") - public static boolean postPistonAddBlockLineEvent(BlockState blockState, Level level, BlockPos blockPos, Direction direction) { - return BUS.post(new org.auioc.mcmod.arnicalib.common.event.impl.PistonAddBlockLineEvent(blockState, level, blockPos, direction)); - } - public static boolean onPistonCheckPushable(BlockState blockState, Level level, BlockPos blockPos, Direction pushDirection, boolean p_60209_, Direction p_60210_) { return BUS.post(new PistonCheckPushableEvent(blockState, level, blockPos, pushDirection, p_60209_, p_60210_)); } diff --git a/src/main/java/org/auioc/mcmod/arnicalib/common/event/impl/PistonAddBlockLineEvent.java b/src/main/java/org/auioc/mcmod/arnicalib/common/event/impl/PistonAddBlockLineEvent.java deleted file mode 100644 index 898778c9..00000000 --- a/src/main/java/org/auioc/mcmod/arnicalib/common/event/impl/PistonAddBlockLineEvent.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.auioc.mcmod.arnicalib.common.event.impl; - - -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.eventbus.api.Cancelable; -import net.minecraftforge.eventbus.api.Event; - -@Deprecated(since = "3.1.1") -@Cancelable -public class PistonAddBlockLineEvent extends Event { - - private final BlockState blockState; - private final Level level; - private final BlockPos blockPos; - private final Direction direction; - - public PistonAddBlockLineEvent(BlockState blockState, Level level, BlockPos blockPos, Direction direction) { - super(); - this.blockState = blockState; - this.level = level; - this.blockPos = blockPos; - this.direction = direction; - } - - public BlockPos getBlockPos() { - return this.blockPos; - } - - public Level getLevel() { - return this.level; - } - - public BlockState getBlockState() { - return this.blockState; - } - - public Direction getDirection() { - return this.direction; - } - -} diff --git a/src/main/java/org/auioc/mcmod/arnicalib/game/chat/TextUtils.java b/src/main/java/org/auioc/mcmod/arnicalib/game/chat/TextUtils.java index b65ed87b..9fe417c3 100644 --- a/src/main/java/org/auioc/mcmod/arnicalib/game/chat/TextUtils.java +++ b/src/main/java/org/auioc/mcmod/arnicalib/game/chat/TextUtils.java @@ -1,12 +1,10 @@ package org.auioc.mcmod.arnicalib.game.chat; import java.util.List; -import net.minecraft.Util; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; import net.minecraft.network.chat.TextComponent; import net.minecraft.network.chat.TranslatableComponent; -import net.minecraft.world.entity.player.Player; public interface TextUtils { @@ -46,60 +44,4 @@ static MutableComponent join(List texts) { return join(texts, literal(", ")); } - - /* ============================================================================================================== */ - // #region Deprecated - - @Deprecated(since = "5.4.1", forRemoval = true) - static void chat(Player player, String message) { - player.sendMessage(new TextComponent(message), Util.NIL_UUID); - } - - @Deprecated(since = "5.4.1", forRemoval = true) - static void chat(Player player, Component message) { - player.sendMessage(message, Util.NIL_UUID); - } - - @Deprecated(since = "5.4.1", forRemoval = true) - static TextComponent emptyText() { - return new TextComponent(""); - } - - @Deprecated(since = "5.4.1", forRemoval = true) - static TextComponent EmptyText() { - return new TextComponent(""); - } - - @Deprecated(since = "5.4.1", forRemoval = true) - static TextComponent getStringText(String text) { - return new TextComponent(text); - } - - @Deprecated(since = "5.4.1", forRemoval = true) - static TextComponent StringText(String text) { - return new TextComponent(text); - } - - @Deprecated(since = "5.4.1", forRemoval = true) - static TranslatableComponent getI18nText(String key) { - return new TranslatableComponent(key); - } - - @Deprecated(since = "5.4.1", forRemoval = true) - static TranslatableComponent I18nText(String key) { - return new TranslatableComponent(key); - } - - @Deprecated(since = "5.4.1", forRemoval = true) - static TranslatableComponent getI18nText(String key, Object... arguments) { - return new TranslatableComponent(key, arguments); - } - - @Deprecated(since = "5.4.1", forRemoval = true) - static TranslatableComponent I18nText(String key, Object... arguments) { - return new TranslatableComponent(key, arguments); - } - - // #endregion Deprecated - } diff --git a/src/main/java/org/auioc/mcmod/arnicalib/mod/client/command/AHClientCommands.java b/src/main/java/org/auioc/mcmod/arnicalib/mod/client/command/AHClientCommands.java index 79c1e774..6284707b 100644 --- a/src/main/java/org/auioc/mcmod/arnicalib/mod/client/command/AHClientCommands.java +++ b/src/main/java/org/auioc/mcmod/arnicalib/mod/client/command/AHClientCommands.java @@ -23,13 +23,4 @@ public static CommandNode getAHNode(CommandDispatcher getRootNode(CommandDispatcher dispatcher) { - return getAHNode(dispatcher); - } - } diff --git a/src/main/java/org/auioc/mcmod/arnicalib/mod/server/command/AHServerCommands.java b/src/main/java/org/auioc/mcmod/arnicalib/mod/server/command/AHServerCommands.java index b9bd35ef..ef5698ea 100644 --- a/src/main/java/org/auioc/mcmod/arnicalib/mod/server/command/AHServerCommands.java +++ b/src/main/java/org/auioc/mcmod/arnicalib/mod/server/command/AHServerCommands.java @@ -31,15 +31,6 @@ public static CommandNode getAHNode(CommandDispatcher getRootNode(CommandDispatcher dispatcher) { - return getAHNode(dispatcher); - } - private static void addTestNode(CommandNode node) { node.addChild( literal("test") diff --git a/src/main/java/org/auioc/mcmod/arnicalib/server/event/impl/ServerLoginEvent.java b/src/main/java/org/auioc/mcmod/arnicalib/server/event/impl/ServerLoginEvent.java index 7f38dfb1..c84fcda1 100644 --- a/src/main/java/org/auioc/mcmod/arnicalib/server/event/impl/ServerLoginEvent.java +++ b/src/main/java/org/auioc/mcmod/arnicalib/server/event/impl/ServerLoginEvent.java @@ -22,11 +22,6 @@ public ClientIntentionPacket getPacket() { return this.packet; } - @Deprecated - public Connection getManager() { - return this.manager; - } - public Connection getNetworkManager() { return this.manager; } diff --git a/src/main/java/org/auioc/mcmod/arnicalib/utils/Loggers.java b/src/main/java/org/auioc/mcmod/arnicalib/utils/Loggers.java deleted file mode 100644 index 848dff5e..00000000 --- a/src/main/java/org/auioc/mcmod/arnicalib/utils/Loggers.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.auioc.mcmod.arnicalib.utils; - -import org.apache.logging.log4j.Level; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.auioc.mcmod.arnicalib.base.log.LogUtil; - -/** - * @deprecated Use {@link LogUtil} instead - */ -@Deprecated(forRemoval = true) -public class Loggers { - public static final Logger logger = LogManager.getLogger(); - - public static void log(Level level, String message, Object... fields) { - logger.log(level, message, fields); - } - - public static void log(Level level, String message) { - log(level, message, (Object) null); - } - - public static void error(String message, Throwable t) { - logger.error(message, t); - } - - public static void error(String message) { - logger.error(message); - } - - public static void warn(String message) { - logger.warn(message); - } - - public static void info(String message) { - logger.info(message); - } - - public static void debug(String message) { - logger.debug(message); - } - - public static void print(String message) { - System.out.println(message); - } - - public static void print(Object object) { - System.out.println(object); - } -} diff --git a/src/main/java/org/auioc/mcmod/arnicalib/utils/game/CommandFeedbackHelper.java b/src/main/java/org/auioc/mcmod/arnicalib/utils/game/CommandFeedbackHelper.java deleted file mode 100644 index a91adfef..00000000 --- a/src/main/java/org/auioc/mcmod/arnicalib/utils/game/CommandFeedbackHelper.java +++ /dev/null @@ -1,158 +0,0 @@ -package org.auioc.mcmod.arnicalib.utils.game; - -import java.util.function.Function; -import javax.annotation.Nullable; -import org.auioc.mcmod.arnicalib.game.chat.TextUtils; -import com.mojang.brigadier.Command; -import com.mojang.brigadier.context.CommandContext; -import net.minecraft.ChatFormatting; -import net.minecraft.commands.CommandSourceStack; -import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.MutableComponent; - -@Deprecated(since = "5.3.9", forRemoval = true) -public class CommandFeedbackHelper { - - public static enum MessageType { - SUCCESS, SUCCESS_BROADCAST, FAILURE - } - - public static final Object[] NO_ARGS = new Object[0]; - public static final ChatFormatting[] NO_STYLE = new ChatFormatting[0]; - - private final MutableComponent prefix; - private final Function i18n; - - public CommandFeedbackHelper(MutableComponent prefix, Function i18n) { - this.prefix = prefix; - this.i18n = i18n; - } - - public CommandFeedbackHelper(String modName, Function i18n) { - this(TextUtils.literal("[" + modName + "] ").withStyle(ChatFormatting.AQUA), i18n); - } - - public CommandFeedbackHelper(Function i18n) { - this(TextUtils.empty(), i18n); - } - - - public MutableComponent createMessage(Component message) { - return (TextUtils.empty()).append(this.prefix).append(message); - } - - public MutableComponent createMessage(String key, Object... args) { - return (TextUtils.empty()).append(this.prefix).append(TextUtils.translatable(this.i18n.apply("command." + key), args)); - } - - public MutableComponent createMessage(String key) { - return createMessage(key, NO_ARGS); - } - - public MutableComponent createMessage(MessageType type, String key, @Nullable String subKey, Object... args) { - var sb = new StringBuilder(5); - { - sb.append("command."); - sb.append(key); - sb.append((type == MessageType.FAILURE) ? ".failure" : ".success"); - if (subKey != null) { - sb.append("."); - sb.append(subKey); - } - } - return (TextUtils.empty()).append(this.prefix).append(TextUtils.translatable(this.i18n.apply(sb.toString()), args)); - } - - - public int sendMessage(CommandContext ctx, MessageType type, String key, @Nullable String subKey, @Nullable Object[] args, @Nullable ChatFormatting[] styles) { - if (args == null) args = NO_ARGS; - if (styles == null) styles = NO_STYLE; - - var message = createMessage(type, key, subKey, args).withStyle(styles); - - var source = ctx.getSource(); - switch (type) { - case SUCCESS: { - source.sendSuccess(message, false); - break; - } - case SUCCESS_BROADCAST: { - source.sendSuccess(message, true); - break; - } - case FAILURE: { - source.sendFailure(message); - break; - } - } - - return Command.SINGLE_SUCCESS; - } - - - public int sendSuccess(CommandContext ctx, String key) { - return sendMessage(ctx, MessageType.SUCCESS, key, null, NO_ARGS, NO_STYLE); - } - - public int sendSuccess(CommandContext ctx, String key, Object... args) { - return sendMessage(ctx, MessageType.SUCCESS, key, null, args, NO_STYLE); - } - - public int sendSuccessWithSubkey(CommandContext ctx, String key, String subKey) { - return sendMessage(ctx, MessageType.SUCCESS, key, subKey, NO_ARGS, NO_STYLE); - } - - public int sendSuccessWithSubkey(CommandContext ctx, String key, String subKey, Object... args) { - return sendMessage(ctx, MessageType.SUCCESS, key, subKey, args, NO_STYLE); - } - - public int sendSuccessAndBoardcast(CommandContext ctx, String key) { - return sendMessage(ctx, MessageType.SUCCESS_BROADCAST, key, null, NO_ARGS, NO_STYLE); - } - - public int sendSuccessAndBoardcast(CommandContext ctx, String key, Object... args) { - return sendMessage(ctx, MessageType.SUCCESS_BROADCAST, key, null, args, NO_STYLE); - } - - public int sendFailure(CommandContext ctx, String key) { - return sendMessage(ctx, MessageType.FAILURE, key, null, NO_ARGS, NO_STYLE); - } - - public int sendFailure(CommandContext ctx, String key, Object... args) { - return sendMessage(ctx, MessageType.FAILURE, key, null, args, NO_STYLE); - } - - public int sendFailureWithSubkey(CommandContext ctx, String key, String subKey) { - return sendMessage(ctx, MessageType.FAILURE, key, subKey, NO_ARGS, NO_STYLE); - } - - public int sendFailureWithSubkey(CommandContext ctx, String key, String subKey, Object... args) { - return sendMessage(ctx, MessageType.FAILURE, key, subKey, args, NO_STYLE); - } - - /* ============================================================================================================== */ - // #region Deprecated - - @Deprecated(since = "5.3.6") - public int success(CommandContext ctx, String key) { - return sendSuccess(ctx, key); - } - - @Deprecated(since = "5.3.6") - public int success(CommandContext ctx, String key, Object... args) { - return sendSuccess(ctx, key, args); - } - - @Deprecated(since = "5.3.6") - public int failure(CommandContext ctx, String key) { - return sendFailure(ctx, key); - } - - @Deprecated(since = "5.3.6") - public int failure(CommandContext ctx, String key, Object... args) { - return sendFailure(ctx, key, args); - } - - // #endregion Deprecated - -} diff --git a/src/main/java/org/auioc/mcmod/arnicalib/utils/game/CommandUtils.java b/src/main/java/org/auioc/mcmod/arnicalib/utils/game/CommandUtils.java deleted file mode 100644 index 3929bd52..00000000 --- a/src/main/java/org/auioc/mcmod/arnicalib/utils/game/CommandUtils.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.auioc.mcmod.arnicalib.utils.game; - -import java.util.List; -import java.util.function.Predicate; -import org.auioc.mcmod.arnicalib.game.command.CommandExceptions; -import org.auioc.mcmod.arnicalib.game.command.CommandNodeUtils; -import org.auioc.mcmod.arnicalib.game.command.CommandSourceUtils; -import com.mojang.brigadier.context.ParsedCommandNode; -import com.mojang.brigadier.exceptions.CommandSyntaxException; -import com.mojang.brigadier.exceptions.SimpleCommandExceptionType; -import net.minecraft.client.player.LocalPlayer; -import net.minecraft.commands.CommandSource; -import net.minecraft.commands.CommandSourceStack; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; - -@Deprecated(since = "5.4.4", forRemoval = true) -public interface CommandUtils { - - SimpleCommandExceptionType INTERNAL_ERROR = CommandExceptions.INTERNAL_ERROR; - SimpleCommandExceptionType LOGGABLE_INTERNAL_ERROR = CommandExceptions.LOGGABLE_INTERNAL_ERROR; - SimpleCommandExceptionType NOT_SERVER_ERROR = CommandExceptions.NOT_SERVER_ERROR; - SimpleCommandExceptionType NOT_DEDICATED_SERVER_ERROR = CommandExceptions.NOT_DEDICATED_SERVER_ERROR; - SimpleCommandExceptionType GET_REAL_SOURCE_REFLECTION_ERROR = CommandExceptions.GET_REAL_SOURCE_REFLECTION_ERROR; - - Predicate IS_PLAYER = CommandSourceUtils.IS_PLAYER; - Predicate PERMISSION_LEVEL_0 = CommandSourceUtils.PERMISSION_LEVEL_0; - Predicate PERMISSION_LEVEL_1 = CommandSourceUtils.PERMISSION_LEVEL_1; - Predicate PERMISSION_LEVEL_2 = CommandSourceUtils.PERMISSION_LEVEL_2; - Predicate PERMISSION_LEVEL_3 = CommandSourceUtils.PERMISSION_LEVEL_3; - Predicate PERMISSION_LEVEL_4 = CommandSourceUtils.PERMISSION_LEVEL_4; - - static CommandSource getPrivateSource(CommandSourceStack sourceStack) { - return CommandSourceUtils.getRealSourceReflection(sourceStack); - } - - @OnlyIn(Dist.CLIENT) - static LocalPlayer getLocalPlayerOrException(CommandSourceStack sourceStack) throws CommandSyntaxException { - return CommandSourceUtils.getLocalPlayerOrException(sourceStack); - } - - static String joinLiteralNodes(List> nodeList, int fromIndex, int toIndex, boolean conventToSnakeCase) { - return CommandNodeUtils.joinLiteralNodes(nodeList, fromIndex, toIndex); - } - - static String joinLiteralNodes(List> nodes, int fromIndex) { - return CommandNodeUtils.joinLiteralNodes(nodes, fromIndex, nodes.size()); - } - - static String joinLiteralNodes(List> nodes) { - return CommandNodeUtils.joinLiteralNodes(nodes, 0, nodes.size()); - } - -} diff --git a/src/main/java/org/auioc/mcmod/arnicalib/utils/game/I18nUtils.java b/src/main/java/org/auioc/mcmod/arnicalib/utils/game/I18nUtils.java deleted file mode 100644 index c0356f9c..00000000 --- a/src/main/java/org/auioc/mcmod/arnicalib/utils/game/I18nUtils.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.auioc.mcmod.arnicalib.utils.game; - -import org.auioc.mcmod.arnicalib.game.chat.TextUtils; -import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.TranslatableComponent; - -/** - * @deprecated Use {@link TextUtils} instead - */ -@Deprecated(since = "3.1.3", forRemoval = true) -public interface I18nUtils { - static Component getTranslatedText(String key) { - return new TranslatableComponent(key); - } - - static Component getTranslatedText(String key, Object... arguments) { - return new TranslatableComponent(key, arguments); - } -}