mirror of
https://github.com/taoneill/war.git
synced 2024-11-23 18:55:28 +01:00
Fixed Spout-less server being broken at zone entry and exit.
This commit is contained in:
parent
80fd939922
commit
92b949343c
@ -426,6 +426,12 @@ public class Warzone {
|
|||||||
PlayerInventory inventory = player.getInventory();
|
PlayerInventory inventory = player.getInventory();
|
||||||
ItemStack[] contents = inventory.getContents();
|
ItemStack[] contents = inventory.getContents();
|
||||||
List<PotionEffect> potionEffects = PotionEffect.getCurrentPotionEffects(player);
|
List<PotionEffect> 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(),
|
this.playerStates.put(player.getName(), new PlayerState(player.getGameMode(),
|
||||||
contents,
|
contents,
|
||||||
inventory.getHelmet(),
|
inventory.getHelmet(),
|
||||||
@ -437,7 +443,7 @@ public class Warzone {
|
|||||||
player.getSaturation(),
|
player.getSaturation(),
|
||||||
player.getFoodLevel(),
|
player.getFoodLevel(),
|
||||||
potionEffects,
|
potionEffects,
|
||||||
SpoutManager.getPlayer(player).getTitle()));
|
playerTitle));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void restorePlayerState(Player player) {
|
public void restorePlayerState(Player player) {
|
||||||
@ -451,9 +457,12 @@ public class Warzone {
|
|||||||
player.setSaturation(originalContents.getSaturation());
|
player.setSaturation(originalContents.getSaturation());
|
||||||
player.setFoodLevel(originalContents.getFoodLevel());
|
player.setFoodLevel(originalContents.getFoodLevel());
|
||||||
PotionEffect.restorePotionEffects(player, originalContents.getPotionEffects());
|
PotionEffect.restorePotionEffects(player, originalContents.getPotionEffects());
|
||||||
|
|
||||||
|
if (War.war.isSpoutServer()) {
|
||||||
SpoutManager.getPlayer(player).setTitle(originalContents.getPlayerTitle());
|
SpoutManager.getPlayer(player).setTitle(originalContents.getPlayerTitle());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void playerInvFromInventoryStash(PlayerInventory playerInv, PlayerState originalContents) {
|
private void playerInvFromInventoryStash(PlayerInventory playerInv, PlayerState originalContents) {
|
||||||
playerInv.clear();
|
playerInv.clear();
|
||||||
|
Loading…
Reference in New Issue
Block a user