MaterialWithBackground

This commit is contained in:
NichtStudioCode 2021-01-28 22:37:49 +01:00
parent ac8401ef6b
commit 0a62cb85b6
2 changed files with 30 additions and 1 deletions

@ -5,6 +5,8 @@ import de.studiocode.invgui.item.impl.SimpleItem;
import de.studiocode.invgui.item.itembuilder.ItemBuilder;
import org.bukkit.Material;
import java.util.HashMap;
public enum CustomItem {
BACKGROUND(10000000),
@ -70,4 +72,31 @@ public enum CustomItem {
return item;
}
public enum MaterialWithBackground {
FULL(9999998),
NORMAL(9999999);
private final int customModelData;
private final HashMap<Material, Item> items = new HashMap<>();
MaterialWithBackground(int customModelData) {
this.customModelData = customModelData;
}
public ItemBuilder getItemBuilder(Material material) {
return new ItemBuilder(material).setCustomModelData(customModelData);
}
public Item getItem(Material material) {
if (!items.containsKey(material)) {
items.put(material, new SimpleItem(getItemBuilder(material)));
}
return items.get(material);
}
}
}

@ -19,7 +19,7 @@ public class ForceResourcePack implements Listener {
private final HashMap<Player, BukkitTask> tasks = new HashMap<>();
private String resourcePackUrl = "https://github.com/NichtStudioCode/InvGuiRP/releases/download/v0.2/InvGuiRP.zip";
private String resourcePackUrl = "https://github.com/NichtStudioCode/InvGuiRP/releases/download/v0.3/InvGuiRP.zip";
private boolean activated;
private ForceResourcePack() {