Jump to content

Transparent Vanilla Doors - Help! I have no idea what I'm doing!


Recommended Posts

Posted (edited)

I'm 2 days in on revamping my 1.8 basemod to work as a 1.12.2 standalone mod and I am in so far over my head.

 

My basemod worked as a kind of total conversion mod which basically forced Minecraft to start handling transparency renderings on vanilla Ore blocks, doors, and some other items, so I could make them look like glass with a fancy texture. To be clear, I want the base game to let it's base models support transparencies.  That's all. 

 

Without a good way to get MCP working for 1.12.2, I decided to try and make a mod for this. It's been rough. My path has been to basically clone the .java of a given file, mod it enough so that it's essentially packaged like a custom block and then try to use an event handler to slip in my version of the vanilla block instead of its version during Registration. Is that the right way to do this? I have no idea.

 

I managed to clone BlockOre and package it as a TestOre.java and then use some of the code I found here to load it in.

 

Handler:

package encom.grid.rezcraft;

import encom.grid.rezcraft.TestOre;
import encom.grid.rezcraft.TestDoor;
import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

@Mod.EventBusSubscriber(modid = TestOre.MODID)

public final class EventSubscriber {
@SubscribeEvent
static void onBlockRegister(final RegistryEvent.Register<Block> event) {
	
    event.getRegistry().register(new TestOre().setHardness(3.0F).setResistance(5.0F).setUnlocalizedName("oreIron").setRegistryName(new ResourceLocation("minecraft", "iron_ore")));
    event.getRegistry().register(new TestOre().setHardness(3.0F).setResistance(5.0F).setUnlocalizedName("oreDiamond").setRegistryName(new ResourceLocation("minecraft", "diamond_ore")));
    event.getRegistry().register(new TestDoor(Material.WOOD).setHardness(3.0F).setUnlocalizedName("doorAcacia").setRegistryName(new ResourceLocation("minecraft", "acacia_door")));
  }
}

 

The ore part works great, the door not so much. Cloning the BlockDoor.java file has been quite an undertaking. 

 

package encom.grid.rezcraft;

import java.util.Random;

import init.BlockInit;
import net.minecraft.block.Block;
import net.minecraft.block.BlockHorizontal;
import net.minecraft.block.BlockPlanks;
import net.minecraft.block.material.EnumPushReaction;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.properties.PropertyDirection;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.BlockFaceShape;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.IStringSerializable;
import net.minecraft.util.Mirror;
import net.minecraft.util.Rotation;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.translation.I18n;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class TestDoor extends Block
{
    public static final PropertyDirection FACING = BlockHorizontal.FACING;
    public static final PropertyBool OPEN = PropertyBool.create("open");
    public static final PropertyEnum<TestDoor.EnumHingePosition> HINGE = PropertyEnum.<TestDoor.EnumHingePosition>create("hinge", TestDoor.EnumHingePosition.class);
    public static final PropertyBool POWERED = PropertyBool.create("powered");
    public static final PropertyEnum<TestDoor.EnumDoorHalf> HALF = PropertyEnum.<TestDoor.EnumDoorHalf>create("half", TestDoor.EnumDoorHalf.class);
    protected static final AxisAlignedBB SOUTH_AABB = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.1875D);
    protected static final AxisAlignedBB NORTH_AABB = new AxisAlignedBB(0.0D, 0.0D, 0.8125D, 1.0D, 1.0D, 1.0D);
    protected static final AxisAlignedBB WEST_AABB = new AxisAlignedBB(0.8125D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D);
    protected static final AxisAlignedBB EAST_AABB = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.1875D, 1.0D, 1.0D);

    public TestDoor(Material materialIn)
    {
        super(materialIn);
        this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(OPEN, Boolean.valueOf(false)).withProperty(HINGE, TestDoor.EnumHingePosition.LEFT).withProperty(POWERED, Boolean.valueOf(false)).withProperty(HALF, TestDoor.EnumDoorHalf.LOWER));
    }


	public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
    {
        state = state.getActualState(source, pos);
        EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);
        boolean flag = !((Boolean)state.getValue(OPEN)).booleanValue();
        boolean flag1 = state.getValue(HINGE) == TestDoor.EnumHingePosition.RIGHT;

        switch (enumfacing)
        {
            case EAST:
            default:
                return flag ? EAST_AABB : (flag1 ? NORTH_AABB : SOUTH_AABB);
            case SOUTH:
                return flag ? SOUTH_AABB : (flag1 ? EAST_AABB : WEST_AABB);
            case WEST:
                return flag ? WEST_AABB : (flag1 ? SOUTH_AABB : NORTH_AABB);
            case NORTH:
                return flag ? NORTH_AABB : (flag1 ? WEST_AABB : EAST_AABB);
        }
    }

    /**
     * Gets the localized name of this block. Used for the statistics page.
     */
    public String getLocalizedName()
    {
        return I18n.translateToLocal((this.getUnlocalizedName() + ".name").replaceAll("tile", "item"));
    }

    /**
     * Used to determine ambient occlusion and culling when rebuilding chunks for render
     */
    public boolean isOpaqueCube(IBlockState state)
    {
        return false;
    }

    /**
     * Determines if an entity can path through this block
     */
    public boolean isPassable(IBlockAccess worldIn, BlockPos pos)
    {
        return isOpen(combineMetadata(worldIn, pos));
    }

    public boolean isFullCube(IBlockState state)
    {
        return false;
    }

    private int getCloseSound()
    {
        return this.blockMaterial == Material.IRON ? 1011 : 1012;
    }

    private int getOpenSound()
    {
        return this.blockMaterial == Material.IRON ? 1005 : 1006;
    }

    /**
     * Get the MapColor for this Block and the given BlockState
     */
    public MapColor getMapColor(IBlockState state, IBlockAccess worldIn, BlockPos pos)
    {
        if (state.getBlock() == Blocks.IRON_DOOR)
        {
            return MapColor.IRON;
        }
        else if (state.getBlock() == Blocks.OAK_DOOR)
        {
            return BlockPlanks.EnumType.OAK.getMapColor();
        }
        else if (state.getBlock() == Blocks.SPRUCE_DOOR)
        {
            return BlockPlanks.EnumType.SPRUCE.getMapColor();
        }
        else if (state.getBlock() == Blocks.BIRCH_DOOR)
        {
            return BlockPlanks.EnumType.BIRCH.getMapColor();
        }
        else if (state.getBlock() == Blocks.JUNGLE_DOOR)
        {
            return BlockPlanks.EnumType.JUNGLE.getMapColor();
        }
        else if (state.getBlock() == Blocks.ACACIA_DOOR)
        {
            return BlockPlanks.EnumType.ACACIA.getMapColor();
        }
        else
        {
            return state.getBlock() == Blocks.DARK_OAK_DOOR ? BlockPlanks.EnumType.DARK_OAK.getMapColor() : super.getMapColor(state, worldIn, pos);
        }
    }

    /**
     * Called when the block is right clicked by a player.
     */
    public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
    {
        if (this.blockMaterial == Material.IRON)
        {
            return false;
        }
        else
        {
            BlockPos blockpos = state.getValue(HALF) == TestDoor.EnumDoorHalf.LOWER ? pos : pos.down();
            IBlockState iblockstate = pos.equals(blockpos) ? state : worldIn.getBlockState(blockpos);

            if (iblockstate.getBlock() != this)
            {
                return false;
            }
            else
            {
                state = iblockstate.cycleProperty(OPEN);
                worldIn.setBlockState(blockpos, state, 10);
                worldIn.markBlockRangeForRenderUpdate(blockpos, pos);
                worldIn.playEvent(playerIn, ((Boolean)state.getValue(OPEN)).booleanValue() ? this.getOpenSound() : this.getCloseSound(), pos, 0);
                return true;
            }
        }
    }

    public void toggleDoor(World worldIn, BlockPos pos, boolean open)
    {
        IBlockState iblockstate = worldIn.getBlockState(pos);

        if (iblockstate.getBlock() == this)
        {
            BlockPos blockpos = iblockstate.getValue(HALF) == TestDoor.EnumDoorHalf.LOWER ? pos : pos.down();
            IBlockState iblockstate1 = pos == blockpos ? iblockstate : worldIn.getBlockState(blockpos);

            if (iblockstate1.getBlock() == this && ((Boolean)iblockstate1.getValue(OPEN)).booleanValue() != open)
            {
                worldIn.setBlockState(blockpos, iblockstate1.withProperty(OPEN, Boolean.valueOf(open)), 10);
                worldIn.markBlockRangeForRenderUpdate(blockpos, pos);
                worldIn.playEvent((EntityPlayer)null, open ? this.getOpenSound() : this.getCloseSound(), pos, 0);
            }
        }
    }

    /**
     * Called when a neighboring block was changed and marks that this state should perform any checks during a neighbor
     * change. Cases may include when redstone power is updated, cactus blocks popping off due to a neighboring solid
     * block, etc.
     */
    public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos fromPos)
    {
        if (state.getValue(HALF) == TestDoor.EnumDoorHalf.UPPER)
        {
            BlockPos blockpos = pos.down();
            IBlockState iblockstate = worldIn.getBlockState(blockpos);

            if (iblockstate.getBlock() != this)
            {
                worldIn.setBlockToAir(pos);
            }
            else if (blockIn != this)
            {
                iblockstate.neighborChanged(worldIn, blockpos, blockIn, fromPos);
            }
        }
        else
        {
            boolean flag1 = false;
            BlockPos blockpos1 = pos.up();
            IBlockState iblockstate1 = worldIn.getBlockState(blockpos1);

            if (iblockstate1.getBlock() != this)
            {
                worldIn.setBlockToAir(pos);
                flag1 = true;
            }

            if (!worldIn.getBlockState(pos.down()).isSideSolid(worldIn,  pos.down(), EnumFacing.UP))
            {
                worldIn.setBlockToAir(pos);
                flag1 = true;

                if (iblockstate1.getBlock() == this)
                {
                    worldIn.setBlockToAir(blockpos1);
                }
            }

            if (flag1)
            {
                if (!worldIn.isRemote)
                {
                    this.dropBlockAsItem(worldIn, pos, state, 0);
                }
            }
            else
            {
                boolean flag = worldIn.isBlockPowered(pos) || worldIn.isBlockPowered(blockpos1);

                if (blockIn != this && (flag || blockIn.getDefaultState().canProvidePower()) && flag != ((Boolean)iblockstate1.getValue(POWERED)).booleanValue())
                {
                    worldIn.setBlockState(blockpos1, iblockstate1.withProperty(POWERED, Boolean.valueOf(flag)), 2);

                    if (flag != ((Boolean)state.getValue(OPEN)).booleanValue())
                    {
                        worldIn.setBlockState(pos, state.withProperty(OPEN, Boolean.valueOf(flag)), 2);
                        worldIn.markBlockRangeForRenderUpdate(pos, pos);
                        worldIn.playEvent((EntityPlayer)null, flag ? this.getOpenSound() : this.getCloseSound(), pos, 0);
                    }
                }
            }
        }
    }

    /**
     * Get the Item that this Block should drop when harvested.
     */
    public Item getItemDropped(IBlockState state, Random rand, int fortune)
    {
        return state.getValue(HALF) == TestDoor.EnumDoorHalf.UPPER ? Items.AIR : this.getItem();
    }

    /**
     * Checks if this block can be placed exactly at the given position.
     */
    public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
    {
        if (pos.getY() >= worldIn.getHeight() - 1)
        {
            return false;
        }
        else
        {
            IBlockState state = worldIn.getBlockState(pos.down());
            return (state.isTopSolid() || state.getBlockFaceShape(worldIn, pos.down(), EnumFacing.UP) == BlockFaceShape.SOLID) && super.canPlaceBlockAt(worldIn, pos) && super.canPlaceBlockAt(worldIn, pos.up());
        }
    }

    public EnumPushReaction getMobilityFlag(IBlockState state)
    {
        return EnumPushReaction.DESTROY;
    }

    public static int combineMetadata(IBlockAccess worldIn, BlockPos pos)
    {
        IBlockState iblockstate = worldIn.getBlockState(pos);
        int i = iblockstate.getBlock().getMetaFromState(iblockstate);
        boolean flag = isTop(i);
        IBlockState iblockstate1 = worldIn.getBlockState(pos.down());
        int j = iblockstate1.getBlock().getMetaFromState(iblockstate1);
        int k = flag ? j : i;
        IBlockState iblockstate2 = worldIn.getBlockState(pos.up());
        int l = iblockstate2.getBlock().getMetaFromState(iblockstate2);
        int i1 = flag ? i : l;
        boolean flag1 = (i1 & 1) != 0;
        boolean flag2 = (i1 & 2) != 0;
        return removeHalfBit(k) | (flag ? 8 : 0) | (flag1 ? 16 : 0) | (flag2 ? 32 : 0);
    }

    public ItemStack getItem(World worldIn, BlockPos pos, IBlockState state)
    {
        return new ItemStack(this.getItem());
    }

    private Item getItem()
    {
    	
    	
        if (this == BlockInit.IRON_DOOR)
        {
            return Items.IRON_DOOR;
        }
        else if (this == BlockInit.SPRUCE_DOOR)
        {
            return Items.SPRUCE_DOOR;
        }
        else if (this == BlockInit.BIRCH_DOOR)
        {
            return Items.BIRCH_DOOR;
        }
        else if (this == BlockInit.JUNGLE_DOOR)
        {
            return Items.JUNGLE_DOOR;
        }
        else if (this == BlockInit.ACACIA_DOOR)
        {
            return Items.ACACIA_DOOR;
        }
        else
        {
            return this == BlockInit.DARK_OAK_DOOR ? Items.DARK_OAK_DOOR : Items.OAK_DOOR;
        }
    }

    /**
     * Called before the Block is set to air in the world. Called regardless of if the player's tool can actually
     * collect this block
     */
    public void onBlockHarvested(World worldIn, BlockPos pos, IBlockState state, EntityPlayer player)
    {
        BlockPos blockpos = pos.down();
        BlockPos blockpos1 = pos.up();

        if (player.capabilities.isCreativeMode && state.getValue(HALF) == TestDoor.EnumDoorHalf.UPPER && worldIn.getBlockState(blockpos).getBlock() == this)
        {
            worldIn.setBlockToAir(blockpos);
        }

        if (state.getValue(HALF) == TestDoor.EnumDoorHalf.LOWER && worldIn.getBlockState(blockpos1).getBlock() == this)
        {
            if (player.capabilities.isCreativeMode)
            {
                worldIn.setBlockToAir(pos);
            }

            worldIn.setBlockToAir(blockpos1);
        }
    }
    @Override
    @SideOnly(Side.CLIENT)
    public BlockRenderLayer getBlockLayer()
    {
        return BlockRenderLayer.TRANSLUCENT;
        
    }

    /**
     * Get the actual Block state of this Block at the given position. This applies properties not visible in the
     * metadata, such as fence connections.
     */
    public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos)
    {
        if (state.getValue(HALF) == TestDoor.EnumDoorHalf.LOWER)
        {
            IBlockState iblockstate = worldIn.getBlockState(pos.up());

            if (iblockstate.getBlock() == this)
            {
                state = state.withProperty(HINGE, iblockstate.getValue(HINGE)).withProperty(POWERED, iblockstate.getValue(POWERED));
            }
        }
        else
        {
            IBlockState iblockstate1 = worldIn.getBlockState(pos.down());

            if (iblockstate1.getBlock() == this)
            {
                state = state.withProperty(FACING, iblockstate1.getValue(FACING)).withProperty(OPEN, iblockstate1.getValue(OPEN));
            }
        }

        return state;
    }

    /**
     * Returns the blockstate with the given rotation from the passed blockstate. If inapplicable, returns the passed
     * blockstate.
     */
    public IBlockState withRotation(IBlockState state, Rotation rot)
    {
        return state.getValue(HALF) != TestDoor.EnumDoorHalf.LOWER ? state : state.withProperty(FACING, rot.rotate((EnumFacing)state.getValue(FACING)));
    }

    /**
     * Returns the blockstate with the given mirror of the passed blockstate. If inapplicable, returns the passed
     * blockstate.
     */
    public IBlockState withMirror(IBlockState state, Mirror mirrorIn)
    {
        return mirrorIn == Mirror.NONE ? state : state.withRotation(mirrorIn.toRotation((EnumFacing)state.getValue(FACING))).cycleProperty(HINGE);
    }

    /**
     * Convert the given metadata into a BlockState for this Block
     */
    public IBlockState getStateFromMeta(int meta)
    {
        return (meta & 8) > 0 ? this.getDefaultState().withProperty(HALF, TestDoor.EnumDoorHalf.UPPER).withProperty(HINGE, (meta & 1) > 0 ? TestDoor.EnumHingePosition.RIGHT : TestDoor.EnumHingePosition.LEFT).withProperty(POWERED, Boolean.valueOf((meta & 2) > 0)) : this.getDefaultState().withProperty(HALF, TestDoor.EnumDoorHalf.LOWER).withProperty(FACING, EnumFacing.getHorizontal(meta & 3).rotateYCCW()).withProperty(OPEN, Boolean.valueOf((meta & 4) > 0));
    }

    /**
     * Convert the BlockState into the correct metadata value
     */
    public int getMetaFromState(IBlockState state)
    {
        int i = 0;

        if (state.getValue(HALF) == TestDoor.EnumDoorHalf.UPPER)
        {
            i = i | 8;

            if (state.getValue(HINGE) == TestDoor.EnumHingePosition.RIGHT)
            {
                i |= 1;
            }

            if (((Boolean)state.getValue(POWERED)).booleanValue())
            {
                i |= 2;
            }
        }
        else
        {
            i = i | ((EnumFacing)state.getValue(FACING)).rotateY().getHorizontalIndex();

            if (((Boolean)state.getValue(OPEN)).booleanValue())
            {
                i |= 4;
            }
        }

        return i;
    }

    protected static int removeHalfBit(int meta)
    {
        return meta & 7;
    }

    public static boolean isOpen(IBlockAccess worldIn, BlockPos pos)
    {
        return isOpen(combineMetadata(worldIn, pos));
    }

    public static EnumFacing getFacing(IBlockAccess worldIn, BlockPos pos)
    {
        return getFacing(combineMetadata(worldIn, pos));
    }

    public static EnumFacing getFacing(int combinedMeta)
    {
        return EnumFacing.getHorizontal(combinedMeta & 3).rotateYCCW();
    }

    protected static boolean isOpen(int combinedMeta)
    {
        return (combinedMeta & 4) != 0;
    }

    protected static boolean isTop(int meta)
    {
        return (meta & 8) != 0;
    }

    protected BlockStateContainer createBlockState()
    {
        return new BlockStateContainer(this, new IProperty[] {HALF, FACING, OPEN, HINGE, POWERED});
    }

    /**
     * Get the geometry of the queried face at the given position and state. This is used to decide whether things like
     * buttons are allowed to be placed on the face, or how glass panes connect to the face, among other things.
     * <p>
     * Common values are {@code SOLID}, which is the default, and {@code UNDEFINED}, which represents something that
     * does not fit the other descriptions and will generally cause other things not to connect to the face.
     * 
     * @return an approximation of the form of the given face
     */
    public BlockFaceShape getBlockFaceShape(IBlockAccess worldIn, IBlockState state, BlockPos pos, EnumFacing face)
    {
        return BlockFaceShape.UNDEFINED;
    }

    public static enum EnumDoorHalf implements IStringSerializable
    {
        UPPER,
        LOWER;

        public String toString()
        {
            return this.getName();
        }

        public String getName()
        {
            return this == UPPER ? "upper" : "lower";
        }
    }

    public static enum EnumHingePosition implements IStringSerializable
    {
        LEFT,
        RIGHT;

        public String toString()
        {
            return this.getName();
        }

        public String getName()
        {
            return this == LEFT ? "left" : "right";
        }
    }
}

 

 

Because BlockDoor.java does some comparison with some of the information in Blocks.*class* and a comparison between BlockDoor and TestDoor was invalid, writing an Init for it seemed to fix that particular problem. 

 

package init;

import java.util.ArrayList;
import java.util.List;

import encom.grid.rezcraft.TestDoor;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;

public class BlockInit {

	public static final List<Block> Blocks = new ArrayList<Block>();
	
	//Vanilla Door Replacer
	public static final Block IRON_DOOR = new TestDoor(Material.IRON);
	public static final Block ACACIA_DOOR = new TestDoor(Material.WOOD);
	public static final Block SPRUCE_DOOR = new TestDoor(Material.WOOD);
	public static final Block JUNGLE_DOOR = new TestDoor(Material.WOOD);
	public static final Block BIRCH_DOOR = new TestDoor(Material.WOOD);
	public static final Block DARK_OAK_DOOR = new TestDoor(Material.WOOD);
}

 

All of these files seem to check out, however when I run the game, I get a really ugly error and doors show up as checkered rectangles. The error: [07:19:56] [Client thread/WARN] [FML]: Unable to set public static net.minecraft.block.BlockDoor net.minecraft.init.Blocks.ACACIA_DOOR with value Block{minecraft:acacia_door} (minecraft:acacia_door) is confusing. I don't know if that means that I *can't* load a value there or if I was just bad about telling it about it. 

 

[07:19:56] [Client thread/WARN] [FML]: Unable to set public static net.minecraft.block.BlockDoor net.minecraft.init.Blocks.ACACIA_DOOR with value Block{minecraft:acacia_door} (minecraft:acacia_door)
java.lang.reflect.InvocationTargetException: null
	at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source) ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_231]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_231]
	at net.minecraftforge.registries.ObjectHolderRef$FinalFieldHelper.setField(ObjectHolderRef.java:180) ~[ObjectHolderRef$FinalFieldHelper.class:?]
	at net.minecraftforge.registries.ObjectHolderRef.apply(ObjectHolderRef.java:146) [ObjectHolderRef.class:?]
	at net.minecraftforge.registries.ObjectHolderRegistry.applyObjectHolders(ObjectHolderRegistry.java:170) [ObjectHolderRegistry.class:?]
	at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:848) [GameData.class:?]
	at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:630) [Loader.class:?]
	at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:252) [FMLClientHandler.class:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:514) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:422) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_231]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_231]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_231]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_231]
	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_231]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_231]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_231]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_231]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:25) [start/:?]
Caused by: java.lang.IllegalArgumentException: Can not set static net.minecraft.block.BlockDoor field net.minecraft.init.Blocks.ACACIA_DOOR to encom.grid.rezcraft.TestDoor
	at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167) ~[?:1.8.0_231]
	at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171) ~[?:1.8.0_231]
	at sun.reflect.UnsafeStaticObjectFieldAccessorImpl.set(UnsafeStaticObjectFieldAccessorImpl.java:79) ~[?:1.8.0_231]
	... 24 more
[07:19:56] [Client thread/INFO] [FML]: Holder lookups applied
[07:19:56] [Client thread/INFO] [FML]: Applying holder lookups
[07:19:56] [Client thread/WARN] [FML]: Unable to set public static net.minecraft.block.BlockDoor net.minecraft.init.Blocks.ACACIA_DOOR with value Block{minecraft:acacia_door} (minecraft:acacia_door)
java.lang.reflect.InvocationTargetException: null
	at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source) ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_231]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_231]
	at net.minecraftforge.registries.ObjectHolderRef$FinalFieldHelper.setField(ObjectHolderRef.java:180) ~[ObjectHolderRef$FinalFieldHelper.class:?]
	at net.minecraftforge.registries.ObjectHolderRef.apply(ObjectHolderRef.java:146) [ObjectHolderRef.class:?]
	at net.minecraftforge.registries.ObjectHolderRegistry.applyObjectHolders(ObjectHolderRegistry.java:170) [ObjectHolderRegistry.class:?]
	at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:853) [GameData.class:?]
	at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:630) [Loader.class:?]
	at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:252) [FMLClientHandler.class:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:514) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:422) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_231]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_231]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_231]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_231]
	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_231]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_231]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_231]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_231]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:25) [start/:?]
Caused by: java.lang.IllegalArgumentException: Can not set static net.minecraft.block.BlockDoor field net.minecraft.init.Blocks.ACACIA_DOOR to encom.grid.rezcraft.TestDoor
	at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167) ~[?:1.8.0_231]
	at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171) ~[?:1.8.0_231]
	at sun.reflect.UnsafeStaticObjectFieldAccessorImpl.set(UnsafeStaticObjectFieldAccessorImpl.java:79) ~[?:1.8.0_231]
	... 24 more
[07:19:56] [Client thread/INFO] [FML]: Holder lookups applied
[07:19:56] [Client thread/INFO] [FML]: Applying holder lookups
[07:19:56] [Client thread/WARN] [FML]: Unable to set public static net.minecraft.block.BlockDoor net.minecraft.init.Blocks.ACACIA_DOOR with value Block{minecraft:acacia_door} (minecraft:acacia_door)
java.lang.reflect.InvocationTargetException: null
	at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source) ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_231]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_231]
	at net.minecraftforge.registries.ObjectHolderRef$FinalFieldHelper.setField(ObjectHolderRef.java:180) ~[ObjectHolderRef$FinalFieldHelper.class:?]
	at net.minecraftforge.registries.ObjectHolderRef.apply(ObjectHolderRef.java:146) [ObjectHolderRef.class:?]
	at net.minecraftforge.registries.ObjectHolderRegistry.applyObjectHolders(ObjectHolderRegistry.java:170) [ObjectHolderRegistry.class:?]
	at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:861) [GameData.class:?]
	at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:630) [Loader.class:?]
	at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:252) [FMLClientHandler.class:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:514) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:422) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_231]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_231]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_231]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_231]
	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_231]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_231]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_231]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_231]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:25) [start/:?]
Caused by: java.lang.IllegalArgumentException: Can not set static net.minecraft.block.BlockDoor field net.minecraft.init.Blocks.ACACIA_DOOR to encom.grid.rezcraft.TestDoor
	at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167) ~[?:1.8.0_231]
	at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171) ~[?:1.8.0_231]
	at sun.reflect.UnsafeStaticObjectFieldAccessorImpl.set(UnsafeStaticObjectFieldAccessorImpl.java:79) ~[?:1.8.0_231]
	... 24 more
[07:19:56] [Client thread/INFO] [FML]: Holder lookups applied
[07:19:56] [Client thread/INFO] [FML]: Applying holder lookups
[07:19:56] [Client thread/WARN] [FML]: Unable to set public static net.minecraft.block.BlockDoor net.minecraft.init.Blocks.ACACIA_DOOR with value Block{minecraft:acacia_door} (minecraft:acacia_door)
java.lang.reflect.InvocationTargetException: null
	at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source) ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_231]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_231]
	at net.minecraftforge.registries.ObjectHolderRef$FinalFieldHelper.setField(ObjectHolderRef.java:180) ~[ObjectHolderRef$FinalFieldHelper.class:?]
	at net.minecraftforge.registries.ObjectHolderRef.apply(ObjectHolderRef.java:146) [ObjectHolderRef.class:?]
	at net.minecraftforge.registries.ObjectHolderRegistry.applyObjectHolders(ObjectHolderRegistry.java:170) [ObjectHolderRegistry.class:?]
	at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:632) [Loader.class:?]
	at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:252) [FMLClientHandler.class:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:514) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:422) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_231]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_231]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_231]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_231]
	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_231]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_231]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_231]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_231]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:25) [start/:?]
Caused by: java.lang.IllegalArgumentException: Can not set static net.minecraft.block.BlockDoor field net.minecraft.init.Blocks.ACACIA_DOOR to encom.grid.rezcraft.TestDoor
	at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167) ~[?:1.8.0_231]
	at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171) ~[?:1.8.0_231]
	at sun.reflect.UnsafeStaticObjectFieldAccessorImpl.set(UnsafeStaticObjectFieldAccessorImpl.java:79) ~[?:1.8.0_231]
	... 23 more

 

Anyway, I just want some translucent doors. Would someone be able to kind of give me an idea if I'm doing the right thing or if I need to change something?

Edited by Eedelia01
Posted
13 hours ago, Eedelia01 said:

I'm 2 days in on revamping my 1.8 basemod to work as a 1.12.2 standalone mod and I am in so far over my head.

 

My basemod worked as a kind of total conversion mod which basically forced Minecraft to start handling transparency renderings on vanilla Ore blocks, doors, and some other items, so I could make them look like glass with a fancy texture. To be clear, I want the base game to let it's base models support transparencies.  That's all. 

 

Without a good way to get MCP working for 1.12.2, I decided to try and make a mod for this. It's been rough. My path has been to basically clone the .java of a given file, mod it enough so that it's essentially packaged like a custom block and then try to use an event handler to slip in my version of the vanilla block instead of its version during Registration. Is that the right way to do this? I have no idea.

 

I managed to clone BlockOre and package it as a TestOre.java and then use some of the code I found here to load it in.

 

Handler:


package encom.grid.rezcraft;

import encom.grid.rezcraft.TestOre;
import encom.grid.rezcraft.TestDoor;
import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

@Mod.EventBusSubscriber(modid = TestOre.MODID)

public final class EventSubscriber {
@SubscribeEvent
static void onBlockRegister(final RegistryEvent.Register<Block> event) {
	
    event.getRegistry().register(new TestOre().setHardness(3.0F).setResistance(5.0F).setUnlocalizedName("oreIron").setRegistryName(new ResourceLocation("minecraft", "iron_ore")));
    event.getRegistry().register(new TestOre().setHardness(3.0F).setResistance(5.0F).setUnlocalizedName("oreDiamond").setRegistryName(new ResourceLocation("minecraft", "diamond_ore")));
    event.getRegistry().register(new TestDoor(Material.WOOD).setHardness(3.0F).setUnlocalizedName("doorAcacia").setRegistryName(new ResourceLocation("minecraft", "acacia_door")));
  }
}

 

The ore part works great, the door not so much. Cloning the BlockDoor.java file has been quite an undertaking. 

 


package encom.grid.rezcraft;

import java.util.Random;

import init.BlockInit;
import net.minecraft.block.Block;
import net.minecraft.block.BlockHorizontal;
import net.minecraft.block.BlockPlanks;
import net.minecraft.block.material.EnumPushReaction;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.properties.PropertyDirection;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.BlockFaceShape;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.IStringSerializable;
import net.minecraft.util.Mirror;
import net.minecraft.util.Rotation;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.translation.I18n;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class TestDoor extends Block
{
    public static final PropertyDirection FACING = BlockHorizontal.FACING;
    public static final PropertyBool OPEN = PropertyBool.create("open");
    public static final PropertyEnum<TestDoor.EnumHingePosition> HINGE = PropertyEnum.<TestDoor.EnumHingePosition>create("hinge", TestDoor.EnumHingePosition.class);
    public static final PropertyBool POWERED = PropertyBool.create("powered");
    public static final PropertyEnum<TestDoor.EnumDoorHalf> HALF = PropertyEnum.<TestDoor.EnumDoorHalf>create("half", TestDoor.EnumDoorHalf.class);
    protected static final AxisAlignedBB SOUTH_AABB = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.1875D);
    protected static final AxisAlignedBB NORTH_AABB = new AxisAlignedBB(0.0D, 0.0D, 0.8125D, 1.0D, 1.0D, 1.0D);
    protected static final AxisAlignedBB WEST_AABB = new AxisAlignedBB(0.8125D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D);
    protected static final AxisAlignedBB EAST_AABB = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.1875D, 1.0D, 1.0D);

    public TestDoor(Material materialIn)
    {
        super(materialIn);
        this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(OPEN, Boolean.valueOf(false)).withProperty(HINGE, TestDoor.EnumHingePosition.LEFT).withProperty(POWERED, Boolean.valueOf(false)).withProperty(HALF, TestDoor.EnumDoorHalf.LOWER));
    }


	public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
    {
        state = state.getActualState(source, pos);
        EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);
        boolean flag = !((Boolean)state.getValue(OPEN)).booleanValue();
        boolean flag1 = state.getValue(HINGE) == TestDoor.EnumHingePosition.RIGHT;

        switch (enumfacing)
        {
            case EAST:
            default:
                return flag ? EAST_AABB : (flag1 ? NORTH_AABB : SOUTH_AABB);
            case SOUTH:
                return flag ? SOUTH_AABB : (flag1 ? EAST_AABB : WEST_AABB);
            case WEST:
                return flag ? WEST_AABB : (flag1 ? SOUTH_AABB : NORTH_AABB);
            case NORTH:
                return flag ? NORTH_AABB : (flag1 ? WEST_AABB : EAST_AABB);
        }
    }

    /**
     * Gets the localized name of this block. Used for the statistics page.
     */
    public String getLocalizedName()
    {
        return I18n.translateToLocal((this.getUnlocalizedName() + ".name").replaceAll("tile", "item"));
    }

    /**
     * Used to determine ambient occlusion and culling when rebuilding chunks for render
     */
    public boolean isOpaqueCube(IBlockState state)
    {
        return false;
    }

    /**
     * Determines if an entity can path through this block
     */
    public boolean isPassable(IBlockAccess worldIn, BlockPos pos)
    {
        return isOpen(combineMetadata(worldIn, pos));
    }

    public boolean isFullCube(IBlockState state)
    {
        return false;
    }

    private int getCloseSound()
    {
        return this.blockMaterial == Material.IRON ? 1011 : 1012;
    }

    private int getOpenSound()
    {
        return this.blockMaterial == Material.IRON ? 1005 : 1006;
    }

    /**
     * Get the MapColor for this Block and the given BlockState
     */
    public MapColor getMapColor(IBlockState state, IBlockAccess worldIn, BlockPos pos)
    {
        if (state.getBlock() == Blocks.IRON_DOOR)
        {
            return MapColor.IRON;
        }
        else if (state.getBlock() == Blocks.OAK_DOOR)
        {
            return BlockPlanks.EnumType.OAK.getMapColor();
        }
        else if (state.getBlock() == Blocks.SPRUCE_DOOR)
        {
            return BlockPlanks.EnumType.SPRUCE.getMapColor();
        }
        else if (state.getBlock() == Blocks.BIRCH_DOOR)
        {
            return BlockPlanks.EnumType.BIRCH.getMapColor();
        }
        else if (state.getBlock() == Blocks.JUNGLE_DOOR)
        {
            return BlockPlanks.EnumType.JUNGLE.getMapColor();
        }
        else if (state.getBlock() == Blocks.ACACIA_DOOR)
        {
            return BlockPlanks.EnumType.ACACIA.getMapColor();
        }
        else
        {
            return state.getBlock() == Blocks.DARK_OAK_DOOR ? BlockPlanks.EnumType.DARK_OAK.getMapColor() : super.getMapColor(state, worldIn, pos);
        }
    }

    /**
     * Called when the block is right clicked by a player.
     */
    public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
    {
        if (this.blockMaterial == Material.IRON)
        {
            return false;
        }
        else
        {
            BlockPos blockpos = state.getValue(HALF) == TestDoor.EnumDoorHalf.LOWER ? pos : pos.down();
            IBlockState iblockstate = pos.equals(blockpos) ? state : worldIn.getBlockState(blockpos);

            if (iblockstate.getBlock() != this)
            {
                return false;
            }
            else
            {
                state = iblockstate.cycleProperty(OPEN);
                worldIn.setBlockState(blockpos, state, 10);
                worldIn.markBlockRangeForRenderUpdate(blockpos, pos);
                worldIn.playEvent(playerIn, ((Boolean)state.getValue(OPEN)).booleanValue() ? this.getOpenSound() : this.getCloseSound(), pos, 0);
                return true;
            }
        }
    }

    public void toggleDoor(World worldIn, BlockPos pos, boolean open)
    {
        IBlockState iblockstate = worldIn.getBlockState(pos);

        if (iblockstate.getBlock() == this)
        {
            BlockPos blockpos = iblockstate.getValue(HALF) == TestDoor.EnumDoorHalf.LOWER ? pos : pos.down();
            IBlockState iblockstate1 = pos == blockpos ? iblockstate : worldIn.getBlockState(blockpos);

            if (iblockstate1.getBlock() == this && ((Boolean)iblockstate1.getValue(OPEN)).booleanValue() != open)
            {
                worldIn.setBlockState(blockpos, iblockstate1.withProperty(OPEN, Boolean.valueOf(open)), 10);
                worldIn.markBlockRangeForRenderUpdate(blockpos, pos);
                worldIn.playEvent((EntityPlayer)null, open ? this.getOpenSound() : this.getCloseSound(), pos, 0);
            }
        }
    }

    /**
     * Called when a neighboring block was changed and marks that this state should perform any checks during a neighbor
     * change. Cases may include when redstone power is updated, cactus blocks popping off due to a neighboring solid
     * block, etc.
     */
    public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos fromPos)
    {
        if (state.getValue(HALF) == TestDoor.EnumDoorHalf.UPPER)
        {
            BlockPos blockpos = pos.down();
            IBlockState iblockstate = worldIn.getBlockState(blockpos);

            if (iblockstate.getBlock() != this)
            {
                worldIn.setBlockToAir(pos);
            }
            else if (blockIn != this)
            {
                iblockstate.neighborChanged(worldIn, blockpos, blockIn, fromPos);
            }
        }
        else
        {
            boolean flag1 = false;
            BlockPos blockpos1 = pos.up();
            IBlockState iblockstate1 = worldIn.getBlockState(blockpos1);

            if (iblockstate1.getBlock() != this)
            {
                worldIn.setBlockToAir(pos);
                flag1 = true;
            }

            if (!worldIn.getBlockState(pos.down()).isSideSolid(worldIn,  pos.down(), EnumFacing.UP))
            {
                worldIn.setBlockToAir(pos);
                flag1 = true;

                if (iblockstate1.getBlock() == this)
                {
                    worldIn.setBlockToAir(blockpos1);
                }
            }

            if (flag1)
            {
                if (!worldIn.isRemote)
                {
                    this.dropBlockAsItem(worldIn, pos, state, 0);
                }
            }
            else
            {
                boolean flag = worldIn.isBlockPowered(pos) || worldIn.isBlockPowered(blockpos1);

                if (blockIn != this && (flag || blockIn.getDefaultState().canProvidePower()) && flag != ((Boolean)iblockstate1.getValue(POWERED)).booleanValue())
                {
                    worldIn.setBlockState(blockpos1, iblockstate1.withProperty(POWERED, Boolean.valueOf(flag)), 2);

                    if (flag != ((Boolean)state.getValue(OPEN)).booleanValue())
                    {
                        worldIn.setBlockState(pos, state.withProperty(OPEN, Boolean.valueOf(flag)), 2);
                        worldIn.markBlockRangeForRenderUpdate(pos, pos);
                        worldIn.playEvent((EntityPlayer)null, flag ? this.getOpenSound() : this.getCloseSound(), pos, 0);
                    }
                }
            }
        }
    }

    /**
     * Get the Item that this Block should drop when harvested.
     */
    public Item getItemDropped(IBlockState state, Random rand, int fortune)
    {
        return state.getValue(HALF) == TestDoor.EnumDoorHalf.UPPER ? Items.AIR : this.getItem();
    }

    /**
     * Checks if this block can be placed exactly at the given position.
     */
    public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
    {
        if (pos.getY() >= worldIn.getHeight() - 1)
        {
            return false;
        }
        else
        {
            IBlockState state = worldIn.getBlockState(pos.down());
            return (state.isTopSolid() || state.getBlockFaceShape(worldIn, pos.down(), EnumFacing.UP) == BlockFaceShape.SOLID) && super.canPlaceBlockAt(worldIn, pos) && super.canPlaceBlockAt(worldIn, pos.up());
        }
    }

    public EnumPushReaction getMobilityFlag(IBlockState state)
    {
        return EnumPushReaction.DESTROY;
    }

    public static int combineMetadata(IBlockAccess worldIn, BlockPos pos)
    {
        IBlockState iblockstate = worldIn.getBlockState(pos);
        int i = iblockstate.getBlock().getMetaFromState(iblockstate);
        boolean flag = isTop(i);
        IBlockState iblockstate1 = worldIn.getBlockState(pos.down());
        int j = iblockstate1.getBlock().getMetaFromState(iblockstate1);
        int k = flag ? j : i;
        IBlockState iblockstate2 = worldIn.getBlockState(pos.up());
        int l = iblockstate2.getBlock().getMetaFromState(iblockstate2);
        int i1 = flag ? i : l;
        boolean flag1 = (i1 & 1) != 0;
        boolean flag2 = (i1 & 2) != 0;
        return removeHalfBit(k) | (flag ? 8 : 0) | (flag1 ? 16 : 0) | (flag2 ? 32 : 0);
    }

    public ItemStack getItem(World worldIn, BlockPos pos, IBlockState state)
    {
        return new ItemStack(this.getItem());
    }

    private Item getItem()
    {
    	
    	
        if (this == BlockInit.IRON_DOOR)
        {
            return Items.IRON_DOOR;
        }
        else if (this == BlockInit.SPRUCE_DOOR)
        {
            return Items.SPRUCE_DOOR;
        }
        else if (this == BlockInit.BIRCH_DOOR)
        {
            return Items.BIRCH_DOOR;
        }
        else if (this == BlockInit.JUNGLE_DOOR)
        {
            return Items.JUNGLE_DOOR;
        }
        else if (this == BlockInit.ACACIA_DOOR)
        {
            return Items.ACACIA_DOOR;
        }
        else
        {
            return this == BlockInit.DARK_OAK_DOOR ? Items.DARK_OAK_DOOR : Items.OAK_DOOR;
        }
    }

    /**
     * Called before the Block is set to air in the world. Called regardless of if the player's tool can actually
     * collect this block
     */
    public void onBlockHarvested(World worldIn, BlockPos pos, IBlockState state, EntityPlayer player)
    {
        BlockPos blockpos = pos.down();
        BlockPos blockpos1 = pos.up();

        if (player.capabilities.isCreativeMode && state.getValue(HALF) == TestDoor.EnumDoorHalf.UPPER && worldIn.getBlockState(blockpos).getBlock() == this)
        {
            worldIn.setBlockToAir(blockpos);
        }

        if (state.getValue(HALF) == TestDoor.EnumDoorHalf.LOWER && worldIn.getBlockState(blockpos1).getBlock() == this)
        {
            if (player.capabilities.isCreativeMode)
            {
                worldIn.setBlockToAir(pos);
            }

            worldIn.setBlockToAir(blockpos1);
        }
    }
    @Override
    @SideOnly(Side.CLIENT)
    public BlockRenderLayer getBlockLayer()
    {
        return BlockRenderLayer.TRANSLUCENT;
        
    }

    /**
     * Get the actual Block state of this Block at the given position. This applies properties not visible in the
     * metadata, such as fence connections.
     */
    public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos)
    {
        if (state.getValue(HALF) == TestDoor.EnumDoorHalf.LOWER)
        {
            IBlockState iblockstate = worldIn.getBlockState(pos.up());

            if (iblockstate.getBlock() == this)
            {
                state = state.withProperty(HINGE, iblockstate.getValue(HINGE)).withProperty(POWERED, iblockstate.getValue(POWERED));
            }
        }
        else
        {
            IBlockState iblockstate1 = worldIn.getBlockState(pos.down());

            if (iblockstate1.getBlock() == this)
            {
                state = state.withProperty(FACING, iblockstate1.getValue(FACING)).withProperty(OPEN, iblockstate1.getValue(OPEN));
            }
        }

        return state;
    }

    /**
     * Returns the blockstate with the given rotation from the passed blockstate. If inapplicable, returns the passed
     * blockstate.
     */
    public IBlockState withRotation(IBlockState state, Rotation rot)
    {
        return state.getValue(HALF) != TestDoor.EnumDoorHalf.LOWER ? state : state.withProperty(FACING, rot.rotate((EnumFacing)state.getValue(FACING)));
    }

    /**
     * Returns the blockstate with the given mirror of the passed blockstate. If inapplicable, returns the passed
     * blockstate.
     */
    public IBlockState withMirror(IBlockState state, Mirror mirrorIn)
    {
        return mirrorIn == Mirror.NONE ? state : state.withRotation(mirrorIn.toRotation((EnumFacing)state.getValue(FACING))).cycleProperty(HINGE);
    }

    /**
     * Convert the given metadata into a BlockState for this Block
     */
    public IBlockState getStateFromMeta(int meta)
    {
        return (meta & 8) > 0 ? this.getDefaultState().withProperty(HALF, TestDoor.EnumDoorHalf.UPPER).withProperty(HINGE, (meta & 1) > 0 ? TestDoor.EnumHingePosition.RIGHT : TestDoor.EnumHingePosition.LEFT).withProperty(POWERED, Boolean.valueOf((meta & 2) > 0)) : this.getDefaultState().withProperty(HALF, TestDoor.EnumDoorHalf.LOWER).withProperty(FACING, EnumFacing.getHorizontal(meta & 3).rotateYCCW()).withProperty(OPEN, Boolean.valueOf((meta & 4) > 0));
    }

    /**
     * Convert the BlockState into the correct metadata value
     */
    public int getMetaFromState(IBlockState state)
    {
        int i = 0;

        if (state.getValue(HALF) == TestDoor.EnumDoorHalf.UPPER)
        {
            i = i | 8;

            if (state.getValue(HINGE) == TestDoor.EnumHingePosition.RIGHT)
            {
                i |= 1;
            }

            if (((Boolean)state.getValue(POWERED)).booleanValue())
            {
                i |= 2;
            }
        }
        else
        {
            i = i | ((EnumFacing)state.getValue(FACING)).rotateY().getHorizontalIndex();

            if (((Boolean)state.getValue(OPEN)).booleanValue())
            {
                i |= 4;
            }
        }

        return i;
    }

    protected static int removeHalfBit(int meta)
    {
        return meta & 7;
    }

    public static boolean isOpen(IBlockAccess worldIn, BlockPos pos)
    {
        return isOpen(combineMetadata(worldIn, pos));
    }

    public static EnumFacing getFacing(IBlockAccess worldIn, BlockPos pos)
    {
        return getFacing(combineMetadata(worldIn, pos));
    }

    public static EnumFacing getFacing(int combinedMeta)
    {
        return EnumFacing.getHorizontal(combinedMeta & 3).rotateYCCW();
    }

    protected static boolean isOpen(int combinedMeta)
    {
        return (combinedMeta & 4) != 0;
    }

    protected static boolean isTop(int meta)
    {
        return (meta & 8) != 0;
    }

    protected BlockStateContainer createBlockState()
    {
        return new BlockStateContainer(this, new IProperty[] {HALF, FACING, OPEN, HINGE, POWERED});
    }

    /**
     * Get the geometry of the queried face at the given position and state. This is used to decide whether things like
     * buttons are allowed to be placed on the face, or how glass panes connect to the face, among other things.
     * <p>
     * Common values are {@code SOLID}, which is the default, and {@code UNDEFINED}, which represents something that
     * does not fit the other descriptions and will generally cause other things not to connect to the face.
     * 
     * @return an approximation of the form of the given face
     */
    public BlockFaceShape getBlockFaceShape(IBlockAccess worldIn, IBlockState state, BlockPos pos, EnumFacing face)
    {
        return BlockFaceShape.UNDEFINED;
    }

    public static enum EnumDoorHalf implements IStringSerializable
    {
        UPPER,
        LOWER;

        public String toString()
        {
            return this.getName();
        }

        public String getName()
        {
            return this == UPPER ? "upper" : "lower";
        }
    }

    public static enum EnumHingePosition implements IStringSerializable
    {
        LEFT,
        RIGHT;

        public String toString()
        {
            return this.getName();
        }

        public String getName()
        {
            return this == LEFT ? "left" : "right";
        }
    }
}

 

 

Because BlockDoor.java does some comparison with some of the information in Blocks.*class* and a comparison between BlockDoor and TestDoor was invalid, writing an Init for it seemed to fix that particular problem. 

 


package init;

import java.util.ArrayList;
import java.util.List;

import encom.grid.rezcraft.TestDoor;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;

public class BlockInit {

	public static final List<Block> Blocks = new ArrayList<Block>();
	
	//Vanilla Door Replacer
	public static final Block IRON_DOOR = new TestDoor(Material.IRON);
	public static final Block ACACIA_DOOR = new TestDoor(Material.WOOD);
	public static final Block SPRUCE_DOOR = new TestDoor(Material.WOOD);
	public static final Block JUNGLE_DOOR = new TestDoor(Material.WOOD);
	public static final Block BIRCH_DOOR = new TestDoor(Material.WOOD);
	public static final Block DARK_OAK_DOOR = new TestDoor(Material.WOOD);
}

 

All of these files seem to check out, however when I run the game, I get a really ugly error and doors show up as checkered rectangles. The error: [07:19:56] [Client thread/WARN] [FML]: Unable to set public static net.minecraft.block.BlockDoor net.minecraft.init.Blocks.ACACIA_DOOR with value Block{minecraft:acacia_door} (minecraft:acacia_door) is confusing. I don't know if that means that I *can't* load a value there or if I was just bad about telling it about it. 

 


[07:19:56] [Client thread/WARN] [FML]: Unable to set public static net.minecraft.block.BlockDoor net.minecraft.init.Blocks.ACACIA_DOOR with value Block{minecraft:acacia_door} (minecraft:acacia_door)
java.lang.reflect.InvocationTargetException: null
	at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source) ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_231]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_231]
	at net.minecraftforge.registries.ObjectHolderRef$FinalFieldHelper.setField(ObjectHolderRef.java:180) ~[ObjectHolderRef$FinalFieldHelper.class:?]
	at net.minecraftforge.registries.ObjectHolderRef.apply(ObjectHolderRef.java:146) [ObjectHolderRef.class:?]
	at net.minecraftforge.registries.ObjectHolderRegistry.applyObjectHolders(ObjectHolderRegistry.java:170) [ObjectHolderRegistry.class:?]
	at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:848) [GameData.class:?]
	at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:630) [Loader.class:?]
	at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:252) [FMLClientHandler.class:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:514) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:422) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_231]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_231]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_231]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_231]
	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_231]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_231]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_231]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_231]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:25) [start/:?]
Caused by: java.lang.IllegalArgumentException: Can not set static net.minecraft.block.BlockDoor field net.minecraft.init.Blocks.ACACIA_DOOR to encom.grid.rezcraft.TestDoor
	at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167) ~[?:1.8.0_231]
	at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171) ~[?:1.8.0_231]
	at sun.reflect.UnsafeStaticObjectFieldAccessorImpl.set(UnsafeStaticObjectFieldAccessorImpl.java:79) ~[?:1.8.0_231]
	... 24 more
[07:19:56] [Client thread/INFO] [FML]: Holder lookups applied
[07:19:56] [Client thread/INFO] [FML]: Applying holder lookups
[07:19:56] [Client thread/WARN] [FML]: Unable to set public static net.minecraft.block.BlockDoor net.minecraft.init.Blocks.ACACIA_DOOR with value Block{minecraft:acacia_door} (minecraft:acacia_door)
java.lang.reflect.InvocationTargetException: null
	at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source) ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_231]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_231]
	at net.minecraftforge.registries.ObjectHolderRef$FinalFieldHelper.setField(ObjectHolderRef.java:180) ~[ObjectHolderRef$FinalFieldHelper.class:?]
	at net.minecraftforge.registries.ObjectHolderRef.apply(ObjectHolderRef.java:146) [ObjectHolderRef.class:?]
	at net.minecraftforge.registries.ObjectHolderRegistry.applyObjectHolders(ObjectHolderRegistry.java:170) [ObjectHolderRegistry.class:?]
	at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:853) [GameData.class:?]
	at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:630) [Loader.class:?]
	at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:252) [FMLClientHandler.class:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:514) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:422) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_231]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_231]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_231]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_231]
	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_231]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_231]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_231]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_231]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:25) [start/:?]
Caused by: java.lang.IllegalArgumentException: Can not set static net.minecraft.block.BlockDoor field net.minecraft.init.Blocks.ACACIA_DOOR to encom.grid.rezcraft.TestDoor
	at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167) ~[?:1.8.0_231]
	at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171) ~[?:1.8.0_231]
	at sun.reflect.UnsafeStaticObjectFieldAccessorImpl.set(UnsafeStaticObjectFieldAccessorImpl.java:79) ~[?:1.8.0_231]
	... 24 more
[07:19:56] [Client thread/INFO] [FML]: Holder lookups applied
[07:19:56] [Client thread/INFO] [FML]: Applying holder lookups
[07:19:56] [Client thread/WARN] [FML]: Unable to set public static net.minecraft.block.BlockDoor net.minecraft.init.Blocks.ACACIA_DOOR with value Block{minecraft:acacia_door} (minecraft:acacia_door)
java.lang.reflect.InvocationTargetException: null
	at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source) ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_231]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_231]
	at net.minecraftforge.registries.ObjectHolderRef$FinalFieldHelper.setField(ObjectHolderRef.java:180) ~[ObjectHolderRef$FinalFieldHelper.class:?]
	at net.minecraftforge.registries.ObjectHolderRef.apply(ObjectHolderRef.java:146) [ObjectHolderRef.class:?]
	at net.minecraftforge.registries.ObjectHolderRegistry.applyObjectHolders(ObjectHolderRegistry.java:170) [ObjectHolderRegistry.class:?]
	at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:861) [GameData.class:?]
	at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:630) [Loader.class:?]
	at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:252) [FMLClientHandler.class:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:514) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:422) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_231]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_231]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_231]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_231]
	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_231]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_231]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_231]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_231]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:25) [start/:?]
Caused by: java.lang.IllegalArgumentException: Can not set static net.minecraft.block.BlockDoor field net.minecraft.init.Blocks.ACACIA_DOOR to encom.grid.rezcraft.TestDoor
	at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167) ~[?:1.8.0_231]
	at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171) ~[?:1.8.0_231]
	at sun.reflect.UnsafeStaticObjectFieldAccessorImpl.set(UnsafeStaticObjectFieldAccessorImpl.java:79) ~[?:1.8.0_231]
	... 24 more
[07:19:56] [Client thread/INFO] [FML]: Holder lookups applied
[07:19:56] [Client thread/INFO] [FML]: Applying holder lookups
[07:19:56] [Client thread/WARN] [FML]: Unable to set public static net.minecraft.block.BlockDoor net.minecraft.init.Blocks.ACACIA_DOOR with value Block{minecraft:acacia_door} (minecraft:acacia_door)
java.lang.reflect.InvocationTargetException: null
	at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source) ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_231]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_231]
	at net.minecraftforge.registries.ObjectHolderRef$FinalFieldHelper.setField(ObjectHolderRef.java:180) ~[ObjectHolderRef$FinalFieldHelper.class:?]
	at net.minecraftforge.registries.ObjectHolderRef.apply(ObjectHolderRef.java:146) [ObjectHolderRef.class:?]
	at net.minecraftforge.registries.ObjectHolderRegistry.applyObjectHolders(ObjectHolderRegistry.java:170) [ObjectHolderRegistry.class:?]
	at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:632) [Loader.class:?]
	at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:252) [FMLClientHandler.class:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:514) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:422) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_231]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_231]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_231]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_231]
	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_231]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_231]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_231]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_231]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:25) [start/:?]
Caused by: java.lang.IllegalArgumentException: Can not set static net.minecraft.block.BlockDoor field net.minecraft.init.Blocks.ACACIA_DOOR to encom.grid.rezcraft.TestDoor
	at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167) ~[?:1.8.0_231]
	at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171) ~[?:1.8.0_231]
	at sun.reflect.UnsafeStaticObjectFieldAccessorImpl.set(UnsafeStaticObjectFieldAccessorImpl.java:79) ~[?:1.8.0_231]
	... 23 more

 

Anyway, I just want some translucent doors. Would someone be able to kind of give me an idea if I'm doing the right thing or if I need to change something?

 

Posted

Caused by: java.lang.IllegalArgumentException: Can not set static net.minecraft.block.BlockDoor field net.minecraft.init.Blocks.ACACIA_DOOR to encom.grid.rezcraft.TestDoor

 

This is definitely my root cause now. The problem is I'm not sure if this means that I've malformed my setRegistry command or if it's just telling me that I can't do this. 

Posted
24 minutes ago, Eedelia01 said:

Can not set static net.minecraft.block.BlockDoor field net.minecraft.init.Blocks.ACACIA_DOOR to encom.grid.rezcraft.TestDoor

Your TestDoor does not extend BlockDoor but you declare your field as though you expect it to.

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Posted (edited)

So I hear what you're saying, so after tinkering with it all day I decided to blow it away, copy BlockDoor and modify it only so that classes and methods referred to it as TestDoor. now this causes problems because in the middle of BlockDoor it wants to run some comparisons between this = this.Blocks.ACACIA_DOOR, etc, to determine what item to drop.The comparison fails because TestDoor and BlockDoor can't be compared, as ACACIA_DOOR is defined as type BlockDoor in Blocks.java. I've been working on a way to add this functionality via my own BlocksInit second, but for the time being I just commented those 3 sections of code out. I wanted to see if it would render them or throw compile errors if it was just up to a watered down TestDoor and an EventSubscriber as listed above. 

 

Essentially, it threw the same error. I think this error is basically saying listen, you can't take TestDoor and stick it into Blocks.ACACIA_DOOR. I'm guessing it wants to see a type BlockDoor for this. I make a TestDoor that's an actual extension of BlockDoor add in a Initializer, I'll get no build errors, but the same result. Purple Checkered Doors. I read on a troubleshooting guide that this can be caused by: 

 

  1. Your Block registration is not being called (must be called during preInitialisation)
  2. You have passed the wrong block to registerBlock, or the block instance is null.
  3. You haven't set the appropriate creative tab in your Block

    I've made sure all the setCreativeTab stuff works, that part is fine. If I make TestDoor an extension of BlockDoor and code accordingly, it seems to register the block but doesn't render correctly. If I make TestDoor an extention of door, it looks like it considers that the wrong type of block for the field and won't let me overwrite the vanilla one.  

 

I'm still not sure if I should or shot not be extending but I imagine it's way more mod/user friendly if I did. I've tried following some guides on how to do custom doors online with the goal of perhaps creating a "custom" door that is basically like the vanilla one and then overloading the vanilla one with it but this method doesn't seem to be working. The upswing is I now know doors in vanilla are instantiated and created, but I'm stuck for the time being on figuring it out any further.

image.png

Edited by Eedelia01
Posted

/me does not see updated code or an updated error message

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted (edited)

Apologies for not posting code, I've been learning a lot about how the Forge works and I've been changing a lot of things as I go. I think I have it to the point where it is trying to register my block in the right place in the right way, but it is complaining now that it isn't able to complete initializing it because apparently it believes the BlockStateContainer is Air? Even though I've looked through all that to make sure all my "this" statements is good. I'm wondering if I just haven't wrapped my head in which the order of this replacement happens and it may be possible that doing when it goes to register my item over BloockDoor.

 

 

 

BlockInit (sans all the other types of doors for simplicity)

package encom.grid.rezcraft;

import java.util.ArrayList;
import java.util.List;

import net.minecraft.block.Block;
import net.minecraft.block.BlockDoor;
import net.minecraft.block.material.Material;

public class BlockInit {

	public static final List<Block> BLOCKS = new ArrayList<Block>();
	
	//Vanilla Door Replacer

	public static final BlockDoor ACACIA_DOOR = new TestDoor("acacia_door", Material.WOOD);
}

 

TestDoor

package encom.grid.rezcraft;

import java.util.Random;

import net.minecraft.block.Block;
import net.minecraft.block.BlockDoor;
import net.minecraft.block.BlockHorizontal;
import net.minecraft.block.BlockPlanks;
import net.minecraft.block.material.EnumPushReaction;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.properties.PropertyDirection;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.BlockFaceShape;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.IStringSerializable;
import net.minecraft.util.Mirror;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.Rotation;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.translation.I18n;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class TestDoor extends BlockDoor
{
    public static final PropertyDirection FACING = BlockHorizontal.FACING;
    public static final PropertyBool OPEN = PropertyBool.create("open");
    public static final PropertyEnum<TestDoor.EnumHingePosition> HINGE = PropertyEnum.<TestDoor.EnumHingePosition>create("hinge", TestDoor.EnumHingePosition.class);
    public static final PropertyBool POWERED = PropertyBool.create("powered");
    public static final PropertyEnum<TestDoor.EnumDoorHalf> HALF = PropertyEnum.<TestDoor.EnumDoorHalf>create("half", TestDoor.EnumDoorHalf.class);
    protected static final AxisAlignedBB SOUTH_AABB = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.1875D);
    protected static final AxisAlignedBB NORTH_AABB = new AxisAlignedBB(0.0D, 0.0D, 0.8125D, 1.0D, 1.0D, 1.0D);
    protected static final AxisAlignedBB WEST_AABB = new AxisAlignedBB(0.8125D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D);
    protected static final AxisAlignedBB EAST_AABB = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.1875D, 1.0D, 1.0D);

    public TestDoor(String name, Material materialIn)
    {
        super(materialIn);
        
        BlockInit.BLOCKS.add(this);
        setUnlocalizedName(name);
        setHardness(3.0F);
		setRegistryName((new ResourceLocation("minecraft", "acacia_door")));
        this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(OPEN, Boolean.valueOf(false)).withProperty(HINGE, TestDoor.EnumHingePosition.LEFT).withProperty(POWERED, Boolean.valueOf(false)).withProperty(HALF, TestDoor.EnumDoorHalf.LOWER));
    
    
    }


	public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
    {
        state = state.getActualState(source, pos);
        EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);
        boolean flag = !((Boolean)state.getValue(OPEN)).booleanValue();
        boolean flag1 = state.getValue(HINGE) == TestDoor.EnumHingePosition.RIGHT;

        switch (enumfacing)
        {
            case EAST:
            default:
                return flag ? EAST_AABB : (flag1 ? NORTH_AABB : SOUTH_AABB);
            case SOUTH:
                return flag ? SOUTH_AABB : (flag1 ? EAST_AABB : WEST_AABB);
            case WEST:
                return flag ? WEST_AABB : (flag1 ? SOUTH_AABB : NORTH_AABB);
            case NORTH:
                return flag ? NORTH_AABB : (flag1 ? WEST_AABB : EAST_AABB);
        }
    }

    /**
     * Gets the localized name of this block. Used for the statistics page.
     */
    public String getLocalizedName()
    {
        return I18n.translateToLocal((this.getUnlocalizedName() + ".name").replaceAll("tile", "item"));
    }

    /**
     * Used to determine ambient occlusion and culling when rebuilding chunks for render
     */
    public boolean isOpaqueCube(IBlockState state)
    {
        return false;
    }

    /**
     * Determines if an entity can path through this block
     */
    public boolean isPassable(IBlockAccess worldIn, BlockPos pos)
    {
        return isOpen(combineMetadata(worldIn, pos));
    }

    public boolean isFullCube(IBlockState state)
    {
        return false;
    }

    private int getCloseSound()
    {
        return this.blockMaterial == Material.IRON ? 1011 : 1012;
    }

    private int getOpenSound()
    {
        return this.blockMaterial == Material.IRON ? 1005 : 1006;
    }

    /**
     * Get the MapColor for this Block and the given BlockState
     */
    public MapColor getMapColor(IBlockState state, IBlockAccess worldIn, BlockPos pos)
    {
        if (state.getBlock() == Blocks.IRON_DOOR)
        {
            return MapColor.IRON;
        }
        else if (state.getBlock() == Blocks.OAK_DOOR)
        {
            return BlockPlanks.EnumType.OAK.getMapColor();
        }
        else if (state.getBlock() == Blocks.SPRUCE_DOOR)
        {
            return BlockPlanks.EnumType.SPRUCE.getMapColor();
        }
        else if (state.getBlock() == Blocks.BIRCH_DOOR)
        {
            return BlockPlanks.EnumType.BIRCH.getMapColor();
        }
        else if (state.getBlock() == Blocks.JUNGLE_DOOR)
        {
            return BlockPlanks.EnumType.JUNGLE.getMapColor();
        }
        else if (state.getBlock() == Blocks.ACACIA_DOOR)
        {
            return BlockPlanks.EnumType.ACACIA.getMapColor();
        }
        else
        {
            return state.getBlock() == Blocks.DARK_OAK_DOOR ? BlockPlanks.EnumType.DARK_OAK.getMapColor() : super.getMapColor(state, worldIn, pos);
        }
    }

    /**
     * Called when the block is right clicked by a player.
     */
    public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
    {
        if (this.blockMaterial == Material.IRON)
        {
            return false;
        }
        else
        {
            BlockPos blockpos = state.getValue(HALF) == TestDoor.EnumDoorHalf.LOWER ? pos : pos.down();
            IBlockState iblockstate = pos.equals(blockpos) ? state : worldIn.getBlockState(blockpos);

            if (iblockstate.getBlock() != this)
            {
                return false;
            }
            else
            {
                state = iblockstate.cycleProperty(OPEN);
                worldIn.setBlockState(blockpos, state, 10);
                worldIn.markBlockRangeForRenderUpdate(blockpos, pos);
                worldIn.playEvent(playerIn, ((Boolean)state.getValue(OPEN)).booleanValue() ? this.getOpenSound() : this.getCloseSound(), pos, 0);
                return true;
            }
        }
    }

    public void toggleDoor(World worldIn, BlockPos pos, boolean open)
    {
        IBlockState iblockstate = worldIn.getBlockState(pos);

        if (iblockstate.getBlock() == this)
        {
            BlockPos blockpos = iblockstate.getValue(HALF) == TestDoor.EnumDoorHalf.LOWER ? pos : pos.down();
            IBlockState iblockstate1 = pos == blockpos ? iblockstate : worldIn.getBlockState(blockpos);

            if (iblockstate1.getBlock() == this && ((Boolean)iblockstate1.getValue(OPEN)).booleanValue() != open)
            {
                worldIn.setBlockState(blockpos, iblockstate1.withProperty(OPEN, Boolean.valueOf(open)), 10);
                worldIn.markBlockRangeForRenderUpdate(blockpos, pos);
                worldIn.playEvent((EntityPlayer)null, open ? this.getOpenSound() : this.getCloseSound(), pos, 0);
            }
        }
    }

    /**
     * Called when a neighboring block was changed and marks that this state should perform any checks during a neighbor
     * change. Cases may include when redstone power is updated, cactus blocks popping off due to a neighboring solid
     * block, etc.
     */
    public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos fromPos)
    {
        if (state.getValue(HALF) == TestDoor.EnumDoorHalf.UPPER)
        {
            BlockPos blockpos = pos.down();
            IBlockState iblockstate = worldIn.getBlockState(blockpos);

            if (iblockstate.getBlock() != this)
            {
                worldIn.setBlockToAir(pos);
            }
            else if (blockIn != this)
            {
                iblockstate.neighborChanged(worldIn, blockpos, blockIn, fromPos);
            }
        }
        else
        {
            boolean flag1 = false;
            BlockPos blockpos1 = pos.up();
            IBlockState iblockstate1 = worldIn.getBlockState(blockpos1);

            if (iblockstate1.getBlock() != this)
            {
                worldIn.setBlockToAir(pos);
                flag1 = true;
            }

            if (!worldIn.getBlockState(pos.down()).isSideSolid(worldIn,  pos.down(), EnumFacing.UP))
            {
                worldIn.setBlockToAir(pos);
                flag1 = true;

                if (iblockstate1.getBlock() == this)
                {
                    worldIn.setBlockToAir(blockpos1);
                }
            }

            if (flag1)
            {
                if (!worldIn.isRemote)
                {
                    this.dropBlockAsItem(worldIn, pos, state, 0);
                }
            }
            else
            {
                boolean flag = worldIn.isBlockPowered(pos) || worldIn.isBlockPowered(blockpos1);

                if (blockIn != this && (flag || blockIn.getDefaultState().canProvidePower()) && flag != ((Boolean)iblockstate1.getValue(POWERED)).booleanValue())
                {
                    worldIn.setBlockState(blockpos1, iblockstate1.withProperty(POWERED, Boolean.valueOf(flag)), 2);

                    if (flag != ((Boolean)state.getValue(OPEN)).booleanValue())
                    {
                        worldIn.setBlockState(pos, state.withProperty(OPEN, Boolean.valueOf(flag)), 2);
                        worldIn.markBlockRangeForRenderUpdate(pos, pos);
                        worldIn.playEvent((EntityPlayer)null, flag ? this.getOpenSound() : this.getCloseSound(), pos, 0);
                    }
                }
            }
        }
    }

    /**
     * Get the Item that this Block should drop when harvested.
     */
 //   public Item getItemDropped(IBlockState state, Random rand, int fortune)
//    {
//        return state.getValue(HALF) == TestDoor.EnumDoorHalf.UPPER ? Items.AIR : this.getItem();
 //   }

    /**
     * Checks if this block can be placed exactly at the given position.
     */
    public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
    {
        if (pos.getY() >= worldIn.getHeight() - 1)
        {
            return false;
        }
        else
        {
            IBlockState state = worldIn.getBlockState(pos.down());
            return (state.isTopSolid() || state.getBlockFaceShape(worldIn, pos.down(), EnumFacing.UP) == BlockFaceShape.SOLID) && super.canPlaceBlockAt(worldIn, pos) && super.canPlaceBlockAt(worldIn, pos.up());
        }
    }

    public EnumPushReaction getMobilityFlag(IBlockState state)
    {
        return EnumPushReaction.DESTROY;
    }

    public static int combineMetadata(IBlockAccess worldIn, BlockPos pos)
    {
        IBlockState iblockstate = worldIn.getBlockState(pos);
        int i = iblockstate.getBlock().getMetaFromState(iblockstate);
        boolean flag = isTop(i);
        IBlockState iblockstate1 = worldIn.getBlockState(pos.down());
        int j = iblockstate1.getBlock().getMetaFromState(iblockstate1);
        int k = flag ? j : i;
        IBlockState iblockstate2 = worldIn.getBlockState(pos.up());
        int l = iblockstate2.getBlock().getMetaFromState(iblockstate2);
        int i1 = flag ? i : l;
        boolean flag1 = (i1 & 1) != 0;
        boolean flag2 = (i1 & 2) != 0;
        return removeHalfBit(k) | (flag ? 8 : 0) | (flag1 ? 16 : 0) | (flag2 ? 32 : 0);
    }

 public ItemStack getItem(World worldIn, BlockPos pos, IBlockState state)
{
        return new ItemStack(this.getItem());
    }

    private Item getItem()
    {
        if (this == Blocks.IRON_DOOR)
      {
            return Items.IRON_DOOR;
        }
      else if (this == Blocks.SPRUCE_DOOR)
       {
          return Items.SPRUCE_DOOR;
       }
       else if (this == Blocks.BIRCH_DOOR)
      {
          return Items.BIRCH_DOOR;
      }
        else if (this == Blocks.JUNGLE_DOOR)
       {
           return Items.JUNGLE_DOOR;
       }
       else if (this == Blocks.ACACIA_DOOR)
       {
            return Items.ACACIA_DOOR;
       }
       else
        {
          return this == Blocks.DARK_OAK_DOOR ? Items.DARK_OAK_DOOR : Items.OAK_DOOR;
       }
   }

    /**
     * Called before the Block is set to air in the world. Called regardless of if the player's tool can actually
     * collect this block
     */
    public void onBlockHarvested(World worldIn, BlockPos pos, IBlockState state, EntityPlayer player)
    {
        BlockPos blockpos = pos.down();
        BlockPos blockpos1 = pos.up();

        if (player.capabilities.isCreativeMode && state.getValue(HALF) == TestDoor.EnumDoorHalf.UPPER && worldIn.getBlockState(blockpos).getBlock() == this)
        {
            worldIn.setBlockToAir(blockpos);
        }

        if (state.getValue(HALF) == TestDoor.EnumDoorHalf.LOWER && worldIn.getBlockState(blockpos1).getBlock() == this)
        {
            if (player.capabilities.isCreativeMode)
            {
                worldIn.setBlockToAir(pos);
            }

            worldIn.setBlockToAir(blockpos1);
        }
    }

    @SideOnly(Side.CLIENT)
    public BlockRenderLayer getBlockLayer()
    {
        return BlockRenderLayer.CUTOUT;
    }

    /**
     * Get the actual Block state of this Block at the given position. This applies properties not visible in the
     * metadata, such as fence connections.
     */
    public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos)
    {
        if (state.getValue(HALF) == TestDoor.EnumDoorHalf.LOWER)
        {
            IBlockState iblockstate = worldIn.getBlockState(pos.up());

            if (iblockstate.getBlock() == this)
            {
                state = state.withProperty(HINGE, iblockstate.getValue(HINGE)).withProperty(POWERED, iblockstate.getValue(POWERED));
            }
        }
        else
        {
            IBlockState iblockstate1 = worldIn.getBlockState(pos.down());

            if (iblockstate1.getBlock() == this)
            {
                state = state.withProperty(FACING, iblockstate1.getValue(FACING)).withProperty(OPEN, iblockstate1.getValue(OPEN));
            }
        }

        return state;
    }

    /**
     * Returns the blockstate with the given rotation from the passed blockstate. If inapplicable, returns the passed
     * blockstate.
     */
    public IBlockState withRotation(IBlockState state, Rotation rot)
    {
        return state.getValue(HALF) != TestDoor.EnumDoorHalf.LOWER ? state : state.withProperty(FACING, rot.rotate((EnumFacing)state.getValue(FACING)));
    }

    /**
     * Returns the blockstate with the given mirror of the passed blockstate. If inapplicable, returns the passed
     * blockstate.
     */
    public IBlockState withMirror(IBlockState state, Mirror mirrorIn)
    {
        return mirrorIn == Mirror.NONE ? state : state.withRotation(mirrorIn.toRotation((EnumFacing)state.getValue(FACING))).cycleProperty(HINGE);
    }

    /**
     * Convert the given metadata into a BlockState for this Block
     */
    public IBlockState getStateFromMeta(int meta)
    {
        return (meta & 8) > 0 ? this.getDefaultState().withProperty(HALF, TestDoor.EnumDoorHalf.UPPER).withProperty(HINGE, (meta & 1) > 0 ? TestDoor.EnumHingePosition.RIGHT : TestDoor.EnumHingePosition.LEFT).withProperty(POWERED, Boolean.valueOf((meta & 2) > 0)) : this.getDefaultState().withProperty(HALF, TestDoor.EnumDoorHalf.LOWER).withProperty(FACING, EnumFacing.getHorizontal(meta & 3).rotateYCCW()).withProperty(OPEN, Boolean.valueOf((meta & 4) > 0));
    }

    /**
     * Convert the BlockState into the correct metadata value
     */
    public int getMetaFromState(IBlockState state)
    {
        int i = 0;

        if (state.getValue(HALF) == TestDoor.EnumDoorHalf.UPPER)
        {
            i = i | 8;

            if (state.getValue(HINGE) == TestDoor.EnumHingePosition.RIGHT)
            {
                i |= 1;
            }

            if (((Boolean)state.getValue(POWERED)).booleanValue())
            {
                i |= 2;
            }
        }
        else
        {
            i = i | ((EnumFacing)state.getValue(FACING)).rotateY().getHorizontalIndex();

            if (((Boolean)state.getValue(OPEN)).booleanValue())
            {
                i |= 4;
            }
        }

        return i;
    }

    protected static int removeHalfBit(int meta)
    {
        return meta & 7;
    }

    public static boolean isOpen(IBlockAccess worldIn, BlockPos pos)
    {
        return isOpen(combineMetadata(worldIn, pos));
    }

    public static EnumFacing getFacing(IBlockAccess worldIn, BlockPos pos)
    {
        return getFacing(combineMetadata(worldIn, pos));
    }

    public static EnumFacing getFacing(int combinedMeta)
    {
        return EnumFacing.getHorizontal(combinedMeta & 3).rotateYCCW();
    }

    protected static boolean isOpen(int combinedMeta)
    {
        return (combinedMeta & 4) != 0;
    }

    protected static boolean isTop(int meta)
    {
        return (meta & 8) != 0;
    }

    protected BlockStateContainer createBlockState()
    {
        return new BlockStateContainer(this, new IProperty[] {HALF, FACING, OPEN, HINGE, POWERED});
    }

    /**
     * Get the geometry of the queried face at the given position and state. This is used to decide whether things like
     * buttons are allowed to be placed on the face, or how glass panes connect to the face, among other things.
     * <p>
     * Common values are {@code SOLID}, which is the default, and {@code UNDEFINED}, which represents something that
     * does not fit the other descriptions and will generally cause other things not to connect to the face.
     * 
     * @return an approximation of the form of the given face
     */
    public BlockFaceShape getBlockFaceShape(IBlockAccess worldIn, IBlockState state, BlockPos pos, EnumFacing face)
    {
        return BlockFaceShape.UNDEFINED;
    }

    public static enum EnumDoorHalf implements IStringSerializable
    {
        UPPER,
        LOWER;

        public String toString()
        {
            return this.getName();
        }

        public String getName()
        {
            return this == UPPER ? "upper" : "lower";
        }
    }

    public static enum EnumHingePosition implements IStringSerializable
    {
        LEFT,
        RIGHT;

        public String toString()
        {
            return this.getName();
        }

        public String getName()
        {
            return this == LEFT ? "left" : "right";
        }
    }
}

 

 

RegistryHandler

package encom.grid.rezcraft;

import net.minecraft.block.Block;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

@EventBusSubscriber
public class RegistryHandler 
{


@SubscribeEvent
public static void registerBlocks(RegistryEvent.Register<Block> event)
{
	event.getRegistry().registerAll(BlockInit.BLOCKS.toArray(new Block[0]));
  }
}

 

Error

Caused by: java.lang.IllegalArgumentException: Cannot set property PropertyEnum{name=hinge, clazz=class net.minecraft.block.BlockDoor$EnumHingePosition, values=[left, right]} as it does not exist in BlockStateContainer{block=minecraft:air, properties=[facing, half, hinge, open, powered]}
	at net.minecraft.block.state.BlockStateContainer$StateImplementation.withProperty(BlockStateContainer.java:221) ~[BlockStateContainer$StateImplementation.class:?]
	at net.minecraft.block.BlockDoor.<init>(BlockDoor.java:48) ~[BlockDoor.class:?]
	at encom.grid.rezcraft.TestDoor.<init>(TestDoor.java:53) ~[TestDoor.class:?]
	at encom.grid.rezcraft.BlockInit.<clinit>(BlockInit.java:16) ~[BlockInit.class:?]

 

Edited by Eedelia01
Posted
On 11/19/2019 at 12:37 PM, Eedelia01 said:

public class BlockInit {

	public static final List<Block> BLOCKS = new ArrayList<Block>();
	
	//Vanilla Door Replacer

	public static final BlockDoor ACACIA_DOOR = new TestDoor("acacia_door", Material.WOOD);
}

You shouldn't use static initialisers.

 

On 11/19/2019 at 12:37 PM, Eedelia01 said:

event.getRegistry().registerAll(BlockInit.BLOCKS.toArray(new Block[0]));

This is pretty disgusting, you should create your objects inside the registerAll call. You also shouldn't have an array of references to your objects as these references will not get changed when a registry override happens.

Use @Override. Please

 

You've both copied AND extended BlockDoor. Therefore you have 2 properties called HINGE - one from your class and one from BlockDoor. You're adding your hinge property to the BlockStateContainer in createBlockState. The vanilla code then tries to use the vanilla hinge property (which doesn't exist on your block) resulting in the crash.

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Get $100 Off temu Coupon Code { ald123454 } | for new users + 30% Discount for all users You can get a $100 Off temu Coupon code using the code { ald123454 }. This temu $100 Off code is specifically for new customers and can be redeemed to receive a $100 discount on your purchase. Our exclusive temu Coupon code offers a flat $100 Off your purchase, plus an additional 30% discount. As a new temu customer, you can slash prices by up to 30% as a new temu customer using code { ald123454 }. Existing users can enjoy $100 Off their next haul with this code. But that’s not all! With our temu coupon code get up to 90% discount on select items and clearance sales. Whether you’re a new customer or an existing shopper, our temu codes provide extra discounts tailored just for you. Save up to 30% with these current temu Coupons { ald123454 } for February 2025. The latest temu coupon codes at here. Free temu codes $100 Off — { ald123454 } temu Coupon $100 Off — { ald123454 } temu Coupon $100 Off — { ald123454 } temu Memorial Day Sale 75% off — { ald123454 } temu Coupon code today — { ald123454 } temu free gift code — { ald123454 } Without inviting friends or family member  Coupon code for Canada - $100 Off— { ald123454 } temu Coupon code Australia - $100 Off— { ald123454 } temu Coupon code New Zealand - $100 Off — { ald123454 } temu Coupon code Japan -$100 Off — { ald123454 } temu Coupon code Mexico - $100 Off — { ald123454 } temu Coupon code Chile - $100 Off — { ald123454 } temu Coupon code Peru - $100 Off — { ald123454 } temu Coupon code Colombia - $100 Off — { ald123454 } temu Coupon code Malaysia - $100 Off — { ald123454 } temu Coupon code the Philippines - $100 Off — { ald123454 } temu Coupon code South Korea - $100 Off — { ald123454 } Redeem Free temu Coupon Code { ald123454 }for first time user Get $100 discount on your temu order with the promo code "acr804084". You can get a discount by clicking on the item to purchase and entering this temu Coupon code $100 Off "{ ald123454 }". temu Coupon Code { ald123454 }: Get Up To $100 Off In June 2025 Are you looking for the best temu Coupon codes to get amazing discounts? Our temu Coupons are perfect for getting those extra savings you crave. We regularly test our coupon codes for temu to ensure they work flawlessly, giving you a guaranteed discount every time. temu New User Coupon { ald123454 }: Up To 75% OFF For First-Time Users Our temu first-time user coupon codes are designed just for new customers, offering the biggest discounts and the best deals currently available on temu. To maximize your savings, download the temu Coupon For $100 Off { ald123454 }: Get A Flat $100 Discount On Order Value Get ready to save big with our incredible temu Coupon code for $100 Off! Our amazing temu $100 Off coupon code will give you a flat $100 discount on your order value, making your shopping experience even more rewarding. temu Coupon Code For $100 Off { ald123454 } For Both New And Existing Customers Our incredible temu Coupon code for $100 Off is here to help you save big on your purchases. Whether you’re a new user or an existing customer, our $100 Off code for temu will give you an additional discount! temu Coupon Bundle { ald123454 }: Flat $100 Off + Up To 30% Discount Get ready for an unbelievable deal with our temu Coupon bundle for 2025! Our temu Coupon bundles will give you a flat $100 discount and an additional $100 Off on top of it. Free temu Coupons { ald123454 }: Unlock Unlimited Savings! Get ready to unlock a world of savings with our free temu Coupons! We’ve got you covered with a wide range of temu Coupon code options that will help you maximize your shopping experience. $100 Off temu Coupons, Promo Codes + 25% Cash Back { ald123454 } Redeem temu Coupon Code { ald123454 }
    • Get $100 Off temu Coupon Code { ald123454 } | for new users + 30% Discount for all users You can get a $100 Off temu Coupon code using the code { ald123454 }. This temu $100 Off code is specifically for new customers and can be redeemed to receive a $100 discount on your purchase. Our exclusive temu Coupon code offers a flat $100 Off your purchase, plus an additional 30% discount. As a new temu customer, you can slash prices by up to 30% as a new temu customer using code { ald123454 }. Existing users can enjoy $100 Off their next haul with this code. But that’s not all! With our temu coupon code get up to 90% discount on select items and clearance sales. Whether you’re a new customer or an existing shopper, our temu codes provide extra discounts tailored just for you. Save up to 30% with these current temu Coupons { ald123454 } for February 2025. The latest temu coupon codes at here. Free temu codes $100 Off — { ald123454 } temu Coupon $100 Off — { ald123454 } temu Coupon $100 Off — { ald123454 } temu Memorial Day Sale 75% off — { ald123454 } temu Coupon code today — { ald123454 } temu free gift code — { ald123454 } Without inviting friends or family member  Coupon code for Canada - $100 Off— { ald123454 } temu Coupon code Australia - $100 Off— { ald123454 } temu Coupon code New Zealand - $100 Off — { ald123454 } temu Coupon code Japan -$100 Off — { ald123454 } temu Coupon code Mexico - $100 Off — { ald123454 } temu Coupon code Chile - $100 Off — { ald123454 } temu Coupon code Peru - $100 Off — { ald123454 } temu Coupon code Colombia - $100 Off — { ald123454 } temu Coupon code Malaysia - $100 Off — { ald123454 } temu Coupon code the Philippines - $100 Off — { ald123454 } temu Coupon code South Korea - $100 Off — { ald123454 } Redeem Free temu Coupon Code { ald123454 }for first time user Get $100 discount on your temu order with the promo code "acr804084". You can get a discount by clicking on the item to purchase and entering this temu Coupon code $100 Off "{ ald123454 }". temu Coupon Code { ald123454 }: Get Up To $100 Off In June 2025 Are you looking for the best temu Coupon codes to get amazing discounts? Our temu Coupons are perfect for getting those extra savings you crave. We regularly test our coupon codes for temu to ensure they work flawlessly, giving you a guaranteed discount every time. temu New User Coupon { ald123454 }: Up To 75% OFF For First-Time Users Our temu first-time user coupon codes are designed just for new customers, offering the biggest discounts and the best deals currently available on temu. To maximize your savings, download the temu Coupon For $100 Off { ald123454 }: Get A Flat $100 Discount On Order Value Get ready to save big with our incredible temu Coupon code for $100 Off! Our amazing temu $100 Off coupon code will give you a flat $100 discount on your order value, making your shopping experience even more rewarding. temu Coupon Code For $100 Off { ald123454 } For Both New And Existing Customers Our incredible temu Coupon code for $100 Off is here to help you save big on your purchases. Whether you’re a new user or an existing customer, our $100 Off code for temu will give you an additional discount! temu Coupon Bundle { ald123454 }: Flat $100 Off + Up To 30% Discount Get ready for an unbelievable deal with our temu Coupon bundle for 2025! Our temu Coupon bundles will give you a flat $100 discount and an additional $100 Off on top of it. Free temu Coupons { ald123454 }: Unlock Unlimited Savings! Get ready to unlock a world of savings with our free temu Coupons! We’ve got you covered with a wide range of temu Coupon code options that will help you maximize your shopping experience. $100 Off temu Coupons, Promo Codes + 25% Cash Back { ald123454 } Redeem temu Coupon Code { ald123454 }
    • Get $100 Off temu Coupon Code { ald123454 } | for new users + 30% Discount for all users You can get a $100 Off temu Coupon code using the code { ald123454 }. This temu $100 Off code is specifically for new customers and can be redeemed to receive a $100 discount on your purchase. Our exclusive temu Coupon code offers a flat $100 Off your purchase, plus an additional 30% discount. As a new temu customer, you can slash prices by up to 30% as a new temu customer using code { ald123454 }. Existing users can enjoy $100 Off their next haul with this code. But that’s not all! With our temu coupon code get up to 90% discount on select items and clearance sales. Whether you’re a new customer or an existing shopper, our temu codes provide extra discounts tailored just for you. Save up to 30% with these current temu Coupons { ald123454 } for February 2025. The latest temu coupon codes at here. Free temu codes $100 Off — { ald123454 } temu Coupon $100 Off — { ald123454 } temu Coupon $100 Off — { ald123454 } temu Memorial Day Sale 75% off — { ald123454 } temu Coupon code today — { ald123454 } temu free gift code — { ald123454 } Without inviting friends or family member  Coupon code for Canada - $100 Off— { ald123454 } temu Coupon code Australia - $100 Off— { ald123454 } temu Coupon code New Zealand - $100 Off — { ald123454 } temu Coupon code Japan -$100 Off — { ald123454 } temu Coupon code Mexico - $100 Off — { ald123454 } temu Coupon code Chile - $100 Off — { ald123454 } temu Coupon code Peru - $100 Off — { ald123454 } temu Coupon code Colombia - $100 Off — { ald123454 } temu Coupon code Malaysia - $100 Off — { ald123454 } temu Coupon code the Philippines - $100 Off — { ald123454 } temu Coupon code South Korea - $100 Off — { ald123454 } Redeem Free temu Coupon Code { ald123454 }for first time user Get $100 discount on your temu order with the promo code "acr804084". You can get a discount by clicking on the item to purchase and entering this temu Coupon code $100 Off "{ ald123454 }". temu Coupon Code { ald123454 }: Get Up To $100 Off In June 2025 Are you looking for the best temu Coupon codes to get amazing discounts? Our temu Coupons are perfect for getting those extra savings you crave. We regularly test our coupon codes for temu to ensure they work flawlessly, giving you a guaranteed discount every time. temu New User Coupon { ald123454 }: Up To 75% OFF For First-Time Users Our temu first-time user coupon codes are designed just for new customers, offering the biggest discounts and the best deals currently available on temu. To maximize your savings, download the temu Coupon For $100 Off { ald123454 }: Get A Flat $100 Discount On Order Value Get ready to save big with our incredible temu Coupon code for $100 Off! Our amazing temu $100 Off coupon code will give you a flat $100 discount on your order value, making your shopping experience even more rewarding. temu Coupon Code For $100 Off { ald123454 } For Both New And Existing Customers Our incredible temu Coupon code for $100 Off is here to help you save big on your purchases. Whether you’re a new user or an existing customer, our $100 Off code for temu will give you an additional discount! temu Coupon Bundle { ald123454 }: Flat $100 Off + Up To 30% Discount Get ready for an unbelievable deal with our temu Coupon bundle for 2025! Our temu Coupon bundles will give you a flat $100 discount and an additional $100 Off on top of it. Free temu Coupons { ald123454 }: Unlock Unlimited Savings! Get ready to unlock a world of savings with our free temu Coupons! We’ve got you covered with a wide range of temu Coupon code options that will help you maximize your shopping experience. $100 Off temu Coupons, Promo Codes + 25% Cash Back { ald123454 } Redeem temu Coupon Code { ald123454 }
    • Get $100 Off temu Coupon Code { ald123454 } | for new users + 30% Discount for all users You can get a $100 Off temu Coupon code using the code { ald123454 }. This temu $100 Off code is specifically for new customers and can be redeemed to receive a $100 discount on your purchase. Our exclusive temu Coupon code offers a flat $100 Off your purchase, plus an additional 30% discount. As a new temu customer, you can slash prices by up to 30% as a new temu customer using code { ald123454 }. Existing users can enjoy $100 Off their next haul with this code. But that’s not all! With our temu coupon code get up to 90% discount on select items and clearance sales. Whether you’re a new customer or an existing shopper, our temu codes provide extra discounts tailored just for you. Save up to 30% with these current temu Coupons { ald123454 } for February 2025. The latest temu coupon codes at here. Free temu codes $100 Off — { ald123454 } temu Coupon $100 Off — { ald123454 } temu Coupon $100 Off — { ald123454 } temu Memorial Day Sale 75% off — { ald123454 } temu Coupon code today — { ald123454 } temu free gift code — { ald123454 } Without inviting friends or family member  Coupon code for Canada - $100 Off— { ald123454 } temu Coupon code Australia - $100 Off— { ald123454 } temu Coupon code New Zealand - $100 Off — { ald123454 } temu Coupon code Japan -$100 Off — { ald123454 } temu Coupon code Mexico - $100 Off — { ald123454 } temu Coupon code Chile - $100 Off — { ald123454 } temu Coupon code Peru - $100 Off — { ald123454 } temu Coupon code Colombia - $100 Off — { ald123454 } temu Coupon code Malaysia - $100 Off — { ald123454 } temu Coupon code the Philippines - $100 Off — { ald123454 } temu Coupon code South Korea - $100 Off — { ald123454 } Redeem Free temu Coupon Code { ald123454 }for first time user Get $100 discount on your temu order with the promo code "acr804084". You can get a discount by clicking on the item to purchase and entering this temu Coupon code $100 Off "{ ald123454 }". temu Coupon Code { ald123454 }: Get Up To $100 Off In June 2025 Are you looking for the best temu Coupon codes to get amazing discounts? Our temu Coupons are perfect for getting those extra savings you crave. We regularly test our coupon codes for temu to ensure they work flawlessly, giving you a guaranteed discount every time. temu New User Coupon { ald123454 }: Up To 75% OFF For First-Time Users Our temu first-time user coupon codes are designed just for new customers, offering the biggest discounts and the best deals currently available on temu. To maximize your savings, download the temu Coupon For $100 Off { ald123454 }: Get A Flat $100 Discount On Order Value Get ready to save big with our incredible temu Coupon code for $100 Off! Our amazing temu $100 Off coupon code will give you a flat $100 discount on your order value, making your shopping experience even more rewarding. temu Coupon Code For $100 Off { ald123454 } For Both New And Existing Customers Our incredible temu Coupon code for $100 Off is here to help you save big on your purchases. Whether you’re a new user or an existing customer, our $100 Off code for temu will give you an additional discount! temu Coupon Bundle { ald123454 }: Flat $100 Off + Up To 30% Discount Get ready for an unbelievable deal with our temu Coupon bundle for 2025! Our temu Coupon bundles will give you a flat $100 discount and an additional $100 Off on top of it. Free temu Coupons { ald123454 }: Unlock Unlimited Savings! Get ready to unlock a world of savings with our free temu Coupons! We’ve got you covered with a wide range of temu Coupon code options that will help you maximize your shopping experience. $100 Off temu Coupons, Promo Codes + 25% Cash Back { ald123454 } Redeem temu Coupon Code { ald123454 }
    • This special ALB496107 Temu coupon code is specifically designed to give maximum benefits to people in European nations, including Germany, France, Italy, and Switzerland. We believe everyone should have access to fantastic discounts, and this code makes it possible for our European community. Get ready to discover how you can significantly reduce your shopping expenses with this amazing Temu coupon 100€ off. This Temu 100 off coupon code is your ticket to a world of unbeatable deals and incredible value on the Temu platform. What Is The Coupon Code For Temu 100€ Off? We are excited to bring you a truly remarkable offer that caters to both new and existing customers on Temu. When you use our exclusive 100€ coupon code on the Temu app and website, you can unlock amazing benefits. This Temu coupon 100€ off is designed to provide substantial savings, making your shopping experience even more rewarding. It’s a fantastic opportunity to grab those items you’ve been eyeing at a significantly reduced price with our 100€ off Temu coupon. Here’s a breakdown of the incredible benefits you can expect with code ALB496107: ALB496107: Enjoy a flat 100€ off your purchase, giving you immediate and tangible savings. ALB496107: Receive a 100€ coupon pack for multiple uses, allowing you to save on various orders. ALB496107: New customers are welcomed with a generous 100€ flat discount on their very first order. ALB496107: Existing customers aren't left out, as this code provides an extra 100€ promo code, rewarding your loyalty. ALB496107: This is a dedicated 100€ coupon for European users, ensuring our community across the continent benefits. Temu Coupon Code 100€ Off For New Users In 2025 For our brand-new users, this is where the real magic happens! If you're new to Temu and located in Europe, using our coupon code on the Temu app will unlock the highest benefits imaginable. We want to make your first experience with Temu truly unforgettable, and this Temu coupon 100€ off is our way of saying welcome. This Temu coupon code 100€ off is tailored to give you an exceptional start. Here’s how new users can maximize their savings with ALB496107: ALB496107: Get a flat 100€ discount specifically for new users, making your initial purchase incredibly affordable. ALB496107: Access a 100€ coupon bundle designed exclusively for new customers, providing multiple opportunities to save. ALB496107: Enjoy an amazing coupon bundle of up to 100€ for multiple uses, ensuring continued savings beyond your first order. ALB496107: Benefit from free shipping all over European Nations, including Germany, France, Italy, and Switzerland, adding even more value to your purchase. ALB496107: Receive an extra 30% off on any purchase for first-time users, sweetening the deal on top of your 100€ discount. How To Redeem The Temu coupon 100€ off For New Customers? Redeeming your Temu 100€ coupon is a straightforward process, designed to get you saving quickly and easily. We’ve made sure that activating your Temu 100€ off coupon code for new users is as simple as possible. Follow these steps to unlock your fantastic discount: Download the Temu App: If you haven't already, download the official Temu app from your respective app store (Google Play Store or Apple App Store). Create a New Account: Open the Temu app and register for a new account. This usually involves providing your email address or phone number and setting up a password. Browse and Add Items to Cart: Explore the vast array of products available on Temu and add your desired items to your shopping cart. Take your time to find everything you need! Proceed to Checkout: Once you're ready to complete your purchase, navigate to your shopping cart and proceed to the checkout page. Apply the Coupon Code: On the checkout page, you will see a field labeled "Coupon Code," "Promo Code," or similar. Enter the code ALB496107 into this field. Click "Apply": After entering the code, click the "Apply" button. You should see the 100€ discount immediately reflected in your order total. Complete Your Purchase: Review your order details, select your preferred shipping method, and proceed with payment. Enjoy your savings! Temu Coupon 100€ Off For Existing Customers We truly value our loyal customers, and we’re delighted to inform you that existing users can also enjoy substantial benefits when they use our exclusive coupon code on the Temu app. We believe in rewarding your continued support, and that's why we've ensured that Temu 100€ coupon codes for existing users are readily available. Plus, you can often combine these savings with Temu coupon 100€ off for existing customers free shipping, adding even more value! Here are the fantastic perks existing users can enjoy with ALB496107: ALB496107: Receive a 100€ extra discount, a special thank you for being a valued Temu user. ALB496107: Unlock a 100€ coupon bundle for multiple purchases, allowing you to save on various upcoming orders. ALB496107: Get a free gift with express shipping all over Europe, an added bonus to your shopping experience. ALB496107: Enjoy up to 70% off on top of existing discounts, stacking your savings for incredible deals. ALB496107: Benefit from free shipping across all European Nations, including Germany, France, Italy, Spain, and Switzerland, making your purchases even more economical. How To Use The Temu Coupon Code 100€ Off For Existing Customers? Utilizing the Temu coupon code 100€ off as an existing customer is just as easy and rewarding. We want to ensure you continue to save effortlessly with our Temu coupon 100€ off code. Follow these simple steps to apply your discount: Log In to Your Temu Account: Open the Temu app or visit the Temu website and log in to your existing account. Browse and Add Items: Explore Temu's extensive range of products and add the items you wish to purchase to your shopping cart. Proceed to Checkout: Once you're satisfied with your selections, go to your shopping cart and proceed to the checkout page. Enter the Coupon Code: On the checkout screen, locate the designated field for coupon or promo codes. Carefully enter ALB496107 into this box. Apply the Code: Click on the "Apply" or "Redeem" button next to the coupon code field. The discount should be applied to your order total, reflecting the 100€ off or other benefits. Complete Your Transaction: Double-check your order summary, select your shipping and payment options, and finalize your purchase. It's that simple to keep saving! Latest Temu Coupon 100€ Off First Order If you're making your very first purchase on Temu, you're in for an absolute treat! Customers can unlock the highest benefits by using our coupon code specifically during their initial order. This is your prime opportunity to experience the incredible value Temu offers with an unbeatable discount, thanks to our Temu coupon code 100€ off first order. It's the ultimate welcome, and we ensure you get the best deal with our Temu coupon code first order. This Temu coupon code 100€ off first time user is your golden ticket! Here’s why ALB496107 is perfect for your first Temu order: ALB496107: Receive a flat 100€ discount specifically for your first order, an incredible way to start your Temu journey. ALB496107: Get a 100€ Temu coupon code for the first order, setting you up for significant savings from the get-go. ALB496107: Benefit from up to a 100€ coupon for multiple uses, ensuring your savings extend beyond your initial purchase. ALB496107: Enjoy free shipping to European countries, making your first order even more appealing without extra delivery costs. ALB496107: Score an extra 30% off on any purchase for your first order in Germany, France, Italy, Switzerland, Spain, and other eligible nations, maximizing your savings right away. How To Find The Temu Coupon Code 100€ Off? Finding your Temu coupon 100€ off is easier than you might think, and we're here to guide you to reliable sources. While you might occasionally see mentions of Temu coupon 100€ off Reddit, we recommend a few tried-and-true methods to ensure you get verified and working codes. Firstly, a fantastic way to stay updated with the latest offers is by signing up for the official Temu newsletter. Temu frequently sends out exclusive deals, promotions, and sometimes even unique coupon codes directly to its subscribers. This is a direct line to savings, ensuring you don't miss out on any new opportunities. Secondly, we highly recommend visiting Temu’s official social media pages. Platforms like Facebook, Instagram, and Twitter are often used by Temu to announce flash sales, new product launches, and special coupon codes. Following their accounts means you'll be among the first to know about these limited-time offers. Engage with their posts, and you might even find community-shared tips for maximizing your savings. Lastly, and this is where we come in, you can always find the latest, verified, and working Temu coupon codes by visiting trusted coupon sites like ours. We diligently test and update our coupon listings to ensure you have access to the most effective discounts, including the sought-after 100€ off codes. We are committed to providing you with accurate and reliable coupon information so you can shop smarter, not harder. Is Temu 100€ Off Coupon Legit? This is a question we hear often, and we're here to provide a resounding "Yes!" Our Temu 100€ Off Coupon Legit status is something we pride ourselves on. We can unequivocally state that our Temu 100 off coupon legit code, ALB496107, is absolutely legitimate and ready for your use. We understand the skepticism that can arise with such generous offers, but rest assured, customers can safely and confidently use our Temu coupon code ALB496107 to get a fantastic 100€ off on their first order, and in many cases, on recurring orders through coupon bundles. We stand behind the validity of our codes. Furthermore, our code is not only legitimate but also regularly tested and verified by our team. We go the extra mile to ensure that when you apply ALB496107, it works exactly as promised, delivering the advertised savings. You won't encounter any unpleasant surprises or invalid messages with our coupons. Crucially, we want to emphasize that our Temu coupon code ALB496107 is valid all over Europe. Whether you're in Germany, France, Italy, Switzerland, Spain, or any other European nation, you can take advantage of these incredible savings. And here's another fantastic point: our coupon code does not have any expiration date. This means you can use it whenever you're ready to shop, offering you unparalleled flexibility and peace of mind. How Does Temu 100€ Off Coupon Work? The Temu coupon code 100€ off first-time user and Temu coupon codes 100 off are incredibly straightforward to use, making savings accessible to everyone. In essence, these coupons provide a direct deduction of 100€ from your total order value, or a bundle of coupons summing up to that amount, once applied successfully at checkout. When you enter the specific code, like ALB496107, into the designated coupon or promo code field on the Temu app or website during the checkout process, the system automatically recognizes it. It then calculates and applies the corresponding discount directly to your shopping cart's subtotal. For new users, this often means a flat 100€ off on a single order, while existing users or certain promotions might receive a coupon pack where the sum of discounts across multiple uses totals 100€. It's designed to be a hassle-free mechanism to reduce your expenditure, whether it's on a single high-value item or spread across several smaller purchases within the provided coupon bundle. The aim is always to put 100€ back into your pocket through direct savings on your Temu shopping. How To Earn Temu 100€ Coupons As A New Customer? Earning your Temu coupon code 100€ off as a new customer is delightfully simple and offers a fantastic welcome to the Temu platform. To secure your 100 off Temu coupon code, the primary method is to simply register for a new account on the Temu app or website. Temu frequently offers substantial welcome bonuses to entice new shoppers, and a 100€ coupon, or a coupon bundle totaling 100€, is a common and very appealing incentive. Once you've successfully created your new account, the coupon or coupon bundle might be automatically credited to your account, or you may be prompted to enter a specific welcome code (such as our ALB496107) during the registration process or at your first checkout. Beyond the initial signup, Temu also has various promotional activities that new users can participate in, such as app downloads, referral programs, or flash sales specifically targeting first-time buyers, all of which can lead to earning these valuable 100€ discounts. Always keep an eye on Temu's official announcements and app notifications for the latest ways to maximize your initial savings. What Are The Advantages Of Using Temu Coupon 100€ Off? Using our Temu coupon code 100 off and the Temu coupon code 100€ off brings a multitude of advantages that significantly enhance your shopping experience. We are committed to helping you save, and these benefits truly reflect that. Here’s why you should definitely use our coupon code: 100€ Discount on the First Order: Immediately save a substantial amount on your very first Temu purchase, making it incredibly budget-friendly. 100€ Coupon Bundle for Multiple Uses: Enjoy sustained savings across several orders, not just one, thanks to a comprehensive coupon pack. Up to 70% Discount on Popular Items: Combine your 100€ savings with existing discounts on trending products, leading to extraordinary deals. Extra 30% Off for Existing Temu Europe Customers: Loyal European users receive an additional discount on top of other offers, rewarding their continued patronage. Up to 90% Off in Selected Items: Discover jaw-dropping price reductions on specific categories or products, allowing for massive savings. Free Gift for New European Users: A special welcome gift awaits new customers in Europe, adding an exciting bonus to your initial purchase. Free Delivery All Over Europe: Eliminate shipping costs entirely, making your overall purchase even more economical and convenient. Temu 100€ Discount Code And Free Gift For New And Existing Customers We are thrilled to highlight that utilizing our Temu coupon code offers a plethora of benefits for everyone, whether you're a new discoverer of Temu or a seasoned shopper. The Temu 100€ off coupon code and 100€ off Temu coupon code are designed to provide unparalleled value. Let's delve into the fantastic benefits you can gain with code ALB496107: ALB496107: Secure a guaranteed 100€ discount for your very first order, setting the stage for incredible savings. ALB496107: Unlock an extra 30% off on any item, allowing you to save even more on your chosen products. ALB496107: Receive a complimentary free gift for new Temu customers, a delightful surprise to enhance your initial shopping. ALB496107: Enjoy up to a 70% discount on any item on the Temu app, making high-quality products astonishingly affordable. ALB496107: Get a free gift accompanied by free shipping in the European Nations, including Germany, France, Italy, and Switzerland, providing both a bonus and cost-free delivery. Pros And Cons Of Using Temu Coupon Code 100€ Off This Month Using the Temu coupon 100€ off code and the Temu 100 off coupon certainly comes with significant advantages, making your shopping experience much more rewarding. However, it's always good to be aware of all aspects. Pros: Significant Savings: The most obvious benefit is a substantial 100€ reduction, either as a direct discount or a valuable coupon bundle. Applicable to Both New and Existing Users: This code caters to a wide audience, ensuring everyone can benefit from the savings. Enhanced Value for First Orders: New users receive exceptional introductory offers, making their initial Temu experience highly economical. Free Shipping and Gifts: Often combined with free delivery across Europe and bonus gifts, maximizing the overall value. Versatility: Can be applied to a wide range of products across various categories on Temu, giving you flexibility in your purchases. Cons: Minimum Purchase Requirements (Potential): While our specific code has no minimum, some 100€ off coupons might require a certain spending threshold, which could be a minor inconvenience if you're only buying a small item. Limited-Time Availability (General): While our ALB496107 code has no expiration, other similar high-value coupons might be time-sensitive, requiring quick action. Terms And Conditions Of Using The Temu Coupon 100€ Off In 2025 Understanding the terms and conditions for our Temu coupon code 100€ off free shipping and the latest Temu coupon code 100€ off is essential to ensure a smooth and successful redemption. We've made these terms as user-friendly as possible, prioritizing your convenience and savings. Here are the key terms and conditions for using our coupon code: No Expiration Date: We are delighted to confirm that our coupon code ALB496107 does not have any expiration date. This means you can use it anytime you want, offering you complete flexibility in your shopping plans. Valid for Both New and Existing Users: This code is inclusive! Whether you are a brand-new customer to Temu or have been shopping with them for a while, you are eligible to use our coupon code. Valid Across European Nations: Our coupon code is widely valid for users in European Nations, including Germany, France, Italy, Switzerland, Spain, and many others, ensuring a broad reach for savings. No Minimum Purchase Requirements: One of the most advantageous aspects of our Temu coupon code ALB496107 is that there are no minimum purchase requirements. You don't need to spend a specific amount to unlock your 100€ discount. One Code Per Order/User (as per Temu's standard policy): While the code offers a substantial discount, standard Temu policy typically allows one coupon code application per order. However, the 100€ benefit might be delivered as a bundle for multiple uses. Subject to Temu's General Terms of Service: While our code is robust, its usage is always subject to Temu's overarching terms of service, which are standard for any platform. Final Note: Use The Latest Temu Coupon Code 100€ Off We hope this comprehensive guide has empowered you to maximize your savings on Temu. Utilizing the Temu coupon code 100€ off is a straightforward and highly effective way to significantly reduce your shopping costs. Don't miss out on this fantastic opportunity to get more for less. We encourage you to embrace the incredible value offered by the Temu coupon 100€ off and enjoy your smart shopping experience today! FAQs Of Temu 100€ Off Coupon  Is the ALB496107 Temu coupon code valid for all products? Yes, our ALB496107 Temu coupon code is generally valid across a wide range of products available on the Temu app and website. While specific exclusions might apply to certain heavily discounted items or categories set by Temu, for the most part, you can apply this code to almost anything you wish to purchase. Can I combine the 100€ off coupon with other Temu promotions? Typically, Temu allows only one coupon code per order. However, the 100€ off benefit through ALB496107 might come as a bundle, letting you save on multiple purchases. Also, it can often be used on top of existing sale prices and percentage discounts already offered by Temu.  What if my Temu 100€ off coupon code isn't working? If your Temu 100€ off coupon code isn't working, first double-check that you've entered ALB496107 correctly. Ensure there are no typos or extra spaces. If the issue persists, verify that your order meets any specific criteria (though our code generally has no minimum). You can also try clearing your app cache or browser cookies.  Does the 100€ off Temu coupon apply to shipping fees? The 100€ off from the ALB496107 coupon code primarily applies as a discount to the product total in your cart. However, as an added benefit, this specific coupon often comes bundled with free shipping offers for European nations, effectively reducing your overall cost by covering both product price and delivery.  How often is the Temu 100€ off coupon available? The Temu 100€ off coupon, particularly our ALB496107 code, is a generous and recurring offer for our users. While other high-value coupons may appear periodically, our code is designed to be a consistent source of significant savings, available without an expiration date for both new and existing customers across Europe.
  • Topics

×
×
  • Create New...

Important Information

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