From d50b272789b3b26ba40d2b504e2b8c7916499a92 Mon Sep 17 00:00:00 2001 From: WakelessSloth56 Date: Thu, 31 Mar 2022 19:48:14 +0800 Subject: [PATCH] docs(utils): javadoc --- .../auioc/mods/arnicalib/utils/Loggers.java | 3 +++ .../arnicalib/utils/game/CommandUtils.java | 6 +++--- .../mods/arnicalib/utils/game/I18nUtils.java | 3 +++ .../arnicalib/utils/game/RegistryUtils.java | 3 ++- .../mods/arnicalib/utils/java/Validate.java | 20 +++++++++---------- 5 files changed, 21 insertions(+), 14 deletions(-) diff --git a/src/main/java/org/auioc/mods/arnicalib/utils/Loggers.java b/src/main/java/org/auioc/mods/arnicalib/utils/Loggers.java index 42e8d1fa..85eafa86 100644 --- a/src/main/java/org/auioc/mods/arnicalib/utils/Loggers.java +++ b/src/main/java/org/auioc/mods/arnicalib/utils/Loggers.java @@ -4,6 +4,9 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +/** + * @deprecated Use {@link LogUtil} instead + */ @Deprecated public class Loggers { public static final Logger logger = LogManager.getLogger(); diff --git a/src/main/java/org/auioc/mods/arnicalib/utils/game/CommandUtils.java b/src/main/java/org/auioc/mods/arnicalib/utils/game/CommandUtils.java index 90851e6b..42d3ec86 100644 --- a/src/main/java/org/auioc/mods/arnicalib/utils/game/CommandUtils.java +++ b/src/main/java/org/auioc/mods/arnicalib/utils/game/CommandUtils.java @@ -55,15 +55,15 @@ static LocalPlayer getLocalPlayerOrException(CommandSourceStack sourceStack) thr } /** - * @param nodes List of {@link ParsedCommandNode}s, from {@link CommandContext#getNodes()} + * @param nodeList List of {@link ParsedCommandNode}s, from {@link CommandContext#getNodes()} * @param fromIndex * @param toIndex * @param conventToSnakeCase * @return String that concatenates the literals (or in its snake case) of all (or some of) {@link LiteralCommandNode}s in the {@link ParsedCommandNode} list, separated by dots * @since 5.1.1 */ - static String joinLiteralNodes(List> nodes, int fromIndex, int toIndex, boolean conventToSnakeCase) { - return nodes + static String joinLiteralNodes(List> nodeList, int fromIndex, int toIndex, boolean conventToSnakeCase) { + return nodeList .subList(fromIndex, toIndex) .stream() .map(ParsedCommandNode::getNode) diff --git a/src/main/java/org/auioc/mods/arnicalib/utils/game/I18nUtils.java b/src/main/java/org/auioc/mods/arnicalib/utils/game/I18nUtils.java index 12dd3845..04b296f9 100644 --- a/src/main/java/org/auioc/mods/arnicalib/utils/game/I18nUtils.java +++ b/src/main/java/org/auioc/mods/arnicalib/utils/game/I18nUtils.java @@ -3,6 +3,9 @@ import net.minecraft.network.chat.Component; import net.minecraft.network.chat.TranslatableComponent; +/** + * @deprecated Use {@link TextUtils} instead + */ @Deprecated(since = "3.1.3") public interface I18nUtils { static Component getTranslatedText(String key) { diff --git a/src/main/java/org/auioc/mods/arnicalib/utils/game/RegistryUtils.java b/src/main/java/org/auioc/mods/arnicalib/utils/game/RegistryUtils.java index e9de4e34..8cfda480 100644 --- a/src/main/java/org/auioc/mods/arnicalib/utils/game/RegistryUtils.java +++ b/src/main/java/org/auioc/mods/arnicalib/utils/game/RegistryUtils.java @@ -22,7 +22,8 @@ public static > List getAllRegistryObjects(D } /** - * For special use only, please use {@link org.auioc.mods.arnicalib.utils.game.RegistryUtils#getAllRegistryObjects(DeferredRegister)} instead generally. + * For special use only, + * please use {@link org.auioc.mods.arnicalib.utils.game.RegistryUtils#getAllRegistryObjects(DeferredRegister)} instead generally. */ @SuppressWarnings("unchecked") public static > List getAllRegistryObjects(Class clazz, Class type) { diff --git a/src/main/java/org/auioc/mods/arnicalib/utils/java/Validate.java b/src/main/java/org/auioc/mods/arnicalib/utils/java/Validate.java index 08fe9e0b..6e8298e7 100644 --- a/src/main/java/org/auioc/mods/arnicalib/utils/java/Validate.java +++ b/src/main/java/org/auioc/mods/arnicalib/utils/java/Validate.java @@ -115,8 +115,8 @@ public static void isNonPositive(double value) { * Validate that the specified primitive value is in the specified interval; otherwise, throws an exception. * * @param interval - * @param value the value to validate - * @param message the exception message if invalid + * @param value the value to validate + * @param message the exception message if invalid * @throws IllegalArgumentException if the value is not in the interval * @see #isInInterval(Range, double, String) */ @@ -136,7 +136,7 @@ public static void isInInterval(Range interval, double value, String mes /** * Validate that the specified bounds are valid the interval bounds; otherwise, throws an exception. * - * @param left the interval left bound + * @param left the interval left bound * @param right the interval right bound */ public static void isBoundedInterval(long left, long right) { @@ -157,7 +157,7 @@ public static void isBoundedInterval(double left, double right) { /** * Validate that the specified primitive value is in the interval (left, right); otherwise, throws an exception. * - * @param left the interval left bound + * @param left the interval left bound * @param right the interval right bound * @param value the value to validate * @throws IllegalArgumentException if the value is not in the interval @@ -171,7 +171,7 @@ public static void isInOpenInterval(long left, long right, long value) { /** * Validate that the specified primitive value is in the interval [left, right]; otherwise, throws an exception. * - * @param left the interval left bound + * @param left the interval left bound * @param right the interval right bound * @param value the value to validate * @throws IllegalArgumentException if the value is not in the interval @@ -185,7 +185,7 @@ public static void isInCloseInterval(long left, long right, long value) { /** * Validate that the specified primitive value is in the interval (left, right]; otherwise, throws an exception. * - * @param left the interval left bound + * @param left the interval left bound * @param right the interval right bound * @param value the value to validate * @throws IllegalArgumentException if the value is not in the interval @@ -199,7 +199,7 @@ public static void isInOpenCloseInterval(long left, long right, long value) { /** * Validate that the specified primitive value is in the interval [left, right); otherwise, throws an exception. * - * @param left the interval left bound + * @param left the interval left bound * @param right the interval right bound * @param value the value to validate * @throws IllegalArgumentException if the value is not in the interval @@ -213,7 +213,7 @@ public static void isInCloseOpenInterval(long left, long right, long value) { /** * Validate that the specified primitive value is in the interval (left, +∞); otherwise, throws an exception. * - * @param left the interval left bound + * @param left the interval left bound * @param value the value to validate * @throws IllegalArgumentException if the value is not in the interval * @see #isInLeftOpenInterval(double, double) @@ -225,7 +225,7 @@ public static void isInLeftOpenInterval(long left, long value) { /** * Validate that the specified primitive value is in the interval [left, +∞); otherwise, throws an exception. * - * @param left the interval left bound + * @param left the interval left bound * @param value the value to validate * @throws IllegalArgumentException if the value is not in the interval * @see #isInLeftClosedInterval(double, double) @@ -261,7 +261,7 @@ public static void isInRightClosedInterval(long right, long value) { /** * Validate that the specified primitive value is in the interval (right, left); it always throws an exception. * - * @param left the interval left bound + * @param left the interval left bound * @param right the interval right bound * @param value the value to validate * @throws IllegalArgumentException if the value is not in the interval