/** * Sends the entity metadata (DataWatcher) and attributes to all players tracking this entity, including the entity * itself if a player. */ private void sendMetadataToAllAssociatedPlayers() { EntityDataManager entitydatamanager = this.trackedEntity.getDataManager(); if (entitydatamanager.isDirty()) { this.sendToTrackingAndSelf(new SPacketEntityMetadata(this.trackedEntity.getEntityId(), entitydatamanager, false)); } if (this.trackedEntity instanceof EntityLivingBase) { AttributeMap attributemap = (AttributeMap)((EntityLivingBase)this.trackedEntity).getAttributeMap(); Set<IAttributeInstance> set = attributemap.getAttributeInstanceSet(); if (!set.isEmpty()) { this.sendToTrackingAndSelf(new SPacketEntityProperties(this.trackedEntity.getEntityId(), set)); } set.clear(); } }
/** * Invoked when the server registers new proximate objects in your watchlist or when objects in your watchlist have * changed -> Registers any changes locally */ public void handleEntityMetadata(SPacketEntityMetadata packetIn) { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityId()); if (entity != null && packetIn.getDataManagerEntries() != null) { entity.getDataManager().setEntryValues(packetIn.getDataManagerEntries()); } }
/** * Invoked when the server registers new proximate objects in your watchlist or when objects in your watchlist have * changed -> Registers any changes locally */ void handleEntityMetadata(SPacketEntityMetadata packetIn);