Ege F
Ege F

Reputation: 107

Minecraft Forge Item Texture Under Wrong Domain

This is my code: GitHub

public class Items {

    public static Item generic_item;

    public static void init(){
        generic_item = new Item().setUnlocalizedName("generic_item");
    }

    public static void register(){
        GameRegistry.registerItem(generic_item, generic_item.getUnlocalizedName().substring(5));
    }

    public static void registerRenders(){
        registerRender(generic_item);
    }

    public static void registerRender(Item item){
        Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Values.MOD_ID + ":" + item.getUnlocalizedName().substring(5), "inventory"));

    }
}   

public class Values {
    public static final String MOD_ID = "generic";
    public static final String MOD_NAME = "Generic Mod";
    public static final String MOD_VER = "0.0.0";
    public static final String CLIENT_PROXY_CLASS = "tutorial.generic.proxy.ClientProxy";
    public static final String SERVER_PROXY_CLASS = "tutorial.generic.proxy.CommonProxy";
}

When I load up the game, I get the black-purple no texture texture appear for Generic Item. However, the model for the block does load in correctly. Upon further investigation, I figure out that the reason for this problem is that Forge is looking for the item under the wrong domain, minecraft. Now, to my understanding, this is expected behaviour as I didn't specify a domain. Is that right? And how do I fix this?

Related error message:

[02:05:50] [Client thread/ERROR] [TEXTURE ERRORS]: +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
[02:05:50] [Client thread/ERROR] [TEXTURE ERRORS]: The following texture errors were found.
[02:05:50] [Client thread/ERROR] [TEXTURE ERRORS]: ==================================================
[02:05:50] [Client thread/ERROR] [TEXTURE ERRORS]:   DOMAIN minecraft
[02:05:50] [Client thread/ERROR] [TEXTURE ERRORS]: --------------------------------------------------
[02:05:50] [Client thread/ERROR] [TEXTURE ERRORS]:   domain minecraft is missing 1 texture
[02:05:50] [Client thread/ERROR] [TEXTURE ERRORS]:     domain minecraft has 3 locations:
[02:05:50] [Client thread/ERROR] [TEXTURE ERRORS]:       unknown resourcepack type net.minecraft.client.resources.DefaultResourcePack : Default
[02:05:50] [Client thread/ERROR] [TEXTURE ERRORS]:       mod FML resources at C:\Users\egef\.gradle\caches\minecraft\net\minecraftforge\forge\1.10.2-12.18.1.2011\snapshot\20160518\forgeSrc-1.10.2-12.18.1.2011.jar
[02:05:50] [Client thread/ERROR] [TEXTURE ERRORS]:       mod Forge resources at C:\Users\egef\.gradle\caches\minecraft\net\minecraftforge\forge\1.10.2-12.18.1.2011\snapshot\20160518\forgeSrc-1.10.2-12.18.1.2011.jar
[02:05:50] [Client thread/ERROR] [TEXTURE ERRORS]: -------------------------
[02:05:50] [Client thread/ERROR] [TEXTURE ERRORS]:     The missing resources for domain minecraft are:
[02:05:50] [Client thread/ERROR] [TEXTURE ERRORS]:       textures/items/generic_item.png
[02:05:50] [Client thread/ERROR] [TEXTURE ERRORS]: -------------------------
[02:05:50] [Client thread/ERROR] [TEXTURE ERRORS]:     No other errors exist for domain minecraft
[02:05:50] [Client thread/ERROR] [TEXTURE ERRORS]: ==================================================
[02:05:50] [Client thread/ERROR] [TEXTURE ERRORS]: +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=

Full console output: Pastebin

Upvotes: 1

Views: 1455

Answers (1)

Skgland
Skgland

Reputation: 991

The problem is in your item model file you specified the image "layer0": "items/generic_item" this does not include a domain therefor defaulting to the minecraft domain you would need to have "layer0": "generic:items/generic_item" there instead.

Upvotes: 1

Related Questions