我阅读了题为“ Minecraft Forge 1.8 - Loading Block Textures ”的问题,但该问题中给出的链接不再存在(错误 404)。所以,我很好奇,如何在 Minecraft Forge 1.8 中加载物品的纹理?
问问题
788 次
1 回答
3
1.8 的修改可能有点棘手,因为有时那里的信息太少。但不要放弃。
块和物品都有一个链接的 *.json 模型文件,其中包含 UV 和纹理信息(例如纹理位置)。除此之外,您只需要注册项目/块并调用您的:
GetMC.getRenderItem().getItemModelMesher().register(Item, int, modelResourceLocation);
// Important notes for Items
// If you are not comfortable modelling a new item,
// just copy the model information from another simple item, like the apple.
// texture location should be "{MOD_ID}:textures/items/itemname" (Items)
// texture location should be "{MOD_ID}:textures/blocks/blockname" (Blocks)
// If you would like to make your own models with little 3D experience, I
// recommend BDCraft Cubik Pro for the **items** and **blocks**
至于Entity,它们遵循稍微不同的格式。(AFAIK)您需要有一个渲染文件和一个模型文件(例如 RenderCar.java、ModelCar.java)。Render 类文件应包含渲染信息并扩展 Render 类。模型文件是实体的 3D 模型信息。
当然,这些信息对于项目、块和实体的渲染来说是特定的。它们仍然需要正确注册、建模和纹理化。
// Important note
// If you have want to try modeling your own entities, I would recommend
// looking into Techne for that, it creates the .java files with less work
上述示例:
// .json model file
{
"__comment": "this is just a tiny piece of the model ",
"textures": {
"particle": "mm:items/browning9mm",
"texture": "mm:items/browning9mm"
},
"elements": [
{
"__comment": "browning9mmshape x128",
"from": [ 0.875, 11, 7 ],
"to": [ 13.875, 13, 9 ],
"faces": {
"down": { "uv": [ 0.875, 5, 13.875, 4.5 ], "texture": "#texture" },
"up": { "uv": [ 0.875, 3, 13.875, 3.5 ], "texture": "#texture" },
"north": { "uv": [ 13.875, 3, 0.875, 5 ], "texture": "#texture" },
"south": { "uv": [ 0.875, 3, 13.875, 5 ], "texture": "#texture" },
"west": { "uv": [ 1.3125, 10.4375, 2.875, 13.625 ], "texture": "#texture" },
"east": { "uv": [ 3.8125, 7.0625, 5.5, 10.3125 ], "texture": "#texture"
}
}
}
于 2015-04-22T07:43:34.290 回答