use of net.minecraftforge.resource.ISelectiveResourceReloadListener in project Structurize by ldtteam.
the class ClientLifecycleSubscriber method onClientInit.
/**
* Called when client app is initialized.
*
* @param event event
*/
@SubscribeEvent
public static void onClientInit(final FMLClientSetupEvent event) {
OptifineCompat.getInstance().intialize();
final IResourceManager rm = event.getMinecraftSupplier().get().getResourceManager();
if (rm instanceof IReloadableResourceManager) {
((IReloadableResourceManager) rm).registerReloadListener((ISelectiveResourceReloadListener) (resourceManager, resourcePredicate) -> {
if (resourcePredicate.test(VanillaResourceType.MODELS) || resourcePredicate.test(VanillaResourceType.TEXTURES) || resourcePredicate.test(VanillaResourceType.SHADERS)) {
Log.getLogger().debug("Clearing blueprint renderer cache.");
BlueprintHandler.getInstance().clearCache();
}
Log.getLogger().debug("Clearing gui XML cache.");
Loader.cleanParsedCache();
});
}
// final RenderType s = RenderType.getSolid();
// ModBlocks.blockSubstitution;
// ModBlocks.blockSolidSubstitution;
// ModBlocks.blockFluidSubstitution;
// ModBlocks.multiBlock;
// ModBlocks.blockDecoBarrel_onside;
// ModBlocks.blockDecoBarrel_standing;
// ModBlocks.paperWalls;
// ModBlocks.floatingCarpets;
// ModBlocks.timberFrames;
// ModBlocks.shingles;
// ModBlocks.shingleSlabs;
// final RenderType c = RenderType.getCutout();
// final RenderType cm = RenderType.getCutoutMipped();
final RenderType t = RenderType.translucent();
ModBlocks.getPaperWalls().forEach(frame -> RenderTypeLookup.setRenderLayer(frame, t));
// ModBlocks.CACTI_BLOCKS
// ModBlocks.BRICKS
DELAYED_RENDER_TYPE_SETUP.forEach(tu -> {
if (!tu.getB().equals(RenderType.solid())) {
RenderTypeLookup.setRenderLayer(tu.getA().get(), tu.getB());
}
});
DELAYED_RENDER_TYPE_SETUP.clear();
DELAYED_RENDER_TYPE_SETUP.trimToSize();
}
Aggregations