Class LootManager

java.lang.Object
net.minecraft.loot.LootManager
All Implemented Interfaces:
LootDataLookup, ResourceReloader

public class LootManager extends Object implements ResourceReloader, LootDataLookup
Mappings:
Namespace Name
official dzf
intermediary net/minecraft/class_60
named net/minecraft/loot/LootManager
  • Field Details

    • LOGGER

      private static final Logger LOGGER
      Mappings:
      Namespace Name Mixin selector
      official b Ldzf;b:Lorg/slf4j/Logger;
      intermediary field_975 Lnet/minecraft/class_60;field_975:Lorg/slf4j/Logger;
      named LOGGER Lnet/minecraft/loot/LootManager;LOGGER:Lorg/slf4j/Logger;
    • EMPTY_LOOT_TABLE

      public static final LootDataKey<LootTable> EMPTY_LOOT_TABLE
      Mappings:
      Namespace Name Mixin selector
      official a Ldzf;a:Ldze;
      intermediary field_44491 Lnet/minecraft/class_60;field_44491:Lnet/minecraft/class_8488;
      named EMPTY_LOOT_TABLE Lnet/minecraft/loot/LootManager;EMPTY_LOOT_TABLE:Lnet/minecraft/loot/LootDataKey;
    • keyToValue

      private Map<LootDataKey<?>,?> keyToValue
      Mappings:
      Namespace Name Mixin selector
      official c Ldzf;c:Ljava/util/Map;
      intermediary field_44492 Lnet/minecraft/class_60;field_44492:Ljava/util/Map;
      named keyToValue Lnet/minecraft/loot/LootManager;keyToValue:Ljava/util/Map;
    • typeToIds

      private Multimap<LootDataType<?>,Identifier> typeToIds
      Mappings:
      Namespace Name Mixin selector
      official d Ldzf;d:Lcom/google/common/collect/Multimap;
      intermediary field_44493 Lnet/minecraft/class_60;field_44493:Lcom/google/common/collect/Multimap;
      named typeToIds Lnet/minecraft/loot/LootManager;typeToIds:Lcom/google/common/collect/Multimap;
  • Constructor Details

    • LootManager

      public LootManager()
  • Method Details

    • reload

      public final CompletableFuture<Void> reload(ResourceReloader.Synchronizer synchronizer, ResourceManager manager, Profiler prepareProfiler, Profiler applyProfiler, Executor prepareExecutor, Executor applyExecutor)
      Performs a reload. Returns a future that is completed when the reload is completed.

      In a reload, there is a prepare stage and an apply stage. For the prepare stage, you should create completable futures with CompletableFuture.supplyAsync(..., prepareExecutor) to ensure the prepare actions are done with the prepare executor. Then, you should have a completable future for all the prepared actions, and call combinedPrepare.thenCompose(synchronizer::waitFor) to notify the synchronizer. Finally, you should run CompletableFuture.thenAcceptAsync(..., applyExecutor) for apply actions. In the end, returns the result of thenAcceptAsync.

      Specified by:
      reload in interface ResourceReloader
      Parameters:
      synchronizer - the synchronizer
      manager - the resource manager
      prepareProfiler - the profiler for prepare stage
      applyProfiler - the profiler for apply stage
      prepareExecutor - the executor for prepare stage
      applyExecutor - the executor for apply stage
      Returns:
      a future for the reload
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Lakp;a(Lakp$a;Lakv;Lbak;Lbak;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;
      intermediary method_25931 Lnet/minecraft/class_3302;method_25931(Lnet/minecraft/class_3302$class_4045;Lnet/minecraft/class_3300;Lnet/minecraft/class_3695;Lnet/minecraft/class_3695;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;
      named reload Lnet/minecraft/resource/ResourceReloader;reload(Lnet/minecraft/resource/ResourceReloader$Synchronizer;Lnet/minecraft/resource/ResourceManager;Lnet/minecraft/util/profiler/Profiler;Lnet/minecraft/util/profiler/Profiler;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;
    • load

      private static <T> CompletableFuture<?> load(LootDataType<T> type, ResourceManager resourceManager, Executor executor, Map<LootDataType<?>,Map<Identifier,?>> results)
      Mappings:
      Namespace Name Mixin selector
      official a Ldzf;a(Ldzh;Lakv;Ljava/util/concurrent/Executor;Ljava/util/Map;)Ljava/util/concurrent/CompletableFuture;
      intermediary method_51194 Lnet/minecraft/class_60;method_51194(Lnet/minecraft/class_8490;Lnet/minecraft/class_3300;Ljava/util/concurrent/Executor;Ljava/util/Map;)Ljava/util/concurrent/CompletableFuture;
      named load Lnet/minecraft/loot/LootManager;load(Lnet/minecraft/loot/LootDataType;Lnet/minecraft/resource/ResourceManager;Ljava/util/concurrent/Executor;Ljava/util/Map;)Ljava/util/concurrent/CompletableFuture;
    • validate

      private void validate(Map<LootDataType<?>,Map<Identifier,?>> lootData)
      Mappings:
      Namespace Name Mixin selector
      official a Ldzf;a(Ljava/util/Map;)V
      intermediary method_20712 Lnet/minecraft/class_60;method_20712(Ljava/util/Map;)V
      named validate Lnet/minecraft/loot/LootManager;validate(Ljava/util/Map;)V
    • validate

      private static <T> void validate(LootTableReporter reporter, LootDataKey<T> key, Object value)
      Mappings:
      Namespace Name Mixin selector
      official a Ldzf;a(Ldzm;Ldze;Ljava/lang/Object;)V
      intermediary method_51196 Lnet/minecraft/class_60;method_51196(Lnet/minecraft/class_58;Lnet/minecraft/class_8488;Ljava/lang/Object;)V
      named validate Lnet/minecraft/loot/LootManager;validate(Lnet/minecraft/loot/LootTableReporter;Lnet/minecraft/loot/LootDataKey;Ljava/lang/Object;)V
    • getElement

      @Nullable public <T> T getElement(LootDataKey<T> key)
      Specified by:
      getElement in interface LootDataLookup
      Mappings:
      Namespace Name Mixin selector
      official getElement Ldzg;getElement(Ldze;)Ljava/lang/Object;
      intermediary getElement Lnet/minecraft/class_8489;getElement(Lnet/minecraft/class_8488;)Ljava/lang/Object;
      named getElement Lnet/minecraft/loot/LootDataLookup;getElement(Lnet/minecraft/loot/LootDataKey;)Ljava/lang/Object;
    • getIds

      public Collection<Identifier> getIds(LootDataType<?> type)
      Mappings:
      Namespace Name Mixin selector
      official a Ldzf;a(Ldzh;)Ljava/util/Collection;
      intermediary method_51193 Lnet/minecraft/class_60;method_51193(Lnet/minecraft/class_8490;)Ljava/util/Collection;
      named getIds Lnet/minecraft/loot/LootManager;getIds(Lnet/minecraft/loot/LootDataType;)Ljava/util/Collection;
    • and

      public static LootCondition and(LootCondition[] predicates)
      Mappings:
      Namespace Name Mixin selector
      official a Ldzf;a([Lecb;)Lecb;
      intermediary method_51201 Lnet/minecraft/class_60;method_51201([Lnet/minecraft/class_5341;)Lnet/minecraft/class_5341;
      named and Lnet/minecraft/loot/LootManager;and([Lnet/minecraft/loot/condition/LootCondition;)Lnet/minecraft/loot/condition/LootCondition;
    • and

      public static LootFunction and(LootFunction[] modifiers)
      Mappings:
      Namespace Name Mixin selector
      official a Ldzf;a([Leaq;)Leaq;
      intermediary method_51200 Lnet/minecraft/class_60;method_51200([Lnet/minecraft/class_117;)Lnet/minecraft/class_117;
      named and Lnet/minecraft/loot/LootManager;and([Lnet/minecraft/loot/function/LootFunction;)Lnet/minecraft/loot/function/LootFunction;