mirror of
https://github.com/Xiao-MoMi/Custom-Fishing.git
synced 2025-12-19 15:09:24 +00:00
bypass other names
This commit is contained in:
@@ -154,7 +154,7 @@ public class MiniMessageTranslationRegistryImpl implements Examinable, MiniMessa
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static class ArgumentTag implements TagResolver {
|
public static class ArgumentTag implements TagResolver {
|
||||||
private static final String NAME = "argument";
|
private static final String NAME_0 = "argument";
|
||||||
private static final String NAME_1 = "arg";
|
private static final String NAME_1 = "arg";
|
||||||
|
|
||||||
private final List<? extends ComponentLike> argumentComponents;
|
private final List<? extends ComponentLike> argumentComponents;
|
||||||
@@ -165,6 +165,10 @@ public class MiniMessageTranslationRegistryImpl implements Examinable, MiniMessa
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @Nullable Tag resolve(final @NotNull String name, final @NotNull ArgumentQueue arguments, final @NotNull Context ctx) throws ParsingException {
|
public @Nullable Tag resolve(final @NotNull String name, final @NotNull ArgumentQueue arguments, final @NotNull Context ctx) throws ParsingException {
|
||||||
|
if (!has(name)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
final int index = arguments.popOr("No argument number provided").asInt().orElseThrow(() -> ctx.newException("Invalid argument number", arguments));
|
final int index = arguments.popOr("No argument number provided").asInt().orElseThrow(() -> ctx.newException("Invalid argument number", arguments));
|
||||||
|
|
||||||
if (index < 0 || index >= argumentComponents.size()) {
|
if (index < 0 || index >= argumentComponents.size()) {
|
||||||
@@ -176,7 +180,7 @@ public class MiniMessageTranslationRegistryImpl implements Examinable, MiniMessa
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean has(final @NotNull String name) {
|
public boolean has(final @NotNull String name) {
|
||||||
return name.equals(NAME) || name.equals(NAME_1);
|
return name.equals(NAME_0) || name.equals(NAME_1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ commons_pool_version=2.12.0
|
|||||||
bstats_version=3.0.2
|
bstats_version=3.0.2
|
||||||
geantyref_version=1.3.16
|
geantyref_version=1.3.16
|
||||||
caffeine_version=3.1.8
|
caffeine_version=3.1.8
|
||||||
rtag_version=1.5.7
|
rtag_version=1.5.8
|
||||||
jedis_version=5.1.5
|
jedis_version=5.1.5
|
||||||
exp4j_version=0.4.8
|
exp4j_version=0.4.8
|
||||||
placeholder_api_version=2.11.6
|
placeholder_api_version=2.11.6
|
||||||
|
|||||||
Reference in New Issue
Block a user