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, float dropChance) EquipmentTable(ResourceKey<LootTable> lootTable, Map<EquipmentSlot, Float> slotDropChances) Creates an instance of aEquipmentTablerecord class. -
Method Summary
Modifier and TypeMethodDescriptionprivate static Map<EquipmentSlot, Float> createForAllSlots(float dropChance) private static Map<EquipmentSlot, Float> createForAllSlots(List<EquipmentSlot> slots, float dropChance) 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
-
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> slots, float dropChance) -
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. 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
-