Fix some issues with head texture

Dieser Commit ist enthalten in:
Silent 2020-10-30 16:49:13 +01:00
Ursprung f941d2f367
Commit ddf0e10c19
4 geänderte Dateien mit 19 neuen und 17 gelöschten Zeilen

27
pom.xml
Datei anzeigen

@ -6,19 +6,7 @@
<groupId>tsp.headdb</groupId>
<artifactId>HeadDB</artifactId>
<version>1.0</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins>
</build>
<version>1.1</version>
<packaging>jar</packaging>
<name>HeadDB</name>
@ -56,4 +44,17 @@
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>

Datei anzeigen

@ -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));

Datei anzeigen

@ -100,6 +100,7 @@ public class HeadDatabase {
Map<Category, List<Head>> result = new HashMap<>();
List<Category> categories = Category.getCategories();
int id = 1;
for (Category category : categories) {
Log.debug("Caching heads from: " + category.getName());
List<Head> 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()

Datei anzeigen

@ -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: