Class BakedModelManager
java.lang.Object
net.minecraft.client.render.model.BakedModelManager
- All Implemented Interfaces:
AutoCloseable
,ResourceReloader
@Environment(CLIENT)
public class BakedModelManager
extends Object
implements ResourceReloader, AutoCloseable
- Mappings:
Namespace Name official fqn
intermediary net/minecraft/class_1092
named net/minecraft/client/render/model/BakedModelManager
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.resource.ResourceReloader
ResourceReloader.Synchronizer
-
Field Summary
Modifier and TypeFieldDescriptionprivate final SpriteAtlasManager
private final BlockModels
private final BlockColors
private static final Map<Identifier,
Identifier> private static final Logger
private int
private BakedModel
private Map<Identifier,
BakedModel> private Object2IntMap<BlockState>
-
Constructor Summary
ConstructorDescriptionBakedModelManager
(TextureManager textureManager, BlockColors colorMap, int mipmap) -
Method Summary
Modifier and TypeMethodDescriptionprivate BakedModelManager.BakingResult
bake
(Profiler profiler, Map<Identifier, SpriteAtlasManager.AtlasPreparation> preparations, ModelLoader modelLoader) void
close()
getAtlas
(Identifier id) final CompletableFuture<Void>
reload
(ResourceReloader.Synchronizer synchronizer, ResourceManager manager, Profiler prepareProfiler, Profiler applyProfiler, Executor prepareExecutor, Executor applyExecutor) Performs a reload.private static CompletableFuture<Map<Identifier,
List<ModelLoader.SourceTrackedData>>> reloadBlockStates
(ResourceManager resourceManager, Executor executor) private static CompletableFuture<Map<Identifier,
JsonUnbakedModel>> reloadModels
(ResourceManager resourceManager, Executor executor) void
setMipmapLevels
(int mipmapLevels) boolean
shouldRerender
(BlockState from, BlockState to) private void
upload
(BakedModelManager.BakingResult bakingResult, Profiler profiler) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.resource.ResourceReloader
getName
-
Field Details
-
LOGGER
- Mappings:
Namespace Name Mixin selector official a
Lfqn;a:Lorg/slf4j/Logger;
intermediary field_40573
Lnet/minecraft/class_1092;field_40573:Lorg/slf4j/Logger;
named LOGGER
Lnet/minecraft/client/render/model/BakedModelManager;LOGGER:Lorg/slf4j/Logger;
-
LAYERS_TO_LOADERS
- Mappings:
Namespace Name Mixin selector official b
Lfqn;b:Ljava/util/Map;
intermediary field_40574
Lnet/minecraft/class_1092;field_40574:Ljava/util/Map;
named LAYERS_TO_LOADERS
Lnet/minecraft/client/render/model/BakedModelManager;LAYERS_TO_LOADERS:Ljava/util/Map;
-
models
- Mappings:
Namespace Name Mixin selector official c
Lfqn;c:Ljava/util/Map;
intermediary field_5408
Lnet/minecraft/class_1092;field_5408:Ljava/util/Map;
named models
Lnet/minecraft/client/render/model/BakedModelManager;models:Ljava/util/Map;
-
atlasManager
- Mappings:
Namespace Name Mixin selector official d
Lfqn;d:Lfqg;
intermediary field_21775
Lnet/minecraft/class_1092;field_21775:Lnet/minecraft/class_4724;
named atlasManager
Lnet/minecraft/client/render/model/BakedModelManager;atlasManager:Lnet/minecraft/client/render/model/SpriteAtlasManager;
-
blockModelCache
- Mappings:
Namespace Name Mixin selector official e
Lfqn;e:Lfel;
intermediary field_5410
Lnet/minecraft/class_1092;field_5410:Lnet/minecraft/class_773;
named blockModelCache
Lnet/minecraft/client/render/model/BakedModelManager;blockModelCache:Lnet/minecraft/client/render/block/BlockModels;
-
colorMap
- Mappings:
Namespace Name Mixin selector official f
Lfqn;f:Lekg;
intermediary field_20277
Lnet/minecraft/class_1092;field_20277:Lnet/minecraft/class_324;
named colorMap
Lnet/minecraft/client/render/model/BakedModelManager;colorMap:Lnet/minecraft/client/color/block/BlockColors;
-
mipmapLevels
private int mipmapLevels- Mappings:
Namespace Name Mixin selector official g
Lfqn;g:I
intermediary field_21777
Lnet/minecraft/class_1092;field_21777:I
named mipmapLevels
Lnet/minecraft/client/render/model/BakedModelManager;mipmapLevels:I
-
missingModel
- Mappings:
Namespace Name Mixin selector official h
Lfqn;h:Lfqh;
intermediary field_5407
Lnet/minecraft/class_1092;field_5407:Lnet/minecraft/class_1087;
named missingModel
Lnet/minecraft/client/render/model/BakedModelManager;missingModel:Lnet/minecraft/client/render/model/BakedModel;
-
stateLookup
- Mappings:
Namespace Name Mixin selector official i
Lfqn;i:Lit/unimi/dsi/fastutil/objects/Object2IntMap;
intermediary field_20278
Lnet/minecraft/class_1092;field_20278:Lit/unimi/dsi/fastutil/objects/Object2IntMap;
named stateLookup
Lnet/minecraft/client/render/model/BakedModelManager;stateLookup:Lit/unimi/dsi/fastutil/objects/Object2IntMap;
-
-
Constructor Details
-
BakedModelManager
- Mappings:
Namespace Name Mixin selector official <init>
Lfqn;<init>(Lfom;Lekg;I)V
intermediary <init>
Lnet/minecraft/class_1092;<init>(Lnet/minecraft/class_1060;Lnet/minecraft/class_324;I)V
named <init>
Lnet/minecraft/client/render/model/BakedModelManager;<init>(Lnet/minecraft/client/texture/TextureManager;Lnet/minecraft/client/color/block/BlockColors;I)V
-
-
Method Details
-
getModel
- Mappings:
Namespace Name Mixin selector official a
Lfqn;a(Lfqo;)Lfqh;
intermediary method_4742
Lnet/minecraft/class_1092;method_4742(Lnet/minecraft/class_1091;)Lnet/minecraft/class_1087;
named getModel
Lnet/minecraft/client/render/model/BakedModelManager;getModel(Lnet/minecraft/client/util/ModelIdentifier;)Lnet/minecraft/client/render/model/BakedModel;
-
getMissingModel
- Mappings:
Namespace Name Mixin selector official a
Lfqn;a()Lfqh;
intermediary method_4744
Lnet/minecraft/class_1092;method_4744()Lnet/minecraft/class_1087;
named getMissingModel
Lnet/minecraft/client/render/model/BakedModelManager;getMissingModel()Lnet/minecraft/client/render/model/BakedModel;
-
getBlockModels
- Mappings:
Namespace Name Mixin selector official b
Lfqn;b()Lfel;
intermediary method_4743
Lnet/minecraft/class_1092;method_4743()Lnet/minecraft/class_773;
named getBlockModels
Lnet/minecraft/client/render/model/BakedModelManager;getBlockModels()Lnet/minecraft/client/render/block/BlockModels;
-
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:
reload
in 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 a
Lajy;a(Lajy$a;Lake;Lazc;Lazc;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;
-
reloadModels
private static CompletableFuture<Map<Identifier,JsonUnbakedModel>> reloadModels(ResourceManager resourceManager, Executor executor) - Mappings:
Namespace Name Mixin selector official a
Lfqn;a(Lake;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;
intermediary method_45881
Lnet/minecraft/class_1092;method_45881(Lnet/minecraft/class_3300;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;
named reloadModels
Lnet/minecraft/client/render/model/BakedModelManager;reloadModels(Lnet/minecraft/resource/ResourceManager;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;
-
reloadBlockStates
private static CompletableFuture<Map<Identifier,List<ModelLoader.SourceTrackedData>>> reloadBlockStates(ResourceManager resourceManager, Executor executor) - Mappings:
Namespace Name Mixin selector official b
Lfqn;b(Lake;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;
intermediary method_45896
Lnet/minecraft/class_1092;method_45896(Lnet/minecraft/class_3300;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;
named reloadBlockStates
Lnet/minecraft/client/render/model/BakedModelManager;reloadBlockStates(Lnet/minecraft/resource/ResourceManager;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;
-
bake
private BakedModelManager.BakingResult bake(Profiler profiler, Map<Identifier, SpriteAtlasManager.AtlasPreparation> preparations, ModelLoader modelLoader) - Mappings:
Namespace Name Mixin selector official a
Lfqn;a(Lazc;Ljava/util/Map;Lfqm;)Lfqn$a;
intermediary method_45883
Lnet/minecraft/class_1092;method_45883(Lnet/minecraft/class_3695;Ljava/util/Map;Lnet/minecraft/class_1088;)Lnet/minecraft/class_1092$class_7779;
named bake
Lnet/minecraft/client/render/model/BakedModelManager;bake(Lnet/minecraft/util/profiler/Profiler;Ljava/util/Map;Lnet/minecraft/client/render/model/ModelLoader;)Lnet/minecraft/client/render/model/BakedModelManager$BakingResult;
-
upload
- Mappings:
Namespace Name Mixin selector official a
Lfqn;a(Lfqn$a;Lazc;)V
intermediary method_18179
Lnet/minecraft/class_1092;method_18179(Lnet/minecraft/class_1092$class_7779;Lnet/minecraft/class_3695;)V
named upload
Lnet/minecraft/client/render/model/BakedModelManager;upload(Lnet/minecraft/client/render/model/BakedModelManager$BakingResult;Lnet/minecraft/util/profiler/Profiler;)V
-
shouldRerender
- Mappings:
Namespace Name Mixin selector official a
Lfqn;a(Lcyt;Lcyt;)Z
intermediary method_21611
Lnet/minecraft/class_1092;method_21611(Lnet/minecraft/class_2680;Lnet/minecraft/class_2680;)Z
named shouldRerender
Lnet/minecraft/client/render/model/BakedModelManager;shouldRerender(Lnet/minecraft/block/BlockState;Lnet/minecraft/block/BlockState;)Z
-
getAtlas
- Mappings:
Namespace Name Mixin selector official a
Lfqn;a(Lacf;)Lfok;
intermediary method_24153
Lnet/minecraft/class_1092;method_24153(Lnet/minecraft/class_2960;)Lnet/minecraft/class_1059;
named getAtlas
Lnet/minecraft/client/render/model/BakedModelManager;getAtlas(Lnet/minecraft/util/Identifier;)Lnet/minecraft/client/texture/SpriteAtlasTexture;
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
setMipmapLevels
public void setMipmapLevels(int mipmapLevels) - Mappings:
Namespace Name Mixin selector official a
Lfqn;a(I)V
intermediary method_24152
Lnet/minecraft/class_1092;method_24152(I)V
named setMipmapLevels
Lnet/minecraft/client/render/model/BakedModelManager;setMipmapLevels(I)V
-