Wilderness-Tp

Wilderness-Tp

36.7k Downloads

Error accessing #getPersistentDataContainer because of the weird JohnBonifield wrapper class

mfnalex opened this issue ยท 4 comments

commented

Hi, I'm the author of Drop2InventoryPlus ( https://github.com/JEFF-Media-GbR/Drop2Inventory-Plus )

Whenever someone does /wild, they get an exception like this:

[20:37:17 ERROR]: Could not pass event BlurredBlockBreakEvent to Drop2InventoryPlus v2.4.1
java.lang.AbstractMethodError: Receiver class net.poweredbyhate.wildtp.JohnBonifield does not define or inherit an implementation of the resolved method 'org.bukkit.persistence.PersistentDataContainer getPersistentDataContainer()' of interface org.bukkit.entity.Player.
        at de.jeff_media.drop2inventory.Main.enabled(Main.java:136) ~[?:?]
        at de.jeff_media.drop2inventory.handlers.PermissionChecker.hasDrop2InvEnabled(PermissionChecker.java:30) ~[?:?]
        at de.jeff_media.drop2inventory.handlers.PermissionChecker.isAllowed(PermissionChecker.java:59) ~[?:?]
        at de.jeff_media.drop2inventory.listeners.RegistrationListener.blockBreak(RegistrationListener.java:100) ~[?:?]
        at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor246.execute(Unknown Source) ~[?:?]
        at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) ~[patched_1.17.1.jar:git-Paper-92]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[patched_1.17.1.jar:git-Paper-92]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.17.1.jar:git-Paper-92]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:624) ~[patched_1.17.1.jar:git-Paper-92]
        at net.poweredbyhate.wildtp.WildWarrantTax.n0tAGreifClam(WildWarrantTax.java:152) ~[?:?]
        at net.poweredbyhate.wildtp.WildWarrantTax.chekar(WildWarrantTax.java:124) ~[?:?]
        at net.poweredbyhate.wildtp.WildWarrantTax.lambda$search$0(WildWarrantTax.java:71) ~[?:?]
        at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:642) ~[?:?]
        at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506) ~[?:?]
        at java.util.concurrent.CompletableFuture.postFire(CompletableFuture.java:610) ~[?:?]
        at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1159) ~[?:?]
        at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:478) ~[?:?]
        at net.minecraft.util.thread.BlockableEventLoop.execute(BlockableEventLoop.java:100) ~[?:?]
        at java.util.concurrent.CompletableFuture$UniCompletion.claim(CompletableFuture.java:568) ~[?:?]
        at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1143) ~[?:?]
        at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506) ~[?:?]
        at java.util.concurrent.CompletableFuture.postFire(CompletableFuture.java:610) ~[?:?]
        at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1159) ~[?:?]
        at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:478) ~[?:?]
        at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:149) ~[?:?]
        at net.minecraft.server.level.ServerChunkCache$MainThreadExecutor.doRunTask(ServerChunkCache.java:1025) ~[?:?]
        at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:122) ~[?:?]
        at net.minecraft.server.level.ServerChunkCache$MainThreadExecutor.pollTask(ServerChunkCache.java:1072) ~[?:?]
        at net.minecraft.server.level.ServerChunkCache.pollTask(ServerChunkCache.java:661) ~[?:?]
        at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1336) ~[patched_1.17.1.jar:git-Paper-92]
        at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1320) ~[patched_1.17.1.jar:git-Paper-92]
        at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:132) ~[?:?]
        at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1281) ~[patched_1.17.1.jar:git-Paper-92]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1192) ~[patched_1.17.1.jar:git-Paper-92]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) ~[patched_1.17.1.jar:git-Paper-92]
        at java.lang.Thread.run(Thread.java:831) [?:?]

Seems like the Player interface isn't properly implemented by WildernessTp.

Reproduceable on all latest Spigot/Paper/Purpur versions.

It SEEMS (I haven't studied the code too much right now) to happen because you're calling a BlockBreakEvent using an instance of your "JohnBonifield" class instead of the Player.

commented

BTW it's obviously caused by the "WildWarrantTax#n0tAGreifClam" method, specifically the BlurredBlockBreakEvent called "iHopePluginsDontFreakOutOverThis"... wtf is that?

commented

high quality code c:

It's used to check for region protection plugins before teleporting the player to that area while preventing denial messages being sent to the actual player. I'll implement a fix regardless though.

commented

Yep, thanks, that fixes it :)