接口 IGlobalLootModifier

所有已知实现类:
LootModifier

public interface IGlobalLootModifier
Implementation that defines what a global loot modifier must implement in order to be functional. LootModifier Supplies base functionality; most modders should only need to extend that.
Requires a Codec to be registered: ForgeRegistries.GLOBAL_LOOT_MODIFIER_SERIALIZERS, and returned in codec() Individual instances of modifiers must be registered via json, see forge:loot_modifiers/global_loot_modifiers
  • 字段概要

    字段
    修饰符和类型
    字段
    说明
    static final com.mojang.serialization.Codec<IGlobalLootModifier>
     
    static final com.mojang.serialization.Codec<LootItemCondition[]>
     
  • 方法概要

    修饰符和类型
    方法
    说明
    @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.
    com.mojang.serialization.MapCodec<? extends IGlobalLootModifier>
    Returns the registered codec for this modifier
    static <U> com.google.gson.JsonElement
    getJson(com.mojang.serialization.Dynamic<?> dynamic)
     
  • 字段详细资料

    • DIRECT_CODEC

      static final com.mojang.serialization.Codec<IGlobalLootModifier> DIRECT_CODEC
    • LOOT_CONDITIONS_CODEC

      static final com.mojang.serialization.Codec<LootItemCondition[]> LOOT_CONDITIONS_CODEC
  • 方法详细资料

    • getJson

      static <U> com.google.gson.JsonElement getJson(com.mojang.serialization.Dynamic<?> dynamic)
    • apply

      @NotNull @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. This function needs to be responsible for checking ILootConditions as well.
      参数:
      generatedLoot - the list of ItemStacks that will be dropped, generated by loot tables
      context - the LootContext, identical to what is passed to loot tables
      返回:
      modified loot drops
    • codec

      com.mojang.serialization.MapCodec<? extends IGlobalLootModifier> codec()
      Returns the registered codec for this modifier