gpt4 book ai didi

java - 错误域下的 Minecraft Forge 元素纹理

转载 作者:太空宇宙 更新时间:2023-11-04 12:25:36 27 4
gpt4 key购买 nike

这是我的代码: 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 出现黑紫色无纹理纹理。但是,该 block 的模型确实正确加载。经过进一步调查,我发现这个问题的原因是 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

最佳答案

问题在于您在元素模型文件中指定了图像"layer0": "items/generic_item",该图像不包含域,因此默认为 minecraft 域,您需要在其中设置 "layer0": "generic:items/generic_item"

关于java - 错误域下的 Minecraft Forge 元素纹理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38429773/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com