What happened to" IIconRegister" in 1.8?

supremegamer76

New Member
Jul 29, 2019
51
0
0
Hi I'm new to modding for minecraft but im currently following pahimar's Let's Mod Reboot series... but I am stuck on registering the First item image/icon but it seems that something happened to the "IIconRegister" class because I try importing it but it won't come up... By the way this is a minecraft 1.8 mod

package com.supremegamer76.MinecraftPlusMod.item;



import com.supremegamer76.MinecraftPlusMod.reference.Reference;



import net.minecraft.item.Item;

import net.minecraft.item.ItemStack;

import net.minecraftforge.fml.relauncher.Side;

import net.minecraftforge.fml.relauncher.SideOnly;

import net.minecraft.client.renderer.texture.IIconRegister;



public class ItemMPM extends Item {

public ItemMPM(){

super();



}



@Override

public String getUnlocalizedName(){

return String.format("item.%s%s", Reference.MOD_ID.toLowerCase(), getUnwrappedUnLocalizedName(super.getUnlocalizedName()));

}



@Override

public String getUnlocalizedName(ItemStack itemStack){

return String.format("item.%s%s", Reference.MOD_ID.toLowerCase(), getUnwrappedUnLocalizedName(super.getUnlocalizedName()));

}



@Override

@SideOnly(Side.CLIENT)

public void registerIcons(IIconRegister iconRegister){

itemIcon = iconRegister.registerIcon();

}



protected String getUnwrappedUnLocalizedName(String unlocalizedName){

return unlocalizedName.substring(unlocalizedName.indexOf(".") + 1);



}

}

Don't be mean if I seem like a noob at this, im just new at modding minecraft(this is my first mod)
 

FyberOptic

New Member
Jul 29, 2019
524
0
0
Literally nothing related to item and block textures from 1.7 or earlier exists in 1.8. You have to use model files, even for items that only display a single icon. And unlike blocks, you have to associate the item's model manually via a very non-intuitive mechanism since Forge is no help last I checked.

To be blunt, 1.8 is a mess and isn't doing beginners any favors in learning how to mod. You're better off learning 1.7.10. But if you're determined, you're going to have to find a 1.8-specific tutorial. Mr. Crayfish might be a good place to start in that case.
 
  • Like
Reactions: Type1Ninja

supremegamer76

New Member
Jul 29, 2019
51
0
0
Update: I used Mr. Crayfish's method (shown in episode 3 of his 1.8 tutorial series) and I got the item in game, just not the texture... it shows it as a block and it has the missing texture on it!

package com.supremegamer76.MinecraftPlusMod.init;



import com.supremegamer76.MinecraftPlusMod.reference.Reference;



import net.minecraft.client.Minecraft;


import net.minecraft.client.resources.model.ModelResourceLocation;


import net.minecraft.creativetab.CreativeTabs;


import net.minecraft.item.Item;


import net.minecraftforge.fml.common.registry.GameRegistry;



public class ModItems extends Item{



public static Item adjustment_wrench;



public static void init(){

adjustment_wrench = new Item().setUnlocalizedName("adjustment_wrench");

}

public static void register() {

GameRegistry.registerItem(adjustment_wrench, adjustment_wrench.getUnlocalizedName().substring(5));

}

public static void registerRenders(){

adjustment_wrench.setCreativeTab(CreativeTabs.tabTools);

registerRender(adjustment_wrench);

}

public static void registerRender(Item item){

Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item,1,new ModelResourceLocation(Reference.MOD_ID + ":" + item.getUnlocalizedName().substring(5), "inventory"));

}

}

package com.supremegamer76.MinecraftPlusMod;

import com.supremegamer76.MinecraftPlusMod.handler.ConfigurationHandler;
import com.supremegamer76.MinecraftPlusMod.init.ModItems;
import com.supremegamer76.MinecraftPlusMod.item.ItemAdjustmentWrench;
import com.supremegamer76.MinecraftPlusMod.item.ItemMPM;
import com.supremegamer76.MinecraftPlusMod.proxy.CommonProxy;
import com.supremegamer76.MinecraftPlusMod.proxy.IProxy;
import com.supremegamer76.MinecraftPlusMod.reference.Reference;
import com.supremegamer76.MinecraftPlusMod.utility.LogHelper;

import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.Instance;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.relauncher.Side;

@Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, version = Reference.VERSION, guiFactory = Reference.GUI_FACTORY_CLASS)
public class MinecraftPlusMod {

@Mod.Instance(Reference.MOD_ID)
public static MinecraftPlusMod instance;

@SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS)
public static CommonProxy proxy;

