tomkeuper / BedWars2023

A minecraft minigame where you have to defend your bed and destroy the others. Once your bed is destroyed, you cannot respawn.
GNU General Public License v3.0
59 stars 16 forks source link

Task #7683 for BedWars2023 v1.1.1 generated an exception #289

Open IAISI opened 6 months ago

IAISI commented 6 months ago

Make sure to check before creating a Bug Report

Type of problem

Plugin/Server Incompatibility

What happened?

[00:55:10 WARN]: [BedWars2023] Task #7683 for BedWars2023 v1.1.1 generated an exception
java.lang.NullPointerException: Cannot invoke "java.util.List.contains(Object)" because "this.players" is null
        at com.tomkeuper.bedwars.arena.Arena.isPlayer(Arena.java:1585) ~[BedWars2023.jar:?]
        at com.tomkeuper.bedwars.arena.Arena.lambda$addPlayer$6(Arena.java:591) ~[BedWars2023.jar:?]
        at org.bukkit.craftbukkit.v1_20_R3.scheduler.CraftTask.run(CraftTask.java:101) ~[sakura-1.20.4.jar:git-Sakura-"81399e4"]
        at org.bukkit.craftbukkit.v1_20_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:482) ~[sakura-1.20.4.jar:git-Sakura-"81399e4"]
        at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1655) ~[sakura-1.20.4.jar:git-Sakura-"81399e4"]
        at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:452) ~[sakura-1.20.4.jar:git-Sakura-"81399e4"]
        at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1534) ~[sakura-1.20.4.jar:git-Sakura-"81399e4"]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1234) ~[sakura-1.20.4.jar:git-Sakura-"81399e4"]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:321) ~[sakura-1.20.4.jar:git-Sakura-"81399e4"]
        at java.lang.Thread.run(Thread.java:1583) ~[?:?]
[00:55:10 WARN]: com.destroystokyo.paper.exception.ServerSchedulerException: Task #7683 for BedWars2023 v1.1.1 generated an exception
[00:55:10 WARN]:        at org.bukkit.craftbukkit.v1_20_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:497)
[00:55:10 WARN]:        at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1655)
[00:55:10 WARN]:        at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:452)
[00:55:10 WARN]:        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1534)
[00:55:10 WARN]:        at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1234)
[00:55:10 WARN]:        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:321)
[00:55:10 WARN]:        at java.base/java.lang.Thread.run(Thread.java:1583)
[00:55:10 WARN]: Caused by: java.lang.NullPointerException: Cannot invoke "java.util.List.contains(Object)" because "this.players" is null
[00:55:10 WARN]:        at BedWars2023.jar//com.tomkeuper.bedwars.arena.Arena.isPlayer(Arena.java:1585)
[00:55:10 WARN]:        at BedWars2023.jar//com.tomkeuper.bedwars.arena.Arena.lambda$addPlayer$6(Arena.java:591)
[00:55:10 WARN]:        at org.bukkit.craftbukkit.v1_20_R3.scheduler.CraftTask.run(CraftTask.java:101)
[00:55:10 WARN]:        at org.bukkit.craftbukkit.v1_20_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:482)
[00:55:10 WARN]:        ... 6 more

Expected Behaviour

N/A

How to Reproduce

Spam /bw join right after map is being unloaded and reload, seems to be occurring kinda randomly.

Console Log

No response

Errors

No response

Additional Info

BedWars 1.1.1 MC 1.20.4

tomkeuper commented 6 months ago

provide the whole server log please

tomkeuper commented 5 months ago

Bump

tomkeuper commented 5 months ago

This issue is closed due to being stale. You can reopen this if needed or create a new issue.

IAISI commented 4 months ago

Sorry for late reply, I was away.

There is literary nothing else related to this exception in server logs, since last update (dev branch) its still an issue:

[13:59:15] [Server thread/ERROR]: Could not pass event PlayerMoveEvent to BedWars2023 v1.2.1-SNAPSHOT
java.lang.IllegalArgumentException: Cannot measure distance between pot and zepplins
    at org.bukkit.Location.distanceSquared(Location.java:510) ~[sakura-api-1.20.4-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.Location.distance(Location.java:493) ~[sakura-api-1.20.4-R0.1-SNAPSHOT.jar:?]
    at com.tomkeuper.bedwars.listeners.DamageDeathMove.onMove(DamageDeathMove.java:608) ~[BedWars2023.jar:?]
    at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor79.execute(Unknown Source) ~[?:?]
    at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77) ~[sakura-api-1.20.4-R0.1-SNAPSHOT.jar:?]
    at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:77) ~[sakura-api-1.20.4-R0.1-SNAPSHOT.jar:git-Sakura-"2e0aa83"]
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[sakura-api-1.20.4-R0.1-SNAPSHOT.jar:?]
    at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[sakura-1.20.4.jar:git-Sakura-"2e0aa83"]
    at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:126) ~[sakura-1.20.4.jar:git-Sakura-"2e0aa83"]
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:615) ~[sakura-api-1.20.4-R0.1-SNAPSHOT.jar:?]
    at net.minecraft.server.network.ServerGamePacketListenerImpl.handleMovePlayer(ServerGamePacketListenerImpl.java:1576) ~[?:?]
    at net.minecraft.network.protocol.game.ServerboundMovePlayerPacket.handle(ServerboundMovePlayerPacket.java:29) ~[?:?]
    at net.minecraft.network.protocol.game.ServerboundMovePlayerPacket$Rot.handle(ServerboundMovePlayerPacket.java:114) ~[?:?]
    at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$0(PacketUtils.java:54) ~[?:?]
    at net.minecraft.server.TickTask.run(TickTask.java:18) ~[sakura-1.20.4.jar:git-Sakura-"2e0aa83"]
    at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:149) ~[?:?]
    at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[?:?]
    at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1474) ~[sakura-1.20.4.jar:git-Sakura-"2e0aa83"]
    at net.minecraft.server.MinecraftServer.wrapRunnable(MinecraftServer.java:195) ~[sakura-1.20.4.jar:git-Sakura-"2e0aa83"]
    at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:123) ~[?:?]
    at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1451) ~[sakura-1.20.4.jar:git-Sakura-"2e0aa83"]
    at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1374) ~[sakura-1.20.4.jar:git-Sakura-"2e0aa83"]
    at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:133) ~[?:?]
    at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1352) ~[sakura-1.20.4.jar:git-Sakura-"2e0aa83"]
    at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1241) ~[sakura-1.20.4.jar:git-Sakura-"2e0aa83"]
    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:321) ~[sakura-1.20.4.jar:git-Sakura-"2e0aa83"]
    at java.lang.Thread.run(Thread.java:1583) ~[?:?]
[13:59:15] [Server thread/WARN]: com.destroystokyo.paper.exception.ServerEventException: Could not pass event PlayerMoveEvent to BedWars2023 v1.2.1-SNAPSHOT
[13:59:15] [Server thread/WARN]:    at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:72)
[13:59:15] [Server thread/WARN]:    at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:126)
[13:59:15] [Server thread/WARN]:    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:615)
[13:59:15] [Server thread/WARN]:    at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1576)
[13:59:15] [Server thread/WARN]:    at net.minecraft.network.protocol.game.PacketPlayInFlying.a(PacketPlayInFlying.java:29)
[13:59:15] [Server thread/WARN]:    at net.minecraft.network.protocol.game.PacketPlayInFlying$PacketPlayInLook.a(PacketPlayInFlying.java:114)
[13:59:15] [Server thread/WARN]:    at net.minecraft.network.protocol.PlayerConnectionUtils.a(PlayerConnectionUtils.java:54)
[13:59:15] [Server thread/WARN]:    at net.minecraft.server.TickTask.run(TickTask.java:18)
[13:59:15] [Server thread/WARN]:    at net.minecraft.util.thread.IAsyncTaskHandler.d(IAsyncTaskHandler.java:149)
[13:59:15] [Server thread/WARN]:    at net.minecraft.util.thread.IAsyncTaskHandlerReentrant.d(IAsyncTaskHandlerReentrant.java:24)
[13:59:15] [Server thread/WARN]:    at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1474)
[13:59:15] [Server thread/WARN]:    at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:195)
[13:59:15] [Server thread/WARN]:    at net.minecraft.util.thread.IAsyncTaskHandler.x(IAsyncTaskHandler.java:123)
[13:59:15] [Server thread/WARN]:    at net.minecraft.server.MinecraftServer.bl(MinecraftServer.java:1451)
[13:59:15] [Server thread/WARN]:    at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1374)
[13:59:15] [Server thread/WARN]:    at net.minecraft.util.thread.IAsyncTaskHandler.c(IAsyncTaskHandler.java:133)
[13:59:15] [Server thread/WARN]:    at net.minecraft.server.MinecraftServer.w_(MinecraftServer.java:1352)
[13:59:15] [Server thread/WARN]:    at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1241)
[13:59:15] [Server thread/WARN]:    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:321)
[13:59:15] [Server thread/WARN]:    at java.base/java.lang.Thread.run(Thread.java:1583)
[13:59:15] [Server thread/WARN]: Caused by: java.lang.IllegalArgumentException: Cannot measure distance between pot and zepplins
[13:59:15] [Server thread/WARN]:    at org.bukkit.Location.distanceSquared(Location.java:510)
[13:59:15] [Server thread/WARN]:    at org.bukkit.Location.distance(Location.java:493)
[13:59:15] [Server thread/WARN]:    at BedWars2023.jar//com.tomkeuper.bedwars.listeners.DamageDeathMove.onMove(DamageDeathMove.java:608)
[13:59:15] [Server thread/WARN]:    at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor79.execute(Unknown Source)
[13:59:15] [Server thread/WARN]:    at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77)
[13:59:15] [Server thread/WARN]:    at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:77)
[13:59:15] [Server thread/WARN]:    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70)
[13:59:15] [Server thread/WARN]:    at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54)
[13:59:15] [Server thread/WARN]:    ... 19 more

quick fix would be updating DamageDeathMove class, line 607 to

                for (ShopHolo sh : ShopHolo.getShopHolograms(e.getPlayer())) {
                    if (sh.getHologram().getLocation().getWorld() == e.getTo().getWorld() && sh.getHologram().getLocation().distance(e.getTo()) > BedWars.hologramUpdateDistance) {
                        sh.update();
                    }
                }

but the real question is how is ShopHolo.getShopHolograms returning holograms from other worlds or previous gameplays..

IAISI commented 4 months ago

I suspect it could be FAWE tick limiter, but not sure how that could even affect it, ill try to disable it and test again.

tomkeuper commented 4 months ago

Can you send the whole server log of where you found this error? I need to see whats happening.

IAISI commented 4 months ago

Discord?

tomkeuper commented 4 months ago

Discord is fine

tomkeuper commented 4 months ago

bump

IAISI commented 4 months ago

We talked in DMs a little while ago, I've also provided server log...