Имею такой код:
RegistryEventHandler.java
ModBlocks.java
TestBlock.java
blockstates/test_block.json
models/block/test_block.json
models/item/test_block.json
Структура проекта:
Получаю ошибку:
[19:52:20] [main/ERROR] [FML.TEXTURE_ERRORS]: +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
[19:52:20] [main/ERROR] [FML.TEXTURE_ERRORS]: The following texture errors were found.
[19:52:20] [main/ERROR] [FML.TEXTURE_ERRORS]: ==================================================
[19:52:20] [main/ERROR] [FML.TEXTURE_ERRORS]: DOMAIN testmod
[19:52:20] [main/ERROR] [FML.TEXTURE_ERRORS]: --------------------------------------------------
[19:52:20] [main/ERROR] [FML.TEXTURE_ERRORS]: domain testmod is missing 1 texture
[19:52:20] [main/ERROR] [FML.TEXTURE_ERRORS]: domain testmod has 1 location:
[19:52:20] [main/ERROR] [FML.TEXTURE_ERRORS]: mod testmod resources at C:\Users\Hekumok\Downloads\TestMod\out\production\TestMod_main
[19:52:20] [main/ERROR] [FML.TEXTURE_ERRORS]: -------------------------
[19:52:20] [main/ERROR] [FML.TEXTURE_ERRORS]: The missing resources for domain testmod are:
[19:52:20] [main/ERROR] [FML.TEXTURE_ERRORS]: textures/blocks/test_block.png
[19:52:20] [main/ERROR] [FML.TEXTURE_ERRORS]: -------------------------
[19:52:20] [main/ERROR] [FML.TEXTURE_ERRORS]: No other errors exist for domain testmod
[19:52:20] [main/ERROR] [FML.TEXTURE_ERRORS]: ==================================================
[19:52:20] [main/ERROR] [FML.TEXTURE_ERRORS]: +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
Что не так?
RegistryEventHandler.java
Java:
package com.hekumok.testmod;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraftforge.client.event.ModelRegistryEvent;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
@Mod.EventBusSubscriber
public class RegistryEventHandler {
@SubscribeEvent
public static void registerBlocks(RegistryEvent.Register<Block> event) {
event.getRegistry().register(ModBlocks.TEST_BLOCK);
TestMod.logger.info("Registered blocks");
}
@SubscribeEvent
public static void registerItems(RegistryEvent.Register<Item> event) {
event.getRegistry().register(new ItemBlock(ModBlocks.TEST_BLOCK).setRegistryName(ModBlocks.TEST_BLOCK.getRegistryName()));
TestMod.logger.info("Registered items");
}
@SubscribeEvent
public static void registerModels(ModelRegistryEvent event) {
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(ModBlocks.TEST_BLOCK), 0,
new ModelResourceLocation(ModBlocks.TEST_BLOCK.getRegistryName(), "inventory"));
TestMod.logger.info("Registered models");
}
}
ModBlocks.java
Java:
package com.hekumok.testmod;
import net.minecraft.block.Block;
public class ModBlocks {
public static Block TEST_BLOCK = new TestBlock("test_block");
}
TestBlock.java
Java:
package com.hekumok.testmod;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
public class TestBlock extends Block {
public TestBlock(String name) {
super(Material.ROCK);
this.setRegistryName(name);
this.setUnlocalizedName(name);
this.setCreativeTab(CreativeTabs.REDSTONE);
}
}
blockstates/test_block.json
JSON:
{
"variants": {
"normal": {
"model": "testmod:test_block"
}
}
}
models/block/test_block.json
JSON:
{
"parent": "block/cube_all",
"textures": {
"all": "testmod:blocks/test_block"
}
}
models/item/test_block.json
JSON:
{
"parent": "testmod:block/test_block"
}
Структура проекта:
Получаю ошибку:
[19:52:20] [main/ERROR] [FML.TEXTURE_ERRORS]: +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
[19:52:20] [main/ERROR] [FML.TEXTURE_ERRORS]: The following texture errors were found.
[19:52:20] [main/ERROR] [FML.TEXTURE_ERRORS]: ==================================================
[19:52:20] [main/ERROR] [FML.TEXTURE_ERRORS]: DOMAIN testmod
[19:52:20] [main/ERROR] [FML.TEXTURE_ERRORS]: --------------------------------------------------
[19:52:20] [main/ERROR] [FML.TEXTURE_ERRORS]: domain testmod is missing 1 texture
[19:52:20] [main/ERROR] [FML.TEXTURE_ERRORS]: domain testmod has 1 location:
[19:52:20] [main/ERROR] [FML.TEXTURE_ERRORS]: mod testmod resources at C:\Users\Hekumok\Downloads\TestMod\out\production\TestMod_main
[19:52:20] [main/ERROR] [FML.TEXTURE_ERRORS]: -------------------------
[19:52:20] [main/ERROR] [FML.TEXTURE_ERRORS]: The missing resources for domain testmod are:
[19:52:20] [main/ERROR] [FML.TEXTURE_ERRORS]: textures/blocks/test_block.png
[19:52:20] [main/ERROR] [FML.TEXTURE_ERRORS]: -------------------------
[19:52:20] [main/ERROR] [FML.TEXTURE_ERRORS]: No other errors exist for domain testmod
[19:52:20] [main/ERROR] [FML.TEXTURE_ERRORS]: ==================================================
[19:52:20] [main/ERROR] [FML.TEXTURE_ERRORS]: +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
Что не так?