Class PlayerConfigHolder

java.lang.Object
com.wildfire.common.entitydata.EntityConfigHolder<PlayerConfig>
com.wildfire.common.entitydata.PlayerConfigHolder

public class PlayerConfigHolder extends EntityConfigHolder<PlayerConfig>
  • Field Details

    • needsSync

      public boolean needsSync

      true if this config should be synced to the connected server on the next attempt

      This only has an effect for the client player.

    • needsCloudSync

      public boolean needsCloudSync

      true if this config should be synced to the cloud sync server on the next attempt

      This only has an effect for the client player.

    • syncStatus

      public PlayerConfigHolder.SyncStatus syncStatus
      The current sync status of this player config
      See Also:
  • Constructor Details

    • PlayerConfigHolder

      public PlayerConfigHolder(UUID uuid)
  • Method Details

    • readFromStack

      public void readFromStack(net.minecraft.world.item.ItemStack chestplate)
      Description copied from class: EntityConfigHolder
      Copy gender settings included in the given item NBT to the current entity
      Overrides:
      readFromStack in class EntityConfigHolder<PlayerConfig>
      See Also:
    • hasJacketLayer

      public boolean hasJacketLayer()
      Description copied from class: EntityConfigHolder
      Only used in the case of armor stands; returns true if the player who equipped the armor stand's chestplate has their jacket layer visible.
      Overrides:
      hasJacketLayer in class EntityConfigHolder<PlayerConfig>
    • getSyncStatus

      public PlayerConfigHolder.SyncStatus getSyncStatus()
    • attemptCloudSync

      @Internal public void attemptCloudSync()
      API Note:
      Only use this on the client side
    • hasLocalConfig

      public boolean hasLocalConfig()
      Returns:
      true if the current player has a local config file
    • loadFromDisk

      public void loadFromDisk(boolean markForSync)
      Loads the current player's settings from a file on disk
      Parameters:
      markForSync - true if needsSync should be set to true
    • save

      public void save()
      Saves the settings stored in this PlayerConfig to the underlying Configuration, and then attempts to save 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 associated ConfigKey, 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 provided JsonObject
      Parameters:
      serialized - The JsonObject to merge with the existing config for this player
      API Note:
      This method will set the player's sync status to PlayerConfigHolder.SyncStatus.SYNCED, as it's expected that this method is only used in such cases where this would be applicable.
    • updateFromPacket

      public void updateFromPacket(PlayerConfig config, boolean fromServer)
    • getDebugInfo

      public List<String> getDebugInfo()
      Overrides:
      getDebugInfo in class EntityConfigHolder<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

      public final Sounds sounds()
    • showBreastsInArmor

      public final ConfigValue<Boolean> showBreastsInArmor()