Jump to content

[1.8.9] Issue with new Forge Blockstate


GalianRyu

Recommended Posts

I'm trying to use the new Submodel Blockstates to make some unique stairs and I've encounterted something odd, hoping you guys might know what I can do.

 

Here is an excerpt from the JSON file in question:

 

{
    "forge_marker": 1,
    "defaults": {
    	"textures": {
    		"top": "millenaire:blocks/tilestopvert",
    		"bottom": "blocks/stonebrick",
    		"front": "millenaire:blocks/tilesfront",
        	"back": "millenaire:blocks/tilesfront",
        	"side": "millenaire:blocks/tilesfront"
        }
},
"variants": {
	"half": {
		"top": { "x": 180 },
		"bottom": {}
	},
	"facing": {
		"north": { "y": 270 },
		"south": { "y": 90 },
		"east": {},
		"west": { "y": 180 }
	},
	"shape": {
		"straight": {
			"submodel": {
        			"stonePart": { "model": "millenaire:byzantineStairsStonePart", "uvlock": true },
        			"tilePart": { "model": "millenaire:byzantineStairsTilePart", "uvlock": false }
        		}
		},

 

No errors in the console, no problem rendering the block, but the issue is that it won't flip the stairs unless they facing East.  Basically unless "facing" is East, "half" is being completely ignored.  I've run many tests and isolated that as the problem.  Anyone know what I can do?

Check out my Mod: The RPCraft Toolkit!

Link to comment
Share on other sites

For further info:  I tried editing it this way, as a test.

	"variants": {
	"half": {
		"top": { "x": 180 },
		"bottom": { "x": 90 }
	},
	"facing": {
		"north": { "y": 270 },
		"south": { "y": 90 },
		"east": { "y": 0 },
		"west": { "y": 180 }
	},

And now it ignores "half" completely, even when facing is east.  So it seems like multiple variables can't both be affecting the rotation, is this a bug in Forge itself?

Check out my Mod: The RPCraft Toolkit!

Link to comment
Share on other sites

Update to 1.10 and the system doesn't work like that the specific x/z values are not mixed so you're defining models with null models and x defined as 0 for all the directions

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Link to comment
Share on other sites

If that's the case, wouldn't it also fail to work on "facing"?  It orients to the correct Y value on all of those.  And if I take out the changes to Y in facing, then if flips on X just fine.  I guess I'm failing to understand exactly what you mean, aside from update to 1.10? (which is the plan eventually, but this is not a small mod and that's a fair bit of work).

Check out my Mod: The RPCraft Toolkit!

Link to comment
Share on other sites

Lex means that rotations aren't combinable.  Just because one specifies X and the other Y doesn't mean that a combined state will rotate XY, instead it picks "one" and that's why removing it makes the other one work: rotate is really only one field.

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.

Link to comment
Share on other sites

Ah, okay that makes sense. 

 

Means I have to either abandon doing the stairs this way and just use a simpler model, or I have to switch from inheriting stairs and define a blockstate that would let me include both directional rotations in one variable (upper-north, upper-south, lower-north, etc).

 

Okay, well thank you both for helping me out!

Check out my Mod: The RPCraft Toolkit!

Link to comment
Share on other sites

I think it means that you must list the Cartesian product of the state's properties (4 facings * 2 halves = 8 variants) so that you can put both x and y into a single rotation array for each.

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

Link to comment
Share on other sites

I cannot believe this actually worked, but it does!  I glanced over the code that makes the blockstates from the new system and test this and it works:

{
    "forge_marker": 1,
    "defaults": {
    	"textures": {
    		"top": "millenaire:blocks/tilestopvert",
    		"bottom": "blocks/stonebrick",
    		"front": "millenaire:blocks/tilesfront",
        	"back": "millenaire:blocks/tilesfront",
        	"side": "millenaire:blocks/tilesfront"
        }
},
"variants": {
	"facing": {
		"north,half=bottom": { "y": 270 },
		"south,half=bottom": { "y": 90 },
		"east,half=bottom": { "y": 0 },
		"west,half=bottom": { "y": 180 },
		"north,half=top": { "y": 270, "x": 180 },
		"south,half=top": { "y": 90, "x": 180 },
		"east,half=top": { "y": 0, "x": 180 },
		"west,half=top": { "y": 180, "x": 180 }
	},
	"shape": {
		"straight": {
			"submodel": {
        			"stonePart": { "model": "millenaire:byzantineStairsStonePart", "uvlock": true },
        			"tilePart": { "model": "millenaire:byzantineStairsTilePart", "uvlock": false }
        		}
		},

 

While this is somewhat of a hack, I'd suggest actually making it a thing, because it greatly increases the options available in this new system.  Immense gratitude to Jeffryfisher for giving me the idea to keep experimenting!

Check out my Mod: The RPCraft Toolkit!

Link to comment
Share on other sites

Uh...

Cartesian product of the state's properties

"north,half=bottom": { "y": 270 },

That's exactly what Jeffy said.

https://en.wikipedia.org/wiki/Cartesian_product

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.

Link to comment
Share on other sites

Join the conversation

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

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

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

×   Your previous content has been restored.   Clear editor

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



×
×
  • Create New...

Important Information

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