Record Class LootTableRewardGenerator
java.lang.Object
java.lang.Record
com.petrolpark.core.data.reward.generator.LootTableRewardGenerator
- All Implemented Interfaces:
ILootTableAccessor,IContextEntityRewardGenerator,IRewardGenerator,net.minecraft.world.level.storage.loot.LootContextUser
public record LootTableRewardGenerator(IEntityTarget target, List<net.minecraft.world.level.storage.loot.functions.LootItemFunction> lateFunctions, com.mojang.datafixers.util.Either<net.minecraft.resources.ResourceKey<net.minecraft.world.level.storage.loot.LootTable>,net.minecraft.world.level.storage.loot.LootTable> lootTable)
extends Record
implements IContextEntityRewardGenerator, ILootTableAccessor
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<LootTableRewardGenerator> Fields inherited from interface com.petrolpark.core.data.reward.generator.IRewardGenerator
TYPED_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionLootTableRewardGenerator(IEntityTarget target, List<net.minecraft.world.level.storage.loot.functions.LootItemFunction> lateFunctions, com.mojang.datafixers.util.Either<net.minecraft.resources.ResourceKey<net.minecraft.world.level.storage.loot.LootTable>, net.minecraft.world.level.storage.loot.LootTable> lootTable) Creates an instance of aLootTableRewardGeneratorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.generate(net.minecraft.world.level.storage.loot.LootContext context) getType()final inthashCode()Returns a hash code value for this object.List<net.minecraft.world.level.storage.loot.functions.LootItemFunction> Returns the value of thelateFunctionsrecord component.com.mojang.datafixers.util.Either<net.minecraft.resources.ResourceKey<net.minecraft.world.level.storage.loot.LootTable>, net.minecraft.world.level.storage.loot.LootTable> Returns the value of thelootTablerecord component.target()Returns the value of thetargetrecord component.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 com.petrolpark.core.data.reward.generator.IContextEntityRewardGenerator
getReferencedContextParamsMethods inherited from interface com.petrolpark.core.data.loot.ILootTableAccessor
getLootTableMethods inherited from interface net.minecraft.world.level.storage.loot.LootContextUser
validate
-
Field Details
-
CODEC
-
-
Constructor Details
-
LootTableRewardGenerator
public LootTableRewardGenerator(IEntityTarget target, List<net.minecraft.world.level.storage.loot.functions.LootItemFunction> lateFunctions, com.mojang.datafixers.util.Either<net.minecraft.resources.ResourceKey<net.minecraft.world.level.storage.loot.LootTable>, net.minecraft.world.level.storage.loot.LootTable> lootTable) Creates an instance of aLootTableRewardGeneratorrecord class.- Parameters:
target- the value for thetargetrecord componentlateFunctions- the value for thelateFunctionsrecord componentlootTable- the value for thelootTablerecord component
-
-
Method Details
-
generate
- Specified by:
generatein interfaceIRewardGenerator
-
getType
- Specified by:
getTypein interfaceIRewardGenerator
-
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). -
target
Returns the value of thetargetrecord component.- Specified by:
targetin interfaceIContextEntityRewardGenerator- Returns:
- the value of the
targetrecord component
-
lateFunctions
Returns the value of thelateFunctionsrecord component.- Returns:
- the value of the
lateFunctionsrecord component
-
lootTable
public com.mojang.datafixers.util.Either<net.minecraft.resources.ResourceKey<net.minecraft.world.level.storage.loot.LootTable>,net.minecraft.world.level.storage.loot.LootTable> lootTable()Returns the value of thelootTablerecord component.- Specified by:
lootTablein interfaceILootTableAccessor- Returns:
- the value of the
lootTablerecord component
-