Class LootEntry

java.lang.Object
dev.itsharshxd.zentrix.api.loot.LootEntry

public final class LootEntry extends Object
Mutable editor copy of one serialized loot entry. Saving a configuration snapshots every field, so later changes to this object do not mutate the active pool.
  • Constructor Details

    • LootEntry

      public LootEntry(@NotNull @NotNull String id, boolean enabled, @Nullable @Nullable String serializedItem, @Nullable @Nullable org.bukkit.inventory.ItemStack item, @Nullable @Nullable String itemLoadError, @NotNull @NotNull LootItemSourceType sourceType, @Nullable @Nullable String sourceId, @Nullable @Nullable String sourceLoadError, double weight, int minimumTotalAppearances, int maximumTotalAppearances, int maximumAppearancesPerContainer, int minimumQuantity, int maximumQuantity, @NotNull @NotNull Set<LootContainerType> allowedContainerTypes)
  • Method Details

    • create

      @NotNull public static @NotNull LootEntry create(@NotNull @NotNull org.bukkit.inventory.ItemStack item)
      Creates an unsaved copied-item entry with Zentrix's standard limits.
    • copy

      @NotNull public @NotNull LootEntry copy()
    • duplicate

      @NotNull public @NotNull LootEntry duplicate()
    • copyWithId

      @NotNull public @NotNull LootEntry copyWithId(@NotNull @NotNull String newId)
    • getId

      @NotNull public @NotNull String getId()
    • isEnabled

      public boolean isEnabled()
    • setEnabled

      public void setEnabled(boolean enabled)
    • getSerializedItem

      @Nullable public @Nullable String getSerializedItem()
    • getItem

      @Nullable public @Nullable org.bukkit.inventory.ItemStack getItem()
    • getItemLoadError

      @Nullable public @Nullable String getItemLoadError()
    • getSourceType

      @NotNull public @NotNull LootItemSourceType getSourceType()
    • getSourceId

      @Nullable public @Nullable String getSourceId()
    • getSourceLoadError

      @Nullable public @Nullable String getSourceLoadError()
    • getWeight

      public double getWeight()
    • setWeight

      public void setWeight(double weight)
    • getMinimumTotalAppearances

      public int getMinimumTotalAppearances()
    • setMinimumTotalAppearances

      public void setMinimumTotalAppearances(int value)
    • getMaximumTotalAppearances

      public int getMaximumTotalAppearances()
    • setMaximumTotalAppearances

      public void setMaximumTotalAppearances(int value)
    • getMaximumAppearancesPerContainer

      public int getMaximumAppearancesPerContainer()
    • setMaximumAppearancesPerContainer

      public void setMaximumAppearancesPerContainer(int value)
    • getMinimumQuantity

      public int getMinimumQuantity()
    • setMinimumQuantity

      public void setMinimumQuantity(int value)
    • getMaximumQuantity

      public int getMaximumQuantity()
    • setMaximumQuantity

      public void setMaximumQuantity(int value)
    • getAllowedContainerTypes

      @NotNull public @NotNull EnumSet<LootContainerType> getAllowedContainerTypes()
    • setContainerAllowed

      public void setContainerAllowed(@NotNull @NotNull LootContainerType type, boolean allowed)
    • allows

      public boolean allows(@NotNull @NotNull LootContainerType type)
    • replaceSerializedItem

      public void replaceSerializedItem(@Nullable @Nullable String serializedItem, @NotNull @NotNull org.bukkit.inventory.ItemStack item, @NotNull @NotNull LootItemSourceType sourceType, @Nullable @Nullable String sourceId)
      Used by the service after it safely reserializes a replacement item.