From d9b6c124eba88453d1c48ba0f5836c0dd3e10b0b Mon Sep 17 00:00:00 2001 From: Yaruma3341 Date: Sat, 13 Apr 2019 18:00:23 +0200 Subject: [PATCH] added new command; hotfixes; Signed-off-by: Yaruma3341 --- src/me/yaruma/fightsystem/commands/AkCommand.java | 15 ++++++++++++++- src/me/yaruma/fightsystem/fight/FightTeam.java | 10 +++++----- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/me/yaruma/fightsystem/commands/AkCommand.java b/src/me/yaruma/fightsystem/commands/AkCommand.java index b3310d8..94ec98c 100644 --- a/src/me/yaruma/fightsystem/commands/AkCommand.java +++ b/src/me/yaruma/fightsystem/commands/AkCommand.java @@ -104,7 +104,7 @@ public class AkCommand implements CommandExecutor { if(fightPlayer.isLeader() && fightTeam.isPlayerInTeam(target)){ fightTeam.removePlayer(target); player.sendMessage(FightSystem.PREFIX + "§aDu hast den Spieler §6" + target.getName() + " §aaus dem Team entfernt!"); - target.sendMessage(FightSystem.PREFIX + "§cDu wurdest auf deinem Team entfernt!"); + target.sendMessage(FightSystem.PREFIX + "§cDu wurdest aus deinem Team entfernt!"); } } } @@ -168,6 +168,19 @@ public class AkCommand implements CommandExecutor { return false; } KitManager.saveInventory(args[1], player); + } else if(args[0].equalsIgnoreCase("schemlist") && FightSystem.getPlugin().getFightState() == FightState.SETUP) { + try { + FightTeam fightTeam = Fight.getPlayerTeam(player); + if(fightTeam != null) { + if(fightTeam.getFightPlayer(player).isLeader()) { + Fight.getPlayerTeam(player).sendPlayerSchematicList(Integer.parseInt(args[1]), 15, player, Config.SchematicType); + return false; + } + } + } catch (NumberFormatException ex) { + player.sendMessage(FightSystem.PREFIX + "§cDu musst eine Seitenzahl angeben!"); + return false; + } } }else{ sendHelp(player); diff --git a/src/me/yaruma/fightsystem/fight/FightTeam.java b/src/me/yaruma/fightsystem/fight/FightTeam.java index 26e342c..d13a3fd 100644 --- a/src/me/yaruma/fightsystem/fight/FightTeam.java +++ b/src/me/yaruma/fightsystem/fight/FightTeam.java @@ -245,7 +245,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, "/schem info " + schematic.getSchemName())); + schematics.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/ak schem " + schematic.getSchemName())); player.spigot().sendMessage(schematics); } @@ -256,24 +256,24 @@ public class FightTeam { TextComponent nextPage = new TextComponent("Nächste Seite >>"); nextPage.setColor(ChatColor.RED); nextPage.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("§6Nächste Seite...").create())); - nextPage.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/schem list 1")); + nextPage.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/ak schemlist 1")); player.spigot().sendMessage(nextPage); } else if((currPage + 1) == pages) { TextComponent beforePage = new TextComponent("<< Vorherige Seite"); beforePage.setColor(ChatColor.RED); beforePage.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("§6Vorherige Seite...").create())); - beforePage.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/schem list " + (currPage - 1))); + beforePage.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/ak schemlist " + (currPage - 1))); player.spigot().sendMessage(beforePage); } else { TextComponent beforePage = new TextComponent("<< Seite "); beforePage.setColor(ChatColor.RED); beforePage.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("§6Vorherige Seite...").create())); - beforePage.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/schem list " + (currPage - 1))); + beforePage.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/ak schemlist " + (currPage - 1))); TextComponent nextPage = new TextComponent(">>"); nextPage.setColor(ChatColor.RED); nextPage.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("§6Nächste Seite...").create())); - nextPage.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/schem list " + (currPage + 1))); + nextPage.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/ak schemlist " + (currPage + 1))); beforePage.addExtra(nextPage); player.spigot().sendMessage(beforePage);