Interface GameLootService


public interface GameLootService
Independent main, Nether, End, and deathmatch pools with per-match frozen state. World, inventory, and generation operations must run on the Bukkit main thread.
Since:
1.6.0
  • Method Details

    • getActiveConfiguration

      @NotNull @NotNull LootPoolConfiguration getActiveConfiguration(@NotNull @NotNull GameLootPool pool)
    • getDiskConfiguration

      @NotNull @NotNull LootPoolConfiguration getDiskConfiguration(@NotNull @NotNull GameLootPool pool)
    • validate

      @NotNull @NotNull LootValidationResult validate(@NotNull @NotNull GameLootPool pool, @NotNull @NotNull LootPoolConfiguration configuration)
    • createEntry

      @NotNull @NotNull LootEntry createEntry(@NotNull @NotNull org.bukkit.inventory.ItemStack item)
    • replaceEntryItem

      void replaceEntryItem(@NotNull @NotNull LootEntry entry, @NotNull @NotNull org.bukkit.inventory.ItemStack item)
    • save

      @NotNull @NotNull LootSaveResult save(@NotNull @NotNull GameLootPool pool, @NotNull @NotNull LootPoolConfiguration configuration)
    • importEntries

      @NotNull @NotNull LootImportResult importEntries(@NotNull @NotNull GameLootPool pool, @NotNull @NotNull List<LootEntry> entries)
    • reload

      @NotNull @NotNull LootReloadResult reload(@NotNull @NotNull GameLootPool pool)
    • reloadAll

      boolean reloadAll()
    • preview

      @NotNull @NotNull LootGenerationResult preview(@NotNull @NotNull GameLootPool pool, @NotNull @NotNull LootPoolConfiguration configuration)
    • getRecoveryState

      @NotNull @NotNull LootRecoveryState getRecoveryState(@NotNull @NotNull GameLootPool pool)
    • restoreRecoverySnapshot

      @NotNull @NotNull LootReloadResult restoreRecoverySnapshot(@NotNull @NotNull GameLootPool pool)
    • prepareGame

      void prepareGame(@NotNull @NotNull ZentrixGame game)
      Freezes all four active configurations for a match if it has no snapshot yet.
    • getFrozenConfiguration

      @NotNull @NotNull Optional<LootPoolConfiguration> getFrozenConfiguration(@NotNull @NotNull ZentrixGame game, @NotNull @NotNull GameLootPool pool)
    • getAppearanceCounters

      @NotNull @NotNull Map<String,Integer> getAppearanceCounters(@NotNull @NotNull ZentrixGame game, @NotNull @NotNull GameLootPool pool)
    • resolve

      @NotNull @NotNull Optional<GameLootResolution> resolve(@NotNull @NotNull org.bukkit.World world)
    • resolveContainer

      @NotNull @NotNull Optional<LootContainerSnapshot> resolveContainer(@NotNull @NotNull org.bukkit.block.Block block)
    • resolveContainer

      @NotNull @NotNull Optional<LootContainerSnapshot> resolveContainer(@NotNull @NotNull org.bukkit.inventory.Inventory inventory)
    • markPlayerPlaced

      void markPlayerPlaced(@NotNull @NotNull org.bukkit.block.Block block)
    • isProcessed

      boolean isProcessed(@NotNull @NotNull ZentrixGame game, @NotNull @NotNull org.bukkit.block.Block block)
    • generateOnOpen

      @NotNull @NotNull Optional<LootGenerationResult> generateOnOpen(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull org.bukkit.inventory.Inventory inventory)
      Lazily generates an eligible original container for an active participant.
    • handleDestruction

      @NotNull @NotNull Optional<LootGenerationResult> handleDestruction(@NotNull @NotNull org.bukkit.block.Block block, boolean generateDrops)
      Consumes a destroyed section and optionally generates its loot as world drops.
    • refill

      default void refill(@NotNull @NotNull ZentrixGame game, boolean replace)
      Starts a new refill cycle for every pool of a running match, exactly like a phase's refill action with scope all.

      Refills are lazy: each container is filled again the next time a participant opens it. A replacing refill clears a container's loot slots first; otherwise new loot tops it up. Fires LootRefillEvent. Main thread only; a match without prepared loot is left alone.

      Parameters:
      replace - whether containers are cleared before being filled again
      Since:
      1.8.0
    • getRefillCycle

      @NotNull default OptionalLong getRefillCycle(@NotNull @NotNull ZentrixGame game, @NotNull @NotNull LootPool pool)
      The refill cycle a match's pool is in: 0 until the first refill, then one more per refill.
      Returns:
      the cycle; empty when the match has no state for that pool
      Since:
      1.8.0