@Mod.EventHandler
public void preinit(FMLPreInitializationEvent event){
ConfigurationHandler.init(event.getSuggestedConfigurationFile());
FMLCommonHandler.instance().bus().register(new ConfigurationHandler());

ModItems.init();
ModItems.register();

LogHelper.info("Preinitialization complete!");

}

@Mod.EventHandler
public void init(FMLInitializationEvent event){

proxy.registerRenders();

LogHelper.info("Initialization complete!");
}

@Mod.EventHandler
public void postinit(FMLPostInitializationEvent event){
LogHelper.info("Postinitialization complete!");
}
}

Common proxy:

package com.supremegamer76.MinecraftPlusMod.proxy;



import com.supremegamer76.MinecraftPlusMod.init.ModItems;



public class ClientProxy extends CommonProxy {

@Override

public void registerRenders(){

ModItems.registerRenders();

}

}

{

"parent": "builtin/generated",

"textures": {

"layer0": "MinecraftPlusMod:items/adjustment_wrench"

},

"display": {

"thirdperson": {

"rotation": [ -90, 0, 0 ],

"translation": [ 0, 1, -3 ],

"scale": [ 0.55, 0.55, 0.55 ]

},

"firstperson": {

"rotation": [ 0, -135, 25 ],

"translation": [ 0, 4, 2 ],

"scale": [ 1.7, 1.7, 1.7 ]

}

}

}

The image that I have is under E:\MY NAME\Projects\Minecraft\1.8\MinecraftPlusMod\src\main\resources\assets\MinecraftPlusMod\textures\items

And the image is a .png file.
 

FyberOptic

New Member
Jul 29, 2019
524
0
0
One thing that stands out to me is that in your registerRender method in your item class, you're registering your model to the item with a metadata value of 1. Change that to a 0 and see if that fixes you up.
 

FyberOptic

New Member
Jul 29, 2019
524
0
0
Make sure your Reference.CLIENT_PROXY_CLASS variable is actually pointing to your client proxy class and not the common proxy. Make sure the model is in src\main\resources\assets\minecraftplusmod\models\item\adjustment_wrench.json (note "models" and "item" specifically). Texture should be src\main\resources\assets\minecraftplusmod\textures\items\adjustment_wrench.png ("items" this time, which you say you had).

Other than that, I'd need to know what error you're getting when you get to the title screen, and/or to see the code you didn't include (mostly just Reference).
 

supremegamer76

New Member
Jul 29, 2019
51
0
0
ok I just ran minecraft again and I got the log in the eclipse console so here it is:

[17:01:58] [main/INFO] [GradleStart]: Extra: []

[17:01:58] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --assetsDir, C:/Users/Conrad/.gradle/caches/minecraft/assets, --assetIndex, 1.8, --accessToken, {REDACTED}, --version, 1.8, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]

[17:01:58] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker

[17:01:58] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker

[17:01:58] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker

[17:01:58] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker

[17:01:58] [main/INFO] [FML]: Forge Mod Loader version 8.99.188.1495 for Minecraft 1.8 loading

[17:01:58] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_51, running on Windows 8.1:amd64:6.3, installed at C:\Program Files\Java\jre1.8.0_51

[17:01:58] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation

[17:01:58] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker

[17:01:58] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin

[17:01:58] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin

[17:01:58] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker

[17:01:58] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker

[17:01:58] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker

[17:01:58] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker

[17:01:58] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker

[17:01:58] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper

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

[17:01:59] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing

[17:01:59] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper

[17:01:59] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker

[17:01:59] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker

[17:01:59] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker

[17:01:59] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker

[17:01:59] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}

[17:01:59] [Client thread/INFO]: Setting user: Player439

[17:02:01] [Client thread/INFO]: LWJGL Version: 2.9.1

[17:02:02] [Client thread/INFO] [STDOUT]: [net.minecraftforge.fml.client.SplashProgress:start:235]: ---- Minecraft Crash Report ----

// Ouch. That hurt :(



Time: 7/23/15 5:02 PM

Description: Loading screen debug info



This is just a prompt for computer specs to be printed. THIS IS NOT A ERROR





A detailed walkthrough of the error, its code path and all known details is as follows:

---------------------------------------------------------------------------------------



-- System Details --

Details:

Minecraft Version: 1.8

Operating System: Windows 8.1 (amd64) version 6.3

Java Version: 1.8.0_51, Oracle Corporation

Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation

Memory: 945524248 bytes (901 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)

JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0

FML:

Loaded coremods (and transformers):

GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.4.0' Renderer: 'GeForce GTX 750/PCIe/SSE2'

[17:02:02] [Client thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization

[17:02:02] [Client thread/INFO] [FML]: MinecraftForge v11.14.3.1495 Initialized

[17:02:02] [Client thread/INFO] [FML]: Replaced 204 ore recipies

[17:02:02] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization

[17:02:02] [Client thread/INFO] [FML]: Found 0 mods from the command line. Injecting into mod discoverer

[17:02:02] [Client thread/INFO] [FML]: Searching E:\Conrad\Projects\Minecraft\1.8\MinecraftPlusMod\eclipse\mods for mods

[17:02:03] [Client thread/INFO] [FML]: Forge Mod Loader has identified 4 mods to load

[17:02:03] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, MinecraftPlusMod] at CLIENT

[17:02:03] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, MinecraftPlusMod] at SERVER

[17:02:04] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Minecraft+ Mod

[17:02:04] [Client thread/WARN]: ResourcePack: ignored non-lowercase namespace: MinecraftPlusMod/ in E:\Conrad\Projects\Minecraft\1.8\MinecraftPlusMod\bin

[17:02:04] [Client thread/INFO] [FML]: Processing ObjectHolder annotations

[17:02:04] [Client thread/INFO] [FML]: Found 384 ObjectHolder annotations

[17:02:04] [Client thread/INFO] [FML]: Identifying ItemStackHolder annotations

[17:02:04] [Client thread/INFO] [FML]: Found 0 ItemStackHolder annotations

[17:02:04] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0

[17:02:04] [Client thread/INFO] [Minecraft+ Mod]: Preinitialization complete!

[17:02:04] [Client thread/INFO] [FML]: Applying holder lookups

[17:02:04] [Client thread/INFO] [FML]: Holder lookups applied

[17:02:04] [Client thread/INFO] [FML]: Injecting itemstacks

[17:02:04] [Client thread/INFO] [FML]: Itemstack injection complete

[17:02:04] [Sound Library Loader/INFO]: Starting up SoundSystem...

[17:02:04] [Thread-9/INFO]: Initializing LWJGL OpenAL

[17:02:04] [Thread-9/INFO]: (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org)

AL lib: (EE) MMDevApiOpenPlayback: Device init failed: 0x80004005

AL lib: (EE) MMDevApiOpenPlayback: Device init failed: 0x80004005

[17:02:04] [Thread-9/ERROR]: Error in class 'LibraryLWJGLOpenAL'

[17:02:04] [Thread-9/ERROR]: Unable to initialize OpenAL. Probable cause: OpenAL not supported.

[17:02:04] [Thread-9/WARN]: ERROR MESSAGE:

[17:02:04] [Thread-9/INFO]: Could not locate OpenAL library.

[17:02:04] [Thread-9/WARN]: STACK TRACE:

[17:02:04] [Thread-9/INFO]: org.lwjgl.openal.AL.create(AL.java:151)

[17:02:04] [Thread-9/INFO]: org.lwjgl.openal.AL.create(AL.java:102)

[17:02:04] [Thread-9/INFO]: org.lwjgl.openal.AL.create(AL.java:201)

[17:02:04] [Thread-9/INFO]: paulscode.sound.libraries.LibraryLWJGLOpenAL.init(LibraryLWJGLOpenAL.java:164)

[17:02:04] [Thread-9/INFO]: paulscode.sound.SoundSystem.CommandNewLibrary(SoundSystem.java:1576)

[17:02:04] [Thread-9/INFO]: paulscode.sound.SoundSystem.CommandQueue(SoundSystem.java:2572)

[17:02:04] [Thread-9/INFO]: paulscode.sound.CommandThread.run(CommandThread.java:121)

[17:02:04] [Sound Library Loader/WARN]: ERROR MESSAGE:

[17:02:04] [Sound Library Loader/INFO]: Could not locate OpenAL library.

[17:02:04] [Sound Library Loader/INFO]: Starting up SoundSystem...

[17:02:05] [Thread-11/INFO]: Switching to No Sound

[17:02:05] [Thread-11/INFO]: (Silent Mode)

[17:02:05] [Sound Library Loader/INFO]: Sound engine started

[17:02:05] [Client thread/INFO] [FML]: Max texture size: 16384

[17:02:05] [Client thread/INFO]: Created: 16x16 textures-atlas

[17:02:06] [Client thread/ERROR] [FML]: Model definition for location minecraftplusmod:adjustment_wrench#inventory not found

[17:02:06] [Client thread/INFO] [Minecraft+ Mod]: Initialization complete!

[17:02:06] [Client thread/INFO] [FML]: Injecting itemstacks

[17:02:06] [Client thread/INFO] [FML]: Itemstack injection complete

[17:02:06] [Client thread/INFO] [Minecraft+ Mod]: Postinitialization complete!

