Class PlayerConfigHolder
java.lang.Object
com.wildfire.common.entities.EntityConfigHolder<AvatarConfig>
com.wildfire.common.entities.avatars.AbstractAvatarConfigHolder
com.wildfire.common.entities.players.PlayerConfigHolder
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleantrueif this config should be synced to thecloud sync serveron the next attemptbooleantrueif this config should be synced to the connected server on the next attemptThe current sync status of this player configFields inherited from class EntityConfigHolder
breastPhysics, config, forceSimplifiedPhysics, uuid -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanvoidloadFromDisk(boolean markForSync) Loads the current player's settings from a file on diskvoidsave()Saves the settings stored in thisAvatarConfigto the underlyingConfiguration, and then attempts tosave to disk.com.google.gson.JsonElementtoJson()Returns a copy of the player's current configuration; the stored values are guaranteed to be valid for the associatedConfigKey, and does not include any unrecognized keys.voidupdateFromJson(com.google.gson.JsonElement serialized) Update player data from the providedJsonObjectvoidupdateFromPacket(AvatarConfig config) Methods inherited from class AbstractAvatarConfigHolder
showBreastsInArmor, sounds, tryPlayHurtSoundMethods inherited from class EntityConfigHolder
breastPhysics, breasts, config, gender, toString, uvs
-
Field Details
-
needsSync
public volatile boolean needsSynctrueif this config should be synced to the connected server on the next attemptThis only has an effect for the client player.
-
needsCloudSync
public volatile boolean needsCloudSynctrueif this config should be synced to thecloud sync serveron the next attemptThis only has an effect for the client player.
-
syncStatus
-
-
Constructor Details
-
PlayerConfigHolder
-
-
Method Details
-
getSyncStatus
-
attemptCloudSync
@Internal public void attemptCloudSync()- API Note:
- Only use this on the client side
-
hasLocalConfig
public boolean hasLocalConfig()- Returns:
trueif the current playerhas a local config file
-
loadFromDisk
public void loadFromDisk(boolean markForSync) Loads the current player's settings from a file on disk- Parameters:
markForSync-trueifneedsSyncshould be set to true
-
save
public void save()Saves the settings stored in thisAvatarConfigto the underlyingConfiguration, and then attempts tosave to disk. -
toJson
public com.google.gson.JsonElement toJson()Returns a copy of the player's current configuration; the stored values are guaranteed to be valid for the associatedConfigKey, and does not include any unrecognized keys.- Returns:
- A new copy of the player's
saved config values
-
updateFromJson
public void updateFromJson(com.google.gson.JsonElement serialized) Update player data from the providedJsonObject- Overrides:
updateFromJsonin classAbstractAvatarConfigHolder- Parameters:
serialized- TheJsonObjectto merge with the existing config for this player- API Note:
- This method will set the player's
sync statustoSyncStatus.SYNCED, as it's expected that this method is only used in such cases where this would be applicable.
-
updateFromPacket
- Specified by:
updateFromPacketin classAbstractAvatarConfigHolder
-
getDebugInfo
- Overrides:
getDebugInfoin classAbstractAvatarConfigHolder
-