Search in sources :

Example 1 with TabRegistry

use of micdoodle8.mods.galacticraft.api.client.tabs.TabRegistry in project Galacticraft by micdoodle8.

the class ClientProxyCore method postInit.

@Override
public void postInit(FMLPostInitializationEvent event) {
    ClientProxyCore.registerInventoryTabs();
    ClientProxyCore.addVariants();
    ItemSchematic.registerTextures();
    MinecraftForge.EVENT_BUS.register(new TabRegistry());
    if (!CompatibilityManager.RenderPlayerAPILoaded) {
        try {
            Field field = RenderManager.class.getDeclaredField(GCCoreUtil.isDeobfuscated() ? "playerRenderer" : "field_178637_m");
            field.setAccessible(true);
            field.set(FMLClientHandler.instance().getClient().getRenderManager(), new RenderPlayerGC());
            field = RenderManager.class.getDeclaredField(GCCoreUtil.isDeobfuscated() ? "skinMap" : "field_178636_l");
            field.setAccessible(true);
            Map<String, RenderPlayer> skinMap = (Map<String, RenderPlayer>) field.get(FMLClientHandler.instance().getClient().getRenderManager());
            skinMap.put("default", new RenderPlayerGC(skinMap.get("default"), false));
            skinMap.put("slim", new RenderPlayerGC(skinMap.get("slim"), true));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    try {
        Field ftc = Minecraft.getMinecraft().getClass().getDeclaredField(GCCoreUtil.isDeobfuscated() ? "mcMusicTicker" : "field_147126_aw");
        ftc.setAccessible(true);
        ftc.set(Minecraft.getMinecraft(), new MusicTickerGC(Minecraft.getMinecraft()));
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : Field(java.lang.reflect.Field) TabRegistry(micdoodle8.mods.galacticraft.api.client.tabs.TabRegistry) RenderPlayer(net.minecraft.client.renderer.entity.RenderPlayer) MusicTickerGC(micdoodle8.mods.galacticraft.core.client.sounds.MusicTickerGC) RenderManager(net.minecraft.client.renderer.entity.RenderManager) StateMap(net.minecraft.client.renderer.block.statemap.StateMap) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 Field (java.lang.reflect.Field)1 TabRegistry (micdoodle8.mods.galacticraft.api.client.tabs.TabRegistry)1 MusicTickerGC (micdoodle8.mods.galacticraft.core.client.sounds.MusicTickerGC)1 StateMap (net.minecraft.client.renderer.block.statemap.StateMap)1 RenderManager (net.minecraft.client.renderer.entity.RenderManager)1 RenderPlayer (net.minecraft.client.renderer.entity.RenderPlayer)1