For version 2.7-SNAPSHOT.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>net.jitse</groupId>
|
||||
<artifactId>npclib-nms</artifactId>
|
||||
<version>2.6-SNAPSHOT</version>
|
||||
<version>2.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>npclib-nms-v1_10_R1</artifactId>
|
||||
|
||||
@@ -4,7 +4,10 @@
|
||||
|
||||
package net.jitse.npclib.nms.v1_10_R1;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import com.mojang.authlib.properties.Property;
|
||||
import net.jitse.npclib.NPCLib;
|
||||
import net.jitse.npclib.api.skin.Skin;
|
||||
import net.jitse.npclib.api.state.NPCSlot;
|
||||
import net.jitse.npclib.hologram.Hologram;
|
||||
import net.jitse.npclib.internal.MinecraftVersion;
|
||||
@@ -105,4 +108,19 @@ public class NPC_v1_10_R1 extends NPCBase {
|
||||
PacketPlayOutEntityEquipment packet = new PacketPlayOutEntityEquipment(entityId, nmsSlot, CraftItemStack.asNMSCopy(item));
|
||||
playerConnection.sendPacket(packet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSkin(Skin skin) {
|
||||
GameProfile newProfile = new GameProfile(uuid, name);
|
||||
newProfile.getProperties().get("textures").clear();
|
||||
newProfile.getProperties().put("textures", new Property("textures", skin.getValue(), skin.getSignature()));
|
||||
this.packetPlayOutPlayerInfoAdd = new PacketPlayOutPlayerInfoWrapper().create(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, newProfile, name);
|
||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
||||
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().playerConnection;
|
||||
playerConnection.sendPacket(packetPlayOutPlayerInfoRemove);
|
||||
playerConnection.sendPacket(packetPlayOutEntityDestroy);
|
||||
playerConnection.sendPacket(packetPlayOutPlayerInfoAdd);
|
||||
playerConnection.sendPacket(packetPlayOutNamedEntitySpawn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user