From 328c4c14f2c3dfaeae3428c9e483938b57d8e34e Mon Sep 17 00:00:00 2001 From: Yaruma3341 Date: Tue, 19 Feb 2019 21:32:04 +0100 Subject: [PATCH] Fixed Issue #21 Replace Falsche Verwendung Signed-off-by: Yaruma3341 --- src/me/yaruma/fightsystem/fight/FightTeam.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/me/yaruma/fightsystem/fight/FightTeam.java b/src/me/yaruma/fightsystem/fight/FightTeam.java index ab52244..1da349d 100644 --- a/src/me/yaruma/fightsystem/fight/FightTeam.java +++ b/src/me/yaruma/fightsystem/fight/FightTeam.java @@ -137,24 +137,26 @@ public class FightTeam { FightTeam fightTeam = Fight.getPlayerTeam(this.leader.getPlayer()); + FightSystem instance = FightSystem.getPlugin(); + if(this.ready == true) { fightTeam.getLeader().getPlayer().getInventory().setItem(3, new ItemBuilder(Material.INK_SACK, (short) 8).removeAllAtributs().addEnchantment(Enchantment.DURABILITY,1 ).setDisplayName("§aBereit").build()); broadcast(FightSystem.PREFIX + "§aEuer Team ist nun bereit!"); if(Fight.getOpposite(fightTeam).isReady()) { - FightSystem.getPlugin().setPreRunningState(); - int time = FightSystem.getPlugin().getFileManager().getIntegerFromConfig("Times.PreFightDuration"); + instance.setPreRunningState(); + int time = instance.getFileManager().getIntegerFromConfig("Times.PreFightDuration"); Countdown countdown = new Countdown(time, new FinishPreRunning()); - countdown.startTimer(FightSystem.getPlugin()); + countdown.startTimer(instance); for(FightPlayer allFightPlayers : fightTeam.getPlayers()) { allFightPlayers.getPlayer().getInventory().clear(); } for(FightPlayer allFightPlayers : Fight.getOpposite(fightTeam).getPlayers()) { allFightPlayers.getPlayer().getInventory().clear(); } - FightSystem.getPlugin().getFightManager().teleportAllToFightSpawn(); - WorldEdit.replace(fightTeam.getLeader().getPlayer(), FightSystem.getPlugin().getTeam1cornerX(), FightSystem.getPlugin().getTeam1cornerY(), FightSystem.getPlugin().getTeam1cornerZ(), FightSystem.getPlugin().getSchemsizeX(), FightSystem.getPlugin().getSchemsizeY(), FightSystem.getPlugin().getSchemsizeZ()); - WorldEdit.replace(Fight.getOpposite(fightTeam).getLeader().getPlayer(), FightSystem.getPlugin().getTeam2cornerX(), FightSystem.getPlugin().getTeam2cornerY(), FightSystem.getPlugin().getTeam2cornerZ(), FightSystem.getPlugin().getSchemsizeX(), FightSystem.getPlugin().getSchemsizeY(), FightSystem.getPlugin().getSchemsizeZ()); + instance.getFightManager().teleportAllToFightSpawn(); + WorldEdit.replace(fightTeam.getLeader().getPlayer(), instance.getTeam1cornerX(), instance.getTeam1cornerY(), instance.getTeam1cornerZ(), instance.getTeam1cornerX() + instance.getSchemsizeX(), instance.getTeam1cornerY() + instance.getSchemsizeY(), instance.getTeam1cornerZ() + instance.getSchemsizeZ()); + WorldEdit.replace(Fight.getOpposite(fightTeam).getLeader().getPlayer(), instance.getTeam2cornerX(), instance.getTeam2cornerY(), instance.getTeam2cornerZ(), instance.getTeam2cornerX() + instance.getSchemsizeX(), instance.getTeam2cornerY() + instance.getSchemsizeY(), instance.getTeam2cornerZ() + instance.getSchemsizeZ()); } } else { fightTeam.getLeader().getPlayer().getInventory().setItem(3, new ItemBuilder(Material.INK_SACK, (short) 10).removeAllAtributs().addEnchantment(Enchantment.DURABILITY, 1).setDisplayName("§cNicht bereit").build());