Package net.minecraft.world.entity
Record Class EquipmentTable
java.lang.Object
java.lang.Record
net.minecraft.world.entity.EquipmentTable
public record EquipmentTable(ResourceKey<LootTable> lootTable, Map<EquipmentSlot,Float> slotDropChances)
extends Record
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<EquipmentTable> static final com.mojang.serialization.Codec
<Map<EquipmentSlot, Float>> private final ResourceKey
<LootTable> The field for thelootTable
record component.private final Map
<EquipmentSlot, Float> The field for theslotDropChances
record component. -
Constructor Summary
ConstructorDescriptionEquipmentTable
(ResourceKey<LootTable> lootTable, Map<EquipmentSlot, Float> slotDropChances) Creates an instance of aEquipmentTable
record class. -
Method Summary
Modifier and TypeMethodDescriptionprivate static Map
<EquipmentSlot, Float> createForAllSlots
(float p_340946_) private static Map
<EquipmentSlot, Float> createForAllSlots
(List<EquipmentSlot> p_340910_, float p_341369_) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of thelootTable
record component.Returns the value of theslotDropChances
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
lootTable
The field for thelootTable
record component. -
slotDropChances
The field for theslotDropChances
record component. -
DROP_CHANCES_CODEC
-
CODEC
-
-
Constructor Details
-
EquipmentTable
Creates an instance of aEquipmentTable
record class.- Parameters:
lootTable
- the value for thelootTable
record componentslotDropChances
- the value for theslotDropChances
record component
-
-
Method Details
-
createForAllSlots
-
createForAllSlots
private static Map<EquipmentSlot,Float> createForAllSlots(List<EquipmentSlot> p_340910_, float p_341369_) -
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)
. -
lootTable
Returns the value of thelootTable
record component.- Returns:
- the value of the
lootTable
record component
-
slotDropChances
Returns the value of theslotDropChances
record component.- Returns:
- the value of the
slotDropChances
record component
-