BentoBoxWorld / Border

Adds a world border around islands
Eclipse Public License 2.0
13 stars 8 forks source link

Could not pass event PlayerTeleportEvent to BentoBox #131

Open BerndPixel opened 3 months ago

BerndPixel commented 3 months ago

Expected behavior

No more error messages

Observed/Actual behavior

An error message appears when entering the island (/is).

Steps/models to reproduce

1) Player enters the command “/is” on the world “spawn”. 2) Player is teleported to the island (world name skyblock_world) 3) Error appears in the console

BentoBox version

Ausführen von PAPER 1.21. (1.21-119-100d75a (MC: 1.21)) BentoBox version: 2.4.0 Datenbank: JSON Geladene Spielewelten: skyblock_world (Skyblock): Oberwelt, Nether, End Geladene Addons: Bank 1.8.0-SNAPSHOT-b94 (ENABLED) Biomes 2.2.0-SNAPSHOT-b268 (ENABLED) Border 4.3.0-SNAPSHOT-b205 (ENABLED) BSkyBlock 1.18.0 (ENABLED) ControlPanel 1.13.1 (ENABLED) DimensionalTrees 1.7.0 (ENABLED) ExtraMobs 1.13 (ENABLED) FarmersDance 1.1.0-SNAPSHOT (ENABLED) Level 2.14.1 (ENABLED) Limits 1.21.1-SNAPSHOT-b330 (ENABLED) Visit 1.7.0-SNAPSHOT (ENABLED)

Plugin list

AdvancedOreGen, BentoBox, BentoBox-Bank, BentoBox-Biomes, BentoBox-BSkyBlock, BentoBox-FarmersDance, BentoBox-Level, BentoBox-Limits, BentoBox-Visit, Citizens, CMI, CMILib, DeluxeMenus, EconomyShopGUI-Premium, FastAsyncWorldEdit, NBTAPI, PlaceholderAPI, ProtocolLib, Quests, UpgradeableSpawners, WorldGuard

Other

[10:47:47 ERROR]: Could not pass event PlayerTeleportEvent to BentoBox v2.4.0
java.lang.NullPointerException: Cannot invoke "org.bukkit.Location.getWorld()" because "to" is null
        at world.bentobox.border.listeners.PlayerListener.onPlayerTeleport(PlayerListener.java:113) ~[?:?]
        at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor1404.execute(Unknown Source) ~[?:?]
        at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77) ~[paper-api-1.21-R0.1-SNAPSHOT.jar:?]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:84) ~[paper-api-1.21-R0.1-SNAPSHOT.jar:1.21-119-100d75a]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-api-1.21-R0.1-SNAPSHOT.jar:?]
        at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[paper-1.21.jar:1.21-119-100d75a]
        at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:131) ~[paper-1.21.jar:1.21-119-100d75a]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:628) ~[paper-api-1.21-R0.1-SNAPSHOT.jar:?]
        at net.minecraft.server.level.ServerPlayer.changeDimension(ServerPlayer.java:1383) ~[paper-1.21.jar:1.21-119-100d75a]
        at net.minecraft.world.entity.Entity.handlePortal(Entity.java:3273) ~[paper-1.21.jar:1.21-119-100d75a]
        at net.minecraft.world.entity.Entity.baseTick(Entity.java:875) ~[paper-1.21.jar:1.21-119-100d75a]
        at net.minecraft.world.entity.LivingEntity.baseTick(LivingEntity.java:442) ~[paper-1.21.jar:1.21-119-100d75a]
        at net.minecraft.world.entity.Entity.tick(Entity.java:848) ~[paper-1.21.jar:1.21-119-100d75a]
        at net.minecraft.world.entity.LivingEntity.tick(LivingEntity.java:3132) ~[paper-1.21.jar:1.21-119-100d75a]
        at net.minecraft.world.entity.player.Player.tick(Player.java:288) ~[paper-1.21.jar:1.21-119-100d75a]
        at net.minecraft.server.level.ServerPlayer.doTick(ServerPlayer.java:835) ~[paper-1.21.jar:1.21-119-100d75a]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.tick(ServerGamePacketListenerImpl.java:346) ~[paper-1.21.jar:1.21-119-100d75a]
        at net.minecraft.network.Connection.tick(Connection.java:638) ~[paper-1.21.jar:1.21-119-100d75a]
        at net.minecraft.server.network.ServerConnectionListener.tick(ServerConnectionListener.java:242) ~[paper-1.21.jar:1.21-119-100d75a]
        at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1823) ~[paper-1.21.jar:1.21-119-100d75a]
        at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:473) ~[paper-1.21.jar:1.21-119-100d75a]
        at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1598) ~[paper-1.21.jar:1.21-119-100d75a]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1304) ~[paper-1.21.jar:1.21-119-100d75a]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:330) ~[paper-1.21.jar:1.21-119-100d75a]
        at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]
tastybento commented 3 months ago

The error is caused by the To location of the teleport being null. I am not sure why that would be the case in what you explain as the steps, but maybe there is some kind of intermediate teleport happening. Anyway, I've added defensive code to skip everything if the To location is null. See https://ci.codemc.io/job/BentoBoxWorld/job/Border/ for a snapshot you can try.

BerndPixel commented 3 months ago

In the latest snapshot now this error: https://pastebin.com/0SSa65qG

tastybento commented 3 months ago

Okay. That error is thrown by BentoBox.

However, the root cause is that the To world is null. That shouldn't normally be the case. I can patch for that error but I don't understand why the server would have a null for the world you are going to.

Has this ever worked for you? If so, what changed before these errors started?

BerndPixel commented 3 months ago

The only thing I have done is to update the server from 1.20.6 to 1.21. Nothing more

tastybento commented 3 months ago

Does this error always happen? Or just occasionally? I can't replicate on my server.