[1.19] dev.latvian.mods.kubejs.forge.KubeJSForge.itemDestroyed needs to use getEntity instead of getPlayer in new Forge versions
zach2039 opened this issue ยท 1 comments
Minecraft Version
1.19
KubeJS Version
1900.5.5-build.27
Rhino Version
1802.1.13-build.174
Architectury Version
5.9.31
Forge/Fabric Version
41.0.98
Describe your issue
NoSuchMethodError after spawning in entity with spawn egg. PlayerDestroyItemEvent no longer has getPlayer(), but instead getEntity(). The following code needs to change in dev.latvian.mods.kubejs.forge.KubeJSForge.java
:
private static void itemDestroyed(PlayerDestroyItemEvent event) {
if (event.getPlayer() instanceof ServerPlayer) {
new ItemDestroyedEventJS(event).post(KubeJSEvents.ITEM_DESTROYED);
}
}