Class MemoriesPlugin

All Implemented Interfaces:
CommandOwner

public class MemoriesPlugin extends JavaPlugin
  • Field Details

    • MEMORIES_JSON_PATH

      @Nonnull public static final String MEMORIES_JSON_PATH
      The legacy path to the memories JSON file, relative to the universe directory. Migrated into the universe resources directory on setup.
      See Also:
    • RECORDED_MEMORIES_ID

      @Nonnull public static final String RECORDED_MEMORIES_ID
      The universe resource id for the recorded memories.
      See Also:
  • Constructor Details

    • MemoriesPlugin

      public MemoriesPlugin(@Nonnull JavaPluginInit init)
  • Method Details

    • get

      public static MemoriesPlugin get()
    • getConfig

    • getPlayerMemoriesComponentType

      public ComponentType<EntityStore, PlayerMemories> getPlayerMemoriesComponentType()
    • registerMemoryProvider

      public <T extends Memory> void registerMemoryProvider(MemoryProvider<T> memoryProvider)
    • getAllMemories

      @Nonnull public Map<String, Set<Memory>> getAllMemories()
    • getMemoriesLevel

      public int getMemoriesLevel(@Nonnull GameplayConfig gameplayConfig)
      Computes the current Memories level for a given config.
      Parameters:
      gameplayConfig - The gameplay config to get the Memories level for.
      Returns:
      The level of Memories - it starts from 1.
    • hasRecordedMemory

      public boolean hasRecordedMemory(Memory memory)
    • recordPlayerMemories

      public boolean recordPlayerMemories(@Nonnull PlayerMemories playerMemories)
    • getRecordedMemories

      @Nonnull public Set<Memory> getRecordedMemories()
    • clearRecordedMemories

      public void clearRecordedMemories()
    • recordAllMemories

      public void recordAllMemories()
    • setRecordedMemoriesCount

      public int setRecordedMemoriesCount(int count)
      Sets the number of recorded memories to a specific count for testing purposes. This will clear existing recorded memories and add the specified number of memories from all available memories.
      Parameters:
      count - The number of memories to record. If count exceeds available memories, all memories will be recorded.
      Returns:
      The actual number of memories recorded.