use of org.quiltmc.qsl.resource.loader.api.reloader.SimpleSynchronousResourceReloader in project quilt-standard-libraries by QuiltMC.
the class ResourceReloaderTestMod method setupClientReloadListeners.
private void setupClientReloadListeners() {
ResourceLoader.get(ResourceType.CLIENT_RESOURCES).registerReloader(new SimpleSynchronousResourceReloader() {
@Override
public Identifier getQuiltId() {
return ResourceLoaderTestMod.id("client_second");
}
@Override
public void reload(ResourceManager manager) {
if (!clientResources) {
throw new AssertionError("Second resource reloader was called before the first!");
}
LOGGER.info("Second client resource reloader is called.");
}
@Override
public Collection<Identifier> getQuiltDependencies() {
return Collections.singletonList(ResourceLoaderTestMod.id("client_first"));
}
});
ResourceLoader.get(ResourceType.CLIENT_RESOURCES).registerReloader(new SimpleSynchronousResourceReloader() {
@Override
public Identifier getQuiltId() {
return ResourceLoaderTestMod.id("client_first");
}
@Override
public void reload(ResourceManager manager) {
clientResources = true;
LOGGER.info("First client resource reloader is called.");
}
});
}
use of org.quiltmc.qsl.resource.loader.api.reloader.SimpleSynchronousResourceReloader in project quilt-standard-libraries by QuiltMC.
the class ResourceReloaderTestMod method setupServerReloadListeners.
private void setupServerReloadListeners() {
ResourceLoader.get(ResourceType.SERVER_DATA).registerReloader(new SimpleSynchronousResourceReloader() {
@Override
public Identifier getQuiltId() {
return ResourceLoaderTestMod.id("server_second");
}
@Override
public void reload(ResourceManager manager) {
if (!serverResources) {
throw new AssertionError("Second resource reloader was called before the first!");
}
LOGGER.info("Second server resource reloader is called.");
}
@Override
public Collection<Identifier> getQuiltDependencies() {
return Collections.singletonList(ResourceLoaderTestMod.id("server_first"));
}
});
ResourceLoader.get(ResourceType.SERVER_DATA).registerReloader(new SimpleSynchronousResourceReloader() {
@Override
public Identifier getQuiltId() {
return ResourceLoaderTestMod.id("server_first");
}
@Override
public void reload(ResourceManager manager) {
serverResources = true;
LOGGER.info("First server resource reloader is called.");
}
});
}
Aggregations