From d78d28cc7a2ab99b94f8e3e0963b1721de4ba7bb Mon Sep 17 00:00:00 2001 From: Super_ Date: Tue, 10 Dec 2019 16:23:30 -0500 Subject: [PATCH] command void issue is no more --- .../totalfreedommod/world/WorldManager.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/me/totalfreedom/totalfreedommod/world/WorldManager.java b/src/main/java/me/totalfreedom/totalfreedommod/world/WorldManager.java index 917841cc..90dcdece 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/world/WorldManager.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/world/WorldManager.java @@ -8,6 +8,7 @@ import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.World; +import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; @@ -161,6 +162,17 @@ public class WorldManager extends FreedomService return; } + for (Player p : Bukkit.getOnlinePlayers()) + { + for (Entity passengerEntity : p.getPassengers()) + { + if (passengerEntity == player) + { + p.removePassenger(passengerEntity); + } + } + } + if (player.getWorld().getName().equalsIgnoreCase(targetWorld)) { playerMsg(player, "Going to main world.", ChatColor.GRAY);