Record Class ContaminationLootItemFunction
java.lang.Object
java.lang.Record
com.petrolpark.core.contamination.ContaminationLootItemFunction
- All Implemented Interfaces:
BiFunction<net.minecraft.world.item.ItemStack,,net.minecraft.world.level.storage.loot.LootContext, net.minecraft.world.item.ItemStack> net.minecraft.world.level.storage.loot.functions.LootItemFunction,net.minecraft.world.level.storage.loot.LootContextUser
public record ContaminationLootItemFunction(net.minecraft.core.Holder<Contaminant> contaminantHolder, ContaminationLootItemFunction.Action action)
extends Record
implements net.minecraft.world.level.storage.loot.functions.LootItemFunction
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface net.minecraft.world.level.storage.loot.functions.LootItemFunction
net.minecraft.world.level.storage.loot.functions.LootItemFunction.Builder -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<ContaminationLootItemFunction> -
Constructor Summary
ConstructorsConstructorDescriptionContaminationLootItemFunction(net.minecraft.core.Holder<Contaminant> contaminantHolder, ContaminationLootItemFunction.Action action) Creates an instance of aContaminationLootItemFunctionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionaction()Returns the value of theactionrecord component.net.minecraft.world.item.ItemStackapply(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.storage.loot.LootContext context) net.minecraft.core.Holder<Contaminant> Returns the value of thecontaminantHolderrecord component.final booleanIndicates whether some other object is "equal to" this one.net.minecraft.world.level.storage.loot.functions.LootItemFunctionType<? extends net.minecraft.world.level.storage.loot.functions.LootItemFunction> getType()final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.function.BiFunction
andThenMethods inherited from interface net.minecraft.world.level.storage.loot.LootContextUser
getReferencedContextParams, validate
-
Field Details
-
CODEC
-
-
Constructor Details
-
ContaminationLootItemFunction
public ContaminationLootItemFunction(net.minecraft.core.Holder<Contaminant> contaminantHolder, ContaminationLootItemFunction.Action action) Creates an instance of aContaminationLootItemFunctionrecord class.- Parameters:
contaminantHolder- the value for thecontaminantHolderrecord componentaction- the value for theactionrecord component
-
-
Method Details
-
apply
public net.minecraft.world.item.ItemStack apply(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.storage.loot.LootContext context) - Specified by:
applyin interfaceBiFunction<net.minecraft.world.item.ItemStack,net.minecraft.world.level.storage.loot.LootContext, net.minecraft.world.item.ItemStack>
-
getType
public net.minecraft.world.level.storage.loot.functions.LootItemFunctionType<? extends net.minecraft.world.level.storage.loot.functions.LootItemFunction> getType()- Specified by:
getTypein interfacenet.minecraft.world.level.storage.loot.functions.LootItemFunction
-
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). -
contaminantHolder
Returns the value of thecontaminantHolderrecord component.- Returns:
- the value of the
contaminantHolderrecord component
-
action
Returns the value of theactionrecord component.- Returns:
- the value of the
actionrecord component
-