Fix Skywars eating/bowing/whatevering bug

This commit is contained in:
samczsun 2017-01-19 21:24:50 -05:00
parent 5ca9b79333
commit 7290b83466
2 changed files with 6 additions and 4 deletions

View File

@ -1014,14 +1014,15 @@ public abstract class Skyfall extends Game
if (System.currentTimeMillis() > _disabledElytras.get(player.getUniqueId())) if (System.currentTimeMillis() > _disabledElytras.get(player.getUniqueId()))
{ {
player.getInventory().setChestplate(new ItemStack(Material.ELYTRA)); player.getInventory().setChestplate(new ItemStack(Material.ELYTRA));
_disabledElytras.remove(player.getUniqueId());
} }
else else
{ {
if (player.getInventory().getChestplate() != null) if (player.getInventory().getChestplate() != null)
{ {
UtilPlayer.message(player, F.main("Game", C.cRed + "Your Elytra is disabled!")); UtilPlayer.message(player, F.main("Game", C.cRed + "Your Elytra is disabled!"));
player.getInventory().setChestplate(null);
} }
player.getInventory().setChestplate(null);
} }
} }
} }

View File

@ -22,7 +22,7 @@ import nautilus.game.arcade.kit.Perk;
* Perk that removes attacked * Perk that removes attacked
* Players Elytra for the * Players Elytra for the
* specified amount of * specified amount of
* tim ein milliseconds. * time in milliseconds.
* *
* @author xXVevzZXx * @author xXVevzZXx
*/ */
@ -50,7 +50,7 @@ public class PerkRemoveElytra extends Perk
} }
@EventHandler @EventHandler
public void stunnEnemy(CustomDamageEvent event) public void stunEnemy(CustomDamageEvent event)
{ {
if (Manager.GetGame() == null) if (Manager.GetGame() == null)
return; return;
@ -83,14 +83,15 @@ public class PerkRemoveElytra extends Perk
if (System.currentTimeMillis() > _disabled.get(player.getUniqueId())) if (System.currentTimeMillis() > _disabled.get(player.getUniqueId()))
{ {
player.getInventory().setChestplate(new ItemStack(Material.ELYTRA)); player.getInventory().setChestplate(new ItemStack(Material.ELYTRA));
_disabled.remove(player.getUniqueId());
} }
else else
{ {
if (player.getInventory().getChestplate() != null) if (player.getInventory().getChestplate() != null)
{ {
UtilPlayer.message(player, F.main("Game", C.cRed + "Your Elytra is disabled!")); UtilPlayer.message(player, F.main("Game", C.cRed + "Your Elytra is disabled!"));
player.getInventory().setChestplate(null);
} }
player.getInventory().setChestplate(null);
} }
} }
} }