* Fixed player won't fly in arena if they where able before.
This commit is contained in:
		| @@ -97,7 +97,8 @@ public class ArenaHandler { | |||||||
| 											player.getExp(), player.getLevel(), | 											player.getExp(), player.getLevel(), | ||||||
| 											player.getHealth(), | 											player.getHealth(), | ||||||
| 											player.getFoodLevel(), | 											player.getFoodLevel(), | ||||||
| 											player.getActivePotionEffects()); | 											player.getActivePotionEffects(), | ||||||
|  | 											player.isFlying()); | ||||||
|  |  | ||||||
| 									W.pData.put(player, pad); | 									W.pData.put(player, pad); | ||||||
|  |  | ||||||
| @@ -117,6 +118,7 @@ public class ArenaHandler { | |||||||
| 											new ItemStack(Material.AIR)); | 											new ItemStack(Material.AIR)); | ||||||
| 									player.getInventory().setBoots( | 									player.getInventory().setBoots( | ||||||
| 											new ItemStack(Material.AIR)); | 											new ItemStack(Material.AIR)); | ||||||
|  | 									player.setFlying(false); | ||||||
|  |  | ||||||
| 									if ((Boolean) W.config | 									if ((Boolean) W.config | ||||||
| 											.get(ConfigC.shop_blockChooserEnabled) == true) { | 											.get(ConfigC.shop_blockChooserEnabled) == true) { | ||||||
| @@ -257,7 +259,7 @@ public class ArenaHandler { | |||||||
| 			} | 			} | ||||||
|  |  | ||||||
| 			PlayerArenaData pad = new PlayerArenaData(null, null, null, null, | 			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) { | 			if (W.pData.get(player) != null) { | ||||||
| 				pad = W.pData.get(player); | 				pad = W.pData.get(player); | ||||||
| @@ -274,6 +276,7 @@ public class ArenaHandler { | |||||||
| 			player.addPotionEffects(pad.pPotionEffects); | 			player.addPotionEffects(pad.pPotionEffects); | ||||||
| 			player.teleport(pad.pLocation); | 			player.teleport(pad.pLocation); | ||||||
| 			player.setGameMode(pad.pGameMode); | 			player.setGameMode(pad.pGameMode); | ||||||
|  | 			player.setFlying(pad.pFlying); | ||||||
|  |  | ||||||
| 			W.pData.remove(player); | 			W.pData.remove(player); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -17,11 +17,12 @@ public class PlayerArenaData { | |||||||
| 	public Double pHealth; | 	public Double pHealth; | ||||||
| 	public Integer pFood; | 	public Integer pFood; | ||||||
| 	public Collection<PotionEffect> pPotionEffects; | 	public Collection<PotionEffect> pPotionEffects; | ||||||
|  | 	public boolean pFlying; | ||||||
|  |  | ||||||
| 	public PlayerArenaData (Location pLocation, GameMode pGameMode, | 	public PlayerArenaData (Location pLocation, GameMode pGameMode, | ||||||
| 			ItemStack[] pInventory, ItemStack[] pArmor, Float pEXP, | 			ItemStack[] pInventory, ItemStack[] pArmor, Float pEXP, | ||||||
| 			Integer pEXPL, Double pHealth, Integer pFood, | 			Integer pEXPL, Double pHealth, Integer pFood, | ||||||
| 			Collection<PotionEffect> pPotionEffects) { | 			Collection<PotionEffect> pPotionEffects, boolean pFlying) { | ||||||
| 		this.pLocation = pLocation; | 		this.pLocation = pLocation; | ||||||
| 		this.pGameMode = pGameMode; | 		this.pGameMode = pGameMode; | ||||||
| 		this.pInventory = pInventory; | 		this.pInventory = pInventory; | ||||||
| @@ -31,5 +32,6 @@ public class PlayerArenaData { | |||||||
| 		this.pHealth = pHealth; | 		this.pHealth = pHealth; | ||||||
| 		this.pFood = pFood; | 		this.pFood = pFood; | ||||||
| 		this.pPotionEffects = pPotionEffects; | 		this.pPotionEffects = pPotionEffects; | ||||||
|  | 		this.pFlying = pFlying; | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 
				 Steffion
					Steffion