Search in sources :

Example 1 with SimpleReloadableResourceManager

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);
    }
}
Also used : IResourceManager(net.minecraft.client.resources.IResourceManager) SimpleReloadableResourceManager(net.minecraft.client.resources.SimpleReloadableResourceManager)

Example 2 with SimpleReloadableResourceManager

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);
}
Also used : QuestResourcesFile(betterquesting.misc.QuestResourcesFile) PlaceholderRenderFactory(betterquesting.client.renderer.PlaceholderRenderFactory) ArrayList(java.util.ArrayList) QuestResourcesFolder(betterquesting.misc.QuestResourcesFolder) SimpleReloadableResourceManager(net.minecraft.client.resources.SimpleReloadableResourceManager) QuestNotification(betterquesting.client.QuestNotification)

Aggregations

SimpleReloadableResourceManager (net.minecraft.client.resources.SimpleReloadableResourceManager)2 QuestNotification (betterquesting.client.QuestNotification)1 PlaceholderRenderFactory (betterquesting.client.renderer.PlaceholderRenderFactory)1 QuestResourcesFile (betterquesting.misc.QuestResourcesFile)1 QuestResourcesFolder (betterquesting.misc.QuestResourcesFolder)1 ArrayList (java.util.ArrayList)1 IResourceManager (net.minecraft.client.resources.IResourceManager)1