Class PlayerConfigHolder
java.lang.Object
com.wildfire.common.entitydata.EntityConfigHolder<PlayerConfig>
com.wildfire.common.entitydata.PlayerConfigHolder
-
Nested Class Summary
Nested Classes -
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, CACHE, config, forceSimplifiedPhysics, fromComponent, jacketLayer, uuid -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanOnly used in the case ofarmor stands; returnstrueif the player who equipped the armor stand's chestplate has their jacket layer visible.booleanvoidloadFromDisk(boolean markForSync) Loads the current player's settings from a file on diskvoidreadFromStack(net.minecraft.world.item.ItemStack chestplate) Copy gender settings included in the givenitem NBTto the current entityvoidsave()Saves the settings stored in thisPlayerConfigto the underlyingConfiguration, and then attempts tosave to disk.final ConfigValue<Boolean> final Soundssounds()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.voidtryPlayHurtSound(net.minecraft.world.entity.player.Player player) Play the relevant mod hurt sound when a player takes damagevoidupdateFromJson(com.google.gson.JsonElement serialized) Update player data from the providedJsonObjectvoidupdateFromPacket(PlayerConfig config, boolean fromServer) Methods inherited from class EntityConfigHolder
breastPhysics, breasts, config, gender, getEntity, toString, uvs
-
Field Details
-
needsSync
public 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 boolean needsCloudSynctrueif this config should be synced to thecloud sync serveron the next attemptThis only has an effect for the client player.
-
syncStatus
The current sync status of this player config- See Also:
-
-
Constructor Details
-
PlayerConfigHolder
-
-
Method Details
-
readFromStack
public void readFromStack(net.minecraft.world.item.ItemStack chestplate) Description copied from class:EntityConfigHolderCopy gender settings included in the givenitem NBTto the current entity- Overrides:
readFromStackin classEntityConfigHolder<PlayerConfig>- See Also:
-
hasJacketLayer
public boolean hasJacketLayer()Description copied from class:EntityConfigHolderOnly used in the case ofarmor stands; returnstrueif the player who equipped the armor stand's chestplate has their jacket layer visible.- Overrides:
hasJacketLayerin classEntityConfigHolder<PlayerConfig>
-
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 thisPlayerConfigto 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- Parameters:
serialized- TheJsonObjectto merge with the existing config for this player- API Note:
- This method will set the player's
sync statustoPlayerConfigHolder.SyncStatus.SYNCED, as it's expected that this method is only used in such cases where this would be applicable.
-
updateFromPacket
-
getDebugInfo
- Overrides:
getDebugInfoin classEntityConfigHolder<PlayerConfig>
-
tryPlayHurtSound
public void tryPlayHurtSound(net.minecraft.world.entity.player.Player player) Play the relevant mod hurt sound when a player takes damage- API Note:
- Only call this on the client side as sounds are only registered on the client.
-
sounds
-
showBreastsInArmor
-