Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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 by MCenderdragon

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.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.