xmaterial hates me

Dieser Commit ist enthalten in:
Silent 2021-06-11 23:38:50 +02:00
Ursprung 09a5441bff
Commit 88b8fcce0c
5 geänderte Dateien mit 9 neuen und 12 gelöschten Zeilen

Datei anzeigen

@ -3,6 +3,7 @@ package tsp.headdb.api;
import com.mojang.authlib.GameProfile; import com.mojang.authlib.GameProfile;
import com.mojang.authlib.properties.Property; import com.mojang.authlib.properties.Property;
import org.apache.commons.lang.Validate; import org.apache.commons.lang.Validate;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.SkullMeta; import org.bukkit.inventory.meta.SkullMeta;
import tsp.headdb.database.Category; import tsp.headdb.database.Category;
@ -35,7 +36,7 @@ public class Head {
Validate.notNull(uuid, "uuid must not be null!"); Validate.notNull(uuid, "uuid must not be null!");
Validate.notNull(value, "value must not be null!"); Validate.notNull(value, "value must not be null!");
ItemStack item = new ItemStack(XMaterial.PLAYER_HEAD.parseItem()); ItemStack item = new ItemStack(Material.PLAYER_HEAD);
SkullMeta meta = (SkullMeta) item.getItemMeta(); SkullMeta meta = (SkullMeta) item.getItemMeta();
meta.setDisplayName(Utils.colorize(category != null ? category.getColor() + name : "&8" + name)); meta.setDisplayName(Utils.colorize(category != null ? category.getColor() + name : "&8" + name));
// set skull owner // set skull owner

Datei anzeigen

@ -2,6 +2,7 @@ package tsp.headdb.api;
import org.apache.commons.lang.Validate; import org.apache.commons.lang.Validate;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.SkullMeta; import org.bukkit.inventory.meta.SkullMeta;
import tsp.headdb.util.Utils; import tsp.headdb.util.Utils;
@ -19,7 +20,7 @@ public class LocalHead {
public ItemStack getItemStack() { public ItemStack getItemStack() {
Validate.notNull(uuid, "uuid must not be null!"); Validate.notNull(uuid, "uuid must not be null!");
ItemStack item = new ItemStack(XMaterial.PLAYER_HEAD.parseItem()); ItemStack item = new ItemStack(Material.PLAYER_HEAD);
SkullMeta meta = (SkullMeta) item.getItemMeta(); SkullMeta meta = (SkullMeta) item.getItemMeta();
meta.setOwningPlayer(Bukkit.getOfflinePlayer(uuid)); meta.setOwningPlayer(Bukkit.getOfflinePlayer(uuid));
meta.setDisplayName(Utils.colorize("&e" + name)); meta.setDisplayName(Utils.colorize("&e" + name));

Datei anzeigen

@ -15,6 +15,7 @@ import tsp.headdb.util.Utils;
import tsp.headdb.util.XMaterial; import tsp.headdb.util.XMaterial;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
public class InventoryUtils { public class InventoryUtils {
@ -150,7 +151,7 @@ public class InventoryUtils {
public static void openDatabase(Player player) { public static void openDatabase(Player player) {
Inventory inventory = Bukkit.createInventory(null, 54, Utils.colorize("&c&lHeadDB &8(" + HeadAPI.getHeads().size() + ")")); Inventory inventory = Bukkit.createInventory(null, 54, Utils.colorize("&c&lHeadDB &8(" + HeadAPI.getHeads().size() + ")"));
fill(inventory, XMaterial.BLACK_STAINED_GLASS_PANE.parseItem()); fill(inventory, new ItemStack(Material.BLACK_STAINED_GLASS_PANE));
for (Category category : Category.getCategories()) { for (Category category : Category.getCategories()) {
ItemStack item = category.getItem(); ItemStack item = category.getItem();
ItemMeta meta = item.getItemMeta(); ItemMeta meta = item.getItemMeta();
@ -202,13 +203,7 @@ public class InventoryUtils {
} }
private static boolean contains(int n, int... array) { private static boolean contains(int n, int... array) {
for (int i : array) { return Arrays.binarySearch(array, n) > -1;
if (i == n) {
return true;
}
}
return false;
} }
private static ItemStack buildButton(ItemStack item, String name, String... lore) { private static ItemStack buildButton(ItemStack item, String name, String... lore) {

Datei anzeigen

@ -15,7 +15,6 @@ import org.bukkit.inventory.meta.ItemMeta;
import tsp.headdb.HeadDB; import tsp.headdb.HeadDB;
import tsp.headdb.api.HeadAPI; import tsp.headdb.api.HeadAPI;
import tsp.headdb.util.Utils; import tsp.headdb.util.Utils;
import tsp.headdb.util.XMaterial;
import java.util.*; import java.util.*;
import java.util.Map.Entry; import java.util.Map.Entry;
@ -206,7 +205,7 @@ public class PagedPane implements InventoryHolder {
// create separator // create separator
fillRow( fillRow(
inventory.getSize() / 9 - 2, inventory.getSize() / 9 - 2,
XMaterial.BLACK_STAINED_GLASS_PANE.parseItem(), new ItemStack(Material.BLACK_STAINED_GLASS_PANE),
inventory inventory
); );

Datei anzeigen

@ -3,6 +3,7 @@ description: ${project.description}
main: tsp.headdb.HeadDB main: tsp.headdb.HeadDB
version: ${project.version} version: ${project.version}
api-version: 1.16
author: Silent author: Silent
commands: commands: