TPS Warp #402
@ -156,6 +156,7 @@ public class FightSystem extends JavaPlugin {
|
|||||||
new LockschemCommand();
|
new LockschemCommand();
|
||||||
new StateCommand();
|
new StateCommand();
|
||||||
new SkipCommand();
|
new SkipCommand();
|
||||||
|
new TPSWarpCommand();
|
||||||
new UnrankCommand();
|
new UnrankCommand();
|
||||||
new WinCommand();
|
new WinCommand();
|
||||||
|
|
||||||
|
@ -51,6 +51,9 @@ INFO_RANKED=§7Ranked§8: §e{0}
|
|||||||
INFO_LEADER=§7Leader {0}§8: {1}
|
INFO_LEADER=§7Leader {0}§8: {1}
|
||||||
INFO_SCHEMATIC=§7Schematic {0}§8: §e{1} §7from {2}, Rank: {3}
|
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
|
# GUI
|
||||||
STATE_TITLE=Fight state
|
STATE_TITLE=Fight state
|
||||||
|
@ -45,6 +45,9 @@ REMOVE_HELP=§8/§eremove §8[§eSpieler§8]
|
|||||||
NOT_FIGHTLEADER=§cDu bist nicht Kampfleiter
|
NOT_FIGHTLEADER=§cDu bist nicht Kampfleiter
|
||||||
WIN_HELP=§8/§7win §8[§eTeam §8oder §etie§8]
|
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
|
# GUI
|
||||||
STATE_TITLE=Kampfstatus
|
STATE_TITLE=Kampfstatus
|
||||||
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
@ -26,4 +26,6 @@ commands:
|
|||||||
win:
|
win:
|
||||||
resetwg:
|
resetwg:
|
||||||
resettb:
|
resettb:
|
||||||
|
tpslimit:
|
||||||
|
tpswarp:
|
||||||
unrank:
|
unrank:
|
In neuem Issue referenzieren
Einen Benutzer sperren