From 6d7d5178358931a3342c1366599e540ac8c0312a Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sat, 12 Nov 2022 08:59:32 +0100 Subject: [PATCH] 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; + } +}