diff --git a/src/main/java/com/gmail/nossr50/runnables/SpoutStart.java b/src/main/java/com/gmail/nossr50/runnables/SpoutStart.java index feebce45d..5702c8977 100644 --- a/src/main/java/com/gmail/nossr50/runnables/SpoutStart.java +++ b/src/main/java/com/gmail/nossr50/runnables/SpoutStart.java @@ -1,9 +1,7 @@ package com.gmail.nossr50.runnables; import org.getspout.spoutapi.SpoutManager; -import org.getspout.spoutapi.event.spout.SpoutCraftEnableEvent; import org.getspout.spoutapi.player.FileManager; -import org.getspout.spoutapi.player.SpoutPlayer; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.config.SpoutConfig; @@ -36,10 +34,7 @@ public class SpoutStart implements Runnable{ FM.addToPreLoginCache(plugin, SpoutStuff.getFiles()); //Handle spout players after a /reload - for (SpoutPlayer spoutPlayer : SpoutManager.getPlayerManager().getOnlinePlayers()) { - SpoutCraftEnableEvent spoutCraftEnableEvent = new SpoutCraftEnableEvent(spoutPlayer); - mcMMO.p.getServer().getPluginManager().callEvent(spoutCraftEnableEvent); - } + SpoutStuff.reloadSpoutPlayers(); } } } diff --git a/src/main/java/com/gmail/nossr50/spout/SpoutStuff.java b/src/main/java/com/gmail/nossr50/spout/SpoutStuff.java index 075d9624b..dee3dcfac 100644 --- a/src/main/java/com/gmail/nossr50/spout/SpoutStuff.java +++ b/src/main/java/com/gmail/nossr50/spout/SpoutStuff.java @@ -16,6 +16,7 @@ import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.entity.Player; import org.getspout.spoutapi.SpoutManager; +import org.getspout.spoutapi.event.spout.SpoutCraftEnableEvent; import org.getspout.spoutapi.keyboard.Keyboard; import org.getspout.spoutapi.player.SpoutPlayer; @@ -574,4 +575,14 @@ public class SpoutStuff { public static void updateXpBar(Player player) { playerHUDs.get(player).updateXpBarDisplay(Users.getProfile(player).getHUDType(), player); //Is there a reason we can't just do HUDmmo.updateXpBarDisplay? } + + /** + * Re-enable SpoutCraft for players after a /reload + */ + public static void reloadSpoutPlayers() { + for (SpoutPlayer spoutPlayer : SpoutManager.getPlayerManager().getOnlinePlayers()) { + SpoutCraftEnableEvent spoutCraftEnableEvent = new SpoutCraftEnableEvent(spoutPlayer); + mcMMO.p.getServer().getPluginManager().callEvent(spoutCraftEnableEvent); + } + } }