SteamWar/BauSystem2.0
Archiviert
12
0

Add Bau... multilingual

Dieser Commit ist enthalten in:
yoyosource 2021-05-13 17:08:14 +02:00
Ursprung 937bf41685
Commit 74e937d7b5
4 geänderte Dateien mit 46 neuen und 19 gelöschten Zeilen

Datei anzeigen

@ -98,6 +98,26 @@ AUTOSTART_MESSAGE_RESULT1 = §eZeit §7bis zur §eExplosion §7am Gegner§8:§e
AUTOSTART_MESSAGE_RESULT2 = §eZeitdifferenz in ticks §7bis 60 Sekunden§8:§e {0} AUTOSTART_MESSAGE_RESULT2 = §eZeitdifferenz in ticks §7bis 60 Sekunden§8:§e {0}
AUTOSTART_MESSAGE_RESULT3 = §7Positiv, wenn zu wenig, negativ wenn zu viel AUTOSTART_MESSAGE_RESULT3 = §7Positiv, wenn zu wenig, negativ wenn zu viel
# Bau
BAU_COMMAND_HELP1 = §8/§ebau togglewe §8[§7Player§8] §8- §7Editiere die WorldEdit Rechte eines Spielers
BAU_COMMAND_HELP2 = §8/§ebau toggleworld §8[§7Player§8] §8- §7Editiere die Welt Rechte eines Spielers
BAU_UNKNOWN-PLAYER = §cUnbekannter Spieler
BAU_NO-PLAYER = §cDer Spieler ist kein Mitglied deiner Welt!
BAU_NO-WORLD = §cDies ist nicht deine Welt!
BAU_INFO_ITEM_NAME = §eBau management
# This is used in BauInfoBauGuiItem.java
BAU-INFO_ITEM_LORE-TNT = §7TNT §8: §e{0}
BAU-INFO_ITEM_LORE-FREEZE = §7Freeze §8: §e{0}
BAU-INFO_ITEM_LORE-FIRE = §7Feuer §8: §e{0}
BAU-INFO_ITEM_LORE-COLOR = §7Farbe §8: §e{0}
BAU-INFO_ITEM_LORE-PROTECT = §7Protect §8: §e{0}
BAU-INFO_COMMAND_HELP = §8/§ebauinfo §8- §7Gibt Informationen über den Bau
BAU-INFO_COMMAND_OWNER = §7Besitzer: §e{0}
BAU-INFO_COMMAND_MEMBER = §7Mitglieder: §e{0}
BAU-INFO_COMMAND_FLAG = §e{0} §8: §7{1}
# GUI # GUI
GUI_EDITOR_ITEM-NAME=§eGui Editor GUI_EDITOR_ITEM-NAME=§eGui Editor
GUI_EXPORT_CODE=§eDein Gui-Code: GUI_EXPORT_CODE=§eDein Gui-Code:

Datei anzeigen

