diff --git a/mcMMO/com/gmail/nossr50/spout/SpoutStuff.java b/mcMMO/com/gmail/nossr50/spout/SpoutStuff.java index 19bd7a600..5c431564e 100644 --- a/mcMMO/com/gmail/nossr50/spout/SpoutStuff.java +++ b/mcMMO/com/gmail/nossr50/spout/SpoutStuff.java @@ -12,6 +12,7 @@ import org.bukkit.event.Event; import org.bukkit.event.Event.Priority; import org.getspout.spoutapi.SpoutManager; import org.getspout.spoutapi.gui.GenericTexture; +import org.getspout.spoutapi.gui.Widget; import org.getspout.spoutapi.player.SpoutPlayer; import org.getspout.spoutapi.sound.SoundEffect; import org.getspout.spoutapi.sound.SoundManager; @@ -87,11 +88,22 @@ public class SpoutStuff SpoutPlayer sPlayer = SpoutManager.getPlayer(x); if(sPlayer.isSpoutCraftEnabled()) { - for(HealthBarMMO y : partyHealthBars.get(x)) + ArrayList widgets = new ArrayList(); + for(Widget w : sPlayer.getMainScreen().getAttachedWidgets()) { - sPlayer.getMainScreen().removeWidget(y.health_bar); - sPlayer.getMainScreen().removeWidget(y.health_name); + if(w instanceof HealthBarMMO) + { + widgets.add(w); + } } + for(Widget w : widgets) + { + sPlayer.getMainScreen().removeWidget(w); + } + + sPlayer.getMainScreen().setDirty(true); + partyHealthBars.get(x).clear(); + initializePartyTracking(SpoutManager.getPlayer(x)); } }