Add Material GUI click item to get into inv
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
9982804a20
Commit
207953cb98
@ -20,6 +20,7 @@
|
|||||||
package de.steamwar.bausystem.features.util;
|
package de.steamwar.bausystem.features.util;
|
||||||
|
|
||||||
import de.steamwar.bausystem.BauSystem;
|
import de.steamwar.bausystem.BauSystem;
|
||||||
|
import de.steamwar.bausystem.SWUtils;
|
||||||
import de.steamwar.bausystem.shared.EnumDisplay;
|
import de.steamwar.bausystem.shared.EnumDisplay;
|
||||||
import de.steamwar.command.PreviousArguments;
|
import de.steamwar.command.PreviousArguments;
|
||||||
import de.steamwar.command.SWCommand;
|
import de.steamwar.command.SWCommand;
|
||||||
@ -39,6 +40,7 @@ import org.bukkit.event.EventHandler;
|
|||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.player.PlayerJoinEvent;
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
import org.bukkit.event.player.PlayerQuitEvent;
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.BiConsumer;
|
import java.util.function.BiConsumer;
|
||||||
@ -185,6 +187,9 @@ public class MaterialCommand extends SWCommand implements Listener {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
SWListInv<Material> materialSWListInv = new SWListInv<>(p, BauSystem.MESSAGE.parse("MATERIAL_INV_NAME", p, swListEntries.size(), MaterialLazyInit.materialData.size()), false, swListEntries, (clickType, material) -> {
|
SWListInv<Material> 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 -> {
|
materialSWListInv.setItem(49, new SWItem(Material.NAME_TAG, BauSystem.MESSAGE.parse("MATERIAL_SEARCH", p), clickType -> {
|
||||||
searchGUI(p);
|
searchGUI(p);
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren