Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
5897b1da75
Commit
213667541c
@ -857,12 +857,7 @@ REGION_TNT_OFF=§cTNT-Damage deactivated
|
||||
REGION_TNT_TB=§aTNT-Damage activated outside the building area
|
||||
REGION_TNT_NO_PERMS=§cYou are not allowed to toggle tnt damage here
|
||||
REGION_TNT_BUILD=§cAn explosion would have destroyed blocks in the building area
|
||||
# Team
|
||||
LOCK_SCHEM_NO_USER=§7This player does not exist!
|
||||
LOCK_SCHEM_NO_SCHEM=§7This player does not have a schem with that name!
|
||||
LOCK_SCHEM_DIR=§7The given schem is a directory
|
||||
LOCK_SCHEM_LOCKED=§e{0} §7by §e{1} §7was reset from §e{2} §7to §eNORMAL §7.
|
||||
LOCK_SCHEM_HELP=§8/§eschemlock §8[§7Owner§8] [§7Schematic§8] - §7Lock a schematic (Notify user about locking reason!)
|
||||
|
||||
AFK_KICK_MESSAGE=§cNothing happened on this server for 5 minutes.
|
||||
AFK_WARNING_MESSAGE=§cThis server will stop in one minute if you remain inactive
|
||||
|
||||
|
@ -820,12 +820,6 @@ REGION_TNT_OFF=§cTNT-Schaden deaktiviert
|
||||
REGION_TNT_TB=§aTNT-Schaden außerhalb Baurahmen aktiviert
|
||||
REGION_TNT_NO_PERMS=§cDu darfst hier nicht TNT-Schaden (de-)aktivieren
|
||||
REGION_TNT_BUILD=§cEine Explosion hätte Blöcke im Baubereich zerstört
|
||||
# Team
|
||||
LOCK_SCHEM_NO_USER=§7Dieser Spieler existiert nicht!
|
||||
LOCK_SCHEM_NO_SCHEM=§7Dieser Spieler besitzt keine Schematic mit diesem Namen!
|
||||
LOCK_SCHEM_DIR=§7Die angegebene Schematic ist ein Ordner
|
||||
LOCK_SCHEM_LOCKED=§e{0} §7von §e{1} §7wurde von §e{2} §7auf §eNORMAL §7zurück gesetzt.
|
||||
LOCK_SCHEM_HELP=§8/§eschemlock §8[§7Owner§8] [§7Schematic§8] - §7Sperre eine Schematic (Nutzer über Sperrungsgrund informieren!)
|
||||
AFK_KICK_MESSAGE=§cAuf diesem Server ist seit 5 Minuten nichts passiert.
|
||||
AFK_WARNING_MESSAGE=§cDieser Server wird bei weiterer Inaktivität in einer Minute gestoppt
|
||||
|
||||
|
@ -1,89 +0,0 @@
|
||||
/*
|
||||
* This file is a part of the SteamWar software.
|
||||
*
|
||||
* Copyright (C) 2021 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.team;
|
||||
|
||||
import de.steamwar.bausystem.BauSystem;
|
||||
import de.steamwar.command.SWCommand;
|
||||
import de.steamwar.linkage.Linked;
|
||||
import de.steamwar.sql.SchematicNode;
|
||||
import de.steamwar.sql.SchematicType;
|
||||
import de.steamwar.sql.SteamwarUser;
|
||||
import de.steamwar.sql.UserGroup;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@Linked
|
||||
public class LockSchemCommand extends SWCommand {
|
||||
|
||||
public LockSchemCommand() {
|
||||
super("lockschem", "schemlock");
|
||||
}
|
||||
|
||||
@Register(help = true)
|
||||
public void genericHelp(Player p, String... args) {
|
||||
SteamwarUser steamwarUser = SteamwarUser.get(p.getUniqueId());
|
||||
UserGroup userGroup = steamwarUser.getUserGroup();
|
||||
|
||||
if (userGroup != UserGroup.Admin &&
|
||||
userGroup != UserGroup.Developer &&
|
||||
userGroup != UserGroup.Moderator &&
|
||||
userGroup != UserGroup.Supporter) {
|
||||
return;
|
||||
}
|
||||
|
||||
sendHelp(p);
|
||||
}
|
||||
|
||||
@Register
|
||||
public void genericCommand(Player p, String owner, String schematicName) {
|
||||
SteamwarUser steamwarUser = SteamwarUser.get(p.getUniqueId());
|
||||
UserGroup userGroup = steamwarUser.getUserGroup();
|
||||
|
||||
if (userGroup != UserGroup.Admin &&
|
||||
userGroup != UserGroup.Developer &&
|
||||
userGroup != UserGroup.Moderator &&
|
||||
userGroup != UserGroup.Supporter) {
|
||||
return;
|
||||
}
|
||||
|
||||
SteamwarUser schemOwner = SteamwarUser.get(owner);
|
||||
if (schemOwner == null) {
|
||||
BauSystem.MESSAGE.send("LOCK_SCHEM_NO_USER", p);
|
||||
return;
|
||||
}
|
||||
SchematicNode schematic = SchematicNode.getNodeFromPath(schemOwner, schematicName);
|
||||
if (schematic == null) {
|
||||
BauSystem.MESSAGE.send("LOCK_SCHEM_NO_SCHEM", p);
|
||||
return;
|
||||
}
|
||||
|
||||
if(schematic.isDir()) {
|
||||
BauSystem.MESSAGE.send("LOCK_SCHEM_DIR", p);
|
||||
return;
|
||||
}
|
||||
|
||||
BauSystem.MESSAGE.send("LOCK_SCHEM_LOCKED", p, schematic.getName(), schemOwner.getUserName(), schematic.getSchemtype().name());
|
||||
schematic.setSchemtype(SchematicType.Normal);
|
||||
}
|
||||
|
||||
private void sendHelp(Player player) {
|
||||
BauSystem.MESSAGE.sendPrefixless("COMMAND_HELP_HEAD", player, "Lock Schem");
|
||||
BauSystem.MESSAGE.sendPrefixless("LOCK_SCHEM_HELP", player);
|
||||
}
|
||||
}
|
In neuem Issue referenzieren
Einen Benutzer sperren