mirror of
https://github.com/Xiao-MoMi/Custom-Nameplates.git
synced 2025-12-26 02:19:28 +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 {
|
||||
private static final String NAME = "argument";
|
||||
private static final String NAME_0 = "argument";
|
||||
private static final String NAME_1 = "arg";
|
||||
|
||||
private final List<? extends ComponentLike> argumentComponents;
|
||||
@@ -165,6 +165,10 @@ public class MiniMessageTranslationRegistryImpl implements Examinable, MiniMessa
|
||||
|
||||
@Override
|
||||
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));
|
||||
|
||||
if (index < 0 || index >= argumentComponents.size()) {
|
||||
@@ -176,7 +180,7 @@ public class MiniMessageTranslationRegistryImpl implements Examinable, MiniMessa
|
||||
|
||||
@Override
|
||||
public boolean has(final @NotNull String name) {
|
||||
return name.equals(NAME) || name.equals(NAME_1);
|
||||
return name.equals(NAME_0) || name.equals(NAME_1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user