Interface Sharable<T>

Type Parameters:
T - The type of data that this sharable represents.

public interface Sharable<T>
An interface for any attribute that can be shared between worlds in a world group. These objects are intended to be used as constants and may not function properly otherwise.
  • Method Details

    • getNames

      String[] getNames()
      Returns:
      The names of this Sharable for setting as shared in the config. There should ALWAYS be a index-0 which represents the main name, and the one that will be used for storing the sharable in a groups shares list in the config file. All names in this array may be used to set a group as sharing this Sharable.
    • getHandler

      SharableHandler<T> getHandler()
      Returns:
      The object that will handle changing out the player's data with the profile's data and vice versa when a player changes worlds.
    • getSerializer

      SharableSerializer<T> getSerializer()
      Returns:
      The object that will handle serializing a profile's data for this sharable for saving/loading in the profile's data file. If this is null it means that persistence is not handled by Multiverse-Inventories for this Sharable.
    • getProfileEntry

      ProfileEntry getProfileEntry()
      Returns:
      The profile entry that describes how to store this Sharable in a profile's data file. This may NOT be null if this Sharable getSerializer() is not null. If getSerializer() IS null, this method is never called.
    • getType

      Class<T> getType()
      Returns:
      The type of data this Sharable represents. Used primarily for casting.
    • isOptional

      boolean isOptional()
      Returns:
      True if this Sharable is optional. That is to say that it is completely ignored when share handling takes place UNLESS it is present in InventoriesConfig.getActiveOptionalShares().