Add LockSchem Items Multi Lang
Signed-off-by: Chaoscaot <chaoscaot444@gmail.com>
Dieser Commit ist enthalten in:
Ursprung
9141db7686
Commit
dcca5e71c9
@ -441,3 +441,8 @@ REGION_TNT_ON=§aTNT-Schaden aktiviert
|
|||||||
REGION_TNT_OFF=§cTNT-Schaden deaktiviert
|
REGION_TNT_OFF=§cTNT-Schaden deaktiviert
|
||||||
REGION_TNT_TB=§aTNT-Schaden außerhalb Baurahmen aktiviert
|
REGION_TNT_TB=§aTNT-Schaden außerhalb Baurahmen aktiviert
|
||||||
REGION_TNT_BUILD=§cEine Explosion hätte Blöcke im Baubereich zerstört
|
REGION_TNT_BUILD=§cEine Explosion hätte Blöcke im Baubereich zerstört
|
||||||
|
# Team
|
||||||
|
LOCK_SCHEM_NO_USER=Dieser Spieler existiert nicht!
|
||||||
|
LOCK_SCHEM_NO_SCHEM=Dieser Spieler besitzt keine Schematic mit diesem Namen!
|
||||||
|
LOCK_SCHEM_LOCKED=§e{0} §7von §e{1} §7wurde von §e{2} §7auf §eNORMAL §7zurück gesetz. §f§lGrund: §f{3}
|
||||||
|
LOCK_SCHEM_HELP=§8/§eschemlock §8[§7Owner§8] [§7Schematic§8] [§7Grund§8] - §7Sperre eine Schematic
|
@ -20,16 +20,15 @@
|
|||||||
package de.steamwar.bausystem.features.team;
|
package de.steamwar.bausystem.features.team;
|
||||||
|
|
||||||
import de.steamwar.bausystem.BauSystem;
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.bausystem.config.ColorConfig;
|
|
||||||
import de.steamwar.bausystem.linkage.LinkageType;
|
import de.steamwar.bausystem.linkage.LinkageType;
|
||||||
import de.steamwar.bausystem.linkage.Linked;
|
import de.steamwar.bausystem.linkage.Linked;
|
||||||
import de.steamwar.command.SWCommand;
|
import de.steamwar.command.SWCommand;
|
||||||
import de.steamwar.sql.Schematic;
|
import de.steamwar.sql.*;
|
||||||
import de.steamwar.sql.SchematicType;
|
|
||||||
import de.steamwar.sql.SteamwarUser;
|
|
||||||
import de.steamwar.sql.UserGroup;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import java.sql.Timestamp;
|
||||||
|
import java.time.Instant;
|
||||||
|
|
||||||
@Linked(LinkageType.COMMAND)
|
@Linked(LinkageType.COMMAND)
|
||||||
public class LockSchemCommand extends SWCommand {
|
public class LockSchemCommand extends SWCommand {
|
||||||
|
|
||||||
@ -53,7 +52,7 @@ public class LockSchemCommand extends SWCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Register
|
@Register
|
||||||
public void genericCommand(Player p, String owner, String schematicName) {
|
public void genericCommand(Player p, String owner, String schematicName, String... reason) {
|
||||||
SteamwarUser steamwarUser = SteamwarUser.get(p.getUniqueId());
|
SteamwarUser steamwarUser = SteamwarUser.get(p.getUniqueId());
|
||||||
UserGroup userGroup = steamwarUser.getUserGroup();
|
UserGroup userGroup = steamwarUser.getUserGroup();
|
||||||
|
|
||||||
@ -66,21 +65,27 @@ public class LockSchemCommand extends SWCommand {
|
|||||||
|
|
||||||
SteamwarUser schemOwner = SteamwarUser.get(owner);
|
SteamwarUser schemOwner = SteamwarUser.get(owner);
|
||||||
if (schemOwner == null) {
|
if (schemOwner == null) {
|
||||||
p.sendMessage(BauSystem.PREFIX + "Dieser Spieler existiert nicht!");
|
BauSystem.MESSAGE.send("LOCK_SCHEM_NO_USER", p);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Schematic schematic = Schematic.getSchemFromDB(schematicName, schemOwner.getUUID());
|
Schematic schematic = Schematic.getSchemFromDB(schematicName, schemOwner.getUUID());
|
||||||
if (schematic == null) {
|
if (schematic == null) {
|
||||||
p.sendMessage(BauSystem.PREFIX + "Dieser Spieler besitzt keine Schematic mit diesem Namen!");
|
BauSystem.MESSAGE.send("LOCK_SCHEM_NO_SCHEM", p);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
p.sendMessage(BauSystem.PREFIX + "Schematic " + schematic.getSchemName() + " von " +
|
|
||||||
SteamwarUser.get(schematic.getSchemOwner()).getUserName() + " von " + schematic.getSchemType().toString() +
|
StringBuilder builder = new StringBuilder();
|
||||||
" auf NORMAL zurückgesetzt!");
|
for (String s : reason) {
|
||||||
|
builder.append(s).append(" ");
|
||||||
|
}
|
||||||
|
|
||||||
|
BauSystem.MESSAGE.send("LOCK_SCHEM_LOCKED", p, schematic.getSchemName(), schemOwner.getUserName(), schematic.getSchemType().name(), builder.toString());
|
||||||
schematic.setSchemType(SchematicType.Normal);
|
schematic.setSchemType(SchematicType.Normal);
|
||||||
|
new CheckedSchematic(schematic.getSchemName(), schematic.getSchemOwner(), steamwarUser.getId(), Timestamp.from(Instant.now()), Timestamp.from(Instant.now()), builder.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendHelp(Player player) {
|
private void sendHelp(Player player) {
|
||||||
player.sendMessage(ColorConfig.OTHER + "/" + ColorConfig.HIGHLIGHT + "schemlock " + ColorConfig.OTHER + "[" + ColorConfig.BASE + "Owner" + ColorConfig.OTHER + "] " + ColorConfig.OTHER + "[" + ColorConfig.BASE + "Schematic" + ColorConfig.OTHER + "] - " + ColorConfig.BASE + "Sperre eine Schematic");
|
BauSystem.MESSAGE.sendPrefixless("COMMAND_HELP_HEAD", player, "Lock Schem");
|
||||||
|
BauSystem.MESSAGE.sendPrefixless("LOCK_SCHEM_HELP", player);
|
||||||
}
|
}
|
||||||
}
|
}
|
In neuem Issue referenzieren
Einen Benutzer sperren