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
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<EquipmentTable> static final com.mojang.serialization.Codec<Map<EquipmentSlot, Float>> private final ResourceKey<LootTable> The field for thelootTablerecord component.private final Map<EquipmentSlot, Float> The field for theslotDropChancesrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionEquipmentTable(ResourceKey<LootTable> lootTable, Map<EquipmentSlot, Float> slotDropChances) Creates an instance of aEquipmentTablerecord 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 booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thelootTablerecord component.Returns the value of theslotDropChancesrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
lootTable
The field for thelootTablerecord component. -
slotDropChances
The field for theslotDropChancesrecord component. -
DROP_CHANCES_CODEC
-
CODEC
-
-
Constructor Details
-
EquipmentTable
Creates an instance of aEquipmentTablerecord class.- Parameters:
lootTable- the value for thelootTablerecord componentslotDropChances- the value for theslotDropChancesrecord 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 thelootTablerecord component.- Returns:
- the value of the
lootTablerecord component
-
slotDropChances
Returns the value of theslotDropChancesrecord component.- Returns:
- the value of the
slotDropChancesrecord component
-