Add Detonator Multilang
Signed-off-by: Chaoscaot <chaoscaot444@gmail.com>
Dieser Commit ist enthalten in:
Ursprung
296d30b727
Commit
b38d782e67
@ -19,7 +19,8 @@
|
||||
|
||||
PREFIX = §eBau§8System §8»
|
||||
TIME = HH:mm:ss
|
||||
DATE = ........
|
||||
DATE=........
|
||||
COMMAND_HELP_HEAD=---=== (§e{0}§7) ===---
|
||||
|
||||
# Permission
|
||||
PERMISSION_WORLD = Einstellungen vornehmen
|
||||
@ -131,26 +132,38 @@ COUNTINGWAND_MESSAGE_DIMENSION = §e{0}§8, §e{1}§8, §e{2}
|
||||
# Detonator
|
||||
DETONATOR_LOC_REMOVE = §e{0} entfernt
|
||||
DETONATOR_LOC_ADD = §e{0} hinzugefügt
|
||||
DETONATOR_BUTTON_SWITCH = Hebel
|
||||
DETONATOR_BUTTON_WOOD-Button = Knopf
|
||||
DETONATOR_BUTTON_STONE-Button = Knopf
|
||||
DETONATOR_BUTTON_PRESSURE-PLATE = Druckplatte
|
||||
DETONATOR_BUTTON_WEIGHTED-PRESSURE-PLATE = Druckplatte
|
||||
DETONATOR_BUTTON_TRIPWIRE = Tripwire
|
||||
DETONATOR_BUTTON_NOTEBLOCK = Noteblock
|
||||
DETONATOR_BUTTON_DAYLIGHTSENSOR = Tageslichtsensor
|
||||
DETONATOR_BUTTON_POWERABLE = Aktivierbarer Block
|
||||
DETONATOR_BUTTON_INVALID = Invalider
|
||||
|
||||
DETONATOR_BUTTON_SWITCH=Hebel
|
||||
DETONATOR_BUTTON_WOOD-Button=Knopf
|
||||
DETONATOR_BUTTON_STONE-Button=Knopf
|
||||
DETONATOR_BUTTON_PRESSURE-PLATE=Druckplatte
|
||||
DETONATOR_BUTTON_WEIGHTED-PRESSURE-PLATE=Druckplatte
|
||||
DETONATOR_BUTTON_TRIPWIRE=Tripwire
|
||||
DETONATOR_BUTTON_NOTEBLOCK=Noteblock
|
||||
DETONATOR_BUTTON_DAYLIGHTSENSOR=Tageslichtsensor
|
||||
DETONATOR_BUTTON_POWERABLE=Aktivierbarer Block
|
||||
DETONATOR_BUTTON_INVALID=Invalider
|
||||
DETONATOR_WAND_NAME=§eFernzünder
|
||||
DETONATOR_WAND_LORE_1=§eLinks Klick §8- §7Setzte einen Punkt zum Aktivieren
|
||||
DETONATOR_WAND_LORE_2=§eLinks Klick + Shift §8- §eFüge einen Punkt hinzu
|
||||
DETONATOR_WAND_LORE_3=§eRechts Klick §8- §eLöse alle Punkte aus
|
||||
DETONATOR_HELP_1=§8/§edetonator wand §8-§7 Gibt den Fernzünder
|
||||
DETONATOR_HELP_2=§8/§edetonator click §8-§7 Aktiviere einen Fernzünder (Haupthand -> Hotbar -> Inventar)
|
||||
DETONATOR_HELP_3=§8/§edetonator clear §8-§7 Cleare einen Fernzünder
|
||||
DETONATOR_AUTOSTART_ENABLE=§7Autostart beim detonate §aangeschaltet
|
||||
DETONATOR_AUTOSTART_DISABLE=§7Autostart beim detonate §causgeschaltet
|
||||
DETONATOR_POINT_ACT=§eEinen Punkt ausgelöst
|
||||
DETONATOR_POINTS_ACT=§e{0} Punkte ausgelöst
|
||||
DETONATOR_INVALID_POINT=§cEin Punkt konnte nicht ausgeführt werden und wurde entfernt
|
||||
DETONATOR_INVALID_POINTS=§c{0} Punkte konnten nicht ausgeführt werden und wurden entfernt
|
||||
DETONATOR_INVALID_BLOCK=§eDer Block konnte nicht hinzugefügt werden
|
||||
# Hotbar
|
||||
HOTBAR_SAVED = §7Deine Hotbar wurde als Standard gespeichert
|
||||
HOTBAR_LOADED = §7Deine Standard Hotbar wurde geladen
|
||||
HOTBAR_INVENTORY = Standard Hotbar
|
||||
|
||||
HOTBAR_SAVED=§7Deine Hotbar wurde als Standard gespeichert
|
||||
HOTBAR_LOADED=§7Deine Standard Hotbar wurde geladen
|
||||
HOTBAR_INVENTORY=Standard Hotbar
|
||||
# GUI
|
||||
GUI_EDITOR_ITEM-NAME = §eGui Editor
|
||||
GUI_EXPORT_CODE = §eDein Gui-Code:
|
||||
GUI_EXPORT_CODE-HOVER = §eKopieren
|
||||
GUI_EDITOR_ITEM-NAME=§eGui Editor
|
||||
GUI_EXPORT_CODE=§eDein Gui-Code:
|
||||
GUI_EXPORT_CODE-HOVER=§eKopieren
|
||||
GUI_IMPORT_INVALID-CODE = §eInvalieder Gui-Code
|
||||
GUI_IMPORT_CODE-SUCCESSFUL = §eGui-Code eingelesen
|
||||
|
||||
|
@ -21,7 +21,6 @@ package de.steamwar.bausystem.features.detonator;
|
||||
|
||||
import de.steamwar.bausystem.BauSystem;
|
||||
import de.steamwar.bausystem.SWUtils;
|
||||
import de.steamwar.bausystem.config.ColorConfig;
|
||||
import de.steamwar.bausystem.configplayer.Config;
|
||||
import de.steamwar.bausystem.features.autostart.AutostartListener;
|
||||
import de.steamwar.bausystem.features.detonator.storage.DetonatorStorage;
|
||||
@ -104,12 +103,20 @@ public class Detonator {
|
||||
}
|
||||
|
||||
int s = detonator.getLocations().size() - invalid.size();
|
||||
SWUtils.sendToActionbar(p, ColorConfig.HIGHLIGHT.toString() + s + " Punkt" + (s > 1 ? "e" : "") + " ausgelöst");
|
||||
if (s == 1) {
|
||||
SWUtils.sendToActionbar(p, BauSystem.MESSAGE.parse("DETONATOR_POINT_ACT", p));
|
||||
} else {
|
||||
SWUtils.sendToActionbar(p, BauSystem.MESSAGE.parse("DETONATOR_POINTS_ACT", p, s));
|
||||
}
|
||||
|
||||
invalid.forEach(detonator::removeLocation);
|
||||
if (!invalid.isEmpty()) {
|
||||
int invalidPoints = invalid.size();
|
||||
p.sendMessage(BauSystem.PREFIX + ColorConfig.DISABLE + invalid.size() + " Punkt" + (invalidPoints > 1 ? "e" : "") + " konnte" + (invalidPoints > 1 ? "n" : "") + " nicht ausgeführt werden und wurde" + (invalidPoints > 1 ? "n" : "") + " entfernt");
|
||||
if (invalidPoints == 1) {
|
||||
BauSystem.MESSAGE.send("DETONATOR_INVALID_POINT", p);
|
||||
} else {
|
||||
BauSystem.MESSAGE.send("DETONATOR_INVALID_POINTS", p, invalidPoints);
|
||||
}
|
||||
detonator.write();
|
||||
}
|
||||
|
||||
|
@ -20,9 +20,9 @@
|
||||
package de.steamwar.bausystem.features.detonator;
|
||||
|
||||
import de.steamwar.bausystem.Permission;
|
||||
import de.steamwar.bausystem.linkage.specific.BauGuiItem;
|
||||
import de.steamwar.bausystem.linkage.LinkageType;
|
||||
import de.steamwar.bausystem.linkage.Linked;
|
||||
import de.steamwar.bausystem.linkage.specific.BauGuiItem;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
@ -36,7 +36,7 @@ public class DetonatorBauGuiItem extends BauGuiItem {
|
||||
|
||||
@Override
|
||||
public ItemStack getItem(Player player) {
|
||||
return DetonatorCommand.getWAND();
|
||||
return DetonatorCommand.getWAND(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -21,14 +21,13 @@ package de.steamwar.bausystem.features.detonator;
|
||||
|
||||
import de.steamwar.bausystem.BauSystem;
|
||||
import de.steamwar.bausystem.SWUtils;
|
||||
import de.steamwar.bausystem.config.ColorConfig;
|
||||
import de.steamwar.bausystem.configplayer.Config;
|
||||
import de.steamwar.bausystem.features.detonator.storage.DetonatorStorage;
|
||||
import de.steamwar.bausystem.features.detonator.storage.ItemStorage;
|
||||
import de.steamwar.bausystem.linkage.LinkageType;
|
||||
import de.steamwar.bausystem.linkage.Linked;
|
||||
import de.steamwar.bausystem.utils.ItemUtils;
|
||||
import de.steamwar.command.SWCommand;
|
||||
import lombok.Getter;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
@ -39,20 +38,19 @@ import java.util.Arrays;
|
||||
@Linked(LinkageType.COMMAND)
|
||||
public class DetonatorCommand extends SWCommand {
|
||||
|
||||
@Getter
|
||||
private static final ItemStack WAND;
|
||||
public static ItemStack getWAND(Player player) {
|
||||
ItemStack wand = new ItemStack(Material.BLAZE_ROD);
|
||||
ItemStorage.setDetonator(wand);
|
||||
ItemMeta meta = wand.getItemMeta();
|
||||
|
||||
static {
|
||||
WAND = new ItemStack(Material.BLAZE_ROD);
|
||||
ItemStorage.setDetonator(WAND);
|
||||
ItemMeta meta = WAND.getItemMeta();
|
||||
meta.setDisplayName(BauSystem.MESSAGE.parse("DETONATOR_WAND_NAME", player));
|
||||
meta.setLore(Arrays.asList(BauSystem.MESSAGE.parse("DETONATOR_WAND_LORE_1", player),
|
||||
BauSystem.MESSAGE.parse("DETONATOR_WAND_LORE_2", player),
|
||||
BauSystem.MESSAGE.parse("DETONATOR_WAND_LORE_3", player)));
|
||||
|
||||
meta.setDisplayName(ColorConfig.HIGHLIGHT + "Fernzünder");
|
||||
meta.setLore(Arrays.asList(ColorConfig.HIGHLIGHT + "Links Klick " + ColorConfig.OTHER + "- " + ColorConfig.BASE + "Setzte einen Punkt zum Aktivieren",
|
||||
ColorConfig.HIGHLIGHT + "Links Klick + Shift " + ColorConfig.OTHER + "- " + ColorConfig.BASE + "Füge einen Punkt hinzu",
|
||||
ColorConfig.HIGHLIGHT + "Rechts Klick " + ColorConfig.OTHER + "- " + ColorConfig.BASE + "Löse alle Punkte aus"));
|
||||
|
||||
WAND.setItemMeta(meta);
|
||||
wand.setItemMeta(meta);
|
||||
ItemUtils.setItem(wand, "detonator");
|
||||
return wand;
|
||||
}
|
||||
|
||||
protected DetonatorCommand() {
|
||||
@ -61,15 +59,15 @@ public class DetonatorCommand extends SWCommand {
|
||||
|
||||
@Register(help = true)
|
||||
public void genericHelp(Player p, String... args) {
|
||||
p.sendMessage(ColorConfig.BASE + "---=== (" + ColorConfig.HIGHLIGHT + "Fernzünder" + ColorConfig.BASE + ") ===---");
|
||||
p.sendMessage(ColorConfig.OTHER + "/" + ColorConfig.HIGHLIGHT + "detonator wand " + ColorConfig.OTHER + "-" + ColorConfig.BASE + " Gibt den Fernzünder");
|
||||
p.sendMessage(ColorConfig.OTHER + "/" + ColorConfig.HIGHLIGHT + "detonator click " + ColorConfig.OTHER + "-" + ColorConfig.BASE + " Aktiviere einen Fernzünder (Haupthand -> Hotbar -> Inventar)");
|
||||
p.sendMessage(ColorConfig.OTHER + "/" + ColorConfig.HIGHLIGHT + "detonator clear " + ColorConfig.OTHER + "-" + ColorConfig.BASE + " Cleare einen Fernzünder");
|
||||
BauSystem.MESSAGE.sendPrefixless("COMMAND_HELP_HEAD", p, "Detonator");
|
||||
BauSystem.MESSAGE.sendPrefixless("DETONATOR_HELP_1", p);
|
||||
BauSystem.MESSAGE.sendPrefixless("DETONATOR_HELP_2", p);
|
||||
BauSystem.MESSAGE.sendPrefixless("DETONATOR_HELP_3", p);
|
||||
}
|
||||
|
||||
@Register("wand")
|
||||
public void giveWand(Player p) {
|
||||
SWUtils.giveItemToPlayer(p, getWAND());
|
||||
SWUtils.giveItemToPlayer(p, getWAND(p));
|
||||
}
|
||||
|
||||
@Register("click")
|
||||
@ -88,6 +86,10 @@ public class DetonatorCommand extends SWCommand {
|
||||
public void toggleAutostartTimer(Player p) {
|
||||
boolean current = Config.getInstance().get(p).getPlainValueOrDefault("detonator-autostart", false);
|
||||
Config.getInstance().get(p).put("detonator-autostart", !current);
|
||||
p.sendMessage(BauSystem.PREFIX + "Autostart beim detonate " + (!current ? "§aangeschaltet" : "§causgeschaltet"));
|
||||
if (!current) {
|
||||
BauSystem.MESSAGE.send("DETONATOR_AUTOSTART_ENABLE", p);
|
||||
} else {
|
||||
BauSystem.MESSAGE.send("DETONATOR_AUTOSTART_DISABLE", p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -26,7 +26,6 @@ import com.comphenix.protocol.events.PacketContainer;
|
||||
import com.comphenix.protocol.events.PacketEvent;
|
||||
import de.steamwar.bausystem.BauSystem;
|
||||
import de.steamwar.bausystem.SWUtils;
|
||||
import de.steamwar.bausystem.config.ColorConfig;
|
||||
import de.steamwar.bausystem.features.detonator.storage.DetonatorStorage;
|
||||
import de.steamwar.bausystem.features.detonator.storage.ItemStorage;
|
||||
import de.steamwar.bausystem.linkage.LinkageType;
|
||||
@ -80,7 +79,7 @@ public class DetonatorListener implements Listener {
|
||||
private static void addLocationToDetonator(Location location, Player p) {
|
||||
Detoblock detoblock = Detonator.getBlock(location.getBlock());
|
||||
if (detoblock == Detoblock.INVALID) {
|
||||
SWUtils.sendToActionbar(p, ColorConfig.HIGHLIGHT + "Der Block konnte nicht hinzugefügt werden");
|
||||
SWUtils.sendToActionbar(p, BauSystem.MESSAGE.parse("DETONATOR_INVALID_BLOCK", p));
|
||||
return;
|
||||
}
|
||||
DetonatorStorage detonator = new ItemStorage(p);
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren