From 72d3d0314b9a033839479d0581acde8a165a6fe1 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sat, 11 Jul 2020 07:53:04 +0200 Subject: [PATCH] Fixing fire arrow bug and kit gui bug Signed-off-by: Lixfel --- FightSystem_Main/src/de/steamwar/fightsystem/kit/Kit.java | 3 +-- .../fightsystem/listener/InFightDamageListener.java | 6 ++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/kit/Kit.java b/FightSystem_Main/src/de/steamwar/fightsystem/kit/Kit.java index fda2c5d..9ab9a64 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/kit/Kit.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/kit/Kit.java @@ -145,8 +145,7 @@ public class Kit { } } - inv.setCallback(-999, (click) -> GUI.kitSelection(player)); - inv.addCloseCallback((click) -> GUI.kitSelection(player)); + inv.setCallback(-999, (click) -> player.closeInventory()); inv.setItem(45, SWItem.getDye(10), (byte)10, "§aKit wählen", (click) -> { Commands.kit(player, name); player.closeInventory(); diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/listener/InFightDamageListener.java b/FightSystem_Main/src/de/steamwar/fightsystem/listener/InFightDamageListener.java index 9bf5239..f24f88b 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/listener/InFightDamageListener.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/listener/InFightDamageListener.java @@ -44,8 +44,6 @@ public class InFightDamageListener extends BasicListener { //Shooter is not a player return; - damagerArrow.setFireTicks(0); - player.setFireTicks(0); damager = (Player) damagerArrow.getShooter(); }else{ //Damager is not a player @@ -60,6 +58,10 @@ public class InFightDamageListener extends BasicListener { if(Fight.getPlayerTeam(player) == Fight.getPlayerTeam(damager)) { event.setCancelled(true); + if(event.getDamager() instanceof Arrow){ + event.getDamager().setFireTicks(0); + player.setFireTicks(0); + } toActionbar(damager, TextComponent.fromLegacyText("§cDu darfst deinen Teamkollegen keinen Schaden zufügen!")); }