From ddf0e10c1941148d09021bc065f9236b29860a8c Mon Sep 17 00:00:00 2001 From: Silent Date: Fri, 30 Oct 2020 16:49:13 +0100 Subject: [PATCH] Fix some issues with head texture --- pom.xml | 27 ++++++++++--------- src/main/java/tsp/headdb/api/Head.java | 4 +-- .../tsp/headdb/database/HeadDatabase.java | 2 +- src/main/resources/plugin.yml | 3 ++- 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/pom.xml b/pom.xml index 724014e..00cfa83 100644 --- a/pom.xml +++ b/pom.xml @@ -6,19 +6,7 @@ tsp.headdb HeadDB - 1.0 - - - - org.apache.maven.plugins - maven-compiler-plugin - - 8 - 8 - - - - + 1.1 jar HeadDB @@ -56,4 +44,17 @@ + + + + org.apache.maven.plugins + maven-compiler-plugin + + 8 + 8 + + + + + \ No newline at end of file diff --git a/src/main/java/tsp/headdb/api/Head.java b/src/main/java/tsp/headdb/api/Head.java index 98a128c..1a1a589 100644 --- a/src/main/java/tsp/headdb/api/Head.java +++ b/src/main/java/tsp/headdb/api/Head.java @@ -3,12 +3,12 @@ package tsp.headdb.api; import com.mojang.authlib.GameProfile; import com.mojang.authlib.properties.Property; import org.apache.commons.lang.Validate; +import org.bukkit.Material; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.SkullMeta; import tsp.headdb.database.Category; import tsp.headdb.util.Log; import tsp.headdb.util.Utils; -import tsp.headdb.util.XMaterial; import java.lang.reflect.Field; import java.util.Collections; @@ -28,7 +28,7 @@ public class Head { Validate.notNull(value, "value must not be null!"); Validate.notNull(category, "category must not be null!"); - ItemStack item = XMaterial.PLAYER_HEAD.parseItem(); + ItemStack item = new ItemStack(Material.PLAYER_HEAD); if (item != null) { SkullMeta meta = (SkullMeta) item.getItemMeta(); meta.setDisplayName(Utils.colorize(category.getColor() + name)); diff --git a/src/main/java/tsp/headdb/database/HeadDatabase.java b/src/main/java/tsp/headdb/database/HeadDatabase.java index ba5eae1..a20b6ef 100644 --- a/src/main/java/tsp/headdb/database/HeadDatabase.java +++ b/src/main/java/tsp/headdb/database/HeadDatabase.java @@ -100,6 +100,7 @@ public class HeadDatabase { Map> result = new HashMap<>(); List categories = Category.getCategories(); + int id = 1; for (Category category : categories) { Log.debug("Caching heads from: " + category.getName()); List heads = new ArrayList<>(); @@ -119,7 +120,6 @@ public class HeadDatabase { } JSONParser parser = new JSONParser(); JSONArray array = (JSONArray) parser.parse(response.toString()); - int id = 1; for (Object o : array) { JSONObject obj = (JSONObject) o; Head head = new Head.Builder() diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index f7df6e7..65d9a9b 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -2,7 +2,8 @@ name: HeadDB description: Head Database main: tsp.headdb.HeadDB -version: 1.0 +version: 1.1 +api-version: 1.16 author: Silent commands: