public static void init() { if (initialized) return; initialized = true; IResourceManager rm = Minecraft.getMinecraft().getResourceManager(); if (rm instanceof IReloadableResourceManager) { ((IReloadableResourceManager) rm).registerReloadListener(__ -> { loadedModels.clear(); reloadCount++; }); } }
@Override public void preInit(FMLPreInitializationEvent e) { super.preInit(e); ModItems.initClient(); ModelLoaderRegistry.registerLoader(new BakedModelLoader()); ModelLoaderRegistry.registerLoader(ModelSeed.LoaderSeeds.INSTANCE); ModelLoaderRegistry.registerLoader(ModelWrappedFood.LoaderWrappedFood.INSTANCE); IResourceManager manager = FMLClientHandler.instance().getClient().getResourceManager(); if(manager !=null && manager instanceof IReloadableResourceManager){ ((IReloadableResourceManager)manager).registerReloadListener(new GuidePageLoader()); ((IReloadableResourceManager)manager).registerReloadListener(this); } MinecraftForge.EVENT_BUS.register(new ClientEventHandler()); MinecraftForge.EVENT_BUS.register(new DisguiseClientHandler()); ModBlocks.initClient(); ModEntites.initClient(); OBJLoader.INSTANCE.addDomain(CrystalMod.MODID); }
void init() { LiteLoader.getInput().registerKeyBinding(SETTINGS_GUI); this.config = new PonyConfig(); this.ponyManager = new PonyManager(config); LiteLoader.getInstance().registerExposable(config, null); IReloadableResourceManager irrm = (IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager(); irrm.registerReloadListener(this.ponyManager); MetadataSerializer ms = Minecraft.getMinecraft().getResourcePackRepository().rprMetadataSerializer; ms.registerMetadataSectionType(new PonyDataSerialzier(), IPonyData.class); // This also makes it the default gateway server. SkinServer.defaultServers.add("legacy:http://minelpskins.voxelmodpack.com;http://minelpskinmanager.voxelmodpack.com"); }
@Override public void init(File configPath) { // register config LiteLoader.getInstance().registerExposable(this, null); // try it initialize voxelmenu button try { Class<?> ex = Class.forName("com.thevoxelbox.voxelmenu.GuiMainMenuVoxelBox"); Method mRegisterCustomScreen = ex.getDeclaredMethod("registerCustomScreen", Class.class, String.class); mRegisterCustomScreen.invoke(null, GuiSkins.class, "HD Skins Manager"); } catch (ClassNotFoundException var4) { // voxelmenu's not here, man } catch (Exception var5) { var5.printStackTrace(); } IReloadableResourceManager irrm = (IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager(); irrm.registerReloadListener(HDSkinManager.INSTANCE); }
@Override public void preInit(FMLPreInitializationEvent event) { super.preInit(event); settings.init(); MinecraftForge.EVENT_BUS.register(this); clientKeyboardHandler = new ClientKeyboardHandler(this); TaleCraftClientCommands.init(); IReloadableResourceManager resManager = (IReloadableResourceManager) mc.getResourceManager(); resManager.registerReloadListener(this); clientTickQeue = new ConcurrentLinkedDeque<Runnable>(); clientRenderer = new ClientRenderer(this); clientRenderer.preInit(); }
public void postInit() { ((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).registerReloadListener(new IResourceManagerReloadListener() { private boolean ranOnce = false; public void onResourceManagerReload(IResourceManager resourcemanager) { if (!this.ranOnce) { this.ranOnce = true; return; } StructuralLevelClientData.loadBaseTextureData(); if (StructuralLevel.LEVELS != null) { for (StructuralLevel level : StructuralLevel.LEVELS) { if (level.levelNum != 0) { level.clientData.generateIcons(); StringTranslate.inject(new ByteArrayInputStream(("item.upgrade.structural." + String.valueOf(level.levelNum) + ".name=" + StatCollector.translateToLocal("item.upgrade.structural") + " " + Utils.romanNumeral(level.levelNum) + " (" + level.clientData.getMaterialName() + ")").getBytes())); } } } StructuralLevelClientData.unloadBaseTextureData(); } }); }
@Override public void registerTileEntities() { super.registerTileEntities(); IReloadableResourceManager IRRM = (IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager(); IRRM.registerReloadListener(this); RenderManager rm = Minecraft.getMinecraft().getRenderManager(); RenderingRegistry.registerEntityRenderingHandler(EntityStone.class, new RenderEntityStone()); RenderingRegistry.registerEntityRenderingHandler(EntityMobHorse.class, new RenderHorse(rm, new ModelHorse(), 0.75f)); RenderingRegistry.registerEntityRenderingHandler(EntityForestSpider.class, new RenderForestSpider(rm)); RenderingRegistry.registerEntityRenderingHandler(EntityCoalPoweredMinecartVC.class, new RenderMinecart(rm)); RenderingRegistry.registerEntityRenderingHandler(EntityEmptyMinecartVC.class, new RenderMinecart(rm)); RenderingRegistry.registerEntityRenderingHandler(EntityCowVC.class, new RenderCow(rm, new ModelCowVC(), 0.7F)); RenderingRegistry.registerEntityRenderingHandler(EntitySheepVC.class, new RenderSheep(rm, new ModelSheep2(), 0.7F)); }
public void init() { // Set global settings settings = new TabbySettings(); LiteLoader.getInstance().registerExposable(settings, null); spellcheck = new Spellcheck(getDataFolder()); // Keeps the current language updated whenever it is changed. IReloadableResourceManager irrm = (IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager(); irrm.registerReloadListener(spellcheck); bus.register(new ChatAddonAntiSpam()); bus.register(new FilterAddon()); bus.register(new ChatLogging(new File("logs/chat"))); }
@Override public void postInit(FMLPostInitializationEvent event) { super.postInit(event); ((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).registerReloadListener(resourceManager -> { HarshenAPIHandler.register(); CauldronBlock.registerModels(); HarshenCastle.LOGGER.info("All recipes loaded"); }); }
@Override public void init(FMLInitializationEvent event) { super.init(event); ((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).registerReloadListener(ShaderHandler.instance); ShaderHandler.instance.init(); }
@Override public void init() { FirstAid.logger.debug("Loading ClientProxy"); MinecraftForge.EVENT_BUS.register(ClientEventHandler.class); ClientRegistry.registerKeyBinding(showWounds); GuiIngameForge.renderHealth = FirstAidConfig.overlay.showVanillaHealthBar; ((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).registerReloadListener(manager -> HUDHandler.rebuildTranslationTable()); EventCalendar.checkDate(); }
@SideOnly(Side.CLIENT) public static void registerFontRenderer(Minecraft mc, FontRenderer renderer) throws Exception { if (mc.gameSettings.language != null) { renderer.setUnicodeFlag(mc.isUnicode()); renderer.setBidiFlag(mc.getLanguageManager().isCurrentLanguageBidirectional()); } ((IReloadableResourceManager) mc.getResourceManager()).registerReloadListener(renderer); }
@Override public void registerEventHandler() { MinecraftForge.EVENT_BUS.register((Object)new EventHandlerClient()); FMLCommonHandler.instance().bus().register((Object)new EventHandlerClient()); ((IReloadableResourceManager)Minecraft.getMinecraft().getResourceManager()).registerReloadListener((IResourceManagerReloadListener)new LiquidColorRegistry()); ((IReloadableResourceManager)Minecraft.getMinecraft().getResourceManager()).registerReloadListener((IResourceManagerReloadListener)new ParticleHelperClient()); ExtraUtils.handlesClientMethods = true; if (Loader.isModLoaded("ForgeMultipart")) { RenderBlockConnectedTextures.fakeRender = new FakeRenderBlocksMultiPart(); } ClientCommandHandler.instance.registerCommand((ICommand)new CommandHologram()); ClientCommandHandler.instance.registerCommand((ICommand)new CommandUUID()); KeyHandler.INSTANCE.register(); super.registerEventHandler(); }
public static void setFont(Minecraft mc, boolean custom) { if (mc.fontRendererObj == null) return; ResourceLocation fontLocation = custom? new ResourceLocation(SAOCore.MODID, "textures/ascii.png"): new ResourceLocation("textures/font/ascii.png"); GameSettings gs = mc.gameSettings; mc.fontRendererObj = new FontRenderer(gs, fontLocation, mc.getTextureManager(), false); if (gs.language != null) { mc.fontRendererObj.setUnicodeFlag(mc.isUnicode()); mc.fontRendererObj.setBidiFlag(mc.getLanguageManager().isCurrentLanguageBidirectional()); } ((IReloadableResourceManager) mc.getResourceManager()).registerReloadListener(mc.fontRendererObj); }
@Override public void postInit(FMLPostInitializationEvent event) { super.postInit(event); if (Minecraft.getMinecraft().getResourceManager() instanceof IReloadableResourceManager) ((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).registerReloadListener(this); }
public static boolean resourceExists(String file) { IReloadableResourceManager resourceManager = (IReloadableResourceManager) FMLClientHandler.instance().getClient().getResourceManager(); try { resourceManager.getResource(new ResourceLocation(EPMod.ID, file)); return true; } catch (Exception e) { return false; } }
@SideOnly(Side.CLIENT) public void registerListener() { ((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).registerReloadListener(new IResourceManagerReloadListener() { @Override public void onResourceManagerReload(IResourceManager resourceManager) { LocalizationUpdater.this.loadLangFiles(); } }); }
@EventHandler public void preInit(FMLPreInitializationEvent event) { AdvancedModelLoader.registerModelHandler(new ColladaModelLoader()); if (event.getSide() == Side.CLIENT) { modelManager = new ModelManager(); ((IReloadableResourceManager) Minecraft.getMinecraft() .getResourceManager()).registerReloadListener(modelManager); } }
public static void run() { //noinspection NullableProblems ((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).registerReloadListener(new IResourceManagerReloadListener() { @Override public void onResourceManagerReload(IResourceManager resourceManager) { D3LanguageInjectEvent event = new D3LanguageInjectEvent(); MinecraftForge.EVENT_BUS.post(event); LanguageMap.replaceWith(event.map); } }); }
@Override public void init() { //new PaneVanityArmor().autoOverlay(GuiInventory.class); //new PaneToolsOverlay().autoOverlay(GuiMainMenu.class); new PaneOrbGlow().autoOverlay(GuiIngame.class); if (FarragoMod.showBrand && StringUtils.isNotBlank(FarragoMod.brand)) { new PaneBranding().autoOverlay(GuiMainMenu.class); } RenderingRegistry.registerEntityRenderingHandler(EntityBlunderbussProjectile.class, new RenderBlunderbussProjectile()); RenderingRegistry.registerEntityRenderingHandler(EntityRifleProjectile.class, new RenderNull()); MinecraftForgeClient.registerItemRenderer(FarragoMod.RIFLE, new RifleItemRenderer()); MinecraftForgeClient.registerItemRenderer(FarragoMod.UNDEFINED, new UndefinedItemRenderer()); prevHotbar = new KeyBinding("key.farrago.utility_belt.prev_hotbar", Keyboard.KEY_MINUS, "key.categories.farrago.utility_belt"); nextHotbar = new KeyBinding("key.farrago.utility_belt.next_hotbar", Keyboard.KEY_EQUALS, "key.categories.farrago.utility_belt"); renameHotbar = new KeyBinding("key.farrago.utility_belt.rename_hotbar", Keyboard.KEY_BACK, "key.categories.farrago.utility_belt"); lockSlot = new KeyBinding("key.farrago.utility_belt.lock_slot", Keyboard.KEY_0, "key.categories.farrago.utility_belt"); ClientRegistry.registerKeyBinding(prevHotbar); ClientRegistry.registerKeyBinding(nextHotbar); ClientRegistry.registerKeyBinding(renameHotbar); ClientRegistry.registerKeyBinding(lockSlot); FarragoMod.lightPipeRenderType = RenderingRegistry.getNextAvailableRenderId(); FarragoMod.machineRenderType = RenderingRegistry.getNextAvailableRenderId(); RenderingRegistry.registerBlockHandler(new LightPipeBlockRenderer()); RenderingRegistry.registerBlockHandler(new MachineBlockRenderer()); IResourceManager manager = Minecraft.getMinecraft().getResourceManager(); if (manager instanceof IReloadableResourceManager) { ((IReloadableResourceManager)manager).registerReloadListener(new Encyclopedia()); } FMLCommonHandler.instance().bus().register(this); MinecraftForge.EVENT_BUS.register(this); UtilityBeltRenderer.showSwapSpace = FarragoMod.config.getBoolean("debug.showSwapSpace"); }
@Override public void postInit() { final IResourceManager resourceManager = Minecraft.getMinecraft().getResourceManager(); if (resourceManager instanceof IReloadableResourceManager) { // These casts are bad, but we don't have another way to do this. ((IReloadableResourceManager) resourceManager).registerReloadListener(AcemusColorizer.INSTANCE); ((IReloadableResourceManager) resourceManager).registerReloadListener(CerasuColorizer.INSTANCE); ((IReloadableResourceManager) resourceManager).registerReloadListener(KulistColorizer.INSTANCE); } }
@Override public void init(FMLInitializationEvent event) { super.init(event); PhysisIntegration.initStart(event, true); ClientProxy.runeFontRenderer = new RuneFontRenderer(); ClientProxy.bookFontRenderer = new BookFontRenderer(); ClientProxy.bookRuneFontRenderer = new BookRuneFontRenderer(); IResourceManager m = Minecraft.getMinecraft().getResourceManager(); if (m instanceof IReloadableResourceManager) { ((IReloadableResourceManager)m).registerReloadListener(ClientProxy.runeFontRenderer); ((IReloadableResourceManager)m).registerReloadListener(ClientProxy.bookFontRenderer); ((IReloadableResourceManager)m).registerReloadListener(ClientProxy.bookRuneFontRenderer); } EncryptionSymbol.init(); FMLCommonHandler.instance().bus().register(new ClientTickHandler()); MinecraftForge.EVENT_BUS.register(new TextureMapHandler()); MinecraftForge.EVENT_BUS.register(new TooltipHandler()); //MinecraftForge.EVENT_BUS.register(new BlockHighlightHandler()); RenderingRegistry.registerBlockHandler(new RenderDigSite(RenderingRegistry.getNextAvailableRenderId())); RenderingRegistry.registerBlockHandler(new RenderSocketTable(RenderingRegistry.getNextAvailableRenderId())); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDigSite.class, new RenderTileDigSite()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySocketTable.class, new RenderTileSocketTable()); MinecraftForgeClient.registerItemRenderer(PhysisItems.socketable, new RenderSocketable()); ShaderHelper.initShaders(); PhysisArtifacts.clientInit(); // make sure it doesn't come out null in that little while before loading. StoryEngine.reload(-1, true); PhysisIntegration.initEnd(event, true); }
public static void init() { IResourceManager rm = Minecraft.getMinecraft().getResourceManager(); if (rm instanceof IReloadableResourceManager) { ((IReloadableResourceManager) rm).registerReloadListener(new IResourceManagerReloadListener() { @Override public void onResourceManagerReload(IResourceManager ignored) { loadedModels.clear(); } }); } }
private BattlegearClientEvents(){ inGameGUI = new BattlegearInGameGUI(); quiverModel = new QuiverModel(); quiverDetails = new ResourceLocation("battlegear2", "textures/armours/quiver/quiver_details.png"); quiverBase = new ResourceLocation("battlegear2", "textures/armours/quiver/quiver_base.png"); ((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).registerReloadListener(this); }
@Override public void preInit() { ClientCommandHandler.instance.registerCommand(new CommandConfig("om_config_c", false)); ClientCommandHandler.instance.registerCommand(new CommandSource("om_source_c", false, OpenMods.instance.getCollector())); ClientCommandHandler.instance.registerCommand(new CommandGlDebug()); if (LibConfig.enableCalculatorCommands) { final ICommandComponent commandRoot = new CommandCalcFactory(new File(getMinecraftDir(), "scripts")).getRoot(); ClientCommandHandler.instance.registerCommand(new CommandCalc(commandRoot, "config")); ClientCommandHandler.instance.registerCommand(new CommandCalc(commandRoot, "eval", "=")); ClientCommandHandler.instance.registerCommand(new CommandCalc(commandRoot, "fun")); ClientCommandHandler.instance.registerCommand(new CommandCalc(commandRoot, "let")); ClientCommandHandler.instance.registerCommand(new CommandCalc(commandRoot, "execute")); } RenderUtils.registerFogUpdater(); MinecraftForge.EVENT_BUS.register(new BlockSelectionHandler()); ModelLoaderRegistry.registerLoader(MappedModelLoader.builder() .put("with-dependencies", ModelWithDependencies.EMPTY) .put("multi-layer", MultiLayerModel.EMPTY) .put("variantmodel", VariantModel.EMPTY_MODEL) .put("textureditem", TexturedItemModel.INSTANCE) .put("stateitem", ItemStateModel.EMPTY) .put("eval", EvalModel.EMPTY) .put("eval-expand", EvalExpandModel.EMPTY) .put("perspective-aware", PerspectiveAwareModel.EMPTY) .build(OpenMods.MODID)); ((IReloadableResourceManager)Minecraft.getMinecraft().getResourceManager()).registerReloadListener(hitboxManager); FramebufferBlitter.setup(); }
public static void registerResourceReloadListener(IResourceManagerReloadListener listener) { ((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()) .registerReloadListener(listener); }
private ExtraBlockBreakHandler(Minecraft mcIn) { this.mc = mcIn; this.renderEngine = mcIn.getTextureManager(); ((IReloadableResourceManager) mc.getResourceManager()).registerReloadListener(this); }
public static void registerLoader(ICustomModelLoader loader) { loaders.add(loader); ((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).registerReloadListener(loader); }
public void register() { final List<IResourcePack> packs = this.getiResourcePacks(); packs.add((IResourcePack)this); ((IReloadableResourceManager)Minecraft.getMinecraft().getResourceManager()).registerReloadListener((IResourceManagerReloadListener)this); LogHelper.info("Registered TCon Resource Pack (" + this.name + ") - " + this.getClass().getSimpleName(), new Object[0]); }
private static TextureHelper loadFromJSON(IResourceManager manager, ResourceLocation location) throws IOException{ TextureHelper helper = loadInternal(manager, location); ((IReloadableResourceManager) manager).registerReloadListener(helper); return helper; }
@Override public void registerRenderInformation() { IReloadableResourceManager IRRM = (IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager(); IRRM.registerReloadListener(this); }
public IngensFontRenderer() { super(Minecraft.getMinecraft().gameSettings, new ResourceLocation(ModRef.MOD_ID + ":textures/font/item_font.png"), Minecraft.getMinecraft().renderEngine, false); IReloadableResourceManager resourceManager = (IReloadableResourceManager)Minecraft.getMinecraft().getResourceManager(); resourceManager.registerReloadListener(this); }
public static void registerReloadListener(IResourceManagerReloadListener obj) { ((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).registerReloadListener(obj); }
public CatSkinLoader() { skinMap = new HashMap<String, String>(); skinTypes = new ArrayList<String>(); ((IReloadableResourceManager)Minecraft.getMinecraft().getResourceManager()).registerReloadListener(this); }
@EventHandler public void init(FMLInitializationEvent event) { if (exempleEnabled) { logger.info("Registering ISBRH Block Exemple..."); testId = RenderRegistry.getNextAvailableRenderId(); GameRegistry.registerBlock(test, "test"); RenderRegistry.registerBlockHandler(new RenderExample()); RenderRegistry.registerTextureHandler((ITextureHandler) test); } Minecraft mc = Minecraft.getMinecraft(); // Prerequisite ModelManager modelManager = ObfuscationReflectionHelper .getPrivateValue(Minecraft.class, mc, "aL", "field_175617_aL", "modelManager"); RenderManager renderManager = mc.getRenderManager(); IReloadableResourceManager resourceManager = ((IReloadableResourceManager) mc .getResourceManager()); // Render Item Hook RenderItem item = new RenderItemISBRH(mc.getTextureManager(), modelManager, mc.getRenderItem()); ObfuscationReflectionHelper.setPrivateValue(Minecraft.class, mc, item, "X", "field_175621_X", "renderItem"); ObfuscationReflectionHelper.setPrivateValue(Minecraft.class, mc, new ItemRenderer(mc), "Y", "field_175620_Y", "itemRenderer"); renderManager.entityRenderMap.remove(EntityItem.class); renderManager.entityRenderMap.put(EntityItem.class, new RenderEntityItem(renderManager, item)); renderManager.entityRenderMap.remove(EntityItemFrame.class); renderManager.entityRenderMap.put(EntityItemFrame.class, new RenderItemFrame(renderManager, item)); mc.entityRenderer = new EntityRenderer(mc, resourceManager); // Render Block Dispatcher Hook BlockRendererDispatcher rendererDispatcher = new ISBRHDispatcher( mc.getBlockRendererDispatcher(), modelManager.getBlockModelShapes(), mc.gameSettings); ObfuscationReflectionHelper.setPrivateValue(Minecraft.class, mc, rendererDispatcher, "aM", "field_175618_aM", "blockRenderDispatcher"); // Register Reload Listeners resourceManager.registerReloadListener(rendererDispatcher); resourceManager.registerReloadListener(item); resourceManager.registerReloadListener(mc.entityRenderer); }