@Environment(value=CLIENT) public class TextureManager extends Object implements ResourceReloadListener, TextureTickListener, AutoCloseable
ResourceReloadListener.Synchronizer
Modifier and Type | Field and Description |
---|---|
private Map<String,Integer> |
dynamicIdCounters |
private static Logger |
LOGGER |
static Identifier |
MISSING_IDENTIFIER |
private ResourceManager |
resourceContainer |
private Map<Identifier,AbstractTexture> |
textures |
private Set<TextureTickListener> |
tickListeners |
Constructor and Description |
---|
TextureManager(ResourceManager resourceManager) |
Modifier and Type | Method and Description |
---|---|
void |
bindTexture(Identifier id) |
private void |
bindTextureInner(Identifier id) |
void |
close() |
void |
destroyTexture(Identifier id) |
AbstractTexture |
getTexture(Identifier id) |
CompletableFuture<Void> |
loadTextureAsync(Identifier id,
Executor executor) |
private AbstractTexture |
method_24303(Identifier identifier,
AbstractTexture abstractTexture) |
private void |
method_30299(Identifier identifier,
AbstractTexture abstractTexture) |
Identifier |
registerDynamicTexture(String prefix,
NativeImageBackedTexture texture) |
void |
registerTexture(Identifier identifier,
AbstractTexture abstractTexture) |
CompletableFuture<Void> |
reload(ResourceReloadListener.Synchronizer synchronizer,
ResourceManager manager,
Profiler prepareProfiler,
Profiler applyProfiler,
Executor prepareExecutor,
Executor applyExecutor) |
private static void |
runOnRenderThread(Runnable runnable) |
void |
tick() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getName
private static final Logger LOGGER
public static final Identifier MISSING_IDENTIFIER
private final Map<Identifier,AbstractTexture> textures
private final Set<TextureTickListener> tickListeners
private final ResourceManager resourceContainer
public TextureManager(ResourceManager resourceManager)
public void bindTexture(Identifier id)
private void bindTextureInner(Identifier id)
public void registerTexture(Identifier identifier, AbstractTexture abstractTexture)
private void method_30299(Identifier identifier, AbstractTexture abstractTexture)
private AbstractTexture method_24303(Identifier identifier, AbstractTexture abstractTexture)
@Nullable public AbstractTexture getTexture(Identifier id)
public Identifier registerDynamicTexture(String prefix, NativeImageBackedTexture texture)
public CompletableFuture<Void> loadTextureAsync(Identifier id, Executor executor)
private static void runOnRenderThread(Runnable runnable)
public void tick()
tick
in interface TextureTickListener
public void destroyTexture(Identifier id)
public void close()
close
in interface AutoCloseable
public CompletableFuture<Void> reload(ResourceReloadListener.Synchronizer synchronizer, ResourceManager manager, Profiler prepareProfiler, Profiler applyProfiler, Executor prepareExecutor, Executor applyExecutor)
reload
in interface ResourceReloadListener