【解決済】[1.10.2]metadataを持つブロックが、設置されている時正しく表示されない

Modding・サーバPlugin制作・ツール制作など、開発関連の質問があればこちらにお願い致します。
フォーラムルール
質問関連フォーラムで質問する時は、必ず次のトピックを一読/厳守お願い致します。
viewtopic.php?f=5&t=999
  • (PostNo.307444)

【解決済】[1.10.2]metadataを持つブロックが、設置されている時正しく表示されない

投稿記事by remiliaMarine » 2017年9月07日(木) 18:42

こんにちは、MissingVariantExceptionが出てしまい、metadataを持つブロックのアイテム(インベントリ内、ドロップ状態)は正しく描画されるのに、設置されたブロックはピンクと黒のテクスチャになってしまいます。こちらのトピックhttp://forum.minecraftuser.jp/viewtopic.php?f=39&t=34837を参考にひとつづつメソッドなどを比較していったのですが、上手く行きませんでした。

出来ていること、分かっていることは、
1.インベントリ内のアイテムブロックは正しくテクスチャが表示される。
inventory.png

2.設置したブロックのvariantは、F3で確認すると、設置したアイテムとmetadataの対応したものになっている。
block.png
block.png (32.7 KiB) 表示数: 363 回

3.破壊したときにドロップするアイテムは、metadataに対応したものになっている。
itementity.png
itementity.png (25.37 KiB) 表示数: 363 回

アイテムは正しく表示されることから、モデルは大丈夫で、
恐らくブロックの登録かコンストラクタ、ブロックステーツに問題があるのだと思います。

ソースコード
@Modアノテーションのあるクラス(関係するところのみ)
コード: 全て選択
public class GuerrillaCityCore
{
    public static Block blockSandBag;
    public static Block blockSandBagSlab;
    public static Block BlockSandBagDoubleSlab;
   
    public static DimensionType GUERRILLA_CITY_DIMENSION;
   
    @EventHandler
    public void preInit(FMLPreInitializationEvent event){
       
        blockSandBag = new BlockSandBag();
        ItemBlock itemBlockSandBag = new ItemBlockSandBag(blockSandBag);
        ResourceLocation blockSandBagResource = new ResourceLocation(MODID, "blocksandbag");
        GameRegistry.register(blockSandBag, blockSandBagResource);
        GameRegistry.register(itemBlockSandBag, blockSandBagResource);
           
        if (event.getSide().isClient()) {
            OBJLoader.INSTANCE.addDomain(MODID);
           
            ModelBakery.registerItemVariants(Item.getItemFromBlock(blockSandBag),
                    new ModelResourceLocation("guerrillacity:blocksandbag_white", "inventory"),
                    new ModelResourceLocation("guerrillacity:blocksandbag_green", "inventory"),
                    new ModelResourceLocation("guerrillacity:blocksandbag_gray", "inventory"));
            ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(blockSandBag), 0, new ModelResourceLocation("guerrillacity:blocksandbag_white", "inventory"));
            ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(blockSandBag), 1, new ModelResourceLocation("guerrillacity:blocksandbag_green", "inventory"));
            ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(blockSandBag), 2, new ModelResourceLocation("guerrillacity:blocksandbag_gray", "inventory"));
        }
    }
    @EventHandler
    public void init(FMLInitializationEvent event)
    {
    }
}

ブロックのクラス(BlockDirtとほぼ同じです)
コード: 全て選択
public class BlockSandBag extends Block {
   
    public static final PropertyEnum<BlockSandBag.EnumType> VARIANT = PropertyEnum.<BlockSandBag.EnumType>create("variant", BlockSandBag.EnumType.class);

    public BlockSandBag()
    {
        super(Material.GROUND);
        this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT, BlockSandBag.EnumType.WHITE));
        this.setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
        this.setHardness(0.25F);
        this.setResistance(15.0F);
        this.setUnlocalizedName("FieldSandBag");
    }
    /**
     * Gets the metadata of the item this Block can drop. This method is called when the block gets destroyed. It
     * returns the metadata of the dropped item based on the old metadata of the block.
     */
    public int damageDropped(IBlockState state)
    {
        return ((BlockSandBag.EnumType)state.getValue(VARIANT)).getMetadata();
    }
    /**
     * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
     */
    @SideOnly(Side.CLIENT)
    public void getSubBlocks(Item itemIn, CreativeTabs tab, List<ItemStack> list)
    {
        list.add(new ItemStack(this, 1, BlockSandBag.EnumType.WHITE.getMetadata()));
        list.add(new ItemStack(this, 1, BlockSandBag.EnumType.GREEN.getMetadata()));
        list.add(new ItemStack(this, 1, BlockSandBag.EnumType.GRAY.getMetadata()));
    }
    public ItemStack getItem(World worldIn, BlockPos pos, IBlockState state)
    {
        return new ItemStack(this, 1, ((BlockSandBag.EnumType)state.getValue(VARIANT)).getMetadata());
    }
    /**
     * Convert the given metadata into a BlockState for this Block
     */
    public IBlockState getStateFromMeta(int meta)
    {
        return this.getDefaultState().withProperty(VARIANT, BlockSandBag.EnumType.byMetadata(meta));
    }
    /**
     * Convert the BlockState into the correct metadata value
     */
    public int getMetaFromState(IBlockState state)
    {
        return ((BlockSandBag.EnumType)state.getValue(VARIANT)).getMetadata();
    }

    protected BlockStateContainer createBlockState()
    {
        return new BlockStateContainer(this, new IProperty[] {VARIANT});
    }
    public String getSpecialName(ItemStack stack) {
        return BlockSandBag.EnumType.byMetadata(stack.getItemDamage()).getName();
     }

    public static enum EnumType implements IStringSerializable {
        WHITE(0, "sandbag_white"),
        GREEN(1, "sandbag_green"),
        GRAY(2, "sandbag_gray");

        private static final BlockSandBag.EnumType[] META_LOOKUP = new BlockSandBag.EnumType[values().length];
        private final int meta;
        private final String name;
        private final String unlocalizedName;
       
        private EnumType(int metaIn, String nameIn)
        {
            this(metaIn, nameIn, nameIn);
        }

        private EnumType(int metaIn, String nameIn, String unlocalizedNameIn)
        {
            this.meta = metaIn;
            this.name = nameIn;
            this.unlocalizedName = unlocalizedNameIn;
        }
        public int getMetadata()
        {
            return this.meta;
        }
       
        public String toString()
        {
            return this.name;
        }
        public static BlockSandBag.EnumType byMetadata(int meta)
        {
            if (meta < 0 || meta >= META_LOOKUP.length)
            {
                meta = 0;
            }
            return META_LOOKUP[meta];
        }
       
        @Override   
        public String getName() {
            return this.name;
        }
        public String getUnlocalizedName()
        {
            return this.unlocalizedName;
        }
       
        static
        {
            for (BlockSandBag.EnumType blocksandbag$enumtype : values())
            {
                META_LOOKUP[blocksandbag$enumtype.getMetadata()] = blocksandbag$enumtype;
            }
        }
    }
}

itemBlockのクラス
コード: 全て選択
public class ItemBlockSandBag extends ItemBlock {

    public ItemBlockSandBag(Block block) {
        super(block);
        this.setHasSubtypes(true);
    }
    @Override
    public int getMetadata(int damage) {
        return damage;
    }
    @Override
    public String getUnlocalizedName(ItemStack stack) {
       return ((BlockSandBag)this.block).getSpecialName(stack);
    }
}

assets.guerrillacity.blockstates.blocksandbag.json全角スペースはありません。
コード: 全て選択
{
   "variants": {
       "meta=0": { "model": "guerrillacity:block/blocksandbag_white" },
       "meta=1": { "model": "guerrillacity:block/blocksandbag_green" },
       "meta=2": { "model": "guerrillacity:block/blocksandbag_gray" }
   }
}

コンソール出力です。GVC本体に関する内容も多いです。
文字制限にかかったのと、最後にはワールドに入るとき関係のない原因(解決済み)で落ちているので、カットしています。
コード: 全て選択
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_144]
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_144]
   at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
   at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_144]
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_144]
   at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
   at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: java.lang.RuntimeException: Encountered an exception when loading model definition of model hmggvc:blockstates/b_camp_so2.json

ゲリラモッド本体に関する内容なのでカットします。

   at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: java.lang.RuntimeException: Encountered an exception when loading model definition of 'hmggvc:b_x128' from: 'hmggvc:blockstates/b_x128.json' in resourcepack: 'FMLFileResourcePack:examplemod'
   at net.minecraft.client.renderer.block.model.ModelBakery.loadModelBlockDefinition(ModelBakery.java:223) ~[ModelBakery.class:?]
   at net.minecraft.client.renderer.block.model.ModelBakery.loadMultipartMBD(ModelBakery.java:200) ~[ModelBakery.class:?]
   at net.minecraft.client.renderer.block.model.ModelBakery.getModelBlockDefinition(ModelBakery.java:185) ~[ModelBakery.class:?]
   at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:270) ~[ModelLoader.class:?]
   ... 20 more
Caused by: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1
   at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:176) ~[ReflectiveTypeAdapterFactory$Adapter.class:?]
   at com.google.gson.Gson.fromJson(Gson.java:803) ~[Gson.class:?]
   at com.google.gson.Gson.fromJson(Gson.java:768) ~[Gson.class:?]
   at com.google.gson.Gson.fromJson(Gson.java:717) ~[Gson.class:?]
   at com.google.gson.Gson.fromJson(Gson.java:689) ~[Gson.class:?]
   at net.minecraftforge.client.model.BlockStateLoader.load(BlockStateLoader.java:76) ~[BlockStateLoader.class:?]
   at net.minecraft.client.renderer.block.model.ModelBlockDefinition.parseFromReader(ModelBlockDefinition.java:37) ~[ModelBlockDefinition.class:?]
   at net.minecraft.client.renderer.block.model.ModelBakery.loadModelBlockDefinition(ModelBakery.java:219) ~[ModelBakery.class:?]
   at net.minecraft.client.renderer.block.model.ModelBakery.loadMultipartMBD(ModelBakery.java:200) ~[ModelBakery.class:?]
   at net.minecraft.client.renderer.block.model.ModelBakery.getModelBlockDefinition(ModelBakery.java:185) ~[ModelBakery.class:?]
   at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:270) ~[ModelLoader.class:?]
   ... 20 more
Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1
   at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:374) ~[JsonReader.class:?]
   at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:165) ~[ReflectiveTypeAdapterFactory$Adapter.class:?]
   at com.google.gson.Gson.fromJson(Gson.java:803) ~[Gson.class:?]
   at com.google.gson.Gson.fromJson(Gson.java:768) ~[Gson.class:?]
   at com.google.gson.Gson.fromJson(Gson.java:717) ~[Gson.class:?]
   at com.google.gson.Gson.fromJson(Gson.java:689) ~[Gson.class:?]
   at net.minecraftforge.client.model.BlockStateLoader.load(BlockStateLoader.java:76) ~[BlockStateLoader.class:?]
   at net.minecraft.client.renderer.block.model.ModelBlockDefinition.parseFromReader(ModelBlockDefinition.java:37) ~[ModelBlockDefinition.class:?]
   at net.minecraft.client.renderer.block.model.ModelBakery.loadModelBlockDefinition(ModelBakery.java:219) ~[ModelBakery.class:?]
   at net.minecraft.client.renderer.block.model.ModelBakery.loadMultipartMBD(ModelBakery.java:200) ~[ModelBakery.class:?]
   at net.minecraft.client.renderer.block.model.ModelBakery.getModelBlockDefinition(ModelBakery.java:185) ~[ModelBakery.class:?]
   at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:270) ~[ModelLoader.class:?]
   ... 20 more
[15:42:54] [Client thread/ERROR] [FML]: Exception loading model for variant guerrillacity:blocksandbag#variant=white_sandbag for blockstate "guerrillacity:blocksandbag[variant=white_sandbag]"
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model guerrillacity:blocksandbag#variant=white_sandbag with loader VariantLoader.INSTANCE, skipping
   at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]
   at net.minecraftforge.client.model.ModelLoader.registerVariant(ModelLoader.java:241) ~[ModelLoader.class:?]
   at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:145) ~[ModelBakery.class:?]
   at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:229) ~[ModelLoader.class:?]
   at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:146) ~[ModelLoader.class:?]
   at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
   at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:122) [SimpleReloadableResourceManager.class:?]
   at net.minecraft.client.Minecraft.startGame(Minecraft.java:540) [Minecraft.class:?]
   at net.minecraft.client.Minecraft.run(Minecraft.java:386) [Minecraft.class:?]
   at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_144]
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_144]
   at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
   at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_144]
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_144]
   at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
   at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException
   at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:78) ~[ModelBlockDefinition.class:?]
   at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1184) ~[ModelLoader$VariantLoader.class:?]
   at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]
   ... 21 more
[15:42:54] [Client thread/ERROR] [FML]: Exception loading model for variant guerrillacity:blocksandbag#variant=green_sandbag for blockstate "guerrillacity:blocksandbag[variant=green_sandbag]"
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model guerrillacity:blocksandbag#variant=green_sandbag with loader VariantLoader.INSTANCE, skipping
   at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]
   at net.minecraftforge.client.model.ModelLoader.registerVariant(ModelLoader.java:241) ~[ModelLoader.class:?]
   at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:145) ~[ModelBakery.class:?]
   at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:229) ~[ModelLoader.class:?]
   at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:146) ~[ModelLoader.class:?]
   at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
   at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:122) [SimpleReloadableResourceManager.class:?]
   at net.minecraft.client.Minecraft.startGame(Minecraft.java:540) [Minecraft.class:?]
   at net.minecraft.client.Minecraft.run(Minecraft.java:386) [Minecraft.class:?]
   at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_144]
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_144]
   at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
   at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_144]
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_144]
   at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
   at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException
   at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:78) ~[ModelBlockDefinition.class:?]
   at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1184) ~[ModelLoader$VariantLoader.class:?]
   at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]
   ... 21 more
[15:42:54] [Client thread/ERROR] [FML]: Suppressed additional 0 model loading errors for domain hmggvc
[15:42:55] [Client thread/INFO] [STDOUT]: [com.example.examplemod.ExampleMod:init:18]: DIRT BLOCK >> tile.dirt
[15:42:58] [Client thread/INFO] [FML]: Injecting itemstacks
[15:42:58] [Client thread/INFO] [FML]: Itemstack injection complete
[15:42:58] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 7 mods
[15:42:58] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:examplemod, FMLFileResourcePack:GVCLib, FMLFileResourcePack:HMGGVC, FMLFileResourcePack:GuerrillaCity
[15:43:09] [Client thread/INFO]: SoundSystem shutting down...
[15:43:10] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com
[15:43:10] [Sound Library Loader/INFO]: Starting up SoundSystem...
[15:43:10] [Thread-10/INFO]: Initializing LWJGL OpenAL
[15:43:10] [Thread-10/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
[15:43:10] [Thread-10/INFO]: OpenAL initialized.
[15:43:10] [Sound Library Loader/INFO]: Sound engine started
[15:43:28] [Client thread/INFO] [FML]: Max texture size: 16384
[15:43:29] [Client thread/INFO]: Created: 1024x512 textures-atlas
[15:43:30] [Client thread/ERROR] [FML]: Exception loading model for variant guerrillacity:blocksandbag#variant=gray_sandbag for blockstate "guerrillacity:blocksandbag[variant=gray_sandbag]"
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model guerrillacity:blocksandbag#variant=gray_sandbag with loader VariantLoader.INSTANCE, skipping
   at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]
   at net.minecraftforge.client.model.ModelLoader.registerVariant(ModelLoader.java:241) ~[ModelLoader.class:?]
   at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:145) ~[ModelBakery.class:?]
   at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:229) ~[ModelLoader.class:?]
   at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:146) ~[ModelLoader.class:?]
   at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
   at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SimpleReloadableResourceManager.java:132) [SimpleReloadableResourceManager.class:?]
   at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:113) [SimpleReloadableResourceManager.class:?]
   at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:799) [Minecraft.class:?]
   at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:340) [FMLClientHandler.class:?]
   at net.minecraft.client.Minecraft.startGame(Minecraft.java:561) [Minecraft.class:?]
   at net.minecraft.client.Minecraft.run(Minecraft.java:386) [Minecraft.class:?]
   at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_144]
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_144]
   at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
   at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_144]
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_144]
   at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
   at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException
   at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:78) ~[ModelBlockDefinition.class:?]
   at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1184) ~[ModelLoader$VariantLoader.class:?]
   at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]
   ... 24 more
[15:43:30] [Client thread/ERROR] [FML]: Exception loading model for variant hmggvc:b_camp_g1#normal for blockstate "hmggvc:b_camp_g1"
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model hmggvc:b_camp_g1#normal with loader VariantLoader.INSTANCE, skipping
   at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]
   at net.minecraftforge.client.model.ModelLoader.registerVariant(ModelLoader.java:241) ~[ModelLoader.class:?]
   at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:145) ~[ModelBakery.class:?]
   at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:229) ~[ModelLoader.class:?]
   at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:146) ~[ModelLoader.class:?]



[SimpleReloadableResourceManager.class:?]
   at net.minecraft.client.renderer.block.model.ModelBakery.loadMultipartMBD(ModelBakery.java:198) ~[ModelBakery.class:?]
   at net.minecraft.client.renderer.block.model.ModelBakery.getModelBlockDefinition(ModelBakery.java:185) ~[ModelBakery.class:?]
   at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:270) ~[ModelLoader.class:?]
   ... 23 more
[15:43:30] [Client thread/ERROR] [FML]: Exception loading model for variant hmggvc:b_camp_so2#normal for blockstate "hmggvc:b_camp_so2"
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model hmggvc:b_camp_so2#normal with loader VariantLoader.INSTANCE, skipping
   at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]
   at net.minecraftforge.client.model.ModelLoader.registerVariant(ModelLoader.java:241) ~[ModelLoader.class:?]
   at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:145) ~[ModelBakery.class:?]
   at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:229) ~[ModelLoader.class:?]
   at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:146) ~[ModelLoader.class:?]
   at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
   at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SimpleReloadableResourceManager.java:132) [SimpleReloadableResourceManager.class:?]
   at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:113) [SimpleReloadableResourceManager.class:?]
   at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:799) [Minecraft.class:?]
   at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:340) [FMLClientHandler.class:?]
   at net.minecraft.client.Minecraft.startGame(Minecraft.java:561) [Minecraft.class:?]
   at net.minecraft.client.Minecraft.run(Minecraft.java:386) [Minecraft.class:?]
   at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_144]
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_144]
   at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
   at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_144]
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_144]
   at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
   at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException
   at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:78) ~[ModelBlockDefinition.class:?]
   at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1184) ~[ModelLoader$VariantLoader.class:?]
   at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]
   ... 24 more
