SteamWar/BauSystem2.0
Archiviert
12
0

Update LoaderDaylightDetector
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2023-05-09 17:19:27 +02:00
Ursprung 07abd7a1e7
Commit 7c9c27ae3e
6 geänderte Dateien mit 27 neuen und 9 gelöschten Zeilen

Datei anzeigen

@ -800,7 +800,7 @@ LOADER_BUTTON_PRESSURE_PLATE=Pressure plate
LOADER_BUTTON_WEIGHTED_PRESSURE_PLATE=Pressure plate
LOADER_BUTTON_TRIPWIRE=Tripwire
LOADER_BUTTON_NOTEBLOCK=Noteblock
LOADER_BUTTON_DAYLIGHTSENSOR=Daylightsensor
LOADER_BUTTON_DAYLIGHT_DETECTOR=Daylight Detector
LOADER_BUTTON_COMPARATOR=Comparator
LOADER_BUTTON_REPEATER=Repeater
LOADER_BUTTON_LECTERN=Lectern
@ -836,6 +836,14 @@ LOADER_GUI_WAIT_TITLE=Settings
LOADER_GUI_WAIT_BACK=§8Back
LOADER_GUI_CLICK_TO_EDIT=§7Click to edit
LOADER_GUI_ITEM_NAME=§7{0}§8: §e{1}
LOADER_SETTING_NAME=§7{0}
LOADER_SETTING_MODES=§7Modes§8: §e{0}
LOADER_SETTING_POWER=§7Power§8: §e{0}
LOADER_INTERACTION_NOOP=NOOP
LOADER_INTERACTION_INTERACT=Interact
LOADER_INTERACTION_POWERED=Powered
LOADER_INTERACTION_UNPOWERED=Unpowered
# Loadtimer
LOADTIMER_HELP_OVERVIEW=§7Compete with your friends loading your cannon and get information about the cannon

Datei anzeigen

@ -773,7 +773,7 @@ LOADER_BUTTON_PRESSURE_PLATE=Druckplatte
LOADER_BUTTON_WEIGHTED_PRESSURE_PLATE=Druckplatte
LOADER_BUTTON_TRIPWIRE=Tripwire
LOADER_BUTTON_NOTEBLOCK=Noteblock
LOADER_BUTTON_DAYLIGHTSENSOR=Tageslichtsensor
LOADER_BUTTON_DAYLIGHT_DETECTOR=Tageslichtsensor
LOADER_BUTTON_COMPARATOR=Comparator
LOADER_BUTTON_REPEATER=Repeater
LOADER_BUTTON_LECTERN=Lectern

Datei anzeigen

@ -115,7 +115,7 @@ public class LoaderRecorder implements Listener {
break;
case DAYLIGHT_DETECTOR:
loaderElementList.add(new LoaderDaylightDetector(block.getLocation()));
message("LOADER_BUTTON_DAYLIGHTSENSOR");
message("LOADER_BUTTON_DAYLIGHT_DETECTOR");
break;
case LECTERN:
loaderElementList.add(new LoaderLectern(block.getLocation()));

Datei anzeigen

@ -19,6 +19,7 @@
package de.steamwar.bausystem.features.loadern.elements;
import de.steamwar.bausystem.BauSystem;
import de.steamwar.inventory.SWItem;
import org.bukkit.entity.Player;
@ -28,4 +29,8 @@ public interface ElementSettings {
void click(Player player, Runnable backAction, Runnable deleteAction);
default void playerInteract() {}
default String translateItemName(String name, String mode, Player player) {
return BauSystem.MESSAGE.parse("LOADER_GUI_ITEM_NAME", player, BauSystem.MESSAGE.parse(name, player), BauSystem.MESSAGE.parse(mode, player));
}
}

Datei anzeigen

@ -19,6 +19,7 @@
package de.steamwar.bausystem.features.loadern.elements;
import de.steamwar.bausystem.BauSystem;
import de.steamwar.inventory.SWItem;
import de.steamwar.inventory.SWListInv;
import org.bukkit.Location;
@ -117,4 +118,8 @@ public abstract class LoaderInteractionElement<T extends ElementSettings> implem
}
public abstract T createNewElement();
protected final String translateItemName(String name, Player player) {
return BauSystem.MESSAGE.parse("LOADER_SETTING_NAME", player, BauSystem.MESSAGE.parse(name, player));
}
}

Datei anzeigen

@ -53,11 +53,11 @@ public class LoaderDaylightDetector extends LoaderInteractionElement<LoaderDayli
private SWItem menu(Player player, boolean noop, boolean interact, boolean powered) {
SWItem swItem;
if (noop) {
swItem = new SWItem(Material.STRUCTURE_VOID, "§7Daylight Detector§8: §eNOOP");
swItem = new SWItem(Material.STRUCTURE_VOID, translateItemName("LOADER_BUTTON_DAYLIGHT_DETECTOR", "LOADER_INTERACTION_NOOP", player));
} else if (interact) {
swItem = new SWItem(Material.STICK, "§7Daylight Detector§8: §eInteract");
swItem = new SWItem(Material.STICK, translateItemName("LOADER_BUTTON_DAYLIGHT_DETECTOR", "LOADER_INTERACTION_INTERACT", player));
} else {
swItem = new SWItem(Material.DAYLIGHT_DETECTOR, "§7Daylight Detector§8: §e" + (powered ? "Powered" : "Unpowered"));
swItem = new SWItem(Material.DAYLIGHT_DETECTOR, translateItemName("LOADER_BUTTON_DAYLIGHT_DETECTOR", powered ? "LOADER_INTERACTION_POWERED": "LOADER_INTERACTION_UNPOWERED", player));
}
swItem.setLore(Arrays.asList(BauSystem.MESSAGE.parse("LOADER_GUI_CLICK_TO_EDIT", player)));
return swItem;
@ -132,7 +132,7 @@ public class LoaderDaylightDetector extends LoaderInteractionElement<LoaderDayli
}
private SWItem item(Player player, int power) {
SWItem swItem = new SWItem(power == 0 ? Material.GUNPOWDER : Material.REDSTONE, "§7Power §8:§e " + power);
SWItem swItem = new SWItem(power == 0 ? Material.GUNPOWDER : Material.REDSTONE, BauSystem.MESSAGE.parse("LOADER_SETTING_POWER", player, power));
swItem.getItemStack().setAmount(power == 0 ? 1 : power);
if (!this.noop && this.power == power) swItem.setEnchanted(true);
return swItem;
@ -148,8 +148,8 @@ public class LoaderDaylightDetector extends LoaderInteractionElement<LoaderDayli
@Override
public SWItem menu(Player player) {
SWItem swItem = new SWItem(Material.DAYLIGHT_DETECTOR, "§7Daylight Detector");
swItem.setLore(Arrays.asList("§7Modes§8: §e" + elements.size(), "§8", "§7Click to edit"));
SWItem swItem = new SWItem(Material.DAYLIGHT_DETECTOR, translateItemName("LOADER_BUTTON_DAYLIGHT_DETECTOR", player));
swItem.setLore(Arrays.asList(BauSystem.MESSAGE.parse("LOADER_SETTING_MODES", player, elements.size()), "§8", BauSystem.MESSAGE.parse("LOADER_GUI_CLICK_TO_EDIT", player)));
return swItem;
}