From 99d3986617e2995e6a660fbe267dcb359de42562 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Wed, 19 Jan 2022 17:41:12 +0100 Subject: [PATCH 1/3] Add better checking for supporter --- .../de/steamwar/fightsystem/FightSystem.java | 2 + .../fightsystem/commands/TBCommand.java | 45 +++++++++++++++++++ .../fightsystem/commands/WGCommand.java | 45 +++++++++++++++++++ .../steamwar/fightsystem/fight/FightTeam.java | 6 +++ 4 files changed, 98 insertions(+) create mode 100644 FightSystem_Core/src/de/steamwar/fightsystem/commands/TBCommand.java create mode 100644 FightSystem_Core/src/de/steamwar/fightsystem/commands/WGCommand.java diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.java b/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.java index e3fd6d9..46680a7 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.java @@ -121,6 +121,8 @@ public class FightSystem extends JavaPlugin { new KitCommand(); new RemoveCommand(); new AcceptCommand(); + new WGCommand(); + new TBCommand(); new DeclineCommand(); new GamemodeCommand(); new InviteCommand(); diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/commands/TBCommand.java b/FightSystem_Core/src/de/steamwar/fightsystem/commands/TBCommand.java new file mode 100644 index 0000000..d024e4f --- /dev/null +++ b/FightSystem_Core/src/de/steamwar/fightsystem/commands/TBCommand.java @@ -0,0 +1,45 @@ +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2020 SteamWar.de-Serverteam + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package de.steamwar.fightsystem.commands; + +import de.steamwar.fightsystem.ArenaMode; +import de.steamwar.fightsystem.fight.Fight; +import de.steamwar.fightsystem.states.FightState; +import de.steamwar.fightsystem.states.StateDependentCommand; +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +public class TBCommand implements CommandExecutor { + + public TBCommand() { + new StateDependentCommand(ArenaMode.Check, FightState.All, "tb", this); + } + + @Override + public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + if(!(sender instanceof Player)) { + return false; + } + Fight.getRedTeam().pasteSchem(); + return false; + } +} diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/commands/WGCommand.java b/FightSystem_Core/src/de/steamwar/fightsystem/commands/WGCommand.java new file mode 100644 index 0000000..e145391 --- /dev/null +++ b/FightSystem_Core/src/de/steamwar/fightsystem/commands/WGCommand.java @@ -0,0 +1,45 @@ +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2020 SteamWar.de-Serverteam + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package de.steamwar.fightsystem.commands; + +import de.steamwar.fightsystem.ArenaMode; +import de.steamwar.fightsystem.fight.Fight; +import de.steamwar.fightsystem.states.FightState; +import de.steamwar.fightsystem.states.StateDependentCommand; +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +public class WGCommand implements CommandExecutor { + + public WGCommand() { + new StateDependentCommand(ArenaMode.VariableTeams, FightState.Setup, "wg", this); + } + + @Override + public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + if(!(sender instanceof Player)) { + return false; + } + Fight.getBlueTeam().pasteSchem(); + return false; + } +} diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/fight/FightTeam.java b/FightSystem_Core/src/de/steamwar/fightsystem/fight/FightTeam.java index f88a616..fdf5325 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/fight/FightTeam.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/fight/FightTeam.java @@ -321,6 +321,12 @@ public class FightTeam { return ready; } + public void pasteSchem() { + if (this.schematic.hasSchematic()) { + testPasteAction(); + } + } + public void pasteSchem(SchematicNode schematic){ setSchem(schematic); testPasteAction(); -- 2.39.2 From ba9bf22f970370621684d0d4a1d145d62a001655 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Wed, 19 Jan 2022 18:15:36 +0100 Subject: [PATCH 2/3] Update stuff --- .../src/de/steamwar/fightsystem/commands/TBCommand.java | 2 +- .../src/de/steamwar/fightsystem/commands/WGCommand.java | 2 +- .../src/de/steamwar/fightsystem/fight/FightTeam.java | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/commands/TBCommand.java b/FightSystem_Core/src/de/steamwar/fightsystem/commands/TBCommand.java index d024e4f..fa18262 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/commands/TBCommand.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/commands/TBCommand.java @@ -31,7 +31,7 @@ import org.bukkit.entity.Player; public class TBCommand implements CommandExecutor { public TBCommand() { - new StateDependentCommand(ArenaMode.Check, FightState.All, "tb", this); + new StateDependentCommand(ArenaMode.Check, FightState.All, "resettb", this); } @Override diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/commands/WGCommand.java b/FightSystem_Core/src/de/steamwar/fightsystem/commands/WGCommand.java index e145391..edb891f 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/commands/WGCommand.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/commands/WGCommand.java @@ -31,7 +31,7 @@ import org.bukkit.entity.Player; public class WGCommand implements CommandExecutor { public WGCommand() { - new StateDependentCommand(ArenaMode.VariableTeams, FightState.Setup, "wg", this); + new StateDependentCommand(ArenaMode.Check, FightState.All, "resetwg", this); } @Override diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/fight/FightTeam.java b/FightSystem_Core/src/de/steamwar/fightsystem/fight/FightTeam.java index fdf5325..d1e888f 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/fight/FightTeam.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/fight/FightTeam.java @@ -322,9 +322,7 @@ public class FightTeam { } public void pasteSchem() { - if (this.schematic.hasSchematic()) { - testPasteAction(); - } + testPasteAction(); } public void pasteSchem(SchematicNode schematic){ -- 2.39.2 From 0a45959e016670a9e56c1f435d32a9e1cf8a164c Mon Sep 17 00:00:00 2001 From: yoyosource Date: Thu, 20 Jan 2022 08:14:15 +0100 Subject: [PATCH 3/3] Update stuff --- FightSystem_Core/src/plugin.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/FightSystem_Core/src/plugin.yml b/FightSystem_Core/src/plugin.yml index 0013293..74e8510 100644 --- a/FightSystem_Core/src/plugin.yml +++ b/FightSystem_Core/src/plugin.yml @@ -21,4 +21,6 @@ commands: lockreplay: state: skip: - win: \ No newline at end of file + win: + resetwg: + resettb: \ No newline at end of file -- 2.39.2