use of net.minecraft.client.resources.SimpleReloadableResourceManager in project GregTech by GregTechCE.
the class ResourcePackHook method init.
public static void init() {
IResourceManager resourceManager = Minecraft.getMinecraft().getResourceManager();
Minecraft.getMinecraft().defaultResourcePacks.add(instance);
if (resourceManager instanceof SimpleReloadableResourceManager) {
((SimpleReloadableResourceManager) resourceManager).registerReloadListener(instance);
}
}
use of net.minecraft.client.resources.SimpleReloadableResourceManager in project BetterQuesting by Funwayguy.
the class ClientProxy method registerHandlers.
@Override
@SuppressWarnings({ "unchecked", "rawtypes" })
public void registerHandlers() {
super.registerHandlers();
// MinecraftForge.EVENT_BUS.register(new UpdateNotification());
MinecraftForge.EVENT_BUS.register(PEventBroadcaster.INSTANCE);
ExpansionLoader.INSTANCE.initClientAPIs();
MinecraftForge.EVENT_BUS.register(new QuestNotification());
BQ_Keybindings.RegisterKeys();
try {
ArrayList list = ObfuscationReflectionHelper.getPrivateValue(Minecraft.class, Minecraft.getMinecraft(), "defaultResourcePacks", "field_110449_ao");
QuestResourcesFolder qRes1 = new QuestResourcesFolder();
QuestResourcesFile qRes2 = new QuestResourcesFile();
list.add(qRes1);
list.add(qRes2);
// Make sure the pack(s) are visible to everything
((SimpleReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).reloadResourcePack(qRes1);
// Make sure the pack(s) are visible to everything
((SimpleReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).reloadResourcePack(qRes2);
} catch (Exception e) {
BetterQuesting.logger.log(Level.ERROR, "Unable to install questing resource loaders", e);
}
RenderingRegistry.registerEntityRenderingHandler(EntityPlaceholder.class, new PlaceholderRenderFactory());
ToolboxRegistry.INSTANCE.registerToolbox(ToolboxTabMain.instance);
}
Aggregations