Package petrolpark.mc.library.core.flags
Record Class FlagLootItemFunction
java.lang.Object
java.lang.Record
petrolpark.mc.library.core.flags.FlagLootItemFunction
- 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 FlagLootItemFunction(net.minecraft.core.Holder<Flag> flagHolder, FlagLootItemFunction.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<FlagLootItemFunction> -
Constructor Summary
ConstructorsConstructorDescriptionFlagLootItemFunction(net.minecraft.core.Holder<Flag> flagHolder, FlagLootItemFunction.Action action) Creates an instance of aFlagLootItemFunctionrecord 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) final booleanIndicates whether some other object is "equal to" this one.net.minecraft.core.Holder<Flag> Returns the value of theflagHolderrecord component.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
-
FlagLootItemFunction
public FlagLootItemFunction(net.minecraft.core.Holder<Flag> flagHolder, FlagLootItemFunction.Action action) Creates an instance of aFlagLootItemFunctionrecord class.- Parameters:
flagHolder- the value for theflagHolderrecord 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). -
flagHolder
Returns the value of theflagHolderrecord component.- Returns:
- the value of the
flagHolderrecord component
-
action
Returns the value of theactionrecord component.- Returns:
- the value of the
actionrecord component
-