Add color swappers, color swapping, and color targets.

This commit is contained in:
Signal 2025-11-19 11:43:24 -05:00
parent 9acd605c86
commit 5fd67703c0
34 changed files with 688 additions and 29 deletions

View file

@ -11,6 +11,8 @@ function artifact.register_node(name, def)
if not def.groups then def.groups = {} end
if artifact.debug then
def.groups.dig_immediate = 3
else
def.groups.everything = 1
end
if def._variants then
for _, x in ipairs(def._variants) do
@ -317,6 +319,16 @@ artifact.register_node("ladder_wood", {
climbable = true
})
artifact.register_node("ladder_iron", {
drawtype = "mesh",
mesh = "artifact_ladder.obj",
paramtype = "light",
paramtype2 = "facedir",
tiles = {"artifact_ladder_iron.png"},
walkable = false,
climbable = true
})
artifact.register_node("glass", {
drawtype = "glasslike",
@ -333,7 +345,38 @@ local function register_lamp(color, brightness)
tiles = {"artifact_lamp_"..color..".png"},
light_source = brightness,
paramtype = "light",
sunlight_propagates = true
sunlight_propagates = true,
collision_box = {
type = "fixed",
fixed = {
{
-2/16,0,-2/16,
2/16, 4/16, 2/16
}
}
}
})
artifact.register_node("lamp_"..color.."_wall", {
drawtype = "mesh",
mesh = "artifact_lamp_wall.obj",
tiles = {"artifact_lamp_"..color..".png"},
light_source = brightness,
paramtype = "light",
sunlight_propagates = true,
paramtype2 = "facedir",
collision_box = {
type = "fixed",
fixed = {
{
-2/16,-1/16,-1/16,
2/16, 3/16, 3/16
},
{
-1/16,4/16,-1/16,
1/16, 6/16, 8/16
},
}
}
})
artifact.register_node("lamp_"..color.."_hanging", {
drawtype = "mesh",
@ -341,7 +384,16 @@ local function register_lamp(color, brightness)
tiles = {"artifact_lamp_"..color..".png"},
light_source = brightness,
paramtype = "light",
sunlight_propagates = true
sunlight_propagates = true,
collision_box = {
type = "fixed",
fixed = {
{
-2/16,0,-2/16,
2/16, 4/16, 2/16
}
}
}
})
end

View file

@ -0,0 +1,141 @@
# Made in Blockbench 4.12.5
mtllib artifact_lamp_wall.mtl
o cube
v 0.125 0.1875 0.1875
v 0.125 0.1875 -0.0625
v 0.125 -0.0625 0.1875
v 0.125 -0.0625 -0.0625
v -0.125 0.1875 -0.0625
v -0.125 0.1875 0.1875
v -0.125 -0.0625 -0.0625
v -0.125 -0.0625 0.1875
vt 0 1
vt 0.25 1
vt 0.25 0.75
vt 0 0.75
vt 0 0.75
vt 0.25 0.75
vt 0.25 0.5
vt 0 0.5
vt 0.25 1
vt 0.5 1
vt 0.5 0.75
vt 0.25 0.75
vt 0.25 0.75
vt 0.5 0.75
vt 0.5 0.5
vt 0.25 0.5
vt 0.25 0.25
vt 0 0.25
vt 0 0.5
vt 0.25 0.5
vt 0.75 1
vt 0.5 1
vt 0.5 0.75
vt 0.75 0.75
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_d2e02cf9-1542-9bb0-7e9d-18f7f87eca79
f 4/4/1 7/3/1 5/2/1 2/1/1
f 3/8/2 4/7/2 2/6/2 1/5/2
f 8/12/3 3/11/3 1/10/3 6/9/3
f 7/16/4 8/15/4 6/14/4 5/13/4
f 6/20/5 1/19/5 2/18/5 5/17/5
f 7/24/6 4/23/6 3/22/6 8/21/6
o cube
v -0.0624999999999993 0.24999999999999928 2.42146138045992e-16
v -0.06250000000000071 0.3749999999999993 -2.5745422303532846e-16
v -0.062499999999999355 0.2500000000000013 0.5000000000000002
v -0.06250000000000076 0.3750000000000013 0.4999999999999998
v 0.0624999999999993 0.3750000000000007 -2.42146138045992e-16
v 0.06250000000000071 0.2500000000000007 2.5745422303532846e-16
v 0.06249999999999924 0.3750000000000027 0.4999999999999998
v 0.06250000000000064 0.2500000000000027 0.5000000000000002
vt 0.25 0.5
vt 0.375 0.5
vt 0.375 0
vt 0.25 0
vt 0.5 0.75
vt 0.625 0.75
vt 0.625 0.25
vt 0.5 0.25
vt 0.375 0.5
vt 0.5 0.5
vt 0.5 0
vt 0.375 0
vt 0.625 0.75
vt 0.75 0.75
vt 0.75 0.25
vt 0.625 0.25
vt 0.125 0.125
vt 0 0.125
vt 0 0.25
vt 0.125 0.25
vt 0.875 1
vt 0.75 1
vt 0.75 0.875
vt 0.875 0.875
vn -1.12246949261663e-14 1 -3.996802888650565e-15
vn -1 -1.12246949261663e-14 -1.2246467991469107e-16
vn 1.12246949261663e-14 -1 3.996802888650565e-15
vn 1 1.12246949261663e-14 1.2246467991469107e-16
vn 1.2246467991473663e-16 -3.996802888650562e-15 -1
vn -1.2246467991473663e-16 3.996802888650562e-15 1
usemtl m_d2e02cf9-1542-9bb0-7e9d-18f7f87eca79
f 12/28/7 15/27/7 13/26/7 10/25/7
f 11/32/8 12/31/8 10/30/8 9/29/8
f 16/36/9 11/35/9 9/34/9 14/33/9
f 15/40/10 16/39/10 14/38/10 13/37/10
f 14/44/11 9/43/11 10/42/11 13/41/11
f 15/48/12 12/47/12 11/46/12 16/45/12
o cube
v 0.09375 0.25 0.15625
v 0.09375 0.25 -0.03125
v 0.09375 0.1875 0.15625
v 0.09375 0.1875 -0.03125
v -0.09375 0.25 -0.03125
v -0.09375 0.25 0.15625
v -0.09375 0.1875 -0.03125
v -0.09375 0.1875 0.15625
vt 0.5 0.6875
vt 0.6875 0.6875
vt 0.6875 0.640625
vt 0.5 0.640625
vt 0.5 0.6875
vt 0.6875 0.6875
vt 0.6875 0.640625
vt 0.5 0.640625
vt 0.5 0.6875
vt 0.6875 0.6875
vt 0.6875 0.640625
vt 0.5 0.640625
vt 0.5 0.6875
vt 0.6875 0.6875
vt 0.6875 0.640625
vt 0.5 0.640625
vt 0.3125 0.4375
vt 0.5 0.4375
vt 0.5 0.25
vt 0.3125 0.25
vt 0.3125 0.4375
vt 0.5 0.4375
vt 0.5 0.25
vt 0.3125 0.25
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_d2e02cf9-1542-9bb0-7e9d-18f7f87eca79
f 20/52/13 23/51/13 21/50/13 18/49/13
f 19/56/14 20/55/14 18/54/14 17/53/14
f 24/60/15 19/59/15 17/58/15 22/57/15
f 23/64/16 24/63/16 22/62/16 21/61/16
f 22/68/17 17/67/17 18/66/17 21/65/17
f 23/72/18 20/71/18 19/70/18 24/69/18

Binary file not shown.

After

Width:  |  Height:  |  Size: 400 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 B