diff --git a/src/me/yaruma/fightsystem/commands/AkCommand.java b/src/me/yaruma/fightsystem/commands/AkCommand.java index ef68961..2e90727 100644 --- a/src/me/yaruma/fightsystem/commands/AkCommand.java +++ b/src/me/yaruma/fightsystem/commands/AkCommand.java @@ -159,31 +159,6 @@ public class AkCommand implements CommandExecutor { Fight.getFightPlayer(player).setKit(kit); player.sendMessage(FightSystem.PREFIX + "§aDu hast nun das Kit §6" + args[1] + "§a!"); - } else if(args[0].equalsIgnoreCase("schem")) { - FightTeam fightTeam = Fight.getPlayerTeam(player); - if(fightTeam == null) { - player.sendMessage(FightSystem.PREFIX + "§cDu bist in keinem Team!"); - return false; - }else if(fightTeam.hasSchematic()) { - player.sendMessage(FightSystem.PREFIX + "§cDie Schematic ist bereits gewählt!"); - return false; - } - - Schematic schem = Schematic.getSchemFromDB(args[1], player.getUniqueId()); - if(schem == null) { - schem = Schematic.getSchemFromDB(args[1], 0); - if(schem == null){ - player.sendMessage(FightSystem.PREFIX + "§cDiese Schematic gibt es nicht!"); - return false; - } - } - if(schem.getSchemType() != Config.SchematicType) { - player.sendMessage(FightSystem.PREFIX + "§cDiese Schematic ist kein " + Config.GameName); - return false; - } - - fightTeam.setSchematic(schem); - Fight.getPlayerTeam(player).broadcast(FightSystem.PREFIX + "Schematic §6" + args[1] + " §8wird für den Kampf verwendet!"); } else if(args[0].equalsIgnoreCase("addkit")){ if(WarkingUser.get(player.getUniqueId()).getUserGroup() != UserGroup.Developer){ sendHelp(player); @@ -214,7 +189,42 @@ public class AkCommand implements CommandExecutor { return false; } } - }else{ + }else if(args.length == 3) { + if(args[0].equalsIgnoreCase("schem")) { + FightTeam fightTeam = Fight.getPlayerTeam(player); + if(fightTeam == null) { + player.sendMessage(FightSystem.PREFIX + "§cDu bist in keinem Team!"); + return false; + }else if(fightTeam.hasSchematic()) { + player.sendMessage(FightSystem.PREFIX + "§cDie Schematic ist bereits gewählt!"); + return false; + } + + Schematic schem; + if(args[2].equalsIgnoreCase("public")) { + schem = Schematic.getSchemFromDB(args[1], WarkingUser.get(0).getUUID()); + } else if(args[2].equalsIgnoreCase("private")) { + schem = Schematic.getSchemFromDB(args[1], player.getUniqueId()); + } else + return false; + + + if(schem == null) { + schem = Schematic.getSchemFromDB(args[1], 0); + if(schem == null){ + player.sendMessage(FightSystem.PREFIX + "§cDiese Schematic gibt es nicht!"); + return false; + } + } + if(schem.getSchemType() != Config.SchematicType) { + player.sendMessage(FightSystem.PREFIX + "§cDiese Schematic ist kein " + Config.GameName); + return false; + } + + fightTeam.setSchematic(schem); + Fight.getPlayerTeam(player).broadcast(FightSystem.PREFIX + "Schematic §6" + args[1] + " §8wird für den Kampf verwendet!"); + } + } else { sendHelp(player); } return false; diff --git a/src/me/yaruma/fightsystem/fight/FightTeam.java b/src/me/yaruma/fightsystem/fight/FightTeam.java index fdee6b0..83291c0 100644 --- a/src/me/yaruma/fightsystem/fight/FightTeam.java +++ b/src/me/yaruma/fightsystem/fight/FightTeam.java @@ -254,7 +254,7 @@ public class FightTeam { schematics.setBold(true); schematics.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("Schematic benutzen...").create())); - schematics.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/ak schem " + schematic.getSchemName())); + schematics.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/ak schem " + schematic.getSchemName() + (publicSchematics ? " public" : " private"))); player.spigot().sendMessage(schematics); } diff --git a/src/me/yaruma/fightsystem/listener/PlayerMoveListener.java b/src/me/yaruma/fightsystem/listener/PlayerMoveListener.java index 058947b..c61864d 100644 --- a/src/me/yaruma/fightsystem/listener/PlayerMoveListener.java +++ b/src/me/yaruma/fightsystem/listener/PlayerMoveListener.java @@ -31,7 +31,7 @@ public class PlayerMoveListener implements Listener { } //Check under Arena - if(to.getBlockY() <= Config.underArenaBorder) { + if(to.getY() <= Config.underArenaBorder) { if(fightTeam == null){ player.teleport(from); player.sendMessage(FightSystem.PREFIX + "§cDu darfst die Arena nicht verlassen!"); diff --git a/src/me/yaruma/fightsystem/winconditions/WinconditionTechKO.java b/src/me/yaruma/fightsystem/winconditions/WinconditionTechKO.java index 0f71e3c..578b38e 100644 --- a/src/me/yaruma/fightsystem/winconditions/WinconditionTechKO.java +++ b/src/me/yaruma/fightsystem/winconditions/WinconditionTechKO.java @@ -71,8 +71,6 @@ public class WinconditionTechKO { FightSystem.getPlugin().setSpectateState(Fight.getRedTeam()); FightSystem.getPlugin().getWaterRemover().stop(); } - Bukkit.broadcastMessage("RedList: " + teamRedWater.size()); - Bukkit.broadcastMessage("BlueList: " + teamBlueWater.size()); } public static void removeWater() { @@ -83,7 +81,6 @@ public class WinconditionTechKO { Location location = (Location) itrRed.next(); if(location.getBlock().getType() != Material.WATER && location.getBlock().getType() != Material.STATIONARY_WATER) { itrRed.remove(); - Bukkit.broadcastMessage("red remove" + teamRedWater.size()); } } if(teamRedWater.isEmpty()) { @@ -99,7 +96,6 @@ public class WinconditionTechKO { Location location = (Location) itrBlue.next(); if(location.getBlock().getType() != Material.WATER && location.getBlock().getType() != Material.STATIONARY_WATER) { itrBlue.remove(); - Bukkit.broadcastMessage("blue remove" + teamBlueWater.size()); } } if(teamBlueWater.isEmpty()) {