Minecraft 在错误的域下锻造物品纹理
Minecraft Forge Item Texture Under Wrong Domain
这是我的代码:
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.10.2-12.18.1.2011\snapshot160518\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.10.2-12.18.1.2011\snapshot160518\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
问题出在您的项目模型文件中,您指定了图像 "layer0": "items/generic_item"
这不包括域因此默认为 minecraft
域,您需要 "layer0": "generic:items/generic_item"
来代替.
这是我的代码: 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.10.2-12.18.1.2011\snapshot160518\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.10.2-12.18.1.2011\snapshot160518\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
问题出在您的项目模型文件中,您指定了图像 "layer0": "items/generic_item"
这不包括域因此默认为 minecraft
域,您需要 "layer0": "generic:items/generic_item"
来代替.