Fix error in BukkitAdvancementListener

This commit is contained in:
Vankka 2023-06-27 21:22:21 +03:00
parent d25e12e0fa
commit 8e12731119
No known key found for this signature in database
GPG Key ID: 6E50CB7A29B96AD0

View File

@ -80,8 +80,8 @@ public class BukkitAdvancementListener extends AbstractBukkitAwardListener {
forwarder.publishEvent( forwarder.publishEvent(
event, event,
event.getPlayer(), event.getPlayer(),
data.titleJson != null ? ComponentUtil.toAPI(BukkitComponentSerializer.gson().deserialize(data.titleJson)) : null,
data.nameJson != null ? ComponentUtil.toAPI(BukkitComponentSerializer.gson().deserialize(data.nameJson)) : null, data.nameJson != null ? ComponentUtil.toAPI(BukkitComponentSerializer.gson().deserialize(data.nameJson)) : null,
data.titleJson != null ? ComponentUtil.toAPI(BukkitComponentSerializer.gson().deserialize(data.titleJson)) : null,
false); false);
} catch (ReflectiveOperationException e) { } catch (ReflectiveOperationException e) {
logger.debug("Failed to get advancement data", e); logger.debug("Failed to get advancement data", e);
@ -143,7 +143,7 @@ public class BukkitAdvancementListener extends AbstractBukkitAwardListener {
} }
private String toJson(Object chat) throws ReflectiveOperationException { private String toJson(Object chat) throws ReflectiveOperationException {
return (String) toJsonMethod.invoke(chat); return (String) toJsonMethod.invoke(null, chat);
} }
} }