geforkt von Mirrors/HeadDB
Fix some issues with head texture
Dieser Commit ist enthalten in:
Ursprung
f941d2f367
Commit
ddf0e10c19
27
pom.xml
27
pom.xml
@ -6,19 +6,7 @@
|
|||||||
|
|
||||||
<groupId>tsp.headdb</groupId>
|
<groupId>tsp.headdb</groupId>
|
||||||
<artifactId>HeadDB</artifactId>
|
<artifactId>HeadDB</artifactId>
|
||||||
<version>1.0</version>
|
<version>1.1</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>
|
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>HeadDB</name>
|
<name>HeadDB</name>
|
||||||
@ -56,4 +44,17 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</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>
|
</project>
|
@ -3,12 +3,12 @@ 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;
|
||||||
import tsp.headdb.util.Log;
|
import tsp.headdb.util.Log;
|
||||||
import tsp.headdb.util.Utils;
|
import tsp.headdb.util.Utils;
|
||||||
import tsp.headdb.util.XMaterial;
|
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@ -28,7 +28,7 @@ public class Head {
|
|||||||
Validate.notNull(value, "value must not be null!");
|
Validate.notNull(value, "value must not be null!");
|
||||||
Validate.notNull(category, "category 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) {
|
if (item != null) {
|
||||||
SkullMeta meta = (SkullMeta) item.getItemMeta();
|
SkullMeta meta = (SkullMeta) item.getItemMeta();
|
||||||
meta.setDisplayName(Utils.colorize(category.getColor() + name));
|
meta.setDisplayName(Utils.colorize(category.getColor() + name));
|
||||||
|
@ -100,6 +100,7 @@ public class HeadDatabase {
|
|||||||
Map<Category, List<Head>> result = new HashMap<>();
|
Map<Category, List<Head>> result = new HashMap<>();
|
||||||
List<Category> categories = Category.getCategories();
|
List<Category> categories = Category.getCategories();
|
||||||
|
|
||||||
|
int id = 1;
|
||||||
for (Category category : categories) {
|
for (Category category : categories) {
|
||||||
Log.debug("Caching heads from: " + category.getName());
|
Log.debug("Caching heads from: " + category.getName());
|
||||||
List<Head> heads = new ArrayList<>();
|
List<Head> heads = new ArrayList<>();
|
||||||
@ -119,7 +120,6 @@ public class HeadDatabase {
|
|||||||
}
|
}
|
||||||
JSONParser parser = new JSONParser();
|
JSONParser parser = new JSONParser();
|
||||||
JSONArray array = (JSONArray) parser.parse(response.toString());
|
JSONArray array = (JSONArray) parser.parse(response.toString());
|
||||||
int id = 1;
|
|
||||||
for (Object o : array) {
|
for (Object o : array) {
|
||||||
JSONObject obj = (JSONObject) o;
|
JSONObject obj = (JSONObject) o;
|
||||||
Head head = new Head.Builder()
|
Head head = new Head.Builder()
|
||||||
|
@ -2,7 +2,8 @@ name: HeadDB
|
|||||||
description: Head Database
|
description: Head Database
|
||||||
|
|
||||||
main: tsp.headdb.HeadDB
|
main: tsp.headdb.HeadDB
|
||||||
version: 1.0
|
version: 1.1
|
||||||
|
api-version: 1.16
|
||||||
author: Silent
|
author: Silent
|
||||||
|
|
||||||
commands:
|
commands:
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren