From 207953cb987cd5d931926e98e8eb533f1d23ee3f Mon Sep 17 00:00:00 2001 From: yoyosource Date: Tue, 26 Sep 2023 09:42:54 +0200 Subject: [PATCH] Add Material GUI click item to get into inv Signed-off-by: yoyosource --- .../de/steamwar/bausystem/features/util/MaterialCommand.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/MaterialCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/util/MaterialCommand.java index e7efd6dd..6f7a92c7 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/util/MaterialCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/util/MaterialCommand.java @@ -20,6 +20,7 @@ package de.steamwar.bausystem.features.util; import de.steamwar.bausystem.BauSystem; +import de.steamwar.bausystem.SWUtils; import de.steamwar.bausystem.shared.EnumDisplay; import de.steamwar.command.PreviousArguments; import de.steamwar.command.SWCommand; @@ -39,6 +40,7 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerQuitEvent; +import org.bukkit.inventory.ItemStack; import java.util.*; import java.util.function.BiConsumer; @@ -185,6 +187,9 @@ public class MaterialCommand extends SWCommand implements Listener { } }); SWListInv materialSWListInv = new SWListInv<>(p, BauSystem.MESSAGE.parse("MATERIAL_INV_NAME", p, swListEntries.size(), MaterialLazyInit.materialData.size()), false, swListEntries, (clickType, material) -> { + if (material.isItem()) { + SWUtils.giveItemToPlayer(p, new ItemStack(material, 1)); + } }); materialSWListInv.setItem(49, new SWItem(Material.NAME_TAG, BauSystem.MESSAGE.parse("MATERIAL_SEARCH", p), clickType -> { searchGUI(p);