Package net.citizensnpcs.npc.skin
Class SkinPacketTracker
java.lang.Object
net.citizensnpcs.npc.skin.SkinPacketTracker
Handles and synchronizes add and remove packets for Player type NPC's in order to properly apply the NPC skin.
 
Used as one instance per NPC entity.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiongetSkin()Get the NPC skin.voidnotifySkinChange(boolean forceUpdate) Notify that the NPC skin has been changed.voidInvoke when the NPC entity is removed.voidInvoke when the NPC entity is spawned.voidupdateNearbyViewers(double radius) Send skin related packets to all nearby players within the specified block radius.voidupdateViewer(Player player) Send skin related packets to a player.
- 
Constructor Details- 
SkinPacketTrackerConstructor.- Parameters:
- entity- The skinnable entity the instance belongs to.
 
 
- 
- 
Method Details- 
getSkinGet the NPC skin.
- 
notifySkinChangepublic void notifySkinChange(boolean forceUpdate) Notify that the NPC skin has been changed.
- 
onRemoveNPCpublic void onRemoveNPC()Invoke when the NPC entity is removed.Sends remove packets to all players. 
- 
onSpawnNPCpublic void onSpawnNPC()Invoke when the NPC entity is spawned.
- 
updateNearbyViewerspublic void updateNearbyViewers(double radius) Send skin related packets to all nearby players within the specified block radius.- Parameters:
- radius- The radius.
 
- 
updateViewerSend skin related packets to a player.- Parameters:
- player- The player.
 
 
-