Block variants inherit placement rules from parent
kaylee-kiako opened this issue ยท 5 comments
Block variants through the Variant Selector inherit the placement rules from the parent, and, in most cases, ignore their own placement rules.
Under testing of planks, slabs, doors, trapdoors, buttons, pressure plates, signs, hanging signs, and minecraft:ladder
, the following behavior was observed:
- When the parent block was a plank, slab, trapdoor, or button, the variant could always be placed, even if it would place a door, trapdoor, or sign in the air.
- When the parent block was a door, pressure plate, sign, or hanging sign, the variant could only be placed under the rules of the parent block, and ignored its own rules.
The only exception to the above is the ladder, which had to satisfy both its own placement rules as well as the parent block's placement rules.
Tests were done using:
- Quark 4.0-454
- Zeta 1.0-16
- NeoForge 47.1.106
- Minecraft 1.20.1
This gist includes my latest.log
and quark-common.toml
, as well as a script for generating manual variants if further testing is desired.
I cant replicate. I'm testing by trying to place a button (from an oak plank) on the side of a fence block in mid air. Nothing happens there
I can confirm that buttons can not be placed against sign posts. I suspect that buttons are affected by the same internal logic as ladders, so both the button and the parent must be able to be placed. Note that if the parent is a pressure plate, for example, it is impossible to place the button against the side of otherwise valid blocks.
This internal logic does not seem to restrict doors, pressure plates, signs, or hanging signs, however:
so hold up this only works if the parent is not a full block. By default thats the only way this works
The above screenshot was done with the parent block being planks, so this appears to ignore the placement rules of doors, pressure plates, signs, and hanging signs. This only unnecessarily restricts placement if the parent is not a full block, but if the parent is a full block, it still allows improper placement.
Additionally, as there is support for manual variants, it's reasonable that someone (like myself) may want to make a non-full block the parent, such as "all sign variants are attached to the basic Sign item", which prevents hanging signs from being placed against ceilings due to this issue.