Record Class SetWeightLootPoolEntryModifier
java.lang.Object
java.lang.Record
com.petrolpark.core.data.loot.modifier.SetWeightLootPoolEntryModifier
- All Implemented Interfaces:
ILootModifierBase,ILootPoolEntryModifier,ILootPoolSingletonEntryModifier
public record SetWeightLootPoolEntryModifier(int weight)
extends Record
implements ILootPoolSingletonEntryModifier
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<SetWeightLootPoolEntryModifier> Fields inherited from interface com.petrolpark.core.data.loot.modifier.ILootPoolEntryModifier
TYPED_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionSetWeightLootPoolEntryModifier(int weight) Creates an instance of aSetWeightLootPoolEntryModifierrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.getType()final inthashCode()Returns a hash code value for this object.net.minecraft.world.level.storage.loot.entries.LootPoolSingletonContainermodifySingleton(net.minecraft.core.HolderLookup.Provider registries, net.minecraft.world.level.storage.loot.LootTable lootTable, net.minecraft.world.level.storage.loot.LootPool pool, net.minecraft.world.level.storage.loot.entries.LootPoolSingletonContainer entry) final StringtoString()Returns a string representation of this record class.intweight()Returns the value of theweightrecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.petrolpark.core.data.loot.modifier.ILootModifierBase
add, apply, apply, copy, copy, getConditions, getEntries, getFunctions, getFunctions, getPools, getRandomSequence, when, withPoolMethods inherited from interface com.petrolpark.core.data.loot.modifier.ILootPoolSingletonEntryModifier
modify
-
Field Details
-
CODEC
-
-
Constructor Details
-
SetWeightLootPoolEntryModifier
public SetWeightLootPoolEntryModifier(int weight) Creates an instance of aSetWeightLootPoolEntryModifierrecord class.- Parameters:
weight- the value for theweightrecord component
-
-
Method Details
-
modifySingleton
public net.minecraft.world.level.storage.loot.entries.LootPoolSingletonContainer modifySingleton(net.minecraft.core.HolderLookup.Provider registries, net.minecraft.world.level.storage.loot.LootTable lootTable, net.minecraft.world.level.storage.loot.LootPool pool, net.minecraft.world.level.storage.loot.entries.LootPoolSingletonContainer entry) - Specified by:
modifySingletonin interfaceILootPoolSingletonEntryModifier
-
getType
- Specified by:
getTypein interfaceILootPoolEntryModifier
-
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 with '=='. -
weight
public int weight()Returns the value of theweightrecord component.- Returns:
- the value of the
weightrecord component
-