@ -49,8 +49,8 @@ public class BauCommand extends SWCommand {
@Register(help = true) @Register(help = true)
public void genericHelp(Player p, String... args) { public void genericHelp(Player p, String... args) {
p.sendMessage("§8/§ebau togglewe §8[§7Player§8] §8- §7Editiere die WorldEdit Rechte eines Spielers"); BauSystem.MESSAGE.send("BAU_COMMAND_HELP1", p);
p.sendMessage("§8/§ebau toggleworld §8[§7Player§8] §8- §7Editiere die Welt Rechte eines Spielers"); BauSystem.MESSAGE.send("BAU_COMMAND_HELP2", p);
} }
@Register("info") @Register("info")
@ -104,13 +104,13 @@ public class BauCommand extends SWCommand {
private boolean negativeToggleCheck(Player p, SteamwarUser id) { private boolean negativeToggleCheck(Player p, SteamwarUser id) {
if (id == null) { if (id == null) {
p.sendMessage(BauSystem.PREFIX + "§cUnbekannter Spieler"); BauSystem.MESSAGE.send("BAU_UNKNOWN-PLAYER", p);
return true; return true;
} }
BauweltMember target = BauweltMember.getBauMember(bauServer.getOwnerID(), id.getId()); BauweltMember target = BauweltMember.getBauMember(bauServer.getOwnerID(), id.getId());
if (target == null) { if (target == null) {
p.sendMessage(BauSystem.PREFIX + "§cDer Spieler ist kein Mitglied deiner Welt!"); BauSystem.MESSAGE.send("BAU_NO-PLAYER", p);
return true; return true;
} }
return false; return false;
@ -119,7 +119,7 @@ public class BauCommand extends SWCommand {
private boolean permissionCheck(Player p) { private boolean permissionCheck(Player p) {
if (!bauServer.getOwner().equals(p.getUniqueId())) { if (!bauServer.getOwner().equals(p.getUniqueId())) {
p.sendMessage(BauSystem.PREFIX + "§cDies ist nicht deine Welt!"); BauSystem.MESSAGE.send("BAU_NO-WORLD", p);
return false; return false;
} else { } else {
return true; return true;

Datei anzeigen

@ -19,22 +19,22 @@
package de.steamwar.bausystem.features.bau; package de.steamwar.bausystem.features.bau;
import de.steamwar.bausystem.BauSystem;
import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.Permission;
import de.steamwar.bausystem.config.BauServer; import de.steamwar.bausystem.config.BauServer;
import de.steamwar.bausystem.config.ColorConfig;
import de.steamwar.bausystem.linkage.specific.BauGuiItem;
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.bausystem.linkage.specific.BauGuiItem;
import de.steamwar.bausystem.region.Region; import de.steamwar.bausystem.region.Region;
import de.steamwar.bausystem.region.flags.Flag; import de.steamwar.bausystem.region.flags.Flag;
import de.steamwar.bausystem.region.flags.flagvalues.*;
import de.steamwar.inventory.SWItem; import de.steamwar.inventory.SWItem;
import de.steamwar.sql.SteamwarUser; import de.steamwar.sql.SteamwarUser;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType; import org.bukkit.event.inventory.ClickType;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import java.util.Arrays; import java.util.ArrayList;
import java.util.List;
@Linked(LinkageType.BAU_GUI_ITEM) @Linked(LinkageType.BAU_GUI_ITEM)
public class BauInfoBauGuiItem extends BauGuiItem { public class BauInfoBauGuiItem extends BauGuiItem {
@ -46,13 +46,19 @@ public class BauInfoBauGuiItem extends BauGuiItem {
@Override @Override
public ItemStack getItem(Player player) { public ItemStack getItem(Player player) {
SWItem itemStack = SWItem.getPlayerSkull(SteamwarUser.get(BauServer.getInstance().getOwner()).getUserName()); SWItem itemStack = SWItem.getPlayerSkull(SteamwarUser.get(BauServer.getInstance().getOwner()).getUserName());
itemStack.setName(ColorConfig.HIGHLIGHT + "Bau management"); itemStack.setName(BauSystem.MESSAGE.parse("BAU_INFO_ITEM_NAME", player));
Region region = Region.getRegion(player.getLocation()); Region region = Region.getRegion(player.getLocation());
itemStack.setLore(Arrays.asList(ColorConfig.BASE + "TNT" + ColorConfig.OTHER + ": " + ColorConfig.HIGHLIGHT + region.getPlain(Flag.TNT, TNTMode.class).getChatValue(), List<String> stringList = new ArrayList<>();
ColorConfig.BASE + "Freeze" + ColorConfig.OTHER + ": " + ColorConfig.HIGHLIGHT + region.getPlain(Flag.FREEZE, FreezeMode.class).getChatValue(), for (Flag flag : Flag.getFlags()) {
ColorConfig.BASE + "Feuer" + ColorConfig.OTHER + ": " + ColorConfig.HIGHLIGHT + region.getPlain(Flag.FIRE, FireMode.class).getChatValue(), if (flag == Flag.PROTECT && region.getFloorLevel() == 0) {
ColorConfig.BASE + "Farbe" + ColorConfig.OTHER + ": " + ColorConfig.HIGHLIGHT + region.getPlain(Flag.COLOR, ColorMode.class).getChatValue(), continue;
ColorConfig.BASE + "Protect" + ColorConfig.OTHER + ": " + ColorConfig.HIGHLIGHT + region.getPlain(Flag.PROTECT, ProtectMode.class).getChatValue())); }
Flag.Value<?> value = region.get(flag);
if (value != null) {
stringList.add(BauSystem.MESSAGE.parse("BAU_INFO_ITEM_LORE-" + flag.name(), player, BauSystem.MESSAGE.parse(value.getChatValue(), player)));
}
}
itemStack.setLore(stringList);
return itemStack.getItemStack(); return itemStack.getItemStack();
} }

Datei anzeigen

@ -30,7 +30,7 @@ public class InfoCommand extends SWCommand {
@Register(help = true) @Register(help = true)
public void genericHelp(Player p, String... args) { public void genericHelp(Player p, String... args) {
p.sendMessage("§8/§ebauinfo §8- §7Gibt Informationen über den Bau"); BauSystem.MESSAGE.send("BAU-INFO_COMMAND_HELP", p);
} }
@Register @Register
@ -39,7 +39,7 @@ public class InfoCommand extends SWCommand {
} }
public void sendBauInfo(Player p) { public void sendBauInfo(Player p) {
p.sendMessage(BauSystem.PREFIX + "Besitzer: §e" + SteamwarUser.get(bauServer.getOwnerID()).getUserName()); BauSystem.MESSAGE.send("BAU-INFO_COMMAND_OWNER", p, SteamwarUser.get(bauServer.getOwnerID()).getUserName());
Region region = Region.getRegion(p.getLocation()); Region region = Region.getRegion(p.getLocation());
for (Flag flag : Flag.getFlags()) { for (Flag flag : Flag.getFlags()) {
if (flag == Flag.PROTECT && region.getFloorLevel() == 0) { if (flag == Flag.PROTECT && region.getFloorLevel() == 0) {
@ -47,12 +47,13 @@ public class InfoCommand extends SWCommand {
} }
Flag.Value<?> value = region.get(flag); Flag.Value<?> value = region.get(flag);
if (value != null) { if (value != null) {
p.sendMessage(BauSystem.PREFIX + "§e" + flag.getChatValue() + "§8: §7" + value.getChatValue()); BauSystem.MESSAGE.send("BAU-INFO_COMMAND_FLAG", p, BauSystem.MESSAGE.parse(flag.getChatValue(), p), BauSystem.MESSAGE.parse(value.getChatValue(), p));
} }
} }
List<BauweltMember> members = BauweltMember.getMembers(bauServer.getOwnerID()); List<BauweltMember> members = BauweltMember.getMembers(bauServer.getOwnerID());
StringBuilder membermessage = new StringBuilder().append(BauSystem.PREFIX).append("Mitglieder: "); StringBuilder membermessage = new StringBuilder();
membermessage.append(BauSystem.MESSAGE.parsePrefixed("BAU-INFO_COMMAND_MEMBER", p));
for (BauweltMember member : members) { for (BauweltMember member : members) {
membermessage.append("§e").append(SteamwarUser.get(member.getMemberID()).getUserName()).append("§8["); membermessage.append("§e").append(SteamwarUser.get(member.getMemberID()).getUserName()).append("§8[");