EvModder / DropHeads

A highly configurable head collecting plugin for Minecraft
GNU Lesser General Public License v3.0
36 stars 29 forks source link

Console errors #74

Closed ValhallaCraft closed 2 years ago

ValhallaCraft commented 2 years ago

Our console gets blown up with this when mobs get killed


- [Fri 11:36:36 ERROR Minecraft] Could not pass event EntityDeathEvent to DropHeads v3.7.7
java.lang.NullPointerException: Cannot invoke "net.evmodder.DropHeads.LRUCache.get(Object)" because "this.weaponCompCache" is null
    at DropHeads.jar//net.evmodder.DropHeads.DropChanceAPI.getWeaponComponent(DropChanceAPI.java:540)
    at DropHeads.jar//net.evmodder.DropHeads.DropChanceAPI.getBeheadMessage(DropChanceAPI.java:561)
    at DropHeads.jar//net.evmodder.DropHeads.DropChanceAPI.triggerHeadDropEvent(DropChanceAPI.java:697)
    at DropHeads.jar//net.evmodder.DropHeads.listeners.EntityDeathListener.onEntityDeath(EntityDeathListener.java:177)
    at DropHeads.jar//net.evmodder.DropHeads.listeners.EntityDeathListener$DeathEventExecutor.execute(EntityDeathListener.java:270)
    at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:76)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:678)
    at org.bukkit.craftbukkit.v1_19_R1.event.CraftEventFactory.callEntityDeathEvent(CraftEventFactory.java:886)
    at net.minecraft.world.entity.LivingEntity.dropAllDeathLoot(LivingEntity.java:1803)
    at net.minecraft.world.entity.LivingEntity.die(LivingEntity.java:1698)
    at net.minecraft.world.entity.LivingEntity.hurt(LivingEntity.java:1515)
    at net.minecraft.world.entity.player.Player.attack(Player.java:1363)
    at net.minecraft.server.level.ServerPlayer.attack(ServerPlayer.java:2176)
    at net.minecraft.server.network.ServerGamePacketListenerImpl$6.a(ServerGamePacketListenerImpl.java:3080)
    at net.minecraft.network.protocol.game.ServerboundInteractPacket$1.dispatch(ServerboundInteractPacket.java:24)
    at net.minecraft.network.protocol.game.ServerboundInteractPacket.dispatch(ServerboundInteractPacket.java:80)
    at net.minecraft.server.network.ServerGamePacketListenerImpl.handleInteract(ServerGamePacketListenerImpl.java:3000)
    at net.minecraft.network.protocol.game.ServerboundI```
felix642 commented 2 years ago

Hi @ValhallaCraft you can fix that issue by defining the line : weapon-tellraw-component-cache-size: 10 at the end of the config.yml file.

EvModder commented 2 years ago

Thanks felix for sharing the workaround; I've also fixed the underlying check that was causing this error spam, I'll try and get the updated .jar submitted to Bukkit later today when I get home