Class LootContainerFilledEvent
java.lang.Object
org.bukkit.event.Event
dev.itsharshxd.zentrix.api.events.ZentrixEvent
dev.itsharshxd.zentrix.api.events.ZentrixGameEvent
dev.itsharshxd.zentrix.api.events.loot.LootContainerFilledEvent
Called after Zentrix generated lazy loot for a container, once per pool.
For an opened container the loot is already in getInventory(), which listeners may
edit directly - add, remove or replace items - before the player sees it. For a destroyed
container nothing has dropped yet: getDrops() is the mutable list of items about to drop
at its location. Appearance counters and the generation result are final either way; editing
items does not give back or consume appearances of the pool's entries.
Main thread; only fired while a listener is registered.
- Since:
- 1.8.0
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionLootContainerFilledEvent(@NotNull ZentrixGame game, @NotNull LootPool pool, @NotNull LootContainerType containerType, @NotNull org.bukkit.Location location, @Nullable org.bukkit.entity.Player player, long cycle, @NotNull LootGenerationResult result, @Nullable org.bukkit.inventory.Inventory inventory, @Nullable List<org.bukkit.inventory.ItemStack> drops) -
Method Summary
Modifier and TypeMethodDescription@NotNull LootContainerTypeThe kind of container.longgetCycle()The refill cycle generated: 0 for the first fill, then one more per refill.@NotNull List<org.bukkit.inventory.ItemStack> getDrops()The items about to drop from a destroyed container, which listeners may change; an empty, unused list for an opened container.static @NotNull org.bukkit.event.HandlerList@NotNull org.bukkit.event.HandlerListGets the handler list for this event.@NotNull Optional<org.bukkit.inventory.Inventory> The container's live inventory holding the loot; empty for a destroyed container.@NotNull org.bukkit.LocationWhere the container is; a copy.@NotNull Optional<org.bukkit.entity.Player> The participant who opened it; empty when it was destroyed.@NotNull LootPoolgetPool()The pool the loot came from.@NotNull LootGenerationResultWhat was generated: placements, appearances that found no room, failures.booleanWhether the container was destroyed, so the loot drops rather than staying inside.Methods inherited from class dev.itsharshxd.zentrix.api.events.ZentrixGameEvent
getArenaName, getGame, getGameId, getGameState, getGameTypeName, getPlayerCount, getRuntimeId, getSourceArenaNameMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
LootContainerFilledEvent
public LootContainerFilledEvent(@NotNull @NotNull ZentrixGame game, @NotNull @NotNull LootPool pool, @NotNull @NotNull LootContainerType containerType, @NotNull @NotNull org.bukkit.Location location, @Nullable @Nullable org.bukkit.entity.Player player, long cycle, @NotNull @NotNull LootGenerationResult result, @Nullable @Nullable org.bukkit.inventory.Inventory inventory, @Nullable @Nullable List<org.bukkit.inventory.ItemStack> drops)
-
-
Method Details
-
getPool
The pool the loot came from. -
getContainerType
The kind of container. -
getLocation
@NotNull public @NotNull org.bukkit.Location getLocation()Where the container is; a copy. -
getPlayer
The participant who opened it; empty when it was destroyed. -
getCycle
public long getCycle()The refill cycle generated: 0 for the first fill, then one more per refill. -
getResult
What was generated: placements, appearances that found no room, failures. -
isDestroyed
public boolean isDestroyed()Whether the container was destroyed, so the loot drops rather than staying inside. -
getInventory
The container's live inventory holding the loot; empty for a destroyed container. -
getDrops
The items about to drop from a destroyed container, which listeners may change; an empty, unused list for an opened container. -
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()Description copied from class:ZentrixGameEventGets the handler list for this event.- Overrides:
getHandlersin classZentrixGameEvent- Returns:
- The handler list
-
getHandlerList
@NotNull public static @NotNull org.bukkit.event.HandlerList getHandlerList()
-