12
1

Merge pull request 'TPS Warp' (#402) from tpswarp into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Reviewed-on: #402
Reviewed-by: YoyoNow <jwsteam@nidido.de>
Dieser Commit ist enthalten in:
Lixfel 2023-10-11 13:34:26 +02:00
Commit 256239c557
5 geänderte Dateien mit 61 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -156,6 +156,7 @@ public class FightSystem extends JavaPlugin {
new LockschemCommand();
new StateCommand();
new SkipCommand();
new TPSWarpCommand();
new UnrankCommand();
new WinCommand();

Datei anzeigen

@ -51,6 +51,9 @@ INFO_RANKED=§7Ranked§8: §e{0}
INFO_LEADER=§7Leader {0}§8: {1}
INFO_SCHEMATIC=§7Schematic {0}§8: §e{1} §7from {2}, Rank: {3}
TPSWARP_HELP=§8/§7tpswarp §8[§eticks per second§8]
TPSWARP_SET=§7TPS set to §e{0}
# GUI
STATE_TITLE=Fight state

Datei anzeigen

@ -45,6 +45,9 @@ REMOVE_HELP=§8/§eremove §8[§eSpieler§8]
NOT_FIGHTLEADER=§cDu bist nicht Kampfleiter
WIN_HELP=§8/§7win §8[§eTeam §8oder §etie§8]
TPSWARP_HELP=§8/§7tpswarp §8[§eTicks pro Sekunde§8]
TPSWARP_SET=§7TPS auf §e{0} §7gesetzt
# GUI
STATE_TITLE=Kampfstatus

Datei anzeigen

@ -0,0 +1,52 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2023 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 <https://www.gnu.org/licenses/>.
*/
package de.steamwar.fightsystem.commands;
import de.steamwar.core.TPSWarpUtils;
import de.steamwar.fightsystem.ArenaMode;
import de.steamwar.fightsystem.FightSystem;
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;
public class TPSWarpCommand implements CommandExecutor {
public TPSWarpCommand() {
new StateDependentCommand(ArenaMode.Prepare, FightState.PostSchemSetup, "tpswarp", this);
new StateDependentCommand(ArenaMode.Prepare, FightState.PostSchemSetup, "tpslimit", this);
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
double tps;
try {
tps = Double.parseDouble(args[0]);
} catch (NumberFormatException | ArrayIndexOutOfBoundsException e) {
FightSystem.getMessage().send("TPSWARP_HELP", sender);
return false;
}
TPSWarpUtils.warp(tps);
FightSystem.getMessage().broadcastActionbar("TPSWARP_SET", tps);
return false;
}
}

Datei anzeigen

@ -26,4 +26,6 @@ commands:
win:
resetwg:
resettb:
tpslimit:
tpswarp:
unrank: