Posted April 14, 20178 yr I am currently trying somekind of connected textured with Blockstates, but it seems some parts of the Forge Blockstates are broken. This is working and all variants (64) are displaying a cube with the same texture for each side. I am using forge 13.20.0.2282 { "forge_marker":1, "defaults": { "model":"cube", "textures":{ "down":"fp:blocks/d0000", "up":"fp:blocks/d0000", "north":"fp:blocks/d0000", "south":"fp:blocks/d0000", "west":"fp:blocks/d0000", "east":"fp:blocks/d0000" } }, "variants":{ "down":{"true":{},"false":{}}, "up":{"true":{},"false":{}}, "north":{"true":{},"false":{}}, "south":{"true":{},"false":{}}, "west":{"true":{},"false":{}}, "east":{"true":{},"false":{}}, "inventory":[{}] } } But if I add only one special variant everything breaks. { "forge_marker":1, "defaults": { "model":"cube", "textures":{ "down":"fp:blocks/d0000", "up":"fp:blocks/d0000", "north":"fp:blocks/d0000", "south":"fp:blocks/d0000", "west":"fp:blocks/d0000", "east":"fp:blocks/d0000" } }, "variants":{ "down":{"true":{},"false":{}}, "up":{"true":{},"false":{}}, "north":{"true":{},"false":{}}, "south":{"true":{},"false":{}}, "west":{"true":{},"false":{}}, "east":{"true":{},"false":{}}, "down=true,east=false,north=false,south=false,up=false,west=false":{ "textures":{ "down":"fp:blocks/d0000", "up":"fp:blocks/d0000", "north":"fp:blocks/d0010", "south":"fp:blocks/d0010", "west":"fp:blocks/d0010", "east":"fp:blocks/d0010"} }, "inventory":[{}] } } The Block class public class BlockQuantanium extends Block { public static final PropertyBool up = PropertyBool.create("up"); public static final PropertyBool down = PropertyBool.create("down"); public static final PropertyBool north = PropertyBool.create("north"); public static final PropertyBool east = PropertyBool.create("east"); public static final PropertyBool south = PropertyBool.create("south"); public static final PropertyBool west = PropertyBool.create("west"); public static final PropertyBool[] faces = new PropertyBool[]{down,up,north,south,west,east}; public BlockQuantanium() { super(Material.ROCK); setCreativeTab(FPMain.tab_deco); } @Override protected BlockStateContainer createBlockState() { return new BlockStateContainer(this, faces); } @Override public int getMetaFromState(IBlockState state) { return 0; } @Override public IBlockState getStateFromMeta(int meta) { return super.getStateFromMeta(meta); } @Override public IBlockState getActualState(IBlockState state, IBlockAccess w, BlockPos pos) { for(int i=0;i<faces.length;i++) { state = state.withProperty(faces[i], w.getBlockState(pos.offset(EnumFacing.getFront(i))).getBlock() == this); } return state; } } Edited April 14, 20178 yr by MCenderdragon catch(Exception e) { } Yay, Pokémon exception handling, gotta catch 'em all (and then do nothing with 'em).
April 14, 20178 yr Author https://github.com/MinecraftForge/MinecraftForge/issues/3843#issuecomment-294181631 Quote Add extra square brackets to the special variant like inventory has, they are needed if you don't have a model tag inside. catch(Exception e) { } Yay, Pokémon exception handling, gotta catch 'em all (and then do nothing with 'em).
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.