From 06c2810061d05564ee4707b2cdb81e47ce19db12 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Fri, 11 Nov 2022 19:36:05 +0100 Subject: [PATCH 1/4] Fix: Typo --- BauSystem_Main/src/BauSystem.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BauSystem_Main/src/BauSystem.properties b/BauSystem_Main/src/BauSystem.properties index 903ebb5a..1294e2d9 100644 --- a/BauSystem_Main/src/BauSystem.properties +++ b/BauSystem_Main/src/BauSystem.properties @@ -948,7 +948,7 @@ RT_ACTIVATE=§7Positions deleted§8. # Region Items REGION_ITEM_COLOR=§7Color: §e{0} REGION_ITEM_COLOR_CHOOSE=Choose color -REGION_ITEM_FIRE_ALLOW=§7Fire: §eAcitvated +REGION_ITEM_FIRE_ALLOW=§7Fire: §eActivated REGION_ITEM_FIRE_DISALLOW=§7Fire: §eDeactivated REGION_ITEM_FREEZE_ALLOW=§7Freeze: §eActivated REGION_ITEM_FREEZE_DISALLOW=§7Freeze: §eDeactivated From 98201061d3877d81e6b1f60db648f719641a48ac Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sat, 12 Nov 2022 08:52:11 +0100 Subject: [PATCH 2/4] Add Close Button --- BauSystem_Main/src/BauSystem.properties | 1 + BauSystem_Main/src/BauSystem_de.properties | 1 + .../features/gui/editor/BauGuiEditor.java | 17 +++++++++++++---- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/BauSystem_Main/src/BauSystem.properties b/BauSystem_Main/src/BauSystem.properties index 1294e2d9..2b9db940 100644 --- a/BauSystem_Main/src/BauSystem.properties +++ b/BauSystem_Main/src/BauSystem.properties @@ -200,6 +200,7 @@ GUI_EDITOR_ITEM_ROW_M=§e-1 Row GUI_EDITOR_ITEM_TRASH=§cTrashcan GUI_EDITOR_ITEM_TRASH_LORE=§7Drop item here GUI_EDITOR_ITEM_MORE=§eMore items +GUI_EDITOR_ITEM_CLOSE=§eClose GUI_EDITOR_TITLE_MORE=Select item # Script diff --git a/BauSystem_Main/src/BauSystem_de.properties b/BauSystem_Main/src/BauSystem_de.properties index 4936643e..65eb1994 100644 --- a/BauSystem_Main/src/BauSystem_de.properties +++ b/BauSystem_Main/src/BauSystem_de.properties @@ -200,6 +200,7 @@ GUI_EDITOR_ITEM_ROW_M=§e-1 Zeile GUI_EDITOR_ITEM_TRASH=§cTrashcan GUI_EDITOR_ITEM_TRASH_LORE=§7Item hier rein Legen GUI_EDITOR_ITEM_MORE=§eMehr Items +GUI_EDITOR_ITEM_CLOSE=§eSchließen GUI_EDITOR_TITLE_MORE=Item auswählen # Script diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/gui/editor/BauGuiEditor.java b/BauSystem_Main/src/de/steamwar/bausystem/features/gui/editor/BauGuiEditor.java index 06c4a41c..733e7213 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/gui/editor/BauGuiEditor.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/gui/editor/BauGuiEditor.java @@ -39,6 +39,7 @@ import org.bukkit.event.inventory.InventoryDragEvent; import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.InventoryView; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.persistence.PersistentDataType; @@ -72,6 +73,7 @@ public class BauGuiEditor implements Listener { inv.setItem(mapping.getSize() + 5, new SWItem(Material.BARRIER, BauSystem.MESSAGE.parse("GUI_EDITOR_ITEM_TRASH", p), Arrays.asList(BauSystem.MESSAGE.parse("GUI_EDITOR_ITEM_TRASH_LORE", p)), false, clickType -> { }).getItemStack()); inv.setItem(mapping.getSize() + 6, new SWItem(Material.SCUTE, BauSystem.MESSAGE.parse("GUI_EDITOR_ITEM_MORE", p)).getItemStack()); + inv.setItem(mapping.getSize() + 8, new SWItem(Material.ARROW, BauSystem.MESSAGE.parse("GUI_EDITOR_ITEM_CLOSE", p)).getItemStack()); p.openInventory(inv); p.getOpenInventory().setCursor(cursor == null ? new SWItem().getItemStack() : cursor); @@ -155,6 +157,10 @@ public class BauGuiEditor implements Listener { }); inv.open(); break; + case 8: + saveMapping(p); + BauGUI.openBauGui(p); + break; default: } } @@ -188,14 +194,17 @@ public class BauGuiEditor implements Listener { } private void saveMapping(Player p) { - BauGuiMapping mapping = BauGuiMapping.getGuiMapping(p); + saveMapping(p.getOpenInventory(), BauGuiMapping.getGuiMapping(p)); + } + + private void saveMapping(InventoryView view, BauGuiMapping mapping) { if (mapping.isSaved()) { return; } HashMap newMapping = new HashMap<>(); - for (int i = 0; i < p.getOpenInventory().getTopInventory().getContents().length; i++) { - ItemStack itemStack = p.getOpenInventory().getTopInventory().getContents()[i]; + for (int i = 0; i < view.getTopInventory().getContents().length; i++) { + ItemStack itemStack = view.getTopInventory().getContents()[i]; if (itemStack == null || itemStack.getType() == Material.AIR || i >= mapping.getSize()) continue; newMapping.put(getId(itemStack), i); } @@ -218,7 +227,7 @@ public class BauGuiEditor implements Listener { Player p = (Player) event.getPlayer(); - saveMapping(p); + saveMapping(event.getView(), BauGuiMapping.getGuiMapping(p)); open_Edits.remove(p); } } From 6d7d5178358931a3342c1366599e540ac8c0312a Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sat, 12 Nov 2022 08:59:32 +0100 Subject: [PATCH 3/4] Add Schematic GUI Bau GUI Item --- BauSystem_Main/src/BauSystem.properties | 3 ++ BauSystem_Main/src/BauSystem_de.properties | 3 ++ .../features/util/items/SchemBauGuiItem.java | 34 +++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 BauSystem_Main/src/de/steamwar/bausystem/features/util/items/SchemBauGuiItem.java diff --git a/BauSystem_Main/src/BauSystem.properties b/BauSystem_Main/src/BauSystem.properties index 2b9db940..ea7acbac 100644 --- a/BauSystem_Main/src/BauSystem.properties +++ b/BauSystem_Main/src/BauSystem.properties @@ -1288,3 +1288,6 @@ XRAY_OFF = §cXray deactivated COLORREPLACE_HELP = §8//§ecolorreplace §8[§7color§8] §8[§7color§8] §8- §7Replace all blocks of one color with another TYPEREPLACE_HELP = §8//§etyreplace §8[§7type§8] §8[§7type§8] §8- §7Replace all blocks of one type with another + +# Schematic +SCHEMATIC_GUI_ITEM=§eSchematics diff --git a/BauSystem_Main/src/BauSystem_de.properties b/BauSystem_Main/src/BauSystem_de.properties index 65eb1994..c351a2a3 100644 --- a/BauSystem_Main/src/BauSystem_de.properties +++ b/BauSystem_Main/src/BauSystem_de.properties @@ -1258,3 +1258,6 @@ XRAY_OFF = §cXray deaktiviert COLORREPLACE_HELP = §8//§ecolorreplace §8[§7color§8] §8[§7color§8] §8- §7Ersetzt eine Farbe mit einer anderen TYPEREPLACE_HELP = §8//§etyreplace §8[§7type§8] §8[§7type§8] §8- §7Ersetzt einen Blockgruppe mit einer anderen + +# Schematics +SCHEMATIC_GUI_ITEM=§eSchematics diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/SchemBauGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/SchemBauGuiItem.java new file mode 100644 index 00000000..dc5569e4 --- /dev/null +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/SchemBauGuiItem.java @@ -0,0 +1,34 @@ +package de.steamwar.bausystem.features.util.items; + +import de.steamwar.bausystem.BauSystem; +import de.steamwar.bausystem.Permission; +import de.steamwar.bausystem.linkage.specific.BauGuiItem; +import de.steamwar.inventory.SWItem; +import de.steamwar.linkage.Linked; +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.event.inventory.ClickType; +import org.bukkit.inventory.ItemStack; + +@Linked +public class SchemBauGuiItem extends BauGuiItem { + public SchemBauGuiItem() { + super(35); + } + + @Override + public Permission permission() { + return Permission.WORLDEDIT; + } + + @Override + public ItemStack getItem(Player player) { + return new SWItem(Material.CHEST, BauSystem.MESSAGE.parse("SCHEMATIC_GUI_ITEM", player)).getItemStack(); + } + + @Override + public boolean click(ClickType click, Player p) { + p.performCommand("schematic gui"); + return false; + } +} From 18319e99fb4ca741e22f8d258a4e862456b80193 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 12 Nov 2022 12:01:05 +0100 Subject: [PATCH 4/4] Fix some messages Signed-off-by: yoyosource --- BauSystem_Main/src/BauSystem.properties | 3 ++- BauSystem_Main/src/BauSystem_de.properties | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/BauSystem_Main/src/BauSystem.properties b/BauSystem_Main/src/BauSystem.properties index 903ebb5a..bebcbd12 100644 --- a/BauSystem_Main/src/BauSystem.properties +++ b/BauSystem_Main/src/BauSystem.properties @@ -123,6 +123,7 @@ 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_DAMAGE= BAU_INFO_ITEM_LORE_FIRE = §7Fire§8: §e{0} BAU_INFO_ITEM_LORE_COLOR = §7Color§8: §e{0} BAU_INFO_ITEM_LORE_PROTECT = §7Protect§8: §e{0} @@ -882,7 +883,7 @@ OTHER_TIME_RESULT=§7§oWhooosh OTHER_TPS_HEAD = §7TPS: 1s 10s 1m 5m 10m OTHER_TPS_MESSAGE = §7 §e{0}§7 §e{1}§7 §e{2}§7 §e{3}§7 §e{4} OTHER_TPS_SINGLE = §8TPS: §e{0} -OTHER_WORLDSPAWN_HELP=§8/§eworldspawn §8-§e Teleprot to the spawn +OTHER_WORLDSPAWN_HELP=§8/§eworldspawn §8-§e Teleport to the spawn # DebugStick DEBUG_STICK_COMMAND_HELP=§8/§edebugstick §8-§7 receive a debugstick DEBUG_STICK_NAME=§eDebugstick diff --git a/BauSystem_Main/src/BauSystem_de.properties b/BauSystem_Main/src/BauSystem_de.properties index 4936643e..6fbb98e7 100644 --- a/BauSystem_Main/src/BauSystem_de.properties +++ b/BauSystem_Main/src/BauSystem_de.properties @@ -1187,7 +1187,7 @@ TNT_CLICK_VELOCITY_X = §7Velocity §eX§8: §e{0} TNT_CLICK_VELOCITY_Y = §7Velocity §eY§8: §e{0} TNT_CLICK_VELOCITY_Z = §7Velocity §eZ§8: §e{0} TNT_CLICK_COUNT = §7Anzahl §8: §e{0} - +TNT_CLICK_ISOLATE=§eIsolieren SELECT_ITEM_CHOOSE_EXTENSION = Extension auswählen SELECT_ITEM_CHOOSE_SELECTION = Auswahl auswählen SELECT_ITEM_NORMAL_EXTENSION = §eNormal