montlikadani / SetTheSpawn

Set spawn at the location.
https://www.spigotmc.org/resources/48992/
1 stars 2 forks source link

Console Spam issue in 1.17.1 when player goes below Y 0 #20

Open prototype464 opened 3 years ago

prototype464 commented 3 years ago

Problem

Very bad console error spam when a player goes below Y 0 in my 1.17.1 lobby server. Did some testing, can confirm this is 100% what's causing it to happen.

Details

Plugin version: 2.7.3 (latest)

Software version: Airplane #57 - 1.17.1

Relevant plugins: AdvancedPortals, Announcer, CMI, CMILib, FastAsyncWorldEdit, LuckPerms, PlaceholderAPI, ProtocolLib, VelocityGuard, VoidGen, Vulcan, WorldGuard, SetTheSpawn

Console error

[18:48:25 ERROR]: Could not pass event PlayerMoveEvent to SetTheSpawn v2.7.3
java.lang.NullPointerException: Cannot invoke "hu.montlikadani.setthespawn.utils.plugin.VaultPermission.getPrimaryGroup(org.bukkit.entity.Player)" because the return value of "hu.montlikadani.setthespawn.SetTheSpawn.getVaultPermission()" is null
        at hu.montlikadani.setthespawn.Listeners.onPlayerMove(Listeners.java:59) ~[?:?]
        at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor27.execute(Unknown Source) ~[?:?]
        at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) ~[patched_1.17.1.jar:git-Airplane-57]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:76) ~[patched_1.17.1.jar:git-Airplane-57]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.17.1.jar:git-Airplane-57]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:624) ~[patched_1.17.1.jar:git-Airplane-57]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.handleMovePlayer(ServerGamePacketListenerImpl.java:1477) ~[?:?]
        at net.minecraft.network.protocol.game.ServerboundMovePlayerPacket.handle(ServerboundMovePlayerPacket.java:114) ~[?:?]
        at net.minecraft.network.protocol.game.ServerboundMovePlayerPacket$Pos.handle(ServerboundMovePlayerPacket.java:42) ~[?:?]
        at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$1(PacketUtils.java:56) ~[?:?]
        at net.minecraft.server.TickTask.run(TickTask.java:18) ~[patched_1.17.1.jar:git-Airplane-57]
        at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:149) ~[?:?]
        at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:23) ~[?:?]
        at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1407) ~[patched_1.17.1.jar:git-Airplane-57]
        at net.minecraft.server.MinecraftServer.shouldRun(MinecraftServer.java:190) ~[patched_1.17.1.jar:git-Airplane-57]
        at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:122) ~[?:?]
        at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1385) ~[patched_1.17.1.jar:git-Airplane-57]
        at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1378) ~[patched_1.17.1.jar:git-Airplane-57]
        at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:132) ~[?:?]
        at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1354) ~[patched_1.17.1.jar:git-Airplane-57]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1265) ~[patched_1.17.1.jar:git-Airplane-57]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:317) ~[patched_1.17.1.jar:git-Airplane-57]
        at java.lang.Thread.run(Thread.java:831) [?:?]

Configuration file(s)

config.yml: https://pastebin.com/8WQqP2rx

ghost commented 3 years ago

Hello

Seems like the VaultPermission wasn't initialised/null. To solve this you could add a null check before L59 in the Listeners class to check if the method getVaultPermission() inside the SetTheSpawn class isn't null (and maybe as a fail safe tp them back to the world spawn or something) as I'm assume this code is there to tp the player to the proper group based location?

Hope this may help in fixing this error :) MrGraycat