@@ -4,6 +4,8 @@
|
||||
|
||||
package net.jitse.npclib.api;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import com.mojang.authlib.properties.Property;
|
||||
import net.jitse.npclib.NPCManager;
|
||||
import net.jitse.npclib.events.NPCDestroyEvent;
|
||||
import net.jitse.npclib.events.NPCSpawnEvent;
|
||||
@@ -37,6 +39,7 @@ public abstract class NPC implements PacketHandler, ActionHandler {
|
||||
protected final List<String> lines;
|
||||
|
||||
protected JavaPlugin plugin;
|
||||
protected GameProfile gameProfile;
|
||||
protected Location location;
|
||||
|
||||
public NPC(JavaPlugin plugin, Skin skin, double autoHideDistance, List<String> lines) {
|
||||
@@ -48,6 +51,17 @@ public abstract class NPC implements PacketHandler, ActionHandler {
|
||||
NPCManager.add(this);
|
||||
}
|
||||
|
||||
protected GameProfile generateGameProfile(UUID uuid, String name) {
|
||||
GameProfile gameProfile = new GameProfile(uuid, name);
|
||||
|
||||
if (skin != null) {
|
||||
gameProfile.getProperties().put("textures", new Property("textures", skin.getValue(), skin.getSignature()));
|
||||
}
|
||||
|
||||
return gameProfile;
|
||||
}
|
||||
|
||||
|
||||
public void destroy() {
|
||||
destroy(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user