红.龙
本帖最后由 红.龙 于 2021-7-21 14:01 编辑

在制作版本迁移模组的灵魂火把时,IDEA读取soul_torch.json时发送了6次[Client thread/ERROR] [FML]: MultiModel minecraft:builtin/missing is empty (no base model or parts were provided/resolved)

报错,分别对应"variants"下"facing=up","facing=south","facing=west","facing=north","facing=east","inventory"6种情况。
在游戏中无论如何放置soul_torch都为紫黑块。facing参数正常。

BlockSoulTorch类直接继承原版BlockTorch类,代码如下。

package reddragon.versiontransport.block;

import net.minecraft.block.BlockTorch;
import reddragon.versiontransport.VT;

import static reddragon.versiontransport.item.CreativeTabRegister.VT_DECORATION;

public class BlockSoulTorch extends BlockTorch
{
    public BlockSoulTorch()
    {
        this.setCreativeTab(VT_DECORATION);
        this.setUnlocalizedName(VT.MODID+"soulTorch");
        this.setRegistryName("soul_torch");
        this.setLightLevel(13);
    }
}

注册过程与其它方块相同,并无差错。json中"elements"直接照搬原版火把的json文件。
soul_torch.json:
{
    "forge_marker": 1,
    "ambientocclusion": false,
    "textures": {
        "particle": "versiontransport:blocks/soul_torch"
    },
    "variants": {
        "inventory": [{}],
        "facing": {
            "south": {
                "elements": [
                    {   "from": [ -1, 3.5, 7 ],
                        "to": [ 1, 13.5, 9 ],
                        "rotation": { "origin": [ 0, 3.5, 8 ], "axis": "z", "angle": -22.5 },
                        "shade": false,
                        "faces": {
                            "down": { "uv": [ 7, 13, 9, 15 ], "texture": "versiontransport:blocks/soul_torch" },
                            "up":   { "uv": [ 7,  6, 9,  8 ], "texture": "versiontransport:blocks/soul_torch" }
                        }
                    },
                    {   "from": [ -1, 3.5, 0 ],
                        "to": [ 1, 19.5, 16 ],
                        "rotation": { "origin": [ 0, 3.5, 8 ], "axis": "z", "angle": -22.5 },
                        "shade": false,
                        "faces": {
                            "west": { "uv": [ 0, 0, 16, 16 ], "texture": "versiontransport:blocks/soul_torch" },
                            "east": { "uv": [ 0, 0, 16, 16 ], "texture": "versiontransport:blocks/soul_torch" }
                        }
                    },
                    {   "from": [ -8, 3.5, 7 ],
                        "to": [ 8, 19.5, 9 ],
                        "rotation": { "origin": [ 0, 3.5, 8 ], "axis": "z", "angle": -22.5 },
                        "shade": false,
                        "faces": {
                            "north": { "uv": [ 0, 0, 16, 16 ], "texture": "versiontransport:blocks/soul_torch" },
                            "south": { "uv": [ 0, 0, 16, 16 ], "texture": "versiontransport:blocks/soul_torch" }
                        }
                    }
                ]
            }                        //之后为当"facing"="east","north","west","up"时的"elements"        
        }
    }
}



2021.12 数据,可能有更多内容在制作版本迁移模组的灵魂火把时,IDEA读取soul_torch.json时发送了6次[Client thread/ERROR] [FML]: MultiModel minecraft:builtin/missing is empty (no base model or parts were provided/resolved)


报错,分别对应"variants"下"facing=up","facing=south","facing=west","facing=north","facing=east","inventory"6种情况。
在游戏中无论如何放置soul_torch都为紫黑块。facing参数正常。


BlockSoulTorch类直接继承原版BlockTorch类,代码如下。


package reddragon.versiontransport.block;

import net.minecraft.block.BlockTorch;
import reddragon.versiontransport.VT;

import static reddragon.versiontransport.item.CreativeTabRegister.VT_DECORATION;

public class BlockSoulTorch extends BlockTorch
{
    public BlockSoulTorch()
    {
  this.setCreativeTab(VT_DECORATION);
  this.setUnlocalizedName(VT.MODID+"soulTorch");
  this.setRegistryName("soul_torch");
  this.setLightLevel(13);
    }
}


注册过程与其它方块相同,并无差错。json中"elements"直接照搬原版火把的json文件。
soul_torch.json:
{
    "forge_marker": 1,
    "ambientocclusion": false,
    "textures": {
  "particle": "versiontransport:blocks/soul_torch"
    },
    "variants": {
  "inventory": [{}],
  "facing": {
   "south": {
    "elements": [
  {   "from": [ -1, 3.5, 7 ],
   "to": [ 1, 13.5, 9 ],
   "rotation": { "origin": [ 0, 3.5, 8 ], "axis": "z", "angle": -22.5 },
   "shade": false,
   "faces": {
    "down": { "uv": [ 7, 13, 9, 15 ], "texture": "versiontransport:blocks/soul_torch" },
    "up":   { "uv": [ 7,6, 9,8 ], "texture": "versiontransport:blocks/soul_torch" }
   }
  },
  {   "from": [ -1, 3.5, 0 ],
   "to": [ 1, 19.5, 16 ],
   "rotation": { "origin": [ 0, 3.5, 8 ], "axis": "z", "angle": -22.5 },
   "shade": false,
   "faces": {
    "west": { "uv": [ 0, 0, 16, 16 ], "texture": "versiontransport:blocks/soul_torch" },
    "east": { "uv": [ 0, 0, 16, 16 ], "texture": "versiontransport:blocks/soul_torch" }
   }
  },
  {   "from": [ -8, 3.5, 7 ],
   "to": [ 8, 19.5, 9 ],
   "rotation": { "origin": [ 0, 3.5, 8 ], "axis": "z", "angle": -22.5 },
   "shade": false,
   "faces": {
    "north": { "uv": [ 0, 0, 16, 16 ], "texture": "versiontransport:blocks/soul_torch" },
    "south": { "uv": [ 0, 0, 16, 16 ], "texture": "versiontransport:blocks/soul_torch" }
   }
  }
    ]
   }      //之后为当"facing"="east","north","west","up"时的"elements" 
  }
    }
}



GeForceLegend
首先请问你的 soul_torch.json 是 blockstates 文件夹下的,还是 models/blocks 文件夹下的?如果是 blockstates 文件夹下的话,方块状态json好像不是这样搞的吧?看这 variants 我估计是方块状态json,那我在假设你这个json是方块状态json的前提下再回答

以我个人的认知水平,方块状态json里面是不能直接写模型代码的(比如 ambientocclusion 和 elements 这些),比较标准的方块状态json应该类似这样。虽然说很多mod都直接在方块状态里面写材质,我个人更推荐在模型文件中写材质
  1. {
  2.     "forge_marker": 1,
  3.     "variants": {
  4.         "inventory": [{}],
  5.         "facing": {
  6.             "south": {
  7.                 "model": "versiontransport:blocks/soul_torch_south"
  8.             }
  9.         }
  10.     }
  11. }
复制代码
然后在 models/blocks 里面,创建模型文件 soul_torch_south.json 作为模型文件
  1. {
  2.     "textures": {
  3.         "torch": "versiontransport:blocks/soul_torch",
  4.         "particle": "versiontransport:blocks/soul_torch"
  5.     },
  6.     "elements": [
  7.         {   "from": [ -1, 3.5, 7 ],
  8.             "to": [ 1, 13.5, 9 ],
  9.             "rotation": { "origin": [ 0, 3.5, 8 ], "axis": "z", "angle": -22.5 },
  10.             "shade": false,
  11.             "faces": {
  12.                 "down": { "uv": [ 7, 13, 9, 15 ], "texture": "#torch" },
  13.                 "up":   { "uv": [ 7,  6, 9,  8 ], "texture": "#torch" }
  14.             }
  15.         },
  16.         {   "from": [ -1, 3.5, 0 ],
  17.             "to": [ 1, 19.5, 16 ],
  18.             "rotation": { "origin": [ 0, 3.5, 8 ], "axis": "z", "angle": -22.5 },
  19.             "shade": false,
  20.             "faces": {
  21.                 "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#torch" },
  22.                 "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#torch" }
  23.             }
  24.         },
  25.         {   "from": [ -8, 3.5, 7 ],
  26.             "to": [ 8, 19.5, 9 ],
  27.             "rotation": { "origin": [ 0, 3.5, 8 ], "axis": "z", "angle": -22.5 },
  28.             "shade": false,
  29.             "faces": {
  30.                 "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#torch" },
  31.                 "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#torch" }
  32.             }
  33.         }
  34.     ]
  35. }
复制代码






红.龙
GeForceLegend 发表于 2021-7-20 20:24
首先请问你的 soul_torch.json 是 blockstates 文件夹下的,还是 models/blocks 文件夹下的?如果是 blocks ...

多谢指点!问题终于解决了!

第一页 上一页 下一页 最后一页