这是我的代码: 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";
}
当我加载游戏时,我会看到Generic Item
的黑紫色无纹理纹理。但是,块的模型确实正确加载。经过进一步调查,我发现造成这个问题的原因是Forge正在寻找错误域名minecraft
下的项目。现在,根据我的理解,这是预期的行为,因为我没有指定域。是对的吗?我该如何解决这个问题?
相关错误讯息:
[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]: +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
完整控制台输出:Pastebin
答案 0 :(得分:0)
问题出在您的商品模型文件中,您指定了图片"layer0": "items/generic_item"
这不包含域名,因此默认为您需要minecraft
域"layer0": "generic:items/generic_item"
。< / p>