use of org.spongepowered.api.data.type.SkinPart in project LanternServer by LanternPowered.
the class HumanoidEntityProtocol method update.
@Override
protected void update(ParameterList parameterList) {
super.update(parameterList);
final HandPreference dominantHand = this.entity.get(Keys.DOMINANT_HAND).orElse(HandPreferences.RIGHT);
if (dominantHand != this.lastDominantHand) {
parameterList.add(EntityParameters.Humanoid.MAIN_HAND, (byte) (dominantHand == HandPreferences.RIGHT ? 1 : 0));
this.lastDominantHand = dominantHand;
}
final Set<SkinPart> skinParts = this.entity.get(LanternKeys.DISPLAYED_SKIN_PARTS).orElse(null);
if (!Objects.equals(this.lastSkinParts, skinParts)) {
parameterList.add(EntityParameters.Humanoid.SKIN_PARTS, (byte) (skinParts == null ? 0xff : LanternSkinPart.toBitPattern(skinParts)));
this.lastSkinParts = skinParts;
}
}
Aggregations