Record Class EquipmentNumberProvider
java.lang.Object
java.lang.Record
com.petrolpark.core.data.loot.numberprovider.entity.EquipmentNumberProvider
- All Implemented Interfaces:
EntityNumberProvider,net.minecraft.world.level.storage.loot.LootContextUser
public record EquipmentNumberProvider(net.minecraft.world.entity.EquipmentSlot slot, ItemStackNumberProvider value)
extends Record
implements EntityNumberProvider
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<EquipmentNumberProvider> Fields inherited from interface com.petrolpark.core.data.loot.numberprovider.entity.EntityNumberProvider
TYPED_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionEquipmentNumberProvider(net.minecraft.world.entity.EquipmentSlot slot, ItemStackNumberProvider value) Creates an instance of aEquipmentNumberProviderrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.floatgetFloat(net.minecraft.world.entity.Entity entity, net.minecraft.world.level.storage.loot.LootContext lootContext) floatgetMaxFloat(net.minecraft.world.entity.Entity entity, net.minecraft.world.level.storage.loot.LootContext lootContext) Set<net.minecraft.world.level.storage.loot.parameters.LootContextParam<?>> getType()final inthashCode()Returns a hash code value for this object.net.minecraft.world.entity.EquipmentSlotslot()Returns the value of theslotrecord component.final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.world.level.storage.loot.LootContextUser
validate
-
Field Details
-
CODEC
-
-
Constructor Details
-
EquipmentNumberProvider
public EquipmentNumberProvider(net.minecraft.world.entity.EquipmentSlot slot, ItemStackNumberProvider value) Creates an instance of aEquipmentNumberProviderrecord class.- Parameters:
slot- the value for theslotrecord componentvalue- the value for thevaluerecord component
-
-
Method Details
-
getFloat
public float getFloat(net.minecraft.world.entity.Entity entity, net.minecraft.world.level.storage.loot.LootContext lootContext) - Specified by:
getFloatin interfaceEntityNumberProvider
-
getMaxFloat
public float getMaxFloat(net.minecraft.world.entity.Entity entity, net.minecraft.world.level.storage.loot.LootContext lootContext) - Specified by:
getMaxFloatin interfaceEntityNumberProvider
-
getEstimate
- Specified by:
getEstimatein interfaceEntityNumberProvider
-
getReferencedContextParams
public Set<net.minecraft.world.level.storage.loot.parameters.LootContextParam<?>> getReferencedContextParams()- Specified by:
getReferencedContextParamsin interfacenet.minecraft.world.level.storage.loot.LootContextUser
-
getType
- Specified by:
getTypein interfaceEntityNumberProvider
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
slot
public net.minecraft.world.entity.EquipmentSlot slot()Returns the value of theslotrecord component.- Returns:
- the value of the
slotrecord component
-
value
Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-