Doors
@@ -0,0 +1,98 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"block": {
|
||||
"id": "bworld:acacia_door",
|
||||
"name": "Acacia Door",
|
||||
"textures": {
|
||||
"item": "bworld:acacia_door",
|
||||
"bottom": "bworld:acacia_door_bottom",
|
||||
"top": "bworld:acacia_door_top"
|
||||
},
|
||||
"model": "bworld:door_bottom",
|
||||
"render_layer": "cutout",
|
||||
"states": [
|
||||
{
|
||||
"name": "facing",
|
||||
"bits": 2,
|
||||
"default": 0
|
||||
},
|
||||
{
|
||||
"name": "half",
|
||||
"bits": 1,
|
||||
"default": 0
|
||||
},
|
||||
{
|
||||
"name": "open",
|
||||
"bits": 1,
|
||||
"default": 0
|
||||
},
|
||||
{
|
||||
"name": "hinge",
|
||||
"bits": 1,
|
||||
"default": 0
|
||||
}
|
||||
],
|
||||
"variants": {
|
||||
"half=0,hinge=0,open=1": {
|
||||
"model": "bworld:door_bottom_rh"
|
||||
},
|
||||
"half=0,hinge=1,open=0": {
|
||||
"model": "bworld:door_bottom_rh"
|
||||
},
|
||||
"half=1,hinge=0,open=1": {
|
||||
"model": "bworld:door_top_rh"
|
||||
},
|
||||
"half=1,hinge=1,open=0": {
|
||||
"model": "bworld:door_top_rh"
|
||||
},
|
||||
"half=1": {
|
||||
"model": "bworld:door_top"
|
||||
},
|
||||
"facing=0,open=0": {
|
||||
"y": 270
|
||||
},
|
||||
"facing=0,open=1,hinge=0": {
|
||||
"y": 0
|
||||
},
|
||||
"facing=0,open=1,hinge=1": {
|
||||
"y": 180
|
||||
},
|
||||
"facing=1,open=0": {
|
||||
"y": 0
|
||||
},
|
||||
"facing=1,open=1,hinge=0": {
|
||||
"y": 90
|
||||
},
|
||||
"facing=1,open=1,hinge=1": {
|
||||
"y": 270
|
||||
},
|
||||
"facing=2,open=0": {
|
||||
"y": 90
|
||||
},
|
||||
"facing=2,open=1,hinge=0": {
|
||||
"y": 180
|
||||
},
|
||||
"facing=2,open=1,hinge=1": {
|
||||
"y": 0
|
||||
},
|
||||
"facing=3,open=0": {
|
||||
"y": 180
|
||||
},
|
||||
"facing=3,open=1,hinge=0": {
|
||||
"y": 270
|
||||
},
|
||||
"facing=3,open=1,hinge=1": {
|
||||
"y": 90
|
||||
}
|
||||
},
|
||||
"mining": {
|
||||
"toughness": 3,
|
||||
"tool": "axe"
|
||||
},
|
||||
"drops": "bworld:acacia_door",
|
||||
"interactive": true,
|
||||
"components": {
|
||||
"bworld:door": { "pairs_with": "bworld:wooden_doors" }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"block": {
|
||||
"id": "bworld:birch_door",
|
||||
"name": "Birch Door",
|
||||
"textures": {
|
||||
"item": "bworld:birch_door",
|
||||
"bottom": "bworld:birch_door_bottom",
|
||||
"top": "bworld:birch_door_top"
|
||||
},
|
||||
"model": "bworld:door_bottom",
|
||||
"render_layer": "cutout",
|
||||
"states": [
|
||||
{
|
||||
"name": "facing",
|
||||
"bits": 2,
|
||||
"default": 0
|
||||
},
|
||||
{
|
||||
"name": "half",
|
||||
"bits": 1,
|
||||
"default": 0
|
||||
},
|
||||
{
|
||||
"name": "open",
|
||||
"bits": 1,
|
||||
"default": 0
|
||||
},
|
||||
{
|
||||
"name": "hinge",
|
||||
"bits": 1,
|
||||
"default": 0
|
||||
}
|
||||
],
|
||||
"variants": {
|
||||
"half=0,hinge=0,open=1": {
|
||||
"model": "bworld:door_bottom_rh"
|
||||
},
|
||||
"half=0,hinge=1,open=0": {
|
||||
"model": "bworld:door_bottom_rh"
|
||||
},
|
||||
"half=1,hinge=0,open=1": {
|
||||
"model": "bworld:door_top_rh"
|
||||
},
|
||||
"half=1,hinge=1,open=0": {
|
||||
"model": "bworld:door_top_rh"
|
||||
},
|
||||
"half=1": {
|
||||
"model": "bworld:door_top"
|
||||
},
|
||||
"facing=0,open=0": {
|
||||
"y": 270
|
||||
},
|
||||
"facing=0,open=1,hinge=0": {
|
||||
"y": 0
|
||||
},
|
||||
"facing=0,open=1,hinge=1": {
|
||||
"y": 180
|
||||
},
|
||||
"facing=1,open=0": {
|
||||
"y": 0
|
||||
},
|
||||
"facing=1,open=1,hinge=0": {
|
||||
"y": 90
|
||||
},
|
||||
"facing=1,open=1,hinge=1": {
|
||||
"y": 270
|
||||
},
|
||||
"facing=2,open=0": {
|
||||
"y": 90
|
||||
},
|
||||
"facing=2,open=1,hinge=0": {
|
||||
"y": 180
|
||||
},
|
||||
"facing=2,open=1,hinge=1": {
|
||||
"y": 0
|
||||
},
|
||||
"facing=3,open=0": {
|
||||
"y": 180
|
||||
},
|
||||
"facing=3,open=1,hinge=0": {
|
||||
"y": 270
|
||||
},
|
||||
"facing=3,open=1,hinge=1": {
|
||||
"y": 90
|
||||
}
|
||||
},
|
||||
"mining": {
|
||||
"toughness": 3,
|
||||
"tool": "axe"
|
||||
},
|
||||
"drops": "bworld:birch_door",
|
||||
"interactive": true,
|
||||
"components": {
|
||||
"bworld:door": { "pairs_with": "bworld:wooden_doors" }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"block": {
|
||||
"id": "bworld:cherry_door",
|
||||
"name": "Cherry Door",
|
||||
"textures": {
|
||||
"item": "bworld:cherry_door",
|
||||
"bottom": "bworld:cherry_door_bottom",
|
||||
"top": "bworld:cherry_door_top"
|
||||
},
|
||||
"model": "bworld:door_bottom",
|
||||
"render_layer": "cutout",
|
||||
"states": [
|
||||
{
|
||||
"name": "facing",
|
||||
"bits": 2,
|
||||
"default": 0
|
||||
},
|
||||
{
|
||||
"name": "half",
|
||||
"bits": 1,
|
||||
"default": 0
|
||||
},
|
||||
{
|
||||
"name": "open",
|
||||
"bits": 1,
|
||||
"default": 0
|
||||
},
|
||||
{
|
||||
"name": "hinge",
|
||||
"bits": 1,
|
||||
"default": 0
|
||||
}
|
||||
],
|
||||
"variants": {
|
||||
"half=0,hinge=0,open=1": {
|
||||
"model": "bworld:door_bottom_rh"
|
||||
},
|
||||
"half=0,hinge=1,open=0": {
|
||||
"model": "bworld:door_bottom_rh"
|
||||
},
|
||||
"half=1,hinge=0,open=1": {
|
||||
"model": "bworld:door_top_rh"
|
||||
},
|
||||
"half=1,hinge=1,open=0": {
|
||||
"model": "bworld:door_top_rh"
|
||||
},
|
||||
"half=1": {
|
||||
"model": "bworld:door_top"
|
||||
},
|
||||
"facing=0,open=0": {
|
||||
"y": 270
|
||||
},
|
||||
"facing=0,open=1,hinge=0": {
|
||||
"y": 0
|
||||
},
|
||||
"facing=0,open=1,hinge=1": {
|
||||
"y": 180
|
||||
},
|
||||
"facing=1,open=0": {
|
||||
"y": 0
|
||||
},
|
||||
"facing=1,open=1,hinge=0": {
|
||||
"y": 90
|
||||
},
|
||||
"facing=1,open=1,hinge=1": {
|
||||
"y": 270
|
||||
},
|
||||
"facing=2,open=0": {
|
||||
"y": 90
|
||||
},
|
||||
"facing=2,open=1,hinge=0": {
|
||||
"y": 180
|
||||
},
|
||||
"facing=2,open=1,hinge=1": {
|
||||
"y": 0
|
||||
},
|
||||
"facing=3,open=0": {
|
||||
"y": 180
|
||||
},
|
||||
"facing=3,open=1,hinge=0": {
|
||||
"y": 270
|
||||
},
|
||||
"facing=3,open=1,hinge=1": {
|
||||
"y": 90
|
||||
}
|
||||
},
|
||||
"mining": {
|
||||
"toughness": 3,
|
||||
"tool": "axe"
|
||||
},
|
||||
"drops": "bworld:cherry_door",
|
||||
"interactive": true,
|
||||
"components": {
|
||||
"bworld:door": { "pairs_with": "bworld:wooden_doors" }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"block": {
|
||||
"id": "bworld:dark_oak_door",
|
||||
"name": "Dark Oak Door",
|
||||
"textures": {
|
||||
"item": "bworld:dark_oak_door",
|
||||
"bottom": "bworld:dark_oak_door_bottom",
|
||||
"top": "bworld:dark_oak_door_top"
|
||||
},
|
||||
"model": "bworld:door_bottom",
|
||||
"render_layer": "cutout",
|
||||
"states": [
|
||||
{
|
||||
"name": "facing",
|
||||
"bits": 2,
|
||||
"default": 0
|
||||
},
|
||||
{
|
||||
"name": "half",
|
||||
"bits": 1,
|
||||
"default": 0
|
||||
},
|
||||
{
|
||||
"name": "open",
|
||||
"bits": 1,
|
||||
"default": 0
|
||||
},
|
||||
{
|
||||
"name": "hinge",
|
||||
"bits": 1,
|
||||
"default": 0
|
||||
}
|
||||
],
|
||||
"variants": {
|
||||
"half=0,hinge=0,open=1": {
|
||||
"model": "bworld:door_bottom_rh"
|
||||
},
|
||||
"half=0,hinge=1,open=0": {
|
||||
"model": "bworld:door_bottom_rh"
|
||||
},
|
||||
"half=1,hinge=0,open=1": {
|
||||
"model": "bworld:door_top_rh"
|
||||
},
|
||||
"half=1,hinge=1,open=0": {
|
||||
"model": "bworld:door_top_rh"
|
||||
},
|
||||
"half=1": {
|
||||
"model": "bworld:door_top"
|
||||
},
|
||||
"facing=0,open=0": {
|
||||
"y": 270
|
||||
},
|
||||
"facing=0,open=1,hinge=0": {
|
||||
"y": 0
|
||||
},
|
||||
"facing=0,open=1,hinge=1": {
|
||||
"y": 180
|
||||
},
|
||||
"facing=1,open=0": {
|
||||
"y": 0
|
||||
},
|
||||
"facing=1,open=1,hinge=0": {
|
||||
"y": 90
|
||||
},
|
||||
"facing=1,open=1,hinge=1": {
|
||||
"y": 270
|
||||
},
|
||||
"facing=2,open=0": {
|
||||
"y": 90
|
||||
},
|
||||
"facing=2,open=1,hinge=0": {
|
||||
"y": 180
|
||||
},
|
||||
"facing=2,open=1,hinge=1": {
|
||||
"y": 0
|
||||
},
|
||||
"facing=3,open=0": {
|
||||
"y": 180
|
||||
},
|
||||
"facing=3,open=1,hinge=0": {
|
||||
"y": 270
|
||||
},
|
||||
"facing=3,open=1,hinge=1": {
|
||||
"y": 90
|
||||
}
|
||||
},
|
||||
"mining": {
|
||||
"toughness": 3,
|
||||
"tool": "axe"
|
||||
},
|
||||
"drops": "bworld:dark_oak_door",
|
||||
"interactive": true,
|
||||
"components": {
|
||||
"bworld:door": { "pairs_with": "bworld:wooden_doors" }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"block": {
|
||||
"id": "bworld:jungle_door",
|
||||
"name": "Jungle Door",
|
||||
"textures": {
|
||||
"item": "bworld:jungle_door",
|
||||
"bottom": "bworld:jungle_door_bottom",
|
||||
"top": "bworld:jungle_door_top"
|
||||
},
|
||||
"model": "bworld:door_bottom",
|
||||
"render_layer": "cutout",
|
||||
"states": [
|
||||
{
|
||||
"name": "facing",
|
||||
"bits": 2,
|
||||
"default": 0
|
||||
},
|
||||
{
|
||||
"name": "half",
|
||||
"bits": 1,
|
||||
"default": 0
|
||||
},
|
||||
{
|
||||
"name": "open",
|
||||
"bits": 1,
|
||||
"default": 0
|
||||
},
|
||||
{
|
||||
"name": "hinge",
|
||||
"bits": 1,
|
||||
"default": 0
|
||||
}
|
||||
],
|
||||
"variants": {
|
||||
"half=0,hinge=0,open=1": {
|
||||
"model": "bworld:door_bottom_rh"
|
||||
},
|
||||
"half=0,hinge=1,open=0": {
|
||||
"model": "bworld:door_bottom_rh"
|
||||
},
|
||||
"half=1,hinge=0,open=1": {
|
||||
"model": "bworld:door_top_rh"
|
||||
},
|
||||
"half=1,hinge=1,open=0": {
|
||||
"model": "bworld:door_top_rh"
|
||||
},
|
||||
"half=1": {
|
||||
"model": "bworld:door_top"
|
||||
},
|
||||
"facing=0,open=0": {
|
||||
"y": 270
|
||||
},
|
||||
"facing=0,open=1,hinge=0": {
|
||||
"y": 0
|
||||
},
|
||||
"facing=0,open=1,hinge=1": {
|
||||
"y": 180
|
||||
},
|
||||
"facing=1,open=0": {
|
||||
"y": 0
|
||||
},
|
||||
"facing=1,open=1,hinge=0": {
|
||||
"y": 90
|
||||
},
|
||||
"facing=1,open=1,hinge=1": {
|
||||
"y": 270
|
||||
},
|
||||
"facing=2,open=0": {
|
||||
"y": 90
|
||||
},
|
||||
"facing=2,open=1,hinge=0": {
|
||||
"y": 180
|
||||
},
|
||||
"facing=2,open=1,hinge=1": {
|
||||
"y": 0
|
||||
},
|
||||
"facing=3,open=0": {
|
||||
"y": 180
|
||||
},
|
||||
"facing=3,open=1,hinge=0": {
|
||||
"y": 270
|
||||
},
|
||||
"facing=3,open=1,hinge=1": {
|
||||
"y": 90
|
||||
}
|
||||
},
|
||||
"mining": {
|
||||
"toughness": 3,
|
||||
"tool": "axe"
|
||||
},
|
||||
"drops": "bworld:jungle_door",
|
||||
"interactive": true,
|
||||
"components": {
|
||||
"bworld:door": { "pairs_with": "bworld:wooden_doors" }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"block": {
|
||||
"id": "bworld:oak_door",
|
||||
"name": "Oak Door",
|
||||
"textures": {
|
||||
"item": "bworld:oak_door",
|
||||
"bottom": "bworld:oak_door_bottom",
|
||||
"top": "bworld:oak_door_top"
|
||||
},
|
||||
"model": "bworld:door_bottom",
|
||||
"render_layer": "cutout",
|
||||
"states": [
|
||||
{
|
||||
"name": "facing",
|
||||
"bits": 2,
|
||||
"default": 0
|
||||
},
|
||||
{
|
||||
"name": "half",
|
||||
"bits": 1,
|
||||
"default": 0
|
||||
},
|
||||
{
|
||||
"name": "open",
|
||||
"bits": 1,
|
||||
"default": 0
|
||||
},
|
||||
{
|
||||
"name": "hinge",
|
||||
"bits": 1,
|
||||
"default": 0
|
||||
}
|
||||
],
|
||||
"variants": {
|
||||
"half=0,hinge=0,open=1": {
|
||||
"model": "bworld:door_bottom_rh"
|
||||
},
|
||||
"half=0,hinge=1,open=0": {
|
||||
"model": "bworld:door_bottom_rh"
|
||||
},
|
||||
"half=1,hinge=0,open=1": {
|
||||
"model": "bworld:door_top_rh"
|
||||
},
|
||||
"half=1,hinge=1,open=0": {
|
||||
"model": "bworld:door_top_rh"
|
||||
},
|
||||
"half=1": {
|
||||
"model": "bworld:door_top"
|
||||
},
|
||||
"facing=0,open=0": {
|
||||
"y": 270
|
||||
},
|
||||
"facing=0,open=1,hinge=0": {
|
||||
"y": 0
|
||||
},
|
||||
"facing=0,open=1,hinge=1": {
|
||||
"y": 180
|
||||
},
|
||||
"facing=1,open=0": {
|
||||
"y": 0
|
||||
},
|
||||
"facing=1,open=1,hinge=0": {
|
||||
"y": 90
|
||||
},
|
||||
"facing=1,open=1,hinge=1": {
|
||||
"y": 270
|
||||
},
|
||||
"facing=2,open=0": {
|
||||
"y": 90
|
||||
},
|
||||
"facing=2,open=1,hinge=0": {
|
||||
"y": 180
|
||||
},
|
||||
"facing=2,open=1,hinge=1": {
|
||||
"y": 0
|
||||
},
|
||||
"facing=3,open=0": {
|
||||
"y": 180
|
||||
},
|
||||
"facing=3,open=1,hinge=0": {
|
||||
"y": 270
|
||||
},
|
||||
"facing=3,open=1,hinge=1": {
|
||||
"y": 90
|
||||
}
|
||||
},
|
||||
"mining": {
|
||||
"toughness": 3,
|
||||
"tool": "axe"
|
||||
},
|
||||
"drops": "bworld:oak_door",
|
||||
"interactive": true,
|
||||
"components": {
|
||||
"bworld:door": { "pairs_with": "bworld:wooden_doors" }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"block": {
|
||||
"id": "bworld:spruce_door",
|
||||
"name": "Spruce Door",
|
||||
"textures": {
|
||||
"item": "bworld:spruce_door",
|
||||
"bottom": "bworld:spruce_door_bottom",
|
||||
"top": "bworld:spruce_door_top"
|
||||
},
|
||||
"model": "bworld:door_bottom",
|
||||
"render_layer": "cutout",
|
||||
"states": [
|
||||
{
|
||||
"name": "facing",
|
||||
"bits": 2,
|
||||
"default": 0
|
||||
},
|
||||
{
|
||||
"name": "half",
|
||||
"bits": 1,
|
||||
"default": 0
|
||||
},
|
||||
{
|
||||
"name": "open",
|
||||
"bits": 1,
|
||||
"default": 0
|
||||
},
|
||||
{
|
||||
"name": "hinge",
|
||||
"bits": 1,
|
||||
"default": 0
|
||||
}
|
||||
],
|
||||
"variants": {
|
||||
"half=0,hinge=0,open=1": {
|
||||
"model": "bworld:door_bottom_rh"
|
||||
},
|
||||
"half=0,hinge=1,open=0": {
|
||||
"model": "bworld:door_bottom_rh"
|
||||
},
|
||||
"half=1,hinge=0,open=1": {
|
||||
"model": "bworld:door_top_rh"
|
||||
},
|
||||
"half=1,hinge=1,open=0": {
|
||||
"model": "bworld:door_top_rh"
|
||||
},
|
||||
"half=1": {
|
||||
"model": "bworld:door_top"
|
||||
},
|
||||
"facing=0,open=0": {
|
||||
"y": 270
|
||||
},
|
||||
"facing=0,open=1,hinge=0": {
|
||||
"y": 0
|
||||
},
|
||||
"facing=0,open=1,hinge=1": {
|
||||
"y": 180
|
||||
},
|
||||
"facing=1,open=0": {
|
||||
"y": 0
|
||||
},
|
||||
"facing=1,open=1,hinge=0": {
|
||||
"y": 90
|
||||
},
|
||||
"facing=1,open=1,hinge=1": {
|
||||
"y": 270
|
||||
},
|
||||
"facing=2,open=0": {
|
||||
"y": 90
|
||||
},
|
||||
"facing=2,open=1,hinge=0": {
|
||||
"y": 180
|
||||
},
|
||||
"facing=2,open=1,hinge=1": {
|
||||
"y": 0
|
||||
},
|
||||
"facing=3,open=0": {
|
||||
"y": 180
|
||||
},
|
||||
"facing=3,open=1,hinge=0": {
|
||||
"y": 270
|
||||
},
|
||||
"facing=3,open=1,hinge=1": {
|
||||
"y": 90
|
||||
}
|
||||
},
|
||||
"mining": {
|
||||
"toughness": 3,
|
||||
"tool": "axe"
|
||||
},
|
||||
"drops": "bworld:spruce_door",
|
||||
"interactive": true,
|
||||
"components": {
|
||||
"bworld:door": { "pairs_with": "bworld:wooden_doors" }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"model": {
|
||||
"id": "bworld:door_bottom",
|
||||
"elements": [
|
||||
{
|
||||
"from": [0, 0, 0],
|
||||
"to": [3, 16, 16],
|
||||
"faces": {
|
||||
"bottom": {
|
||||
"texture": "#bottom",
|
||||
"uv": [13, 0, 16, 16],
|
||||
"cullface": "bottom"
|
||||
},
|
||||
"north": {
|
||||
"texture": "#bottom",
|
||||
"uv": [3, 0, 0, 16],
|
||||
"cullface": "north"
|
||||
},
|
||||
"south": {
|
||||
"texture": "#bottom",
|
||||
"uv": [0, 0, 3, 16],
|
||||
"cullface": "south"
|
||||
},
|
||||
"west": {
|
||||
"texture": "#bottom",
|
||||
"uv": [0, 0, 16, 16],
|
||||
"cullface": "west"
|
||||
},
|
||||
"east": {
|
||||
"texture": "#bottom",
|
||||
"uv": [16, 0, 0, 16]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"model": {
|
||||
"id": "bworld:door_bottom_rh",
|
||||
"elements": [
|
||||
{
|
||||
"from": [0, 0, 0],
|
||||
"to": [3, 16, 16],
|
||||
"faces": {
|
||||
"bottom": {
|
||||
"texture": "#bottom",
|
||||
"uv": [13, 0, 16, 16],
|
||||
"cullface": "bottom"
|
||||
},
|
||||
"north": {
|
||||
"texture": "#bottom",
|
||||
"uv": [3, 0, 0, 16],
|
||||
"cullface": "north"
|
||||
},
|
||||
"south": {
|
||||
"texture": "#bottom",
|
||||
"uv": [0, 0, 3, 16],
|
||||
"cullface": "south"
|
||||
},
|
||||
"west": {
|
||||
"texture": "#bottom",
|
||||
"uv": [16, 0, 0, 16],
|
||||
"cullface": "west"
|
||||
},
|
||||
"east": {
|
||||
"texture": "#bottom",
|
||||
"uv": [0, 0, 16, 16]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"model": {
|
||||
"id": "bworld:door_top",
|
||||
"elements": [
|
||||
{
|
||||
"from": [0, 0, 0],
|
||||
"to": [3, 16, 16],
|
||||
"faces": {
|
||||
"top": {
|
||||
"texture": "#bottom",
|
||||
"uv": [13, 0, 16, 16],
|
||||
"cullface": "top"
|
||||
},
|
||||
"north": {
|
||||
"texture": "#top",
|
||||
"uv": [3, 0, 0, 16],
|
||||
"cullface": "north"
|
||||
},
|
||||
"south": {
|
||||
"texture": "#top",
|
||||
"uv": [0, 0, 3, 16],
|
||||
"cullface": "south"
|
||||
},
|
||||
"west": {
|
||||
"texture": "#top",
|
||||
"uv": [0, 0, 16, 16],
|
||||
"cullface": "west"
|
||||
},
|
||||
"east": {
|
||||
"texture": "#top",
|
||||
"uv": [16, 0, 0, 16]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"model": {
|
||||
"id": "bworld:door_top_rh",
|
||||
"elements": [
|
||||
{
|
||||
"from": [0, 0, 0],
|
||||
"to": [3, 16, 16],
|
||||
"faces": {
|
||||
"top": {
|
||||
"texture": "#bottom",
|
||||
"uv": [13, 0, 16, 16],
|
||||
"cullface": "top"
|
||||
},
|
||||
"north": {
|
||||
"texture": "#top",
|
||||
"uv": [3, 0, 0, 16],
|
||||
"cullface": "north"
|
||||
},
|
||||
"south": {
|
||||
"texture": "#top",
|
||||
"uv": [0, 0, 3, 16],
|
||||
"cullface": "south"
|
||||
},
|
||||
"west": {
|
||||
"texture": "#top",
|
||||
"uv": [16, 0, 0, 16],
|
||||
"cullface": "west"
|
||||
},
|
||||
"east": {
|
||||
"texture": "#top",
|
||||
"uv": [0, 0, 16, 16]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"recipe": {
|
||||
"type": "shaped",
|
||||
"pattern": [
|
||||
"PP",
|
||||
"PP",
|
||||
"PP"
|
||||
],
|
||||
"key": {
|
||||
"P": "bworld:acacia_planks"
|
||||
},
|
||||
"result": {
|
||||
"id": "bworld:acacia_door",
|
||||
"count": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"recipe": {
|
||||
"type": "shaped",
|
||||
"pattern": [
|
||||
"PP",
|
||||
"PP",
|
||||
"PP"
|
||||
],
|
||||
"key": {
|
||||
"P": "bworld:birch_planks"
|
||||
},
|
||||
"result": {
|
||||
"id": "bworld:birch_door",
|
||||
"count": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"recipe": {
|
||||
"type": "shaped",
|
||||
"pattern": [
|
||||
"PP",
|
||||
"PP",
|
||||
"PP"
|
||||
],
|
||||
"key": {
|
||||
"P": "bworld:cherry_planks"
|
||||
},
|
||||
"result": {
|
||||
"id": "bworld:cherry_door",
|
||||
"count": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"recipe": {
|
||||
"type": "shaped",
|
||||
"pattern": [
|
||||
"PP",
|
||||
"PP",
|
||||
"PP"
|
||||
],
|
||||
"key": {
|
||||
"P": "bworld:dark_oak_planks"
|
||||
},
|
||||
"result": {
|
||||
"id": "bworld:dark_oak_door",
|
||||
"count": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"recipe": {
|
||||
"type": "shaped",
|
||||
"pattern": [
|
||||
"PP",
|
||||
"PP",
|
||||
"PP"
|
||||
],
|
||||
"key": {
|
||||
"P": "bworld:jungle_planks"
|
||||
},
|
||||
"result": {
|
||||
"id": "bworld:jungle_door",
|
||||
"count": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"recipe": {
|
||||
"type": "shaped",
|
||||
"pattern": [
|
||||
"PP",
|
||||
"PP",
|
||||
"PP"
|
||||
],
|
||||
"key": {
|
||||
"P": "bworld:oak_planks"
|
||||
},
|
||||
"result": {
|
||||
"id": "bworld:oak_door",
|
||||
"count": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"recipe": {
|
||||
"type": "shaped",
|
||||
"pattern": [
|
||||
"PP",
|
||||
"PP",
|
||||
"PP"
|
||||
],
|
||||
"key": {
|
||||
"P": "bworld:spruce_planks"
|
||||
},
|
||||
"result": {
|
||||
"id": "bworld:spruce_door",
|
||||
"count": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ export function setup(ctx: ServerContext) {
|
||||
register_smithing_table(ctx);
|
||||
register_farming(ctx);
|
||||
register_fishing(ctx);
|
||||
register_door(ctx);
|
||||
register_buckets(ctx);
|
||||
register_curios(ctx);
|
||||
register_effects(ctx);
|
||||
@@ -645,3 +646,42 @@ function register_growable_block(ctx: ServerContext) {
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// doors are two blocks, a lower and an upper half, see register_door in shared.ts. one is only placed with air above
|
||||
// it, where the upper half goes, and breaking either half takes the other away with it. only the half that was broken
|
||||
// drops the door, the other is just taken away
|
||||
const DOOR = "bworld:door";
|
||||
|
||||
function register_door(ctx: ServerContext) {
|
||||
const is_door = (id: string) => DOOR in ctx.blocks.components(id);
|
||||
ctx.events.before.block_place.subscribe((event) => {
|
||||
const { id, x, y, z } = event.block;
|
||||
if (is_door(id) && ctx.world.get_block(x, y + 1, z) !== "bworld:air") event.cancel = true;
|
||||
});
|
||||
ctx.events.after.block_place.subscribe(({ block: { id, x, y, z } }) => {
|
||||
if (!is_door(id)) return;
|
||||
ctx.world.set_block(x, y + 1, z, id);
|
||||
for (const state of ["facing", "open", "hinge"]) {
|
||||
ctx.world.set_state(x, y + 1, z, state, ctx.world.get_state(x, y, z, state) ?? 0);
|
||||
}
|
||||
ctx.world.set_state(x, y + 1, z, "half", 1);
|
||||
});
|
||||
|
||||
// the halves being taken away, so the other half's on_break doesn't take the first away again
|
||||
const breaking = new Set<string>();
|
||||
ctx.components.register_block(DOOR, {
|
||||
on_break(block) {
|
||||
const { x, y, z } = block;
|
||||
if (breaking.has(`${x},${y},${z}`)) return;
|
||||
const other = ctx.world.get_state(x, y, z, "half") ? y - 1 : y + 1;
|
||||
if (ctx.world.get_block(x, other, z) !== block.id) return;
|
||||
const halves = [`${x},${y},${z}`, `${x},${other},${z}`];
|
||||
for (const half of halves) breaking.add(half);
|
||||
try {
|
||||
ctx.world.set_block(x, other, z, "bworld:air");
|
||||
} finally {
|
||||
for (const half of halves) breaking.delete(half);
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
// the base game's block rules: how blocks are placed and how they change with the blocks beside them. they run on the
|
||||
// server and on every client, so players see a fence join or a trapdoor turn the moment they place it, and a trapdoor
|
||||
// open the moment they click it
|
||||
// or a door open the moment they click it
|
||||
import type { SharedBlock, SharedContext } from "bworld/shared";
|
||||
|
||||
export function setup(ctx: SharedContext) {
|
||||
register_fence(ctx);
|
||||
register_trapdoor(ctx);
|
||||
register_door(ctx);
|
||||
}
|
||||
|
||||
// the sides a fence connects on, and the face of the block there it connects to
|
||||
@@ -65,3 +66,68 @@ function register_trapdoor(ctx: SharedContext) {
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// the way along the ground each facing goes, in FACINGS' order
|
||||
const FACING_STEPS = [[0, -1], [1, 0], [0, 1], [-1, 0]];
|
||||
|
||||
// a door is two blocks, its lower half (half 0) and its upper half (half 1), with the same states. it faces the way
|
||||
// the player placing it looks, and is hinged on the side away from a door of its kind beside it, so the two meet in
|
||||
// the middle as a double door, like minecraft's DoorBlock.getHinge. without one, on the side of the block the player
|
||||
// clicked toward. right clicking either half opens or closes both, and the other door of a double door with it. the
|
||||
// server places the upper half and takes away the other half when one breaks, see register_door in server.ts.
|
||||
// "pairs_with" is the tag of doors it makes double doors with
|
||||
interface DoorParams {
|
||||
pairs_with: string;
|
||||
}
|
||||
|
||||
function register_door(ctx: SharedContext) {
|
||||
// a door's lower half there, of the kind this one pairs with
|
||||
const door_at = (x: number, y: number, z: number, params: DoorParams) => {
|
||||
const id = ctx.world.get_block(x, y, z);
|
||||
return id !== undefined && ctx.tags.has("blocks", params.pairs_with, id) &&
|
||||
ctx.world.get_state(x, y, z, "half") === 0;
|
||||
};
|
||||
// opens or closes both halves of the door whose lower half is there
|
||||
const set_open = (x: number, y: number, z: number, open: number) => {
|
||||
if (ctx.world.get_block(x, y + 1, z) === ctx.world.get_block(x, y, z)) {
|
||||
ctx.world.set_state(x, y + 1, z, "open", open);
|
||||
}
|
||||
return ctx.world.set_state(x, y, z, "open", open);
|
||||
};
|
||||
|
||||
ctx.components.register_block<DoorParams>("bworld:door", {
|
||||
on_interact(block, params) {
|
||||
const { x, z } = block;
|
||||
const y = ctx.world.get_state(x, block.y, z, "half") ? block.y - 1 : block.y;
|
||||
const state = (name: string, at_x = x, at_z = z) => ctx.world.get_state(at_x, y, at_z, name);
|
||||
const was_open = state("open");
|
||||
const open = was_open ? 0 : 1;
|
||||
// the other door of a double door is beside its free edge, facing the same way, hinged the other way, and
|
||||
// open or closed like it
|
||||
const facing = state("facing")!;
|
||||
const [step_x, step_z] = FACING_STEPS[(facing + (state("hinge") ? 3 : 1)) % 4];
|
||||
const [px, pz] = [x + step_x, z + step_z];
|
||||
if (
|
||||
door_at(px, y, pz, params) && state("facing", px, pz) === facing &&
|
||||
state("hinge", px, pz) !== state("hinge") && state("open", px, pz) === was_open
|
||||
) {
|
||||
set_open(px, y, pz, open);
|
||||
}
|
||||
return set_open(x, y, z, open);
|
||||
},
|
||||
state_for_placement(placement, params): Record<string, number> {
|
||||
const facing = FACINGS.indexOf(placement.facing);
|
||||
const { x, y, z } = placement;
|
||||
const [left_x, left_z] = FACING_STEPS[(facing + 3) % 4];
|
||||
const [right_x, right_z] = FACING_STEPS[(facing + 1) % 4];
|
||||
const door_left = door_at(x + left_x, y, z + left_z, params);
|
||||
const door_right = door_at(x + right_x, y, z + right_z, params);
|
||||
if (door_left !== door_right) return { facing, half: 0, hinge: door_left ? 1 : 0 };
|
||||
const [step_x, step_z] = FACING_STEPS[facing];
|
||||
const [hit_x, , hit_z] = placement.hit;
|
||||
const right = (step_x < 0 && hit_z < 0.5) || (step_x > 0 && hit_z > 0.5) ||
|
||||
(step_z < 0 && hit_x > 0.5) || (step_z > 0 && hit_x < 0.5);
|
||||
return { facing, half: 0, hinge: right ? 1 : 0 };
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"tag": {
|
||||
"values": [
|
||||
"bworld:oak_door",
|
||||
"bworld:spruce_door",
|
||||
"bworld:birch_door",
|
||||
"bworld:jungle_door",
|
||||
"bworld:acacia_door",
|
||||
"bworld:dark_oak_door",
|
||||
"bworld:cherry_door"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 6.2 KiB |
|
After Width: | Height: | Size: 6.2 KiB |
|
After Width: | Height: | Size: 6.0 KiB |
|
After Width: | Height: | Size: 6.1 KiB |
|
After Width: | Height: | Size: 6.2 KiB |
|
After Width: | Height: | Size: 6.2 KiB |
|
After Width: | Height: | Size: 6.1 KiB |
|
After Width: | Height: | Size: 6.1 KiB |
|
After Width: | Height: | Size: 6.0 KiB |
|
After Width: | Height: | Size: 6.2 KiB |
|
After Width: | Height: | Size: 6.1 KiB |
|
After Width: | Height: | Size: 6.3 KiB |
|
After Width: | Height: | Size: 6.2 KiB |
|
After Width: | Height: | Size: 353 B |
|
After Width: | Height: | Size: 359 B |
|
After Width: | Height: | Size: 6.1 KiB |
|
After Width: | Height: | Size: 462 B |
|
After Width: | Height: | Size: 491 B |
|
After Width: | Height: | Size: 503 B |
|
After Width: | Height: | Size: 380 B |
|
After Width: | Height: | Size: 6.4 KiB |