[17:02:06] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 4 mods

[17:02:06] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Minecraft+ Mod

[17:02:06] [Client thread/WARN]: ResourcePack: ignored non-lowercase namespace: MinecraftPlusMod/ in E:\Conrad\Projects\Minecraft\1.8\MinecraftPlusMod\bin

[17:02:06] [Client thread/INFO]: SoundSystem shutting down...

[17:02:06] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com

[17:02:06] [Sound Library Loader/INFO]: Starting up SoundSystem...

[17:02:07] [Thread-13/INFO]: Initializing LWJGL OpenAL

[17:02:07] [Thread-13/INFO]: (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org)

[17:02:07] [Thread-13/INFO]: OpenAL initialized.

[17:02:07] [Sound Library Loader/INFO]: Sound engine started

[17:02:08] [Client thread/INFO] [FML]: Max texture size: 16384

[17:02:08] [Client thread/INFO]: Created: 512x512 textures-atlas

[17:02:08] [Client thread/ERROR] [FML]: Model definition for location minecraftplusmod:adjustment_wrench#inventory not found

[17:03:12] [Client thread/INFO]: Stopping!

[17:03:12] [Client thread/INFO]: SoundSystem shutting down...

[17:03:13] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com

Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release

note that at about the fourth line from the bottom there is an error saying "Model definition for location minecraftplusmod:adjustment_wrench#inventory not found" I don't totally know what this means but it could be why the texture is not showing... I think it is because there is a problem in the "registerRender" method, but im not sure.

package com.supremegamer76.MinecraftPlusMod.reference;



public class Reference {

public static final String MOD_ID = "MinecraftPlusMod";

public static final String MOD_NAME = "Minecraft+ Mod";

public static final String VERSION = "1.8.7-1.0";

public static final String CLIENT_PROXY_CLASS ="com.supremegamer76.MinecraftPlusMod.proxy.ClientProxy";

public static final String SERVER_PROXY_CLASS = "com.supremegamer76.MinecraftPlusMod.proxy.CommmonProxy";

public static final String GUI_FACTORY_CLASS = "com.supremegamer76.MinecraftPlusMod.client.gui.GuiFactory";

}
 

supremegamer76

New Member
Jul 29, 2019
51
0
0
I think I just saw another problem... in the references code I set the SERVER_PROXY_CLASS to "com.supremegamer76.MinecraftPlusMod.proxy.CommmonProxy"; instead of "com.supremegamer76.MinecraftPlusMod.proxy.CommonProxy"; so I accidently had 3 m's in Common instead of 2
 

FyberOptic

New Member
Jul 29, 2019
524
0
0
The model definition error is the one I assumed you were getting. If the model were at least loading you'd see just an item-shaped object with the missing texture pattern applied. But you said it looked like a block, which means it's likely not loading the model at all.

One thing you might do is move your ModItems.init() and ModItems.register() to the beginning of the init method rather than preinit.

If you verified that your model is in the exact location I specified, and set the metadata value back to 0, confirmed your CLIENT_PROXY variable is accurate, and can guarantee that your registerRender method is getting called (just print out a string to verify), then I dunno what else to tell you. It should be working if those things are correct.
 

supremegamer76

New Member
Jul 29, 2019
51
0
0
I've been taking a look at the #inventory part of the error and I'm pretty sure its because of the ModelResourceLocation() method that I used in the "renderRegister" because I looked at the code for the ModelResourceLocation() method and it shows this...

public ModelResourceLocation(String p_i46081_1_, String p_i46081_2_)
{
this(0, parsePathString(p_i46081_1_ + '#' + (p_i46081_2_ == null ? "normal" : p_i46081_2_)));
}
 

FyberOptic

New Member
Jul 29, 2019
524
0
0
That's not the problem, that's required to register an item model.

Seriously, I dumped all your code into a project and made it work by doing the things I said.
 

supremegamer76

New Member
Jul 29, 2019
51
0
0
I finally got it to work! I had to kind of replace the package in com.supremegamer76, MinecraftPlusMod to minecraftplusmod and in assets, MinecraftPlusMod to minecraftplusmod... and I had to fix a few things to make it work for "minecraftplusmod" and in the build.gradle I had to change whatever was "MinecraftPlusMod" to "minecraftplusmod"... what I now think the problem was is that the "Model definition for location minecraftplusmod:adjustment_wrench#inventory not found" thing had shown the thing not found as minecraftplusmod:adjustment_wrench#inventory (emphasis on "minecraftplusmod" part) and i had my mod_id in the reference class as "MinecraftModPlus" so i think it got changed to all lowercase because of something in the ModelResourceLocation() method I was using somehow changed it to that... but who knows, I'm new to this.