Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
5a2552f9b2
Commit
c4b5847dfd
@ -573,7 +573,10 @@ SIMULATOR_GUI_MOVE_ALL = §eMove all
|
|||||||
|
|
||||||
SIMULATOR_MOVE_ALL_GUI_NAME = Move TNT
|
SIMULATOR_MOVE_ALL_GUI_NAME = Move TNT
|
||||||
|
|
||||||
SIMULATOR_TNT_SPAWN_GUI_NAME = Configure TNT
|
SIMULATOR_TNT_SPAWN_GUI_NAME = Configure TNT {0}
|
||||||
|
SIMULATOR_TNT_SPAWN_EDIT_LOCATION = - Location
|
||||||
|
SIMULATOR_TNT_SPAWN_EDIT_PROPERTIES = - Properties
|
||||||
|
SIMULATOR_TNT_SPAWN_EDIT_OTHER = - Other
|
||||||
SIMULATOR_TNT_SPAWN_LORE = §eClick to change
|
SIMULATOR_TNT_SPAWN_LORE = §eClick to change
|
||||||
SIMULATOR_TNT_SPAWN_COUNT = §7TNT-Count §8- §e{0}
|
SIMULATOR_TNT_SPAWN_COUNT = §7TNT-Count §8- §e{0}
|
||||||
SIMULATOR_TNT_SPAWN_COUNT_ANVIL_GUI_NAME = TNT-Count
|
SIMULATOR_TNT_SPAWN_COUNT_ANVIL_GUI_NAME = TNT-Count
|
||||||
|
@ -560,7 +560,7 @@ SIMULATOR_GUI_MOVE_ALL = §eAlle Verschieben
|
|||||||
|
|
||||||
SIMULATOR_MOVE_ALL_GUI_NAME = TNT Verschieben
|
SIMULATOR_MOVE_ALL_GUI_NAME = TNT Verschieben
|
||||||
|
|
||||||
SIMULATOR_TNT_SPAWN_GUI_NAME = TNT konfigurieren
|
SIMULATOR_TNT_SPAWN_GUI_NAME = TNT konfigurieren {0}
|
||||||
SIMULATOR_TNT_SPAWN_LORE = §eZum Ändern klicken
|
SIMULATOR_TNT_SPAWN_LORE = §eZum Ändern klicken
|
||||||
SIMULATOR_TNT_SPAWN_COUNT = §7TNT-Anzahl §8- §e{0}
|
SIMULATOR_TNT_SPAWN_COUNT = §7TNT-Anzahl §8- §e{0}
|
||||||
SIMULATOR_TNT_SPAWN_COUNT_ANVIL_GUI_NAME = Anzahl TNT
|
SIMULATOR_TNT_SPAWN_COUNT_ANVIL_GUI_NAME = Anzahl TNT
|
||||||
|
@ -33,13 +33,18 @@ import java.util.List;
|
|||||||
@UtilityClass
|
@UtilityClass
|
||||||
public class TNTElementGUI {
|
public class TNTElementGUI {
|
||||||
|
|
||||||
public void open(Player player, TNTElement tntElement, Runnable back) {
|
private SWInventory open(Player player, String name) {
|
||||||
SWInventory inv = new SWInventory(player, 45, BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_GUI_NAME", player));
|
SWInventory inv = new SWInventory(player, 45, BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_GUI_NAME", player, name));
|
||||||
SWItem gray = new SWItem(Material.GRAY_STAINED_GLASS_PANE, "§f", clickType -> {});
|
SWItem gray = new SWItem(Material.GRAY_STAINED_GLASS_PANE, "§f", clickType -> {});
|
||||||
for (int i = 0; i < 9; i++) {
|
for (int i = 0; i < 9; i++) {
|
||||||
inv.setItem(i, gray);
|
inv.setItem(i, gray);
|
||||||
inv.setItem(i + 36, gray);
|
inv.setItem(i + 36, gray);
|
||||||
}
|
}
|
||||||
|
return inv;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void open(Player player, TNTElement tntElement, Runnable back) {
|
||||||
|
SWInventory inv = open(player, "");
|
||||||
if (back != null) {
|
if (back != null) {
|
||||||
inv.setItem(36, new SWItem(Material.ARROW, BauSystem.MESSAGE.parse("SIMULATOR_BACK", player), clickType -> back.run()));
|
inv.setItem(36, new SWItem(Material.ARROW, BauSystem.MESSAGE.parse("SIMULATOR_BACK", player), clickType -> back.run()));
|
||||||
}
|
}
|
||||||
@ -50,7 +55,7 @@ public class TNTElementGUI {
|
|||||||
locationLore.add(BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_POSITION_Y", player, tntElement.getPosition().getY()));
|
locationLore.add(BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_POSITION_Y", player, tntElement.getPosition().getY()));
|
||||||
locationLore.add(BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_POSITION_Z", player, tntElement.getPosition().getZ()));
|
locationLore.add(BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_POSITION_Z", player, tntElement.getPosition().getZ()));
|
||||||
inv.setItem(20, new SWItem(Material.PAPER, BauSystem.MESSAGE.parse("SIMULATOR_EDIT_LOCATION", player), locationLore, false, clickType -> {
|
inv.setItem(20, new SWItem(Material.PAPER, BauSystem.MESSAGE.parse("SIMULATOR_EDIT_LOCATION", player), locationLore, false, clickType -> {
|
||||||
|
editLocation(player, tntElement, () -> open(player, tntElement, back));
|
||||||
}));
|
}));
|
||||||
|
|
||||||
List<String> propertiesLore = new ArrayList<>();
|
List<String> propertiesLore = new ArrayList<>();
|
||||||
@ -63,7 +68,7 @@ public class TNTElementGUI {
|
|||||||
propertiesLore.add(BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_VELOCITY_Y", player, active(player, tntElement.isYVelocity())));
|
propertiesLore.add(BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_VELOCITY_Y", player, active(player, tntElement.isYVelocity())));
|
||||||
propertiesLore.add(BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_VELOCITY_Z", player, active(player, tntElement.isZVelocity())));
|
propertiesLore.add(BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_VELOCITY_Z", player, active(player, tntElement.isZVelocity())));
|
||||||
inv.setItem(22, new SWItem(Material.TNT, BauSystem.MESSAGE.parse("SIMULATOR_EDIT_PROPERTIES", player), propertiesLore, false, clickType -> {
|
inv.setItem(22, new SWItem(Material.TNT, BauSystem.MESSAGE.parse("SIMULATOR_EDIT_PROPERTIES", player), propertiesLore, false, clickType -> {
|
||||||
|
editProperties(player, tntElement, () -> open(player, tntElement, back));
|
||||||
}));
|
}));
|
||||||
|
|
||||||
List<String> otherLore = new ArrayList<>();
|
List<String> otherLore = new ArrayList<>();
|
||||||
@ -71,12 +76,39 @@ public class TNTElementGUI {
|
|||||||
otherLore.add(BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_ACTIVATED_WITH", player, activationType(player, tntElement.getOrder())));
|
otherLore.add(BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_ACTIVATED_WITH", player, activationType(player, tntElement.getOrder())));
|
||||||
otherLore.add(BauSystem.MESSAGE.parse("SIMULATOR_MATERIAL_NAME_LORE", player, tntElement.getMaterial().name()));
|
otherLore.add(BauSystem.MESSAGE.parse("SIMULATOR_MATERIAL_NAME_LORE", player, tntElement.getMaterial().name()));
|
||||||
inv.setItem(24, new SWItem(Material.ANVIL, BauSystem.MESSAGE.parse("SIMULATOR_EDIT_OTHER", player), otherLore, false, clickType -> {
|
inv.setItem(24, new SWItem(Material.ANVIL, BauSystem.MESSAGE.parse("SIMULATOR_EDIT_OTHER", player), otherLore, false, clickType -> {
|
||||||
|
editOther(player, tntElement, () -> open(player, tntElement, back));
|
||||||
}));
|
}));
|
||||||
|
|
||||||
inv.open();
|
inv.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void editLocation(Player player, TNTElement tntElement, Runnable back) {
|
||||||
|
SWInventory inv = open(player, BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_EDIT_LOCATION", player));
|
||||||
|
if (back != null) {
|
||||||
|
inv.setItem(36, new SWItem(Material.ARROW, BauSystem.MESSAGE.parse("SIMULATOR_BACK", player), clickType -> back.run()));
|
||||||
|
}
|
||||||
|
|
||||||
|
inv.open();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void editProperties(Player player, TNTElement tntElement, Runnable back) {
|
||||||
|
SWInventory inv = open(player, BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_EDIT_PROPERTIES", player));
|
||||||
|
if (back != null) {
|
||||||
|
inv.setItem(36, new SWItem(Material.ARROW, BauSystem.MESSAGE.parse("SIMULATOR_BACK", player), clickType -> back.run()));
|
||||||
|
}
|
||||||
|
|
||||||
|
inv.open();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void editOther(Player player, TNTElement tntElement, Runnable back) {
|
||||||
|
SWInventory inv = open(player, BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_EDIT_OTHER", player));
|
||||||
|
if (back != null) {
|
||||||
|
inv.setItem(36, new SWItem(Material.ARROW, BauSystem.MESSAGE.parse("SIMULATOR_BACK", player), clickType -> back.run()));
|
||||||
|
}
|
||||||
|
|
||||||
|
inv.open();
|
||||||
|
}
|
||||||
|
|
||||||
private String active(Player p, boolean active) {
|
private String active(Player p, boolean active) {
|
||||||
return active ? BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_VELOCITY_ON", p) : BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_VELOCITY_OFF", p);
|
return active ? BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_VELOCITY_ON", p) : BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_VELOCITY_OFF", p);
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,6 @@ import de.steamwar.inventory.SWItem;
|
|||||||
import de.steamwar.inventory.SWListInv;
|
import de.steamwar.inventory.SWListInv;
|
||||||
import lombok.experimental.UtilityClass;
|
import lombok.experimental.UtilityClass;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.data.type.TNT;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren