Add Detonator Multilang
Signed-off-by: Chaoscaot <chaoscaot444@gmail.com>
Dieser Commit ist enthalten in:
Ursprung
296d30b727
Commit
b38d782e67
@ -20,6 +20,7 @@
|
|||||||
PREFIX = §eBau§8System §8»
|
PREFIX = §eBau§8System §8»
|
||||||
TIME = HH:mm:ss
|
TIME = HH:mm:ss
|
||||||
DATE=........
|
DATE=........
|
||||||
|
COMMAND_HELP_HEAD=---=== (§e{0}§7) ===---
|
||||||
|
|
||||||
# Permission
|
# Permission
|
||||||
PERMISSION_WORLD = Einstellungen vornehmen
|
PERMISSION_WORLD = Einstellungen vornehmen
|
||||||
@ -141,12 +142,24 @@ DETONATOR_BUTTON_NOTEBLOCK = Noteblock
|
|||||||
DETONATOR_BUTTON_DAYLIGHTSENSOR=Tageslichtsensor
|
DETONATOR_BUTTON_DAYLIGHTSENSOR=Tageslichtsensor
|
||||||
DETONATOR_BUTTON_POWERABLE=Aktivierbarer Block
|
DETONATOR_BUTTON_POWERABLE=Aktivierbarer Block
|
||||||
DETONATOR_BUTTON_INVALID=Invalider
|
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
|
||||||
HOTBAR_SAVED=§7Deine Hotbar wurde als Standard gespeichert
|
HOTBAR_SAVED=§7Deine Hotbar wurde als Standard gespeichert
|
||||||
HOTBAR_LOADED=§7Deine Standard Hotbar wurde geladen
|
HOTBAR_LOADED=§7Deine Standard Hotbar wurde geladen
|
||||||
HOTBAR_INVENTORY=Standard Hotbar
|
HOTBAR_INVENTORY=Standard Hotbar
|
||||||
|
|
||||||
# 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:
|
||||||
|
@ -21,7 +21,6 @@ package de.steamwar.bausystem.features.detonator;
|
|||||||
|
|
||||||
import de.steamwar.bausystem.BauSystem;
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.bausystem.SWUtils;
|
import de.steamwar.bausystem.SWUtils;
|
||||||
import de.steamwar.bausystem.config.ColorConfig;
|
|
||||||
import de.steamwar.bausystem.configplayer.Config;
|
import de.steamwar.bausystem.configplayer.Config;
|
||||||
import de.steamwar.bausystem.features.autostart.AutostartListener;
|
import de.steamwar.bausystem.features.autostart.AutostartListener;
|
||||||
import de.steamwar.bausystem.features.detonator.storage.DetonatorStorage;
|
import de.steamwar.bausystem.features.detonator.storage.DetonatorStorage;
|
||||||
@ -104,12 +103,20 @@ public class Detonator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int s = detonator.getLocations().size() - invalid.size();
|
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);
|
invalid.forEach(detonator::removeLocation);
|
||||||
if (!invalid.isEmpty()) {
|
if (!invalid.isEmpty()) {
|
||||||
int invalidPoints = invalid.size();
|
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();
|
detonator.write();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,9 +20,9 @@
|
|||||||
package de.steamwar.bausystem.features.detonator;
|
package de.steamwar.bausystem.features.detonator;
|
||||||
|
|
||||||
import de.steamwar.bausystem.Permission;
|
import de.steamwar.bausystem.Permission;
|
||||||
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 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;
|
||||||
@ -36,7 +36,7 @@ public class DetonatorBauGuiItem extends BauGuiItem {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getItem(Player player) {
|
public ItemStack getItem(Player player) {
|
||||||
return DetonatorCommand.getWAND();
|
return DetonatorCommand.getWAND(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -21,14 +21,13 @@ package de.steamwar.bausystem.features.detonator;
|
|||||||
|
|
||||||
import de.steamwar.bausystem.BauSystem;
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.bausystem.SWUtils;
|
import de.steamwar.bausystem.SWUtils;
|
||||||
import de.steamwar.bausystem.config.ColorConfig;
|
|
||||||
import de.steamwar.bausystem.configplayer.Config;
|
import de.steamwar.bausystem.configplayer.Config;
|
||||||
import de.steamwar.bausystem.features.detonator.storage.DetonatorStorage;
|
import de.steamwar.bausystem.features.detonator.storage.DetonatorStorage;
|
||||||
import de.steamwar.bausystem.features.detonator.storage.ItemStorage;
|
import de.steamwar.bausystem.features.detonator.storage.ItemStorage;
|
||||||
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.utils.ItemUtils;
|
||||||
import de.steamwar.command.SWCommand;
|
import de.steamwar.command.SWCommand;
|
||||||
import lombok.Getter;
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
@ -39,20 +38,19 @@ import java.util.Arrays;
|
|||||||
@Linked(LinkageType.COMMAND)
|
@Linked(LinkageType.COMMAND)
|
||||||
public class DetonatorCommand extends SWCommand {
|
public class DetonatorCommand extends SWCommand {
|
||||||
|
|
||||||
@Getter
|
public static ItemStack getWAND(Player player) {
|
||||||
private static final ItemStack WAND;
|
ItemStack wand = new ItemStack(Material.BLAZE_ROD);
|
||||||
|
ItemStorage.setDetonator(wand);
|
||||||
|
ItemMeta meta = wand.getItemMeta();
|
||||||
|
|
||||||
static {
|
meta.setDisplayName(BauSystem.MESSAGE.parse("DETONATOR_WAND_NAME", player));
|
||||||
WAND = new ItemStack(Material.BLAZE_ROD);
|
meta.setLore(Arrays.asList(BauSystem.MESSAGE.parse("DETONATOR_WAND_LORE_1", player),
|
||||||
ItemStorage.setDetonator(WAND);
|
BauSystem.MESSAGE.parse("DETONATOR_WAND_LORE_2", player),
|
||||||
ItemMeta meta = WAND.getItemMeta();
|
BauSystem.MESSAGE.parse("DETONATOR_WAND_LORE_3", player)));
|
||||||
|
|
||||||
meta.setDisplayName(ColorConfig.HIGHLIGHT + "Fernzünder");
|
wand.setItemMeta(meta);
|
||||||
meta.setLore(Arrays.asList(ColorConfig.HIGHLIGHT + "Links Klick " + ColorConfig.OTHER + "- " + ColorConfig.BASE + "Setzte einen Punkt zum Aktivieren",
|
ItemUtils.setItem(wand, "detonator");
|
||||||
ColorConfig.HIGHLIGHT + "Links Klick + Shift " + ColorConfig.OTHER + "- " + ColorConfig.BASE + "Füge einen Punkt hinzu",
|
return wand;
|
||||||
ColorConfig.HIGHLIGHT + "Rechts Klick " + ColorConfig.OTHER + "- " + ColorConfig.BASE + "Löse alle Punkte aus"));
|
|
||||||
|
|
||||||
WAND.setItemMeta(meta);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected DetonatorCommand() {
|
protected DetonatorCommand() {
|
||||||
@ -61,15 +59,15 @@ public class DetonatorCommand extends SWCommand {
|
|||||||
|
|
||||||
@Register(help = true)
|
@Register(help = true)
|
||||||
public void genericHelp(Player p, String... args) {
|
public void genericHelp(Player p, String... args) {
|
||||||
p.sendMessage(ColorConfig.BASE + "---=== (" + ColorConfig.HIGHLIGHT + "Fernzünder" + ColorConfig.BASE + ") ===---");
|
BauSystem.MESSAGE.sendPrefixless("COMMAND_HELP_HEAD", p, "Detonator");
|
||||||
p.sendMessage(ColorConfig.OTHER + "/" + ColorConfig.HIGHLIGHT + "detonator wand " + ColorConfig.OTHER + "-" + ColorConfig.BASE + " Gibt den Fernzünder");
|
BauSystem.MESSAGE.sendPrefixless("DETONATOR_HELP_1", p);
|
||||||
p.sendMessage(ColorConfig.OTHER + "/" + ColorConfig.HIGHLIGHT + "detonator click " + ColorConfig.OTHER + "-" + ColorConfig.BASE + " Aktiviere einen Fernzünder (Haupthand -> Hotbar -> Inventar)");
|
BauSystem.MESSAGE.sendPrefixless("DETONATOR_HELP_2", p);
|
||||||
p.sendMessage(ColorConfig.OTHER + "/" + ColorConfig.HIGHLIGHT + "detonator clear " + ColorConfig.OTHER + "-" + ColorConfig.BASE + " Cleare einen Fernzünder");
|
BauSystem.MESSAGE.sendPrefixless("DETONATOR_HELP_3", p);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Register("wand")
|
@Register("wand")
|
||||||
public void giveWand(Player p) {
|
public void giveWand(Player p) {
|
||||||
SWUtils.giveItemToPlayer(p, getWAND());
|
SWUtils.giveItemToPlayer(p, getWAND(p));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Register("click")
|
@Register("click")
|
||||||
@ -88,6 +86,10 @@ public class DetonatorCommand extends SWCommand {
|
|||||||
public void toggleAutostartTimer(Player p) {
|
public void toggleAutostartTimer(Player p) {
|
||||||
boolean current = Config.getInstance().get(p).getPlainValueOrDefault("detonator-autostart", false);
|
boolean current = Config.getInstance().get(p).getPlainValueOrDefault("detonator-autostart", false);
|
||||||
Config.getInstance().get(p).put("detonator-autostart", !current);
|
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 com.comphenix.protocol.events.PacketEvent;
|
||||||
import de.steamwar.bausystem.BauSystem;
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.bausystem.SWUtils;
|
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.DetonatorStorage;
|
||||||
import de.steamwar.bausystem.features.detonator.storage.ItemStorage;
|
import de.steamwar.bausystem.features.detonator.storage.ItemStorage;
|
||||||
import de.steamwar.bausystem.linkage.LinkageType;
|
import de.steamwar.bausystem.linkage.LinkageType;
|
||||||
@ -80,7 +79,7 @@ public class DetonatorListener implements Listener {
|
|||||||
private static void addLocationToDetonator(Location location, Player p) {
|
private static void addLocationToDetonator(Location location, Player p) {
|
||||||
Detoblock detoblock = Detonator.getBlock(location.getBlock());
|
Detoblock detoblock = Detonator.getBlock(location.getBlock());
|
||||||
if (detoblock == Detoblock.INVALID) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
DetonatorStorage detonator = new ItemStorage(p);
|
DetonatorStorage detonator = new ItemStorage(p);
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren