Package net.minecraft.loot
Class LootManager
java.lang.Object
net.minecraft.loot.LootManager
- All Implemented Interfaces:
LootDataLookup,ResourceReloader
- Mappings:
Namespace Name official egzintermediary net/minecraft/class_60named net/minecraft/loot/LootManager
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.resource.ResourceReloader
ResourceReloader.Synchronizer -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final LootDataKey<LootTable>private static final Gsonprivate Map<LootDataKey<?>,?> private static final Loggerprivate Multimap<LootDataType<?>,Identifier> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> TgetElement(LootDataKey<T> key) getIds(LootDataType<?> type) private static <T> CompletableFuture<?>load(LootDataType<T> type, ResourceManager resourceManager, Executor executor, Map<LootDataType<?>, Map<Identifier, ?>> results) final CompletableFuture<Void>reload(ResourceReloader.Synchronizer synchronizer, ResourceManager manager, Profiler prepareProfiler, Profiler applyProfiler, Executor prepareExecutor, Executor applyExecutor) Performs a reload.private voidvalidate(Map<LootDataType<?>, Map<Identifier, ?>> lootData) private static <T> voidvalidate(LootTableReporter reporter, LootDataKey<T> key, Object value) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.loot.LootDataLookup
getElement, getElementOptional, getElementOptional, getLootTableMethods inherited from interface net.minecraft.resource.ResourceReloader
getName
-
Field Details
-
LOGGER
- Mappings:
Namespace Name Mixin selector official bLegz;b:Lorg/slf4j/Logger;intermediary field_975Lnet/minecraft/class_60;field_975:Lorg/slf4j/Logger;named LOGGERLnet/minecraft/loot/LootManager;LOGGER:Lorg/slf4j/Logger;
-
GSON
- Mappings:
Namespace Name Mixin selector official cLegz;c:Lcom/google/gson/Gson;intermediary field_45793Lnet/minecraft/class_60;field_45793:Lcom/google/gson/Gson;named GSONLnet/minecraft/loot/LootManager;GSON:Lcom/google/gson/Gson;
-
EMPTY_LOOT_TABLE
- Mappings:
Namespace Name Mixin selector official aLegz;a:Legy;intermediary field_44491Lnet/minecraft/class_60;field_44491:Lnet/minecraft/class_8488;named EMPTY_LOOT_TABLELnet/minecraft/loot/LootManager;EMPTY_LOOT_TABLE:Lnet/minecraft/loot/LootDataKey;
-
keyToValue
- Mappings:
Namespace Name Mixin selector official dLegz;d:Ljava/util/Map;intermediary field_44492Lnet/minecraft/class_60;field_44492:Ljava/util/Map;named keyToValueLnet/minecraft/loot/LootManager;keyToValue:Ljava/util/Map;
-
typeToIds
- Mappings:
Namespace Name Mixin selector official eLegz;e:Lcom/google/common/collect/Multimap;intermediary field_44493Lnet/minecraft/class_60;field_44493:Lcom/google/common/collect/Multimap;named typeToIdsLnet/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 ofthenAcceptAsync.- Specified by:
reloadin interfaceResourceReloader- Parameters:
synchronizer- the synchronizermanager- the resource managerprepareProfiler- the profiler for prepare stageapplyProfiler- the profiler for apply stageprepareExecutor- the executor for prepare stageapplyExecutor- the executor for apply stage- Returns:
- a future for the reload
- See Also:
- Mappings:
Namespace Name Mixin selector official aLaqc;a(Laqc$a;Laqi;Lbgs;Lbgs;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;intermediary method_25931Lnet/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 reloadLnet/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 aLegz;a(Lehb;Laqi;Ljava/util/concurrent/Executor;Ljava/util/Map;)Ljava/util/concurrent/CompletableFuture;intermediary method_51194Lnet/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 loadLnet/minecraft/loot/LootManager;load(Lnet/minecraft/loot/LootDataType;Lnet/minecraft/resource/ResourceManager;Ljava/util/concurrent/Executor;Ljava/util/Map;)Ljava/util/concurrent/CompletableFuture;
-
validate
- Mappings:
Namespace Name Mixin selector official aLegz;a(Ljava/util/Map;)Vintermediary method_20712Lnet/minecraft/class_60;method_20712(Ljava/util/Map;)Vnamed validateLnet/minecraft/loot/LootManager;validate(Ljava/util/Map;)V
-
validate
- Mappings:
Namespace Name Mixin selector official aLegz;a(Lehf;Legy;Ljava/lang/Object;)Vintermediary method_51196Lnet/minecraft/class_60;method_51196(Lnet/minecraft/class_58;Lnet/minecraft/class_8488;Ljava/lang/Object;)Vnamed validateLnet/minecraft/loot/LootManager;validate(Lnet/minecraft/loot/LootTableReporter;Lnet/minecraft/loot/LootDataKey;Ljava/lang/Object;)V
-
getElement
- Specified by:
getElementin interfaceLootDataLookup- Mappings:
Namespace Name Mixin selector official getElementLeha;getElement(Legy;)Ljava/lang/Object;intermediary getElementLnet/minecraft/class_8489;getElement(Lnet/minecraft/class_8488;)Ljava/lang/Object;named getElementLnet/minecraft/loot/LootDataLookup;getElement(Lnet/minecraft/loot/LootDataKey;)Ljava/lang/Object;
-
getIds
- Mappings:
Namespace Name Mixin selector official aLegz;a(Lehb;)Ljava/util/Collection;intermediary method_51193Lnet/minecraft/class_60;method_51193(Lnet/minecraft/class_8490;)Ljava/util/Collection;named getIdsLnet/minecraft/loot/LootManager;getIds(Lnet/minecraft/loot/LootDataType;)Ljava/util/Collection;
-