From a0fba09ac156bded19d5bbeb90a24d3af52453f3 Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Sun, 11 May 2014 11:25:42 +0100 Subject: [PATCH] Don't fire PlayerPortalEvent when we don't have a target --- ...rPortalEvent-when-we-don-t-have-a-ta.patch | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 CraftBukkit-Patches/0146-Don-t-fire-PlayerPortalEvent-when-we-don-t-have-a-ta.patch diff --git a/CraftBukkit-Patches/0146-Don-t-fire-PlayerPortalEvent-when-we-don-t-have-a-ta.patch b/CraftBukkit-Patches/0146-Don-t-fire-PlayerPortalEvent-when-we-don-t-have-a-ta.patch new file mode 100644 index 000000000..96417a82a --- /dev/null +++ b/CraftBukkit-Patches/0146-Don-t-fire-PlayerPortalEvent-when-we-don-t-have-a-ta.patch @@ -0,0 +1,26 @@ +From 9bb3098ad4fb9a1bcdf99d80aeaf3b8d32971703 Mon Sep 17 00:00:00 2001 +From: Thinkofdeath +Date: Sun, 11 May 2014 11:24:20 +0100 +Subject: [PATCH] Don't fire PlayerPortalEvent when we don't have a target + + +diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java +index a4a59ee..355e589 100644 +--- a/src/main/java/net/minecraft/server/PlayerList.java ++++ b/src/main/java/net/minecraft/server/PlayerList.java +@@ -609,6 +609,12 @@ public abstract class PlayerList { + } + + TravelAgent agent = exit != null ? (TravelAgent) ((CraftWorld) exit.getWorld()).getHandle().getTravelAgent() : org.bukkit.craftbukkit.CraftTravelAgent.DEFAULT; // return arbitrary TA to compensate for implementation dependent plugins ++ // Spigot start ++ if ( exit == null ) ++ { ++ return; ++ } ++ // Spigot + PlayerPortalEvent event = new PlayerPortalEvent(entityplayer.getBukkitEntity(), enter, exit, agent, cause); + event.useTravelAgent(useTravelAgent); + Bukkit.getServer().getPluginManager().callEvent(event); +-- +1.9.1 +