private WrappedSignedProperty convertToProperty(SkinModel skinData) { String encodedValue = skinData.getEncodedValue(); String signature = skinData.getSignature(); return WrappedSignedProperty.fromValues(SkinProperty.SKIN_KEY, encodedValue, signature); } }
private Property[] toProperties(SkinModel targetSkin) { if (targetSkin == null) { return emptyProperties; } String encodedValue = targetSkin.getEncodedValue(); String signature = targetSkin.getSignature(); Property prop = new Property(SkinProperty.SKIN_KEY, encodedValue, signature); return new Property[]{prop}; } }
@Override public void applyProperties(GameProfile profile, SkinModel targetSkin) { //remove existing skins profile.getPropertyMap().clear(); if (targetSkin != null) { GameProfileManager profileManager = Sponge.getServer().getGameProfileManager(); ProfileProperty profileProperty = profileManager.createProfileProperty(SkinProperty.SKIN_KEY , targetSkin.getEncodedValue(), targetSkin.getSignature()); profile.getPropertyMap().put(SkinProperty.SKIN_KEY, profileProperty); } }
@Override public void writeTo(ByteArrayDataOutput out) { out.writeBoolean(allowed); out.writeInt(skin.getRowId()); out.writeUTF(skin.getEncodedValue()); out.writeUTF(skin.getSignature()); out.writeUTF(receiverUUID.toString()); }
@Override public void writeTo(ByteArrayDataOutput out) { out.writeInt(targetSkin.getRowId()); out.writeUTF(targetSkin.getEncodedValue()); out.writeUTF(targetSkin.getSignature()); out.writeUTF(receiverUUD.toString()); out.writeBoolean(skinPerm); out.writeBoolean(isOp); }