Jump to content

[SOLVED][1.7.10]registerBlockIcons() called multiple times for one instance


jabelar

Recommended Posts

I'm debugging a texture problem that appeared in my mod and noticed something.  It is a crop block that extends BlockBush and I @Override the registerBlockIcons() function.  The code is simply:

    @Override
    @SideOnly(Side.CLIENT)
    public void registerBlockIcons(IIconRegister parIIconRegister)
    {
    	// DEBUG
    	System.out.println("Block Tomato registerBlockIcons()");
      this.iIcon = new IIcon[8];
      // seems that crops like to have 8 growth icons, but okay to repeat actual texture if you want
      this.iIcon[0] = parIIconRegister.registerIcon("recipeplus:tomatoes_stage_0");
      this.iIcon[1] = parIIconRegister.registerIcon("recipeplus:tomatoes_stage_0");
      this.iIcon[2] = parIIconRegister.registerIcon("recipeplus:tomatoes_stage_1");
      this.iIcon[3] = parIIconRegister.registerIcon("recipeplus:tomatoes_stage_1");
      this.iIcon[4] = parIIconRegister.registerIcon("recipeplus:tomatoes_stage_2");
      this.iIcon[5] = parIIconRegister.registerIcon("recipeplus:tomatoes_stage_2");
      this.iIcon[6] = parIIconRegister.registerIcon("recipeplus:tomatoes_stage_3");
      this.iIcon[7] = parIIconRegister.registerIcon("recipeplus:tomatoes_stage_3");
  }
}

 

Anyway, the weird thing is that the console statement prints out three times during Forge start up.  Here is console log:

 

[22:13:12] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLTweaker

[22:13:12] [main/INFO] [LaunchWrapper]: Using primary tweak class name cpw.mods.fml.common.launcher.FMLTweaker

[22:13:12] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLTweaker

[22:13:12] [main/INFO] [FML]: Forge Mod Loader version 7.10.24.1187 for Minecraft 1.7.10 loading

[22:13:12] [main/INFO] [FML]: Java is Java HotSpot 64-Bit Server VM, version 1.7.0_51, running on Windows 8:amd64:6.2, installed at E:\Program Files\Java\jdk1.7.0_51\jre

[22:13:12] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation

[22:13:12] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker

[22:13:12] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLDeobfTweaker

[22:13:12] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker

[22:13:12] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker

[22:13:12] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper

[22:13:12] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!

[22:13:14] [main/ERROR] [FML]: The minecraft jar file:/C:/Users/Aaron/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.0.1187/forgeSrc-1.7.10-10.13.0.1187.jar!/net/minecraft/client/ClientBrandRetriever.class appears to be corrupt! There has been CRITICAL TAMPERING WITH MINECRAFT, it is highly unlikely minecraft will work! STOP NOW, get a clean copy and try again!

[22:13:14] [main/ERROR] [FML]: FML has been ordered to ignore the invalid or missing minecraft certificate. This is very likely to cause a problem!

[22:13:14] [main/ERROR] [FML]: Technical information: ClientBrandRetriever was at jar:file:/C:/Users/Aaron/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.0.1187/forgeSrc-1.7.10-10.13.0.1187.jar!/net/minecraft/client/ClientBrandRetriever.class, there were 0 certificates for it

[22:13:14] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing

[22:13:14] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper

[22:13:14] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLDeobfTweaker

[22:13:14] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.TerminalTweaker

[22:13:14] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.TerminalTweaker

[22:13:14] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}

[22:13:15] [main/INFO]: Setting user: Player703

[22:13:16] [Client thread/INFO]: LWJGL Version: 2.9.1

[22:13:16] [Client thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization

[22:13:16] [Client thread/INFO] [FML]: MinecraftForge v10.13.0.1187 Initialized

[22:13:16] [Client thread/INFO] [FML]: Replaced 182 ore recipies

[22:13:16] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization

[22:13:16] [Client thread/INFO] [FML]: Searching E:\ModdingWorkspace\run\mods for mods

[22:13:17] [Client thread/ERROR] [FML]: 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!

[22:13:18] [Client thread/INFO] [FML]: Forge Mod Loader has identified 4 mods to load

RecipeBlockContainer() constructor

BlockStove constructor()

RecipeBlockContainer() constructor

BlockStove constructor()

BlockPantry constructor()

[22:13:19] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Recipe+

[22:13:19] [Client thread/INFO] [FML]: Processing ObjectHolder annotations

[22:13:19] [Client thread/INFO] [FML]: Found 341 ObjectHolder annotations

[22:13:19] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0

preInit()

[22:13:19] [Client thread/INFO] [FML]: Applying holder lookups

[22:13:19] [Client thread/INFO] [FML]: Holder lookups applied

 

Starting up SoundSystem...

Initializing LWJGL OpenAL

    (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)

OpenAL initialized.

 

[22:13:19] [sound Library Loader/INFO]: Sound engine started

Block Tomato registerBlockIcons()

Block Tomato registerBlockIcons()

[22:13:21] [Client thread/INFO]: Created: 1024x512 textures/blocks-atlas

[22:13:21] [Client thread/INFO]: Created: 256x256 textures/items-atlas

load()

postInit()

[22:13:21] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 4 mods

[22:13:21] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Recipe+

[22:13:21] [Client thread/INFO]: Created: 256x256 textures/items-atlas

Block Tomato registerBlockIcons()

[22:13:21] [Client thread/INFO]: Created: 1024x512 textures/blocks-atlas

 

SoundSystem shutting down...

    Author: Paul Lamb, www.paulscode.com

 

 

The method is client side only so this isn't duplicate on server side.  I checked the call hierarchy for the registerIcons() method and it is only called by TextureMap's registerIcons() method.

 

Does anyone know why the TextureMap is calling registerIcons() multiple times (or why there are multiple texture maps)?  Is it because there are TextureMap for different resolutions of textures?

 

Note that I'm sure that there is only one instance in my mod of blockTomato, as I checked for all calls to the constructor and only instantiate it once (as expected).

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.