- 30
- 2
- 5
Здравствуйте. Надеюсь, поможете мне с проблемой рендера модели. Сама модель рендерится, но вот карты текстур/бликов/нормалей не накладываются, а сам mtl файл, похоже, что скипается. Все пути и названия файлов вроде названы правильно. Делаю всё через json файл в blockstates. Как исправить?
Консоль выдаёт следующее.
Код
Консоль выдаёт следующее.
Код
Java:
public class LongSword extends ItemSword {
public LongSword(String name, ToolMaterial material) {
super(material);
setRegistryName(name);
setUnlocalizedName(name);
setCreativeTab(Main.LevWeapon);
}
}
Java:
public class ItemsRegister {
public static ToolMaterial LongSwordMaterial = EnumHelper.addToolMaterial("LongSwordMaterial", 2, 256, 50.0F, 2.0F, 12);
public static ItemSword long_sword = new LongSword("long_sword", LongSwordMaterial);
public static void register() {
setRegister(long_sword);
}
@SideOnly(Side.CLIENT)
public static void registerRender() {
setRender(long_sword);
}
private static void setRegister(Item item) {
ForgeRegistries.ITEMS.register(item);
}
@SideOnly(Side.CLIENT)
private static void setRender(Item item) {
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory"));
}
}
Java:
public class ClientProxy extends CommonProxy {
public void registerModel(Item item) {
ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory"));
}
@Override
public void preInit(FMLPreInitializationEvent event) {
OBJLoader.INSTANCE.addDomain(Main.MODID);
registerModel(ItemsRegister.long_sword);
super.preInit(event);
}
@Override
public void init(FMLInitializationEvent event) {
ItemsRegister.registerRender();
KeyHandler.register();
super.init(event);
}
@Override
public void postInit(FMLPostInitializationEvent event) {
super.postInit(event);
}
}
JSON:
{
"forge_marker": 1,
"defaults": {
"model": "leviathan:long_sword.obj"
},
"variants": {
"inventory": [
{
"transform": {
"thirdperson_lefthand": {
"rotation": [ { "x": -90 }, { "y": 0 }, { "z": 0 } ],
"translation": [ 0, -0.1, 0.1 ],
"scale": 1.00
},
"thirdperson_righthand": {
"rotation": [ { "x": -90 }, { "y": 0 }, { "z": 0 } ],
"translation": [ 0, -0.1, 0.1 ],
"scale": 1.00
},
"gui": {
"rotation": [ { "x": -90 }, { "y": 0 }, { "z": -0 } ],
"translation": [ -0.2, -0.2, 0 ],
"scale": 1.00
},
"firstperson_righthand": {
"rotation": [ { "x": -90 }, { "y": 0 }, { "z": 0 } ],
"translation": [ 0, -0.1, 0 ],
"scale": 1.00
},
"firstperson_lefthand": {
"rotation": [ { "x": -90 }, { "y": 0 }, { "z": 0 } ],
"translation": [ 0, -0.1, 0 ],
"scale": 1.00
},
"ground": {
"rotation": [ { "x": -90 }, { "y": 0 }, { "z": 0 } ],
"scale": 1.00
}
}
}
]
}
}
Код:
newmtl Garda
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 1
map_Bump leviathan:textures/items/models/nmap_long_sword
map_Ka leviathan:textures/items/models/aomap_long_sword
map_Kd leviathan:textures/items/models/cycmap_long_sword
newmtl Leswie
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 1
map_Bump leviathan:textures/items/models/nmap_long_sword
map_Ka leviathan:textures/items/models/aomap_long_sword
map_Kd leviathan:textures/items/models/cycmap_long_sword
newmtl Ruka
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
Последнее редактирование: