Json block behaviors OmniRotatable: Difference between revisions

From Vintage Story Wiki
Update orientation group names based on constants in BlockFacing.cs
(→‎Usage: Use syntaxhighlight for the example variant definitions)
(Update orientation group names based on constants in BlockFacing.cs)
Line 26: Line 26:
   </tr>
   </tr>
   <tr>
   <tr>
     <td>HV Vector</td>
     <td>All faces</td>
     <td>
     <td>
* <code>rot</code> variant code with the states "north", "east", "south", "west", "up", and "down"
* <code>rot</code> variant code with the states "north", "east", "south", "west", "up", and "down"
Line 43: Line 43:
   </tr>
   </tr>
   <tr>
   <tr>
     <td>Vertical</td>
     <td>Verticals</td>
     <td>
     <td>
* <code>rot</code> variant code with the states "up" and "down"
* <code>rot</code> variant code with the states "up" and "down"
Line 59: Line 59:
   </tr>
   </tr>
   <tr>
   <tr>
     <td>Horizontal</td>
     <td>Horizontals</td>
     <td>
     <td>
* <code>rot</code> variant code with the states "north", "east", "south", and "west"
* <code>rot</code> variant code with the states "north", "east", "south", and "west"
Line 118: Line 118:
</table>
</table>


Additionally, the behavior adds a placement mode to items. The behavior shows the placement mode when the item is hovered over in the inventory or hotbar. The placement modes are auto, horizontal, and vertical. Auto is the default. The horizontal and vertical modes only work correctly for the HV vector type.
Additionally, the behavior adds a placement mode to items. The behavior shows the placement mode when the item is hovered over in the inventory or hotbar. The placement modes are auto, horizontal, and vertical. Auto is the default. The horizontal and vertical modes only work correctly for the all faces type.


The behavior changes the placement mode when it detects that the block was created through crafting, and the first item in the recipe was an orientable block. So to allow changing the placement mode, add a 1x1 recipe that takes the block as input and produces it as output. The placement mode changes in the following cycle: auto to horizontal, horizontal to vertical, and vertical to auto.
The behavior changes the placement mode when it detects that the block was created through crafting, and the first item in the recipe was an orientable block. So to allow changing the placement mode, add a 1x1 recipe that takes the block as input and produces it as output. The placement mode changes in the following cycle: auto to horizontal, horizontal to vertical, and vertical to auto.


== Properties ==
== Properties ==
; <code>rotateSides</code>&#58; (boolean) : Enables the HV vector type.
; <code>rotateSides</code>&#58; (boolean) : Enables the all faces type.
; <code>rotateH</code>&#58; (boolean) : Enables orienting along the 4 cardinal directions.
; <code>rotateH</code>&#58; (boolean) : Enables orienting along the 4 cardinal directions.
; <code>rotateV</code>&#58; (boolean) : Enables orienting up or down.
; <code>rotateV</code>&#58; (boolean) : Enables orienting up or down.
Confirmedusers
261

edits