SteamWar/BauSystem2.0
Archiviert
12
0

Add KickallCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2022-09-13 21:03:02 +02:00
Ursprung 89f1971106
Commit e4ba3249d7
3 geänderte Dateien mit 60 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -1289,6 +1289,9 @@ STOP_NO_PERMS = §cYou do not have the permission to stop the server
STOP_MESSAGE = §eServer is stopping
WORLD_EDIT_NO_PERMS = §cYou do not have the permission to use WorldEdit
KICKALL_HELP = §8/§ekickall §8- §7Kick all players from the server except the owner
KICKALL_NO_PERM = §cThis is not your world!
# Techhider
TECHHIDER_HELP = §8/§etechhider §8- §7Toggle Techhider
TECHHIDER_GLOBAL = §cNo techhider in global region
@ -1304,7 +1307,5 @@ XRAY_OFF = §cXray deactivated
# WorldEdit
COLORREPLACE_HELP = §8//§ecolorreplace §8[§7color§8] §8[§7color§8] §8- §7Replace all blocks of one color with another
COLORREPLACE_NO_PERMS = §cYou do not have the permission to use this command
TYPEREPLACE_HELP = §8//§etyreplace §8[§7type§8] §8[§7type§8] §8- §7Replace all blocks of one type with another
TYPEREPLACE_NO_PERMS = §cYou do not have the permission to use this command

Datei anzeigen

@ -1267,6 +1267,9 @@ STOP_NO_PERMS = §cDu hast keine Rechte den Server zu stoppen
STOP_MESSAGE = §eDer Server wird gestoppt
WORLD_EDIT_NO_PERMS = §cDu darfst hier kein WorldEdit benutzen
KICKALL_HELP = §8/§ekickall §8- §7Kickt alle Spieler vom Server außer den Owner
KICKALL_NO_PERM = §cDies ist nicht deine Welt!
# Techhider
TECHHIDER_HELP = §8/§etechhider §8- §7Techhider umschalten
TECHHIDER_GLOBAL = §cKein Techhider in der globalen region
@ -1282,7 +1285,5 @@ XRAY_OFF = §cXray deaktiviert
# WorldEdit
COLORREPLACE_HELP = §8//§ecolorreplace §8[§7color§8] §8[§7color§8] §8- §7Ersetzt eine Farbe mit einer anderen
COLORREPLACE_NO_PERMS = §cDu hast keine Rechte um Farben zu ersetzen
TYPEREPLACE_HELP = §8//§etyreplace §8[§7type§8] §8[§7type§8] §8- §7Ersetzt einen Blockgruppe mit einer anderen
TYPEREPLACE_NO_PERMS = §cDu hast keine Rechte um Blockgruppen zu ersetzen

Datei anzeigen

@ -0,0 +1,54 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2022 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.bausystem.features.world;
import de.steamwar.bausystem.config.BauServer;
import de.steamwar.bausystem.linkage.LinkageType;
import de.steamwar.bausystem.linkage.Linked;
import de.steamwar.bausystem.linkage.LinkedInstance;
import de.steamwar.command.SWCommand;
import de.steamwar.command.TypeValidator;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
@Linked(LinkageType.COMMAND)
public class KickallCommand extends SWCommand {
@LinkedInstance
public BauServer bauServer;
public KickallCommand() {
super("/kickall");
}
@Register(description = "KICKALL_HELP")
public void genericCommand(@Validator Player player) {
Bukkit.getOnlinePlayers().forEach(p -> {
if (!bauServer.getOwner().equals(p.getUniqueId())) p.kickPlayer("");
});
}
@ClassValidator(value = Player.class, local = true)
public TypeValidator<Player> validator() {
return (commandSender, player, messageSender) -> {
return !messageSender.send(!bauServer.getOwner().equals(player.getUniqueId()), "KICKALL_NO_PERM");
};
}
}