cdkrot Posted February 28, 2014 Posted February 28, 2014 (Using latest Minecraft forge v10.12.0.1034). I am registering textures in registerBlockIcons(IIconRegister), but in fact tests shows that it isn't invoked during initializations. P.S. i see strange output in console, like forge trying to load mods from java's rt.jar file. [18:26:41] [Client thread/INFO]: MinecraftForge v10.12.0.1034 Initialized [18:26:41] [Client thread/INFO]: Replaced 128 ore recipies [18:26:41] [Client thread/INFO]: Completed early MinecraftForge initialization [18:26:41] [Client thread/INFO]: Searching /home/cds/Dev/mcp/forge_172/eclipse/mods for mods [18:26:46] [Client thread/WARN]: Zip file rt.jar failed to read properly, it will be ignored java.lang.NullPointerException at cpw.mods.fml.common.discovery.asm.ASMModParser.isBaseMod(ASMModParser.java:130) ~[ASMModParser.class:?] at cpw.mods.fml.common.ModContainerFactory.build(ModContainerFactory.java:34) ~[ModContainerFactory.class:?] at cpw.mods.fml.common.discovery.JarDiscoverer.discover(JarDiscoverer.java:83) [JarDiscoverer.class:?] at cpw.mods.fml.common.discovery.ContainerType.findMods(ContainerType.java:42) [ContainerType.class:?] at cpw.mods.fml.common.discovery.ModCandidate.explore(ModCandidate.java:71) [ModCandidate.class:?] at cpw.mods.fml.common.discovery.ModDiscoverer.identifyMods(ModDiscoverer.java:123) [ModDiscoverer.class:?] at cpw.mods.fml.common.Loader.identifyMods(Loader.java:338) [Loader.class:?] at cpw.mods.fml.common.Loader.loadMods(Loader.java:460) [Loader.class:?] at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:201) [FMLClientHandler.class:?] at net.minecraft.client.Minecraft.startGame(Minecraft.java:498) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:853) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:103) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_21] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_21] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_21] at java.lang.reflect.Method.invoke(Method.java:601) ~[?:1.7.0_21] at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_21] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_21] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_21] at java.lang.reflect.Method.invoke(Method.java:601) ~[?:1.7.0_21] at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) [idea_rt.jar:?] [18:26:51] [Client thread/ERROR]: FML has detected a mod that is using a package name based on 'net.minecraft.src' : net.minecraft.src.FMLRenderAccessLibrary. This is generally a severe programming error. There should be no mod code in the minecraft namespace. MOVE YOUR MOD! If you're in eclipse, select your source code and 'refactor' it into a new package. Go on. DO IT NOW! [18:26:51] [Client thread/ERROR]: FML has detected a mod that is using a package name based on 'net.minecraft.src' : net.minecraft.src.Start. This is generally a severe programming error. There should be no mod code in the minecraft namespace. MOVE YOUR MOD! If you're in eclipse, select your source code and 'refactor' it into a new package. Go on. DO IT NOW! Quote
cdkrot Posted March 2, 2014 Author Posted March 2, 2014 Experimentaly, i founded that following code works, but i think it is not the right way. @SideOnly(Side.CLIENT) public void invokeClientSetup()//invoke during Initialisation. { TextureMap iconRegister = Minecraft.getMinecraft().getTextureMapBlocks(); Minecraft.getMinecraft().getTextureManager().onResourceManagerReload(Minecraft.getMinecraft().getResourceManager()); //reload the atlas. block1.registerBlockIcons(iconRegister); block2.registerBlockIcons(iconRegister); ///......... } Quote
fabricator77 Posted March 4, 2014 Posted March 4, 2014 Maybe you've just included the wrong class in your header, for example there are multiple Block classes, only two of them are part of Minecraft. Quote
LexManos Posted March 4, 2014 Posted March 4, 2014 https://github.com/MinecraftForge/FML/commit/b7ad532ab5eb3e00d77ffde946d25675c9f69cf7 For some reason cpw disabled this important reload {done after all loading has finished} Next time I sync FML it'll be pulled in. For now you can either call cpw.mods.fml.common.FMLCommonHandler.updateResourcePackList() manually once in like.. post init. {But please only if your function hasnt already been called to prevent multiple mods reloading it} Quote I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.