Record Class BlockType
java.lang.Object
java.lang.Record
dev.yowsef.stealablock.api.block.BlockType
public record BlockType(@NotNull String id, @NotNull String providerName, @Nullable String customId, @NotNull org.bukkit.Material material, @NotNull String displayName, @NotNull String rarity, @NotNull String mutationId, double baseIncome, double sellValue, @Nullable String fusionTargetId, @NotNull org.bukkit.block.data.BlockData blockData, @NotNull org.bukkit.inventory.ItemStack itemSnapshot)
extends Record
Immutable snapshot of a registered block definition in
blocks.yml.-
Constructor Summary
ConstructorsConstructorDescriptionBlockType(@NotNull String id, @NotNull String providerName, @Nullable String customId, @NotNull org.bukkit.Material material, @NotNull String displayName, @NotNull String rarity, @NotNull String mutationId, double baseIncome, double sellValue, @Nullable String fusionTargetId, @NotNull org.bukkit.block.data.BlockData blockData, @NotNull org.bukkit.inventory.ItemStack itemSnapshot) Creates an instance of aBlockTyperecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of thebaseIncomerecord component.@NotNull org.bukkit.block.data.BlockDataReturns the value of theblockDatarecord component.@NotNull org.bukkit.inventory.ItemStack@Nullable StringcustomId()Returns the value of thecustomIdrecord component.@NotNull StringReturns the value of thedisplayNamerecord component.final booleanIndicates whether some other object is "equal to" this one.@Nullable StringReturns the value of thefusionTargetIdrecord component.final inthashCode()Returns a hash code value for this object.@NotNull Stringid()Returns the value of theidrecord component.boolean@NotNull org.bukkit.inventory.ItemStackReturns the value of theitemSnapshotrecord component.@NotNull org.bukkit.Materialmaterial()Returns the value of thematerialrecord component.@NotNull StringReturns the value of themutationIdrecord component.@NotNull StringReturns the value of theproviderNamerecord component.@NotNull Stringrarity()Returns the value of therarityrecord component.doubleReturns the value of thesellValuerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
BlockType
public BlockType(@NotNull @NotNull String id, @NotNull @NotNull String providerName, @Nullable @Nullable String customId, @NotNull @NotNull org.bukkit.Material material, @NotNull @NotNull String displayName, @NotNull @NotNull String rarity, @NotNull @NotNull String mutationId, double baseIncome, double sellValue, @Nullable @Nullable String fusionTargetId, @NotNull @NotNull org.bukkit.block.data.BlockData blockData, @NotNull @NotNull org.bukkit.inventory.ItemStack itemSnapshot) Creates an instance of aBlockTyperecord class.- Parameters:
id- the value for theidrecord componentproviderName- the value for theproviderNamerecord componentcustomId- the value for thecustomIdrecord componentmaterial- the value for thematerialrecord componentdisplayName- the value for thedisplayNamerecord componentrarity- the value for therarityrecord componentmutationId- the value for themutationIdrecord componentbaseIncome- the value for thebaseIncomerecord componentsellValue- the value for thesellValuerecord componentfusionTargetId- the value for thefusionTargetIdrecord componentblockData- the value for theblockDatarecord componentitemSnapshot- the value for theitemSnapshotrecord component
-
-
Method Details
-
isCustomBlock
public boolean isCustomBlock() -
createItemStack
@NotNull public @NotNull org.bukkit.inventory.ItemStack createItemStack() -
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
providerName
Returns the value of theproviderNamerecord component.- Returns:
- the value of the
providerNamerecord component
-
customId
Returns the value of thecustomIdrecord component.- Returns:
- the value of the
customIdrecord component
-
material
@NotNull public @NotNull org.bukkit.Material material()Returns the value of thematerialrecord component.- Returns:
- the value of the
materialrecord component
-
displayName
Returns the value of thedisplayNamerecord component.- Returns:
- the value of the
displayNamerecord component
-
rarity
Returns the value of therarityrecord component.- Returns:
- the value of the
rarityrecord component
-
mutationId
Returns the value of themutationIdrecord component.- Returns:
- the value of the
mutationIdrecord component
-
baseIncome
public double baseIncome()Returns the value of thebaseIncomerecord component.- Returns:
- the value of the
baseIncomerecord component
-
sellValue
public double sellValue()Returns the value of thesellValuerecord component.- Returns:
- the value of the
sellValuerecord component
-
fusionTargetId
Returns the value of thefusionTargetIdrecord component.- Returns:
- the value of the
fusionTargetIdrecord component
-
blockData
@NotNull public @NotNull org.bukkit.block.data.BlockData blockData()Returns the value of theblockDatarecord component.- Returns:
- the value of the
blockDatarecord component
-
itemSnapshot
@NotNull public @NotNull org.bukkit.inventory.ItemStack itemSnapshot()Returns the value of theitemSnapshotrecord component.- Returns:
- the value of the
itemSnapshotrecord component
-