Package net.minecraft.world.entity
Record Class DropChances
java.lang.Object
java.lang.Record
net.minecraft.world.entity.DropChances
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map
<EquipmentSlot, Float> The field for thebyEquipment
record component.static final com.mojang.serialization.Codec
<DropChances> static final DropChances
static final float
static final int
static final float
-
Constructor Summary
ConstructorsConstructorDescriptionDropChances
(Map<EquipmentSlot, Float> byEquipment) Creates an instance of aDropChances
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thebyEquipment
record component.float
byEquipment
(EquipmentSlot p_394232_) final boolean
Indicates whether some other object is "equal to" this one.private static Map
<EquipmentSlot, Float> filterDefaultValues
(Map<EquipmentSlot, Float> p_394014_) final int
hashCode()
Returns a hash code value for this object.boolean
isPreserved
(EquipmentSlot p_394426_) private static Map
<EquipmentSlot, Float> toEnumMap
(Map<EquipmentSlot, Float> p_393876_) final String
toString()
Returns a string representation of this record class.withEquipmentChance
(EquipmentSlot p_394616_, float p_394553_) withGuaranteedDrop
(EquipmentSlot p_394388_)
-
Field Details
-
byEquipment
The field for thebyEquipment
record component. -
DEFAULT_EQUIPMENT_DROP_CHANCE
public static final float DEFAULT_EQUIPMENT_DROP_CHANCE- See Also:
-
PRESERVE_ITEM_DROP_CHANCE_THRESHOLD
public static final float PRESERVE_ITEM_DROP_CHANCE_THRESHOLD- See Also:
-
PRESERVE_ITEM_DROP_CHANCE
public static final int PRESERVE_ITEM_DROP_CHANCE- See Also:
-
DEFAULT
-
CODEC
-
-
Constructor Details
-
DropChances
Creates an instance of aDropChances
record class.- Parameters:
byEquipment
- the value for thebyEquipment
record component
-
-
Method Details
-
filterDefaultValues
-
toEnumMap
-
withGuaranteedDrop
-
withEquipmentChance
-
byEquipment
-
isPreserved
-
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)
. -
byEquipment
Returns the value of thebyEquipment
record component.- Returns:
- the value of the
byEquipment
record component
-