* Fixed player won't fly in arena if they where able before.

This commit is contained in:
Steffion 2013-09-28 21:45:09 +02:00
parent 2f1b604a37
commit 6e9177fdff
2 changed files with 8 additions and 3 deletions

View File

@ -97,7 +97,8 @@ public class ArenaHandler {
player.getExp(), player.getLevel(),
player.getHealth(),
player.getFoodLevel(),
player.getActivePotionEffects());
player.getActivePotionEffects(),
player.isFlying());
W.pData.put(player, pad);
@ -117,6 +118,7 @@ public class ArenaHandler {
new ItemStack(Material.AIR));
player.getInventory().setBoots(
new ItemStack(Material.AIR));
player.setFlying(false);
if ((Boolean) W.config
.get(ConfigC.shop_blockChooserEnabled) == true) {
@ -257,7 +259,7 @@ public class ArenaHandler {
}
PlayerArenaData pad = new PlayerArenaData(null, null, null, null,
null, null, null, null, null);
null, null, null, null, null, false);
if (W.pData.get(player) != null) {
pad = W.pData.get(player);
@ -274,6 +276,7 @@ public class ArenaHandler {
player.addPotionEffects(pad.pPotionEffects);
player.teleport(pad.pLocation);
player.setGameMode(pad.pGameMode);
player.setFlying(pad.pFlying);
W.pData.remove(player);

View File

@ -17,11 +17,12 @@ public class PlayerArenaData {
public Double pHealth;
public Integer pFood;
public Collection<PotionEffect> pPotionEffects;
public boolean pFlying;
public PlayerArenaData (Location pLocation, GameMode pGameMode,
ItemStack[] pInventory, ItemStack[] pArmor, Float pEXP,
Integer pEXPL, Double pHealth, Integer pFood,
Collection<PotionEffect> pPotionEffects) {
Collection<PotionEffect> pPotionEffects, boolean pFlying) {
this.pLocation = pLocation;
this.pGameMode = pGameMode;
this.pInventory = pInventory;
@ -31,5 +32,6 @@ public class PlayerArenaData {
this.pHealth = pHealth;
this.pFood = pFood;
this.pPotionEffects = pPotionEffects;
this.pFlying = pFlying;
}
}