类 LootModifier
java.lang.Object
net.minecraftforge.common.loot.LootModifier
- 所有已实现的接口:
IGlobalLootModifier
A base implementation of a Global Loot Modifier for modders to extend.
Takes care of ILootCondition matching and comes with the base codec to extend.
-
字段概要
字段从接口继承的字段 net.minecraftforge.common.loot.IGlobalLootModifier
DIRECT_CODEC, LOOT_CONDITIONS_CODEC
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明final @NotNull it.unimi.dsi.fastutil.objects.ObjectArrayList
<ItemStack> apply
(LootTable table, it.unimi.dsi.fastutil.objects.ObjectArrayList<ItemStack> generatedLoot, LootContext context) Applies the modifier to the list of generated loot.protected static <T extends LootModifier>
com.mojang.datafixers.Products.P1<com.mojang.serialization.codecs.RecordCodecBuilder.Mu<T>, LootItemCondition[]> codecStart
(com.mojang.serialization.codecs.RecordCodecBuilder.Instance<T> instance) Simplifies codec creation, especially if no other fields are added:protected abstract @NotNull it.unimi.dsi.fastutil.objects.ObjectArrayList
<ItemStack> doApply
(LootTable table, it.unimi.dsi.fastutil.objects.ObjectArrayList<ItemStack> generatedLoot, LootContext context) Applies the modifier to the generated loot (all loot conditions have already been checked and have returned true).从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 net.minecraftforge.common.loot.IGlobalLootModifier
codec
-
字段详细资料
-
conditions
-
combinedConditions
-
-
构造器详细资料
-
LootModifier
Constructs a LootModifier.- 参数:
conditionsIn
- the ILootConditions that need to be matched before the loot is modified.
-
-
方法详细资料
-
codecStart
protected static <T extends LootModifier> com.mojang.datafixers.Products.P1<com.mojang.serialization.codecs.RecordCodecBuilder.Mu<T>,LootItemCondition[]> codecStart(com.mojang.serialization.codecs.RecordCodecBuilder.Instance<T> instance) Simplifies codec creation, especially if no other fields are added:public static final Codec<MyLootModifier> CODEC = RecordCodecBuilder.create(inst -> codecStart(inst).apply(inst, MyLootModifier::new));
BendingTrunkPlacer.CODEC
-
apply
@NotNull public final @NotNull it.unimi.dsi.fastutil.objects.ObjectArrayList<ItemStack> apply(LootTable table, it.unimi.dsi.fastutil.objects.ObjectArrayList<ItemStack> generatedLoot, LootContext context) 从接口复制的说明:IGlobalLootModifier
Applies the modifier to the list of generated loot. This function needs to be responsible for checking ILootConditions as well.- 指定者:
apply
在接口中IGlobalLootModifier
- 参数:
generatedLoot
- the list of ItemStacks that will be dropped, generated by loot tablescontext
- the LootContext, identical to what is passed to loot tables- 返回:
- modified loot drops
-
doApply
@NotNull protected abstract @NotNull it.unimi.dsi.fastutil.objects.ObjectArrayList<ItemStack> doApply(LootTable table, it.unimi.dsi.fastutil.objects.ObjectArrayList<ItemStack> generatedLoot, LootContext context) Applies the modifier to the generated loot (all loot conditions have already been checked and have returned true).- 参数:
generatedLoot
- the list of ItemStacks that will be dropped, generated by loot tablescontext
- the LootContext, identical to what is passed to loot tables- 返回:
- modified loot drops
-