Record Class Currency
java.lang.Object
java.lang.Record
com.wdiscute.sellingbin.bin.Currency
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCurrency(net.minecraft.world.item.Item item, int value) Creates an instance of aCurrencyrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic intcalculateValueFromSingleStack(net.minecraft.world.item.ItemStack is) static intcalculateValueFromSingleStack(net.minecraft.world.item.ItemStack is, net.minecraft.world.entity.player.Player player) static intcalculateValueFromSingleStack(net.minecraft.world.item.ItemStack is, net.minecraft.world.level.block.entity.BlockEntity blockEntity) static intcalculateValueFromSingleStack(net.minecraft.world.item.ItemStack is, net.minecraft.world.level.block.entity.BlockEntity blockEntity, net.minecraft.world.entity.player.Player player) final booleanIndicates whether some other object is "equal to" this one.static List<net.minecraft.network.chat.Component> getListOfCurrenciesFromValue(List<Currency> currencies, int progressAvailable, boolean addCurrenciesText) static net.minecraft.network.chat.ComponentgetPluralTranslation(net.minecraft.world.item.Item item) static StringgetStringFromValue(int value) final inthashCode()Returns a hash code value for this object.booleanisNone()net.minecraft.world.item.Itemitem()Returns the value of theitemrecord component.final StringtoString()Returns a string representation of this record class.intvalue()Returns the value of thevaluerecord component.
-
Field Details
-
EMPTY
-
NONE
-
-
Constructor Details
-
Currency
public Currency(net.minecraft.world.item.Item item, int value) Creates an instance of aCurrencyrecord class.- Parameters:
item- the value for theitemrecord componentvalue- the value for thevaluerecord component
-
-
Method Details
-
isNone
public boolean isNone() -
getCurrencies
-
calculateValueFromSingleStack
public static int calculateValueFromSingleStack(net.minecraft.world.item.ItemStack is, net.minecraft.world.level.block.entity.BlockEntity blockEntity, @Nullable net.minecraft.world.entity.player.Player player) -
calculateValueFromSingleStack
public static int calculateValueFromSingleStack(net.minecraft.world.item.ItemStack is, net.minecraft.world.level.block.entity.BlockEntity blockEntity) -
calculateValueFromSingleStack
public static int calculateValueFromSingleStack(net.minecraft.world.item.ItemStack is, net.minecraft.world.entity.player.Player player) -
calculateValueFromSingleStack
public static int calculateValueFromSingleStack(net.minecraft.world.item.ItemStack is) -
getStringFromValue
-
getListOfCurrenciesFromValue
-
getPluralTranslation
public static net.minecraft.network.chat.Component getPluralTranslation(net.minecraft.world.item.Item item) -
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. -
item
public net.minecraft.world.item.Item item()Returns the value of theitemrecord component.- Returns:
- the value of the
itemrecord component
-
value
public int value()Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-