[15:43:30] [Client thread/ERROR] [FML]: Exception loading blockstate for the variant hmggvc:b_camp_so2#normal:
java.lang.Exception: Could not load model definition for variant hmggvc:b_camp_so2
   at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:274) ~[ModelLoader.class:?]
   at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:121) ~[ModelBakery.class:?]
   at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:229) ~[ModelLoader.class:?]
   at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:146) ~[ModelLoader.class:?]
   at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
   at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SimpleReloadableResourceManager.java:132) [SimpleReloadableResourceManager.class:?]
   at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:113) [SimpleReloadableResourceManager.class:?]
   at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:799) [Minecraft.class:?]
   at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:340) [FMLClientHandler.class:?]
   at net.minecraft.client.Minecraft.startGame(Minecraft.java:561) [Minecraft.class:?]
   at net.minecraft.client.Minecraft.run(Minecraft.java:386) [Minecraft.class:?]
   at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_144]
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_144]
   at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
   at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_144]
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_144]
   at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
   at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: java.lang.RuntimeException: Encountered an exception when loading model definition of model hmggvc:blockstates/b_camp_so2.json
   at net.minecraft.client.renderer.block.model.ModelBakery.loadMultipartMBD(ModelBakery.java:205) ~[ModelBakery.class:?]
   at net.minecraft.client.renderer.block.model.ModelBakery.getModelBlockDefinition(ModelBakery.java:185) ~[ModelBakery.class:?]
   at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:270) ~[ModelLoader.class:?]
   ... 23 more
Caused by: java.io.FileNotFoundException: hmggvc:blockstates/b_camp_so2.json
   at net.minecraft.client.resources.FallbackResourceManager.getAllResources(FallbackResourceManager.java:103) ~[FallbackResourceManager.class:?]
   at net.minecraft.client.resources.SimpleReloadableResourceManager.getAllResources(SimpleReloadableResourceManager.java:79) ~[SimpleReloadableResourceManager.class:?]
   at net.minecraft.client.renderer.block.model.ModelBakery.loadMultipartMBD(ModelBakery.java:198) ~[ModelBakery.class:?]
   at net.minecraft.client.renderer.block.model.ModelBakery.getModelBlockDefinition(ModelBakery.java:185) ~[ModelBakery.class:?]
   at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:270) ~[ModelLoader.class:?]
   ... 23 more
[15:43:30] [Client thread/ERROR] [FML]: Exception loading model for variant hmggvc:b_base_g#normal for blockstate "hmggvc:b_base_g"
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model hmggvc:b_base_g#normal with loader VariantLoader.INSTANCE, skipping
   at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]
   at net.minecraftforge.client.model.ModelLoader.registerVariant(ModelLoader.java:241) ~[ModelLoader.class:?]
   at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:145) ~[ModelBakery.class:?]
   at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:229) ~[ModelLoader.class:?]
   at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:146) ~[ModelLoader.class:?]
   at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
   at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SimpleReloadableResourceManager.java:132) [SimpleReloadableResourceManager.class:?]
   at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:113) [SimpleReloadableResourceManager.class:?]
   at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:799) [Minecraft.class:?]
   at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:340) [FMLClientHandler.class:?]
   at net.minecraft.client.Minecraft.startGame(Minecraft.java:561) [Minecraft.class:?]
   at net.minecraft.client.Minecraft.run(Minecraft.java:386) [Minecraft.class:?]
   at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_144]
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_144]
   at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
   at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_144]
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_144]
   at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
   at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException
   at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:78) ~[ModelBlockDefinition.class:?]
   at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1184) ~[ModelLoader$VariantLoader.class:?]
   at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]
   ... 24 more
[15:43:30] [Client thread/ERROR] [FML]: Exception loading blockstate for the variant hmggvc:b_base_g#normal:
java.lang.Exception: Could not load model definition for variant hmggvc:b_base_g
   at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:274) ~[ModelLoader.class:?]
   at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:121) ~[ModelBakery.class:?]
   at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:229) ~[ModelLoader.class:?]
   at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:146) ~[ModelLoader.class:?]
   at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
   at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SimpleReloadableResourceManager.java:132) [SimpleReloadableResourceManager.class:?]
   at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:113) [SimpleReloadableResourceManager.class:?]
   at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:799) [Minecraft.class:?]
   at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:340) [FMLClientHandler.class:?]
   at net.minecraft.client.Minecraft.startGame(Minecraft.java:561) [Minecraft.class:?]
   at net.minecraft.client.Minecraft.run(Minecraft.java:386) [Minecraft.class:?]
   at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_144]
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_144]
   at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
   at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_144]
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_144]
   at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
   at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: java.lang.RuntimeException: Encountered an exception when loading model definition of model hmggvc:blockstates/b_base_g.json
   at net.minecraft.client.renderer.block.model.ModelBakery.loadMultipartMBD(ModelBakery.java:205) ~[ModelBakery.class:?]
   at net.minecraft.client.renderer.block.model.ModelBakery.getModelBlockDefinition(ModelBakery.java:185) ~[ModelBakery.class:?]
   at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:270) ~[ModelLoader.class:?]
   ... 23 more
Caused by: java.io.FileNotFoundException: hmggvc:blockstates/b_base_g.json
   at net.minecraft.client.resources.FallbackResourceManager.getAllResources(FallbackResourceManager.java:103) ~[FallbackResourceManager.class:?]
   at net.minecraft.client.resources.SimpleReloadableResourceManager.getAllResources(SimpleReloadableResourceManager.java:79) ~[SimpleReloadableResourceManager.class:?]
   at net.minecraft.client.renderer.block.model.ModelBakery.loadMultipartMBD(ModelBakery.java:198) ~[ModelBakery.class:?]
   at net.minecraft.client.renderer.block.model.ModelBakery.getModelBlockDefinition(ModelBakery.java:185) ~[ModelBakery.class:?]
   at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:270) ~[ModelLoader.class:?]
   ... 23 more
[15:43:30] [Client thread/ERROR] [FML]: Exception loading model for variant hmggvc:b_x128#normal for blockstate "hmggvc:b_x128"
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model hmggvc:b_x128#normal with loader VariantLoader.INSTANCE, skipping
   at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]
   at net.minecraftforge.client.model.ModelLoader.registerVariant(ModelLoader.java:241) ~[ModelLoader.class:?]
   at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:145) ~[ModelBakery.class:?]
   at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:229) ~[ModelLoader.class:?]
   at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:146) ~[ModelLoader.class:?]
   at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
   at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SimpleReloadableResourceManager.java:132) [SimpleReloadableResourceManager.class:?]
   at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:113) [SimpleReloadableResourceManager.class:?]
   at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:799) [Minecraft.class:?]
   at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:340) [FMLClientHandler.class:?]
   at net.minecraft.client.Minecraft.startGame(Minecraft.java:561) [Minecraft.class:?]
   at net.minecraft.client.Minecraft.run(Minecraft.java:386) [Minecraft.class:?]
   at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_144]
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_144]
   at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
   at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_144]
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_144]
   at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
   at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException
   at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:78) ~[ModelBlockDefinition.class:?]
   at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1184) ~[ModelLoader$VariantLoader.class:?]
   at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]
   ... 24 more
[15:43:30] [Client thread/ERROR] [FML]: Exception loading blockstate for the variant hmggvc:b_x128#normal:
java.lang.Exception: Could not load model definition for variant hmggvc:b_x128
   at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:274) ~[ModelLoader.class:?]
   at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:121) ~[ModelBakery.class:?]
   at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:229) ~[ModelLoader.class:?]
   at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:146) ~[ModelLoader.class:?]
   at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
   at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SimpleReloadableResourceManager.java:132) [SimpleReloadableResourceManager.class:?]
   at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:113) [SimpleReloadableResourceManager.class:?]
   at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:799) [Minecraft.class:?]
   at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:340) [FMLClientHandler.class:?]
   at net.minecraft.client.Minecraft.startGame(Minecraft.java:561) [Minecraft.class:?]
   at net.minecraft.client.Minecraft.run(Minecraft.java:386) [Minecraft.class:?]
   at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_144]
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_144]
   at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
   at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_144]
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_144]
   at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
   at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: java.lang.RuntimeException: Encountered an exception when loading model definition of 'hmggvc:b_x128' from: 'hmggvc:blockstates/b_x128.json' in resourcepack: 'FMLFileResourcePack:examplemod'
   at net.minecraft.client.renderer.block.model.ModelBakery.loadModelBlockDefinition(ModelBakery.java:223) ~[ModelBakery.class:?]
   at net.minecraft.client.renderer.block.model.ModelBakery.loadMultipartMBD(ModelBakery.java:200) ~[ModelBakery.class:?]
   at net.minecraft.client.renderer.block.model.ModelBakery.getModelBlockDefinition(ModelBakery.java:185) ~[ModelBakery.class:?]
   at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:270) ~[ModelLoader.class:?]
   ... 23 more
Caused by: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1
   at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:176) ~[ReflectiveTypeAdapterFactory$Adapter.class:?]
   at com.google.gson.Gson.fromJson(Gson.java:803) ~[Gson.class:?]
   at com.google.gson.Gson.fromJson(Gson.java:768) ~[Gson.class:?]
   at com.google.gson.Gson.fromJson(Gson.java:717) ~[Gson.class:?]
   at com.google.gson.Gson.fromJson(Gson.java:689) ~[Gson.class:?]
   at net.minecraftforge.client.model.BlockStateLoader.load(BlockStateLoader.java:76) ~[BlockStateLoader.class:?]
   at net.minecraft.client.renderer.block.model.ModelBlockDefinition.parseFromReader(ModelBlockDefinition.java:37) ~[ModelBlockDefinition.class:?]
   at net.minecraft.client.renderer.block.model.ModelBakery.loadModelBlockDefinition(ModelBakery.java:219) ~[ModelBakery.class:?]
   at net.minecraft.client.renderer.block.model.ModelBakery.loadMultipartMBD(ModelBakery.java:200) ~[ModelBakery.class:?]
   at net.minecraft.client.renderer.block.model.ModelBakery.getModelBlockDefinition(ModelBakery.java:185) ~[ModelBakery.class:?]
   at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:270) ~[ModelLoader.class:?]
   ... 23 more
Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1
   at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:374) ~[JsonReader.class:?]
   at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:165) ~[ReflectiveTypeAdapterFactory$Adapter.class:?]
   at com.google.gson.Gson.fromJson(Gson.java:803) ~[Gson.class:?]
   at com.google.gson.Gson.fromJson(Gson.java:768) ~[Gson.class:?]
   at com.google.gson.Gson.fromJson(Gson.java:717) ~[Gson.class:?]
   at com.google.gson.Gson.fromJson(Gson.java:689) ~[Gson.class:?]
   at net.minecraftforge.client.model.BlockStateLoader.load(BlockStateLoader.java:76) ~[BlockStateLoader.class:?]
   at net.minecraft.client.renderer.block.model.ModelBlockDefinition.parseFromReader(ModelBlockDefinition.java:37) ~[ModelBlockDefinition.class:?]
   at net.minecraft.client.renderer.block.model.ModelBakery.loadModelBlockDefinition(ModelBakery.java:219) ~[ModelBakery.class:?]
   at net.minecraft.client.renderer.block.model.ModelBakery.loadMultipartMBD(ModelBakery.java:200) ~[ModelBakery.class:?]
   at net.minecraft.client.renderer.block.model.ModelBakery.getModelBlockDefinition(ModelBakery.java:185) ~[ModelBakery.class:?]
   at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:270) ~[ModelLoader.class:?]
   ... 23 more
[15:43:30] [Client thread/ERROR] [FML]: Exception loading model for variant guerrillacity:blocksandbag#variant=white_sandbag for blockstate "guerrillacity:blocksandbag[variant=white_sandbag]"
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model guerrillacity:blocksandbag#variant=white_sandbag with loader VariantLoader.INSTANCE, skipping
   at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]
   at net.minecraftforge.client.model.ModelLoader.registerVariant(ModelLoader.java:241) ~[ModelLoader.class:?]
   at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:145) ~[ModelBakery.class:?]
   at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:229) ~[ModelLoader.class:?]
   at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:146) ~[ModelLoader.class:?]
   at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
   at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SimpleReloadableResourceManager.java:132) [SimpleReloadableResourceManager.class:?]
   at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:113) [SimpleReloadableResourceManager.class:?]
   at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:799) [Minecraft.class:?]
   at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:340) [FMLClientHandler.class:?]
   at net.minecraft.client.Minecraft.startGame(Minecraft.java:561) [Minecraft.class:?]
   at net.minecraft.client.Minecraft.run(Minecraft.java:386) [Minecraft.class:?]
   at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_144]
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_144]
   at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
   at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_144]
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_144]
   at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
   at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException
   at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:78) ~[ModelBlockDefinition.class:?]
   at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1184) ~[ModelLoader$VariantLoader.class:?]
   at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]
   ... 24 more
[15:43:30] [Client thread/ERROR] [FML]: Exception loading model for variant guerrillacity:blocksandbag#variant=green_sandbag for blockstate "guerrillacity:blocksandbag[variant=green_sandbag]"
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model guerrillacity:blocksandbag#variant=green_sandbag with loader VariantLoader.INSTANCE, skipping
   at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]
   at net.minecraftforge.client.model.ModelLoader.registerVariant(ModelLoader.java:241) ~[ModelLoader.class:?]
   at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:145) ~[ModelBakery.class:?]
   at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:229) ~[ModelLoader.class:?]
   at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:146) ~[ModelLoader.class:?]
   at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
   at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SimpleReloadableResourceManager.java:132) [SimpleReloadableResourceManager.class:?]
   at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:113) [SimpleReloadableResourceManager.class:?]
   at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:799) [Minecraft.class:?]
   at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:340) [FMLClientHandler.class:?]
   at net.minecraft.client.Minecraft.startGame(Minecraft.java:561) [Minecraft.class:?]
   at net.minecraft.client.Minecraft.run(Minecraft.java:386) [Minecraft.class:?]
   at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_144]
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_144]
   at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
   at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_144]
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
   at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_144]
   at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
   at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException
   at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:78) ~[ModelBlockDefinition.class:?]
   at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1184) ~[ModelLoader$VariantLoader.class:?]
   at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]
   ... 24 more
[15:43:30] [Client thread/ERROR] [FML]: Suppressed additional 0 model loading errors for domain hmggvc
[15:43:30] [Client thread/WARN]: Skipping bad option: lastServer:
[15:43:30] [Client thread/ERROR] [TEXTURE ERRORS]: +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
[15:43:30] [Client thread/ERROR] [TEXTURE ERRORS]: The following texture errors were found.
[15:43:30] [Client thread/ERROR] [TEXTURE ERRORS]: ==================================================
[15:43:30] [Client thread/ERROR] [TEXTURE ERRORS]:   DOMAIN gvclib
[15:43:30] [Client thread/ERROR] [TEXTURE ERRORS]: --------------------------------------------------
[15:43:30] [Client thread/ERROR] [TEXTURE ERRORS]:   domain gvclib is missing 1 texture
[15:43:30] [Client thread/ERROR] [TEXTURE ERRORS]:     domain gvclib has 4 locations:
[15:43:30] [Client thread/ERROR] [TEXTURE ERRORS]:       mod examplemod resources at Z:\MCWorkSpace\ForgeSrc\bin
[15:43:30] [Client thread/ERROR] [TEXTURE ERRORS]:       mod GVCLib resources at Z:\MCWorkSpace\ForgeSrc\bin
[15:43:30] [Client thread/ERROR] [TEXTURE ERRORS]:       mod HMGGVC resources at Z:\MCWorkSpace\ForgeSrc\bin
[15:43:30] [Client thread/ERROR] [TEXTURE ERRORS]:       mod guerrillacity resources at Z:\MCWorkSpace\ForgeSrc\bin
[15:43:30] [Client thread/ERROR] [TEXTURE ERRORS]: -------------------------
[15:43:30] [Client thread/ERROR] [TEXTURE ERRORS]:     The missing resources for domain gvclib are:
[15:43:30] [Client thread/ERROR] [TEXTURE ERRORS]:       textures/items/smoke0.png
[15:43:30] [Client thread/ERROR] [TEXTURE ERRORS]: -------------------------
[15:43:30] [Client thread/ERROR] [TEXTURE ERRORS]:     No other errors exist for domain gvclib
[15:43:30] [Client thread/ERROR] [TEXTURE ERRORS]: ==================================================
[15:43:30] [Client thread/ERROR] [TEXTURE ERRORS]: +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
[15:43:31] [Realms Notification Availability checker #1/INFO]: Could not authorize you against Realms server: Invalid session id
[15:51:52] [Server thread/INFO]: Starting integrated minecraft server version 1.10.2
[15:51:52] [Server thread/INFO]: Generating keypair
[15:51:52] [Server thread/INFO] [FML]: Injecting existing block and item data into this server instance
[15:51:52] [Server thread/INFO] [FML]: Applying holder lookups
[15:51:52] [Server thread/INFO] [FML]: Holder lookups applied
[15:51:52] [Server thread/INFO] [FML]: Loading dimension 0 (Copy of Copy of Copy of Copy of) (net.minecraft.server.integrated.IntegratedServer@18ba459d)
[15:51:53] [Server thread/INFO] [FML]: Loading dimension 2 (Copy of Copy of Copy of Copy of) (net.minecraft.server.integrated.IntegratedServer@18ba459d)
[15:51:53] [Server thread/INFO] [FML]: Loading dimension 1 (Copy of Copy of Copy of Copy of) (net.minecraft.server.integrated.IntegratedServer@18ba459d)
[15:51:53] [Server thread/INFO] [FML]: Loading dimension -1 (Copy of Copy of Copy of Copy of) (net.minecraft.server.integrated.IntegratedServer@18ba459d)
[15:51:53] [Server thread/INFO]: Preparing start region for level 0
[15:51:54] [Server thread/INFO]: Preparing spawn area: 57%
[15:51:55] [Server thread/INFO]: Changing view distance to 12, from 10
[15:51:57] [Netty Local Client IO #0/INFO] [FML]: Server protocol version 2
[15:51:57] [Netty Server IO #1/INFO] [FML]: Client protocol version 2
[15:51:57] [Netty Server IO #1/INFO] [FML]: Client attempting to join with 7 mods : GVCLib@1.7.x-srg-1,FML@8.0.99.99,guerrillacity@1.0.0,Forge@12.18.3.2185,HMGGVC@1.7.x-srg-1,mcp@9.19,examplemod@1.0
[15:51:57] [Netty Local Client IO #0/INFO] [FML]: [Netty Local Client IO #0] Client side modded connection established
[15:51:57] [Server thread/INFO] [FML]: [Server thread] Server side modded connection established
[15:51:57] [Server thread/INFO]: プレイヤー名[local:E:b13fc567] logged in with entity id 257 at (180.7612561189411, 31.0, 205.64370005323957)
[15:51:57] [Server thread/INFO]: プレイヤー名 joined the game
関係ない原因で落ちている後半は、文字数オーバー回避のためカットします。


1.10.2のブロック・アイテム・アイテムブロック登録方法がよくわかっていないので、教えていただけると嬉しいです。
最後に編集したユーザー remiliaMarine [ 2017年9月08日(金) 13:15 ], 累計 1 回
ゲリラMOD最高!アドオンですhttp://forum.minecraftuser.jp/viewtopic.php?f=13&t=35057
アバター
remiliaMarine
ID:8723cd50
木を殴ってる
 
記事: 39
登録日時: 2017年8月27日(日) 17:18

  • (PostNo.307458)

Re: [1.10.2]metadataを持つブロックが、設置されている時正しく表示されない

投稿記事by defeatedcrow » 2017年9月07日(木) 20:58

remiliaMarine さんが書きました:こんにちは、MissingVariantExceptionが出てしまい、metadataを持つブロックのアイテム(インベントリ内、ドロップ状態)は正しく描画されるのに、設置されたブロックはピンクと黒のテクスチャになってしまいます。こちらのトピックhttp://forum.minecraftuser.jp/viewtopic.php?f=39&t=34837を参考にひとつづつメソッドなどを比較していったのですが、上手く行きませんでした。

出来ていること、分かっていることは、
1.インベントリ内のアイテムブロックは正しくテクスチャが表示される。
inventory.png

2.設置したブロックのvariantは、F3で確認すると、設置したアイテムとmetadataの対応したものになっている。
block.png

3.破壊したときにドロップするアイテムは、metadataに対応したものになっている。
itementity.png

アイテムは正しく表示されることから、モデルは大丈夫で、
恐らくブロックの登録かコンストラクタ、ブロックステーツに問題があるのだと思います。

[spoiler=ソースコード]@Modアノテーションのあるクラス(関係するところのみ)
コード: 全て選択
public class GuerrillaCityCore
{
    public static Block blockSandBag;
    public static Block blockSandBagSlab;
    public static Block BlockSandBagDoubleSlab;
   
    public static DimensionType GUERRILLA_CITY_DIMENSION;
   
    @EventHandler
    public void preInit(FMLPreInitializationEvent event){
       
        blockSandBag = new BlockSandBag();
        ItemBlock itemBlockSandBag = new ItemBlockSandBag(blockSandBag);
        ResourceLocation blockSandBagResource = new ResourceLocation(MODID, "blocksandbag");
        GameRegistry.register(blockSandBag, blockSandBagResource);
        GameRegistry.register(itemBlockSandBag, blockSandBagResource);
           
        if (event.getSide().isClient()) {
            OBJLoader.INSTANCE.addDomain(MODID);
           
            ModelBakery.registerItemVariants(Item.getItemFromBlock(blockSandBag),
                    new ModelResourceLocation("guerrillacity:blocksandbag_white", "inventory"),
                    new ModelResourceLocation("guerrillacity:blocksandbag_green", "inventory"),
                    new ModelResourceLocation("guerrillacity:blocksandbag_gray", "inventory"));
            ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(blockSandBag), 0, new ModelResourceLocation("guerrillacity:blocksandbag_white", "inventory"));
            ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(blockSandBag), 1, new ModelResourceLocation("guerrillacity:blocksandbag_green", "inventory"));
            ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(blockSandBag), 2, new ModelResourceLocation("guerrillacity:blocksandbag_gray", "inventory"));
        }
    }
    @EventHandler
    public void init(FMLInitializationEvent event)
    {
    }
}

ブロックのクラス(BlockDirtとほぼ同じです)
コード: 全て選択
public class BlockSandBag extends Block {
   
    public static final PropertyEnum<BlockSandBag.EnumType> VARIANT = PropertyEnum.<BlockSandBag.EnumType>create("variant", BlockSandBag.EnumType.class);

    public BlockSandBag()
    {
        super(Material.GROUND);
        this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT, BlockSandBag.EnumType.WHITE));
        this.setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
        this.setHardness(0.25F);
        this.setResistance(15.0F);
        this.setUnlocalizedName("FieldSandBag");
    }
    /**
     * Gets the metadata of the item this Block can drop. This method is called when the block gets destroyed. It
     * returns the metadata of the dropped item based on the old metadata of the block.
     */
    public int damageDropped(IBlockState state)
    {
        return ((BlockSandBag.EnumType)state.getValue(VARIANT)).getMetadata();
    }
    /**
     * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
     */
    @SideOnly(Side.CLIENT)
    public void getSubBlocks(Item itemIn, CreativeTabs tab, List<ItemStack> list)
    {
        list.add(new ItemStack(this, 1, BlockSandBag.EnumType.WHITE.getMetadata()));
        list.add(new ItemStack(this, 1, BlockSandBag.EnumType.GREEN.getMetadata()));
        list.add(new ItemStack(this, 1, BlockSandBag.EnumType.GRAY.getMetadata()));
    }
    public ItemStack getItem(World worldIn, BlockPos pos, IBlockState state)
    {
        return new ItemStack(this, 1, ((BlockSandBag.EnumType)state.getValue(VARIANT)).getMetadata());
    }
    /**
     * Convert the given metadata into a BlockState for this Block
     */
    public IBlockState getStateFromMeta(int meta)
    {
        return this.getDefaultState().withProperty(VARIANT, BlockSandBag.EnumType.byMetadata(meta));
    }
    /**
     * Convert the BlockState into the correct metadata value
     */
    public int getMetaFromState(IBlockState state)
    {
        return ((BlockSandBag.EnumType)state.getValue(VARIANT)).getMetadata();
    }

    protected BlockStateContainer createBlockState()
    {
        return new BlockStateContainer(this, new IProperty[] {VARIANT});
    }
    public String getSpecialName(ItemStack stack) {
        return BlockSandBag.EnumType.byMetadata(stack.getItemDamage()).getName();
     }

    public static enum EnumType implements IStringSerializable {
        WHITE(0, "sandbag_white"),
        GREEN(1, "sandbag_green"),
        GRAY(2, "sandbag_gray");

        private static final BlockSandBag.EnumType[] META_LOOKUP = new BlockSandBag.EnumType[values().length];
        private final int meta;
        private final String name;
        private final String unlocalizedName;
       
        private EnumType(int metaIn, String nameIn)
        {
            this(metaIn, nameIn, nameIn);
        }

        private EnumType(int metaIn, String nameIn, String unlocalizedNameIn)
        {
            this.meta = metaIn;
            this.name = nameIn;
            this.unlocalizedName = unlocalizedNameIn;
        }
        public int getMetadata()
        {
            return this.meta;
        }
       
        public String toString()
        {
            return this.name;
        }
        public static BlockSandBag.EnumType byMetadata(int meta)
        {
            if (meta < 0 || meta >= META_LOOKUP.length)
            {
                meta = 0;
            }
            return META_LOOKUP[meta];
        }
       
        @Override   
        public String getName() {
            return this.name;
        }
        public String getUnlocalizedName()
        {
            return this.unlocalizedName;
        }
       
        static
        {
            for (BlockSandBag.EnumType blocksandbag$enumtype : values())
            {
                META_LOOKUP[blocksandbag$enumtype.getMetadata()] = blocksandbag$enumtype;
            }
        }
    }
}

itemBlockのクラス
コード: 全て選択
public class ItemBlockSandBag extends ItemBlock {

    public ItemBlockSandBag(Block block) {
        super(block);
        this.setHasSubtypes(true);
    }
    @Override
    public int getMetadata(int damage) {
        return damage;
    }
    @Override
    public String getUnlocalizedName(ItemStack stack) {
       return ((BlockSandBag)this.block).getSpecialName(stack);
    }
}

assets.guerrillacity.blockstates.blocksandbag.json全角スペースはありません。
[code]
{
"variants": {
"meta=0": { "model": "guerrillacity:block/blocksandbag_white" },
"meta=1": { "model": "guerrillacity:block/blocksandbag_green" },
"meta=2": { "model": "guerrillacity:block/blocksandbag_gray" }
}
}


1.10.2のブロック・アイテム・アイテムブロック登録方法がよくわかっていないので、教えていただけると嬉しいです。


とりあえず

現状、1.10以上で作っているような手慣れたModderにチュートリアルに手を出せるような余裕がある人が多分居ないです
”1.10.2のブロック・アイテム・アイテムブロック登録方法がわかる”Modderが果たして国内に何人居るんだよ???という状況です
チュートリアルや手を差し伸べてくれるような存在はないものと思って、開拓半分でやっていくのが良いと思います
(というか、現状そうなってしまっています コンソールログが自力で読めないと厳しいです)

Json書式もチョコチョコチョコチョコと変更が入るのと、人によって使用メソッドも一致してないのでこれという唯一解はないです



で、あなたのソースについてですが
Json登録時にinventory関係のみ登録して、それ以外のことをやっていないので、設置時のモデル用Jsonはblockstate、blockモデルともにデフォルト設定ですので、resources/assets/modのID/blockstates下にファイルを置けば読み込まれるはず
ログを見る限り、起きているのはblockstate記述内のミスです
コンソールログにも原因は出ています、これが読めれていれば自己解決できると思います

[15:43:30] [Client thread/ERROR] [FML]: Exception loading model for variant guerrillacity:blocksandbag#variant=green_sandbag for blockstate "guerrillacity:blocksandbag[variant=green_sandbag]"
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model guerrillacity:blocksandbag#variant=green_sandbag with loader VariantLoader.INSTANCE, skipping
at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) [/b]

あなたはBlockのStateをEnumのPropertyで用意したのだから、json上でもenum名で指定しなければならない
しかし、あなたはこういう記述をしています

{
"variants": {
"meta=0": { "model": "guerrillacity:block/blocksandbag_white" },
"meta=1": { "model": "guerrillacity:block/blocksandbag_green" },
"meta=2": { "model": "guerrillacity:block/blocksandbag_gray" }
}
}

上記のように、あなたは自分が登録していないはずの、"meta"というInt型のPropertyに対してモデルの割り振りをやっています
ですから、モデルが呼ばれないんです
メタデータを数値で扱う風習はもう削除済みですから、旧来の感覚では扱えません
自分がStateのプロパティを設定し、設定したプロパティをもとにモデルを割り振るのが現在のやり方です

これを修正すると下記のようになります
これは汎用解ではなく、このブロック用の記述です
{
"variants": {
"variant=white_sandbag": { "model": "guerrillacity:block/blocksandbag_white" },
"variant=green_sandbag": { "model": "guerrillacity:block/blocksandbag_green" },
"variant=gray_sandbag": { "model": "guerrillacity:block/blocksandbag_gray" }
}
}

Propertyがint型であれば、"Property名=0"...のように書きますし、Boolean型なら"Property名=true"のように書きます
Enumなら文字列で指定します


もちろんこれで解決とは限らないです
プラスして、
・blockstate用Jsonのファイル場所のミス
・モデル用Jsonの場所指定のミス
・誤字脱字
なども合わせて確認する必要があると思います
inventory表示はうまくいっているようなので、モデル用Jsonの内容は大丈夫だと思いますけどね
カラスの敗残兵です。AppleMilkTea他、少々のMODを作成しています。
トピック: AppleMilkTea(~1.7.10) / HeatAndClimate(1.10.2)
作者Wiki / github / twitter
アバター
defeatedcrow
ID:7e692061
ラピスラズリ収集家
 
記事: 931
登録日時: 2014年1月08日(水) 13:48
お住まい: 北関東

  • (PostNo.307470)

Re: [1.10.2]metadataを持つブロックが、設置されている時正しく表示されない

投稿記事by remiliaMarine » 2017年9月08日(金) 08:54

ありがとうございます。大変助かりました。
blockstatesのjsonを
コード: 全て選択
{
   "variants": {
       "variant=sandbag_white": { "model": "guerrillacity:blocksandbag_white" },
       "variant=sandbag_green": { "model": "guerrillacity:blocksandbag_green" },
       "variant=sandbag_gray": { "model": "guerrillacity:blocksandbag_gray" }
   }
}
としたところ、ちゃんとテクスチャが表示されました。

メタデータについてとか、jsonの書き方とか、いろいろ誤解していました。
新しい情報も集めつつ、コンソールログを読めるように精進して、頑張って行きます。
ゲリラMOD最高!アドオンですhttp://forum.minecraftuser.jp/viewtopic.php?f=13&t=35057
アバター
remiliaMarine
ID:ae703c41
木を殴ってる
 
記事: 39
登録日時: 2017年8月27日(日) 17:18


Return to 質問:開発・制作関連

x