Package dev.itsharshxd.zentrix.api.loot
Record Class LootPlacement
java.lang.Object
java.lang.Record
dev.itsharshxd.zentrix.api.loot.LootPlacement
public record LootPlacement(@NotNull String entryId, int quantity, @NotNull String containerId, @NotNull LootContainerType containerType, int slot, @NotNull org.bukkit.inventory.ItemStack item)
extends Record
One generated item appearance and its destination slot.
-
Constructor Summary
ConstructorsConstructorDescriptionLootPlacement(@NotNull String entryId, int quantity, @NotNull String containerId, @NotNull LootContainerType containerType, int slot, @NotNull org.bukkit.inventory.ItemStack item) Creates an instance of aLootPlacementrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull StringReturns the value of thecontainerIdrecord component.@NotNull LootContainerTypeReturns the value of thecontainerTyperecord component.@NotNull StringentryId()Returns the value of theentryIdrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.org.bukkit.inventory.ItemStackitem()Returns the value of theitemrecord component.intquantity()Returns the value of thequantityrecord component.intslot()Returns the value of theslotrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
LootPlacement
public LootPlacement(@NotNull @NotNull String entryId, int quantity, @NotNull @NotNull String containerId, @NotNull @NotNull LootContainerType containerType, int slot, @NotNull @NotNull org.bukkit.inventory.ItemStack item) Creates an instance of aLootPlacementrecord class.- Parameters:
entryId- the value for theentryIdrecord componentquantity- the value for thequantityrecord componentcontainerId- the value for thecontainerIdrecord componentcontainerType- the value for thecontainerTyperecord componentslot- the value for theslotrecord componentitem- the value for theitemrecord component
-
-
Method Details
-
item
public org.bukkit.inventory.ItemStack item()Returns the value of theitemrecord component.- Returns:
- the value of the
itemrecord component
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
entryId
Returns the value of theentryIdrecord component.- Returns:
- the value of the
entryIdrecord component
-
quantity
public int quantity()Returns the value of thequantityrecord component.- Returns:
- the value of the
quantityrecord component
-
containerId
Returns the value of thecontainerIdrecord component.- Returns:
- the value of the
containerIdrecord component
-
containerType
Returns the value of thecontainerTyperecord component.- Returns:
- the value of the
containerTyperecord component
-
slot
public int slot()Returns the value of theslotrecord component.- Returns:
- the value of the
slotrecord component
-