Jump to content

1.12.2 Doors have missing texture dont load right


ijdtm7

Recommended Posts

I have this error with my doors, It appears as the blockstate isn't working. It keeps asking for blockstate normal. I got this error in the logs 

 

 Exception loading model for variant sez:door860#normal for blockstate "sez:door860" net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model sez:door860#normal with loader VariantLoader.INSTANCE, skipping    at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:161
) ~[ModelLoaderRegistry.class:?]    at net.minecraftforge.client.model.ModelLoader.registerVariant(ModelLoader.java:235
) ~[ModelLoader.class:?]    at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:153
) ~[ModelBakery.class:?]    at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:223
) ~[ModelLoader.class:?]    at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:150
) ~[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:121
) [SimpleReloadableResourceManager.class:?]    at net.minecraft.client.Minecraft.init(Minecraft.java:559
) [Minecraft.class:?]    at net.minecraft.client.Minecraft.run(Minecraft.java:421
) [Minecraft.class:?]    at net.minecraft.client.main.Main.main(Main.java:118
) [Main.class:?]    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_212]    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62
) ~[?:1.8.0_212]    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43
) ~[?:1.8.0_212]    at java.lang.reflect.Method.invoke(Method.java:498
) ~[?:1.8.0_212]    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_212]    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62
) ~[?:1.8.0_212]    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43
) ~[?:1.8.0_212]    at java.lang.reflect.Method.invoke(Method.java:498
) ~[?:1.8.0_212]    at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97
) [start/:?]    at GradleStart.main(GradleStart.java:25
) [start/:?] Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException    at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:83
) ~[ModelBlockDefinition.class:?]    at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1175
) ~[ModelLoader$VariantLoader.class:?]    at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:157
) ~[ModelLoaderRegistry.class:?]    ... 21 more

 

 

here is my class file:

package net.mcreator.sez;

import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.client.event.ModelRegistryEvent;

import net.minecraft.world.World;
import net.minecraft.world.IBlockAccess;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.EnumHand;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.Item;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.block.state.IBlockState;
import net.minecraft.block.properties.PropertyDirection;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.material.Material;
import net.minecraft.block.SoundType;
import net.minecraft.block.Block;

import java.util.HashMap;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.SoundCategory;
import net.minecraft.item.ItemStack;
import net.minecraft.block.BlockDoor;

public class MCreatorDoor860 extends sez.ModElement {

    @GameRegistry.ObjectHolder("sez:door860")
    public static final Block block = null;
    public MCreatorDoor860(sez instance) {
        super(instance);
        instance.blocks.add(() -> new BlockCustom());
        instance.items.add(() -> new ItemBlock(block).setRegistryName(block.getRegistryName()));
    }

    @SideOnly(Side.CLIENT)
    @Override
    public void registerModels(ModelRegistryEvent event) {
        ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), 0, new ModelResourceLocation("sez:door860", "inventory"));
    }

    public static class BlockCustom extends Block {

        
        

        public BlockCustom() {
            super(Material.WOOD);
            setRegistryName("door860");
            setUnlocalizedName("door860");
            setSoundType(SoundType.WOOD);
            setHarvestLevel("axe", 1);
            setHardness(2F);
            setResistance(10F);
            setLightLevel(0F);
            setLightOpacity(0);
            setCreativeTab(MCreatorSezbasic.tab);
            
        }

        

        @Override
        public boolean isOpaqueCube(IBlockState state) {
            return false;
        }

        @Override
        public boolean canConnectRedstone(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
            return true;
        }

        
        public EnumActionResult onItemUse(EntityPlayer player, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) 
        {
        if(facing != EnumFacing.UP) return EnumActionResult.FAIL;
        else
            {
            IBlockState bottomDoorState = worldIn.getBlockState(pos);
            Block bottomDoorBlock = bottomDoorState.getBlock();
            
            if(!block.isReplaceable(worldIn, pos)) pos = pos.offset(facing);
            
            ItemStack stack = player.getHeldItem(hand);
            if(player.canPlayerEdit(pos, facing, stack) && block.canPlaceBlockAt(worldIn, pos))
            {
                EnumFacing playerFacing = EnumFacing.fromAngle((double)player.rotationYaw);
                int x = playerFacing.getFrontOffsetX();
                int z = playerFacing.getFrontOffsetZ();
                boolean flag = x < 0 && hitZ < 0.5f || x > 0 && hitZ > 0.5f || z < 0 && hitX < 0.5F || z > 0 && hitX > 0.5F;
                placeDoor(worldIn, pos, playerFacing, block, flag);
                
                SoundType sound = block.getSoundType(bottomDoorState, worldIn, pos, player);
                worldIn.playSound(player, pos, sound.getPlaceSound(), SoundCategory.BLOCKS, (sound.getVolume() + 1.0f) / 2.0f, sound.getPitch() * 0.8f);
                
                stack.shrink(1);
                return EnumActionResult.SUCCESS;
            }
            else return EnumActionResult.FAIL;
        }
    }

    private static void placeDoor(World worldIn, BlockPos bottomDoorPos, EnumFacing playerFacing, Block door, boolean isRightHinge) 
    {
        BlockPos posYClockwise = bottomDoorPos.offset(playerFacing.rotateY());
        BlockPos posYAntiClockwise = bottomDoorPos.offset(playerFacing.rotateYCCW());
        
        int i = (worldIn.getBlockState(posYAntiClockwise).isNormalCube() ? 1 : 0) + (worldIn.getBlockState(posYAntiClockwise.up()).isNormalCube() ? 1 : 0);
        int j = (worldIn.getBlockState(posYClockwise).isNormalCube() ? 1 : 0) + (worldIn.getBlockState(posYClockwise.up()).isNormalCube() ? 1 : 0);
        
        boolean flag = worldIn.getBlockState(posYAntiClockwise).getBlock() == door || worldIn.getBlockState(posYAntiClockwise.up()).getBlock() == door;
        boolean flag1 = worldIn.getBlockState(posYClockwise).getBlock() == door || worldIn.getBlockState(posYClockwise.up()).getBlock() == door;
    
        if((!flag || flag1) && j <= i)
        {
            if(flag1 && !flag || j < i) isRightHinge = false;
        }
        else isRightHinge = true;
        
        BlockPos topDoorPos = bottomDoorPos.up();
        boolean powered = worldIn.isBlockPowered(bottomDoorPos) || worldIn.isBlockPowered(topDoorPos);
        IBlockState doorState = door.getDefaultState().withProperty(BlockDoor.FACING, playerFacing).withProperty(BlockDoor.HINGE, isRightHinge ? BlockDoor.EnumHingePosition.RIGHT : BlockDoor.EnumHingePosition.LEFT).withProperty(BlockDoor.POWERED, Boolean.valueOf(powered)).withProperty(BlockDoor.OPEN, Boolean.valueOf(powered));
        
        worldIn.setBlockState(bottomDoorPos, doorState.withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.LOWER));
        worldIn.setBlockState(topDoorPos, doorState.withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.UPPER));
        worldIn.notifyNeighborsOfStateChange(bottomDoorPos, door, false);
        worldIn.notifyNeighborsOfStateChange(topDoorPos, door, false);        
    }
    }
}
 

and here is blockstates:

{
    "variants": {
        "facing=east,half=lower,hinge=left,open=true,powered=true": [
            {
                "model": "scp:door860_bottom_rh",
                "y": 90
            }
        ],
        "facing=east,half=lower,hinge=left,open=true,powered=false": [
            {
                "model": "scp:door860_bottom_rh",
                "y": 90
            }
        ],
        "facing=east,half=lower,hinge=left,open=false,powered=true": [
            {
                "model": "scp:door860_bottom"
            }
        ],
        "facing=east,half=lower,hinge=left,open=false,powered=false": [
            {
                "model": "scp:door860_bottom"
            }
        ],
        "facing=east,half=lower,hinge=right,open=true,powered=true": [
            {
                "model": "scp:door860_bottom",
                "y": 270
            }
        ],
        "facing=east,half=lower,hinge=right,open=true,powered=false": [
            {
                "model": "scp:door860_bottom",
                "y": 270
            }
        ],
        "facing=east,half=lower,hinge=right,open=false,powered=true": [
            {
                "model": "scp:door860_bottom_rh"
            }
        ],
        "facing=east,half=lower,hinge=right,open=false,powered=false": [
            {
                "model": "scp:door860_bottom_rh"
            }
        ],
        "facing=east,half=upper,hinge=left,open=true,powered=true": [
            {
                "model": "scp:door860_top_rh",
                "y": 90
            }
        ],
        "facing=east,half=upper,hinge=left,open=true,powered=false": [
            {
                "model": "scp:door860_top_rh",
                "y": 90
            }
        ],
        "facing=east,half=upper,hinge=left,open=false,powered=true": [
            {
                "model": "scp:door860_top"
            }
        ],
        "facing=east,half=upper,hinge=left,open=false,powered=false": [
            {
                "model": "scp:door860_top"
            }
        ],
        "facing=east,half=upper,hinge=right,open=true,powered=true": [
            {
                "model": "scp:door860_top",
                "y": 270
            }
        ],
        "facing=east,half=upper,hinge=right,open=true,powered=false": [
            {
                "model": "scp:door860_top",
                "y": 270
            }
        ],
        "facing=east,half=upper,hinge=right,open=false,powered=true": [
            {
                "model": "scp:door860_top_rh"
            }
        ],
        "facing=east,half=upper,hinge=right,open=false,powered=false": [
            {
                "model": "scp:door860_top_rh"
            }
        ],
        "facing=south,half=lower,hinge=left,open=true,powered=true": [
            {
                "model": "scp:door860_bottom_rh",
                "y": 180
            }
        ],
        "facing=south,half=lower,hinge=left,open=true,powered=false": [
            {
                "model": "scp:door860_bottom_rh",
                "y": 180
            }
        ],
        "facing=south,half=lower,hinge=left,open=false,powered=true": [
            {
                "model": "scp:door860_bottom",
                "y": 90
            }
        ],
        "facing=south,half=lower,hinge=left,open=false,powered=false": [
            {
                "model": "scp:door860_bottom",
                "y": 90
            }
        ],
        "facing=south,half=lower,hinge=right,open=true,powered=true": [
            {
                "model": "scp:door860_bottom"
            }
        ],
        "facing=south,half=lower,hinge=right,open=true,powered=false": [
            {
                "model": "scp:door860_bottom"
            }
        ],
        "facing=south,half=lower,hinge=right,open=false,powered=true": [
            {
                "model": "scp:door860_bottom_rh",
                "y": 90
            }
        ],
        "facing=south,half=lower,hinge=right,open=false,powered=false": [
            {
                "model": "scp:door860_bottom_rh",
                "y": 90
            }
        ],
        "facing=south,half=upper,hinge=left,open=true,powered=true": [
            {
                "model": "scp:door860_top_rh",
                "y": 180
            }
        ],
        "facing=south,half=upper,hinge=left,open=true,powered=false": [
            {
                "model": "scp:door860_top_rh",
                "y": 180
            }
        ],
        "facing=south,half=upper,hinge=left,open=false,powered=true": [
            {
                "model": "scp:door860_top",
                "y": 90
            }
        ],
        "facing=south,half=upper,hinge=left,open=false,powered=false": [
            {
                "model": "scp:door860_top",
                "y": 90
            }
        ],
        "facing=south,half=upper,hinge=right,open=true,powered=true": [
            {
                "model": "scp:door860_top"
            }
        ],
        "facing=south,half=upper,hinge=right,open=true,powered=false": [
            {
                "model": "scp:door860_top"
            }
        ],
        "facing=south,half=upper,hinge=right,open=false,powered=true": [
            {
                "model": "scp:door860_top_rh",
                "y": 90
            }
        ],
        "facing=south,half=upper,hinge=right,open=false,powered=false": [
            {
                "model": "scp:door860_top_rh",
                "y": 90
            }
        ],
        "facing=west,half=lower,hinge=left,open=true,powered=true": [
            {
                "model": "scp:door860_bottom_rh",
                "y": 270
            }
        ],
        "facing=west,half=lower,hinge=left,open=true,powered=false": [
            {
                "model": "scp:door860_bottom_rh",
                "y": 270
            }
        ],
        "facing=west,half=lower,hinge=left,open=false,powered=true": [
            {
                "model": "scp:door860_bottom",
                "y": 180
            }
        ],
        "facing=west,half=lower,hinge=left,open=false,powered=false": [
            {
                "model": "scp:door860_bottom",
                "y": 180
            }
        ],
        "facing=west,half=lower,hinge=right,open=true,powered=true": [
            {
                "model": "scp:door860_bottom",
                "y": 90
            }
        ],
        "facing=west,half=lower,hinge=right,open=true,powered=false": [
            {
                "model": "scp:door860_bottom",
                "y": 90
            }
        ],
        "facing=west,half=lower,hinge=right,open=false,powered=true": [
            {
                "model": "scp:door860_bottom_rh",
                "y": 180
            }
        ],
        "facing=west,half=lower,hinge=right,open=false,powered=false": [
            {
                "model": "scp:door860_bottom_rh",
                "y": 180
            }
        ],
        "facing=west,half=upper,hinge=left,open=true,powered=true": [
            {
                "model": "scp:door860_top_rh",
                "y": 270
            }
        ],
        "facing=west,half=upper,hinge=left,open=true,powered=false": [
            {
                "model": "scp:door860_top_rh",
                "y": 270
            }
        ],
        "facing=west,half=upper,hinge=left,open=false,powered=true": [
            {
                "model": "scp:door860_top",
                "y": 180
            }
        ],
        "facing=west,half=upper,hinge=left,open=false,powered=false": [
            {
                "model": "scp:door860_top",
                "y": 180
            }
        ],
        "facing=west,half=upper,hinge=right,open=true,powered=true": [
            {
                "model": "scp:door860_top",
                "y": 90
            }
        ],
        "facing=west,half=upper,hinge=right,open=true,powered=false": [
            {
                "model": "scp:door860_top",
                "y": 90
            }
        ],
        "facing=west,half=upper,hinge=right,open=false,powered=true": [
            {
                "model": "scp:door860_top_rh",
                "y": 180
            }
        ],
        "facing=west,half=upper,hinge=right,open=false,powered=false": [
            {
                "model": "scp:door860_top_rh",
                "y": 180
            }
        ],
        "facing=north,half=lower,hinge=left,open=true,powered=true": [
            {
                "model": "scp:door860_bottom"
            }
        ],
        "facing=north,half=lower,hinge=left,open=true,powered=false": [
            {
                "model": "scp:door860_bottom"
            }
        ],
        "facing=north,half=lower,hinge=left,open=false,powered=true": [
            {
                "model": "scp:door860_bottom",
                "y": 270
            }
        ],
        "facing=north,half=lower,hinge=left,open=false,powered=false": [
            {
                "model": "scp:door860_bottom",
                "y": 270
            }
        ],
        "facing=north,half=lower,hinge=right,open=true,powered=true": [
            {
                "model": "scp:door860_bottom",
                "y": 180
            }
        ],
        "facing=north,half=lower,hinge=right,open=true,powered=false": [
            {
                "model": "scp:door860_bottom",
                "y": 180
            }
        ],
        "facing=north,half=lower,hinge=right,open=false,powered=true": [
            {
                "model": "scp:door860_bottom_rh",
                "y": 270
            }
        ],
        "facing=north,half=lower,hinge=right,open=false,powered=false": [
            {
                "model": "scp:door860_bottom_rh",
                "y": 270
            }
        ],
        "facing=north,half=upper,hinge=left,open=true,powered=true": [
            {
                "model": "scp:door860_top_rh"
            }
        ],
        "facing=north,half=upper,hinge=left,open=true,powered=false": [
            {
                "model": "scp:door860_top_rh"
            }
        ],
        "facing=north,half=upper,hinge=left,open=false,powered=true": [
            {
                "model": "scp:door860_top",
                "y": 270
            }
        ],
        "facing=north,half=upper,hinge=left,open=false,powered=false": [
            {
                "model": "scp:door860_top",
                "y": 270
            }
        ],
        "facing=north,half=upper,hinge=right,open=true,powered=true": [
            {
                "model": "scp:door860_top",
                "y": 180
            }
        ],
        "facing=north,half=upper,hinge=right,open=true,powered=false": [
            {
                "model": "scp:door860_top",
                "y": 180
            }
        ],
        "facing=north,half=upper,hinge=right,open=false,powered=true": [
            {
                "model": "scp:door860_top_rh",
                "y": 270
            }
        ],
        "facing=north,half=upper,hinge=right,open=false,powered=false": [
            {
                "model": "scp:door860_top_rh",
                "y": 270
            }
        ]
    }
}

 

btlZRhT.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.