bukkit/paper: Fix Holder#value reflection in obf environment
This commit is contained in:
parent
1fe1b4a0d3
commit
52e6a53175
2 changed files with 6 additions and 2 deletions
|
|
@ -233,7 +233,11 @@ public final class ItemStackArgument<C> extends CommandArgument<C, ProtoItemStac
|
|||
private static final Class<?> HOLDER_CLASS = CraftBukkitReflection.findMCClass("core.Holder");
|
||||
private static final @Nullable Method VALUE_METHOD = HOLDER_CLASS == null
|
||||
? null
|
||||
: CraftBukkitReflection.needMethod(HOLDER_CLASS, "value");
|
||||
: CraftBukkitReflection.firstNonNullOrThrow(
|
||||
() -> "Couldn't find Holder#value",
|
||||
CraftBukkitReflection.findMethod(HOLDER_CLASS, "value"),
|
||||
CraftBukkitReflection.findMethod(HOLDER_CLASS, "a")
|
||||
);
|
||||
|
||||
private final ArgumentParser<C, ProtoItemStack> parser;
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ public class MaterialArgument<C> extends CommandArgument<C, Material> {
|
|||
@NonNull List<@NonNull String>> suggestionsProvider,
|
||||
final @NonNull ArgumentDescription defaultDescription
|
||||
) {
|
||||
super(required, name, new MaterialParser<>(), defaultValue, Material.class, suggestionsProvider);
|
||||
super(required, name, new MaterialParser<>(), defaultValue, Material.class, suggestionsProvider, defaultDescription);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue