Grief Prevention

Grief Prevention

1M Downloads

Could not pass event PlayerInteractEvent to GriefPrevention

IAISI opened this issue ยท 3 comments

commented

Observed Behavior

On 9dca78a

com.destroystokyo.paper.exception.ServerEventException: Could not pass event PlayerInteractEvent to GriefPrevention v17.0.0-47-g9dca78a-dirty
	at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:72)
	at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:131)
	at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:628)
	at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:598)
	at net.minecraft.server.level.ServerPlayerGameMode.useItemOn(ServerPlayerGameMode.java:536)
	at net.minecraft.server.network.ServerGamePacketListenerImpl.handleUseItemOn(ServerGamePacketListenerImpl.java:1871)
	at net.minecraft.network.protocol.game.ServerboundUseItemOnPacket.handle(ServerboundUseItemOnPacket.java:44)
	at net.minecraft.network.protocol.game.ServerboundUseItemOnPacket.handle(ServerboundUseItemOnPacket.java:11)
	at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$0(PacketUtils.java:56)
	at net.minecraft.server.TickTask.run(TickTask.java:18)
	at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:151)
	at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24)
	at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1545)
	at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:201)
	at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:125)
	at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1522)
	at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1515)
	at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:135)
	at net.minecraft.server.MinecraftServer.managedBlock(MinecraftServer.java:1474)
	at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1481)
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1326)
	at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:331)
	at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.lang.NullPointerException: Cannot read field "claimResizing" because "playerData" is null
	at GriefPrevention.jar//me.ryanhamshire.GriefPrevention.PlayerEventHandler.onPlayerInteract(PlayerEventHandler.java:1918)
	at com.destroystokyo.paper.event.executor.MethodHandleEventExecutor.execute(MethodHandleEventExecutor.java:40)
	at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80)
	at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70)
	at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54)
	... 22 more

Expected Behavior

Not sure how playerData could be null but we should probably load it?

            //if he's resizing a claim and that claim hasn't been deleted since he started resizing it
            if (playerData == null) playerData = this.dataStore.getPlayerData(player.getUniqueId());

Reproduction steps

When player is trying to create new claim.

Stack trace or error log

No response

Server version

Latest paper 1.21 (not 1.21.1)

GriefPrevention version

Latest GP from github

Configuration

N/A

Plugin list

No response

Running without GriefPrevention

  • I attempted running the server without GriefPrevention installed.
  • The problem does not occur when GriefPrevention is removed from the server.

Running with only GriefPrevention

  • I attempted running only GriefPrevention on the server.
  • The issue still occurs when GriefPrevention is the only plugin running.

Running on a fresh, clean server installation

  • I attempted testing for the issue on a new server.
  • The issue still occurs on a new server.

Using unmodified client

  • I attempted testing for the issue with the vanilla client.
  • The issue still occurs when using the vanilla client.

We appreciate you taking the time to fill out a bug report!

  • I searched for similar issues before submitting this bug report.
commented

My suggestion does seem to fix the issue.

commented

Adding to this: in this dev artifact i cannot use my golden shovel anymore. It does nothing and indeed gives that error. Both inside and outside claims.

commented

For future reference and for others who may be searching for their bug, specifying the version is useful. E.g., this doesn't apply to legacy nor to other v17 commits before removing restorenature.