use of net.minecraft.network.play.server.SPacketEntityProperties in project SpongeCommon by SpongePowered.
the class MixinEntityPlayerMP method refreshScaledHealth.
@Override
public void refreshScaledHealth() {
// We need to use the dirty instances to signify that the player needs to ahve it updated, instead
// of modifying the attribute instances themselves, we bypass other potentially detrimental logi
// that would otherwise break the actual health scaling.
final Set<IAttributeInstance> dirtyInstances = ((AttributeMap) this.getAttributeMap()).getDirtyInstances();
injectScaledHealth(dirtyInstances, true);
// Send the new information to the client.
sendHealthUpdate();
this.connection.sendPacket(new SPacketEntityProperties(this.getEntityId(), dirtyInstances));
// Reset the dirty instances since they've now been manually updated on the client.
dirtyInstances.clear();
}
Aggregations