Skip to content

Commit

Permalink
fix: correct reflection for async suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
broccolai committed Jul 23, 2024
1 parent bbad4ce commit b816d39
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ private static final class Modern implements CompletionMapper {
this.deserializeOrNull = CraftBukkitReflection.needMethod(
MessageComponentSerializer.class,
"deserializeOrNull",
Message.class
Object.class
);
this.completionWithTooltipMethod = CraftBukkitReflection.needMethod(
AsyncTabCompleteEvent.Completion.class,
Expand All @@ -83,6 +83,7 @@ private static final class Modern implements CompletionMapper {
public AsyncTabCompleteEvent.@NonNull Completion map(final @NonNull TooltipSuggestion suggestion) {
try {
return (AsyncTabCompleteEvent.Completion) this.completionWithTooltipMethod.invoke(
null,
suggestion.suggestion(),
this.deserializeOrNull.invoke(this.serializer, suggestion.tooltip())
);
Expand Down

0 comments on commit b816d39

Please sign in to comment.