Dieser Commit ist enthalten in:
Silent 2021-04-21 18:53:10 +02:00
Ursprung 121267a71a
Commit 26ef53ea75
7 geänderte Dateien mit 279 neuen und 319 gelöschten Zeilen

11
pom.xml
Datei anzeigen

@ -6,7 +6,7 @@
<groupId>tsp.headdb</groupId> <groupId>tsp.headdb</groupId>
<artifactId>HeadDB</artifactId> <artifactId>HeadDB</artifactId>
<version>2.1</version> <version>2.3</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>HeadDB</name> <name>HeadDB</name>
@ -66,11 +66,18 @@
<dependency> <dependency>
<groupId>net.wesjd</groupId> <groupId>net.wesjd</groupId>
<artifactId>anvilgui</artifactId> <artifactId>anvilgui</artifactId>
<version>1.4.0-SNAPSHOT</version> <version>1.5.0-SNAPSHOT</version>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins> <plugins>
<!-- Compiler --> <!-- Compiler -->
<plugin> <plugin>

Datei anzeigen

@ -3,15 +3,14 @@ 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.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
@ -36,11 +35,11 @@ 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(Material.PLAYER_HEAD); ItemStack item = new ItemStack(XMaterial.PLAYER_HEAD.parseItem());
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
GameProfile profile = new GameProfile(uuid, name); GameProfile profile = new GameProfile(uuid, null);
profile.getProperties().put("textures", new Property("textures", value)); profile.getProperties().put("textures", new Property("textures", value));
Field profileField; Field profileField;
try { try {

Datei anzeigen

@ -2,10 +2,10 @@ 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;
import tsp.headdb.util.XMaterial;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -19,7 +19,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(Material.PLAYER_HEAD); ItemStack item = new ItemStack(XMaterial.PLAYER_HEAD.parseItem());
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

@ -71,7 +71,7 @@ public class InventoryUtils {
pane.open(player); pane.open(player);
} }
public static void openSearchDatabase(Player player, String search) { public static PagedPane openSearchDatabase(Player player, String search) {
PagedPane pane = new PagedPane(4, 6, Utils.colorize("&c&lHeadDB &8- &eSearch: " + search)); PagedPane pane = new PagedPane(4, 6, Utils.colorize("&c&lHeadDB &8- &eSearch: " + search));
List<Head> heads = HeadAPI.getHeadsByName(search); List<Head> heads = HeadAPI.getHeadsByName(search);
@ -94,6 +94,7 @@ public class InventoryUtils {
} }
pane.open(player); pane.open(player);
return pane;
} }
public static void openTagSearchDatabase(Player player, String tag) { public static void openTagSearchDatabase(Player player, String tag) {

Datei anzeigen

@ -59,7 +59,7 @@ public class MenuListener implements Listener {
new AnvilGUI.Builder() new AnvilGUI.Builder()
.onComplete((p, text) -> { .onComplete((p, text) -> {
InventoryUtils.openSearchDatabase(p, text); InventoryUtils.openSearchDatabase(p, text);
return AnvilGUI.Response.text(Utils.colorize("Searching for &e" + text)); return AnvilGUI.Response.openInventory(InventoryUtils.openSearchDatabase(p, text).getInventory());
}) })
.title("Search Heads") .title("Search Heads")
.text("Name...") .text("Name...")

Datei-Diff unterdrückt, da er zu groß ist Diff laden

Datei anzeigen

@ -1,9 +1,8 @@
name: HeadDB name: ${project.name}
description: Database with thousands of heads description: ${project.description}
main: tsp.headdb.HeadDB main: tsp.headdb.HeadDB
version: 2.1 version: ${project.version}
api-version: 1.16
author: Silent author: Silent
commands: commands: