Json block behaviors horizontalattachable: Difference between revisions

From Vintage Story Wiki
→‎Usage: More accurate description of how parent blocks are searched
(→‎Properties: Be more specific about RotatableCube)
(→‎Usage: More accurate description of how parent blocks are searched)
 
Line 14: Line 14:
== Usage ==
== Usage ==


When the block is placed, the behavior will verify that the horizontal selected face on the parent block accepts the attachment. If the selected parent face is not horizontal, or it rejects the attachment, then block is instead attached to the first horizontal face of the parent block that accepts the attachment. If all of the horizontal faces of the parent block reject the attachment, then placing the attachment block is rejected. If the parent block changes such that it no longer accepts the attachment, then the attachment block is broken.
When the block is placed, the behavior will verify that the horizontal selected face on the parent block accepts the attachment. If the selected parent face is not horizontal, or it rejects the attachment, then attachment block finds the first horizontal neighbor block that accepts the attachment. If all of the horizontal neighbors reject the attachment, then placing the attachment block is rejected.
 
If the parent block changes such that it no longer accepts the attachment, then the attachment block is broken.


If the block passes the attachment checks, then it is oriented to the parent. In order to do so, the last variant group (the code does not matter) must contain the horizontal facing codes. They may be specified directly through the <code>states</code> field, but the cleaner way is to load them from the <code>abstract/horizontalorientation</code> [[Json:block:worldvariantgroups|world property]]:
If the block passes the attachment checks, then it is oriented to the parent. In order to do so, the last variant group (the code does not matter) must contain the horizontal facing codes. They may be specified directly through the <code>states</code> field, but the cleaner way is to load them from the <code>abstract/horizontalorientation</code> [[Json:block:worldvariantgroups|world property]]:
Confirmedusers
261

edits