From 92b949343c3fd8d8f6955bacd30695a8679a1f38 Mon Sep 17 00:00:00 2001 From: taoneill Date: Sat, 14 Jan 2012 17:58:46 -0500 Subject: [PATCH] Fixed Spout-less server being broken at zone entry and exit. --- war/src/main/java/com/tommytony/war/Warzone.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/war/src/main/java/com/tommytony/war/Warzone.java b/war/src/main/java/com/tommytony/war/Warzone.java index 8033499..0068cf4 100644 --- a/war/src/main/java/com/tommytony/war/Warzone.java +++ b/war/src/main/java/com/tommytony/war/Warzone.java @@ -426,6 +426,12 @@ public class Warzone { PlayerInventory inventory = player.getInventory(); ItemStack[] contents = inventory.getContents(); List potionEffects = PotionEffect.getCurrentPotionEffects(player); + + String playerTitle = player.getName(); + if (War.war.isSpoutServer()) { + playerTitle = SpoutManager.getPlayer(player).getTitle(); + } + this.playerStates.put(player.getName(), new PlayerState(player.getGameMode(), contents, inventory.getHelmet(), @@ -437,7 +443,7 @@ public class Warzone { player.getSaturation(), player.getFoodLevel(), potionEffects, - SpoutManager.getPlayer(player).getTitle())); + playerTitle)); } public void restorePlayerState(Player player) { @@ -451,7 +457,10 @@ public class Warzone { player.setSaturation(originalContents.getSaturation()); player.setFoodLevel(originalContents.getFoodLevel()); PotionEffect.restorePotionEffects(player, originalContents.getPotionEffects()); - SpoutManager.getPlayer(player).setTitle(originalContents.getPlayerTitle()); + + if (War.war.isSpoutServer()) { + SpoutManager.getPlayer(player).setTitle(originalContents.getPlayerTitle()); + } } }