LadyCailin / TestIssueUploader

Testing testing 123
0 stars 0 forks source link

NPE on SpawnLocationsComponent.onTeleport(PlayerTeleportEvent) #286

Closed LadyCailin closed 4 years ago

LadyCailin commented 4 years ago

CMDBOOK-2126 - Reported by travja on 2012-11-13 01:17:10 UTC

I get this error any time my plugin tries to teleport someone.... I was just wondering why and if it could be fixed... This is a major exploit in my plugin and makes it so nothing works right. I am just using the p.teleport() method.... It thinks I have to have someone teleporting the other person not allowing the p.teleport method.

Thanks for considering this!

Could not pass event PlayerTeleportEvent to CommandBook v2.1 org.bukkit.event.EventException at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:341) at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:477) at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:462) at org.bukkit.craftbukkit.entity.CraftPlayer.teleport(CraftPlayer.java:356) at org.bukkit.craftbukkit.entity.CraftEntity.teleport(CraftEntity.java:175) at me.Travja.HungerArena.HaCommands.onCommand(HaCommands.java:386) at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:185) at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:504) at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:911) at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:824) at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:806) at net.minecraft.server.Packet3Chat.handle(Packet3Chat.java:44) at net.minecraft.server.NetworkManager.b(NetworkManager.java:282) at net.minecraft.server.NetServerHandler.d(NetServerHandler.java:111) at net.minecraft.server.ServerConnection.b(SourceFile:35) at net.minecraft.server.DedicatedServerConnection.b(SourceFile:30) at net.minecraft.server.MinecraftServer.r(MinecraftServer.java:578) at net.minecraft.server.DedicatedServer.r(DedicatedServer.java:215) at net.minecraft.server.MinecraftServer.q(MinecraftServer.java:495) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:428) at net.minecraft.server.ThreadServerApplication.run(SourceFile:818) Caused by: java.lang.NullPointerException at com.sk89q.commandbook.locations.SpawnLocationsComponent.onTeleport(SpawnLocationsComponent.java:90) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:339) ... 22 more

LadyCailin commented 4 years ago

Comment by sk89q on 2012-11-13 01:43:14 UTC

{code:java} @EventHandler public void onTeleport(PlayerTeleportEvent event) {

    Location loc = event.getTo();
    if (event.isCancelled()) {
        return;
    }

/line/if (loc.equals(loc.getWorld().getSpawnLocation())) { // Line 90 event.setTo(spawns.getWorldSpawn(loc.getWorld())); } }```

Are you giving a null world or something? Or a null location?

LadyCailin commented 4 years ago

Comment by sk89q on 2012-11-13 01:46:08 UTC

Whatever, I added a null check anyway because I broke GitHub and it won't show my new commits and I need a test commit.

LadyCailin commented 4 years ago

Comment by travja on 2012-11-13 01:52:01 UTC

I specify a world.... Just the wrong one! Thanks for helping me find that! All my fault! Had the wrong world specified on my things as when I moved to 1.4 I changed world names! Thanks, you can close this issue.