User Tools

Site Tools


tutorial:directionalblock

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
tutorial:directionalblock [2021/02/15 06:48] – [Directional Blocks] Updated getOutlineShpe to fit current syntax arbeetutorial:directionalblock [2021/08/11 02:53] – use auto uv and uvlock solidblock
Line 38: Line 38:
  
  public BlockState getPlacementState(ItemPlacementContext ctx) {  public BlockState getPlacementState(ItemPlacementContext ctx) {
- return (BlockState)this.getDefaultState().with(FACING, ctx.getPlayerFacing());+ return (BlockState)this.getDefaultState().with(Properties.HORIZONTAL_FACING, ctx.getPlayerFacing().getOpposite());
  }  }
  
Line 51: Line 51:
 { {
   "variants": {   "variants": {
-    "facing=north": { "model": "bitmod:block/polished_andesite_side_block" }, +    "facing=north": { "model": "bitmod:block/polished_andesite_side_block", "uvlock": true }, 
-    "facing=east":  { "model": "bitmod:block/polished_andesite_side_block", "y":  90}, +    "facing=east":  { "model": "bitmod:block/polished_andesite_side_block", "y":  90, "uvlock": true }, 
-    "facing=south": { "model": "bitmod:block/polished_andesite_side_block", "y": 180 }, +    "facing=south": { "model": "bitmod:block/polished_andesite_side_block", "y": 180, "uvlock": true }, 
-    "facing=west":  { "model": "bitmod:block/polished_andesite_side_block", "y": 270 }+    "facing=west":  { "model": "bitmod:block/polished_andesite_side_block", "y": 270, "uvlock": true }
   }   }
 } }
Line 73: Line 73:
             "to": [  16, 16, 8 ],             "to": [  16, 16, 8 ],
             "faces": {             "faces": {
-                "down": "uv": [ 0, 8, 16, 16 ], "texture": "#bottom", "cullface": "down" }, +                "down":  { "texture": "#bottom", "cullface": "down" }, 
-                "up":    { "uv": [ 0, 8, 16, 16 ], "texture": "#top",    "cullface": "up" }, +                "up":    { "texture": "#top",    "cullface": "up" }, 
-                "north":"uv": [ 0, 0, 16, 16 ], "texture": "#side",   "cullface": "north" }, +                "north": { "texture": "#side",   "cullface": "north" }, 
-                "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#side },+                "south": { "texture": "#side"  "cullface": "south" },
                 "west":  { "texture": "#side",   "cullface": "west" },                 "west":  { "texture": "#side",   "cullface": "west" },
                 "east":  { "texture": "#side",   "cullface": "east" }                 "east":  { "texture": "#side",   "cullface": "east" }
tutorial/directionalblock.txt · Last modified: 2023/09/26 05:43 by poopooracoocoo