我正在修改 Minecraft 版本 1.8.9 (Forge 11.15.1.2318)。 如果我运行游戏,我的 mod 的块项目的纹理会丢失纹理。
放置的块纹理看起来不错。
ClientProxy.java
public class ClientProxy extends CommonProxy {
@Override
public void registerRenders() {
ModItems.registerRenders();
ModBlocks.registerRenders();
}
}
ModBlocks.java
public class ModBlocks {
public static Block vibranium_ore;
public static Block vibranium_block;
public static void init() {
vibranium_ore = new BlockVibraniumOre("vibranium_ore");
vibranium_block = new BlockVibraniumBlock("vibranium_block");
}
public static void register() {
registerBlock(vibranium_ore);
registerBlock(vibranium_block);
}
public static void registerRenders() {
registerRender(vibranium_ore);
registerRender(vibranium_block);
}
public static void registerBlock(Block block) {
GameRegistry.registerBlock(block, block.getUnlocalizedName().substring(5));
Logging.log("Registered Block: " + block.getUnlocalizedName().substring(5));
}
public static void registerRender(Block block) {
Item item = Item.getItemFromBlock(block);
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0,
new ModelResourceLocation(Reference.MODID + ":" + item.getUnlocalizedName().substring(5), "inventory"));
}
}
我尝试像这样改变模型: 块模型
{
"parent": "block/cube_all",
"textures": {
"all": "legtech:blocks/res/pure/ingot/vb"
}
}
商品型号
{
"parent": "block/vibranium_block",
"textures": {
"layer0": "legtech:blocks/res/pure/ingot/vb"
},
"display": {
"thirdperson": {
"rotation": [ 10, -45, 170 ],
"translation": [ 0, 1.5, -2.75 ],
"scale": [ 0.375, 0.375, 0.375 ]
}
}
}
您在物品模型的父名称中缺少 modID! 而不是这个:
{
"parent": "block/vibranium_block",
"textures": {
"layer0": "legtech:blocks/res/pure/ingot/vb"
},
"display": {
"thirdperson": {
"rotation": [ 10, -45, 170 ],
"translation": [ 0, 1.5, -2.75 ],
"scale": [ 0.375, 0.375, 0.375 ]
}
}
}
写下:
{
"parent": "legtech:block/vibranium_block",
"display": {
"thirdperson": {
"rotation": [ 10, -45, 170 ],
"translation": [ 0, 1.5, -2.75 ],
"scale": [ 0.375, 0.375, 0.375 ]
}
}
}