mirror of
https://github.com/D00Med/scifi_nodes.git
synced 2025-01-08 16:00:17 +01:00
improve octagon glass pane slope / refactor node- and selectionbox code
This commit is contained in:
parent
36b0c5cc05
commit
62037ad60a
10
common.lua
10
common.lua
@ -19,7 +19,7 @@ function scifi_nodes.get_switch_rules(param2)
|
|||||||
return rules
|
return rules
|
||||||
end
|
end
|
||||||
|
|
||||||
scifi_nodes.slope_selection_box = {
|
scifi_nodes.slope_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {
|
fixed = {
|
||||||
{-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
|
{-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
|
||||||
@ -29,12 +29,12 @@ scifi_nodes.slope_selection_box = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
scifi_nodes.slope_collision_box = {
|
scifi_nodes.slope_box_simple = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {
|
fixed = {
|
||||||
{-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
|
{-0.5, -0.5, -0.5, 0.5, -0.25, -0.25},
|
||||||
{-0.5, -0.25, -0.25, 0.5, 0, 0.5},
|
{-0.5, -0.25, -0.25, 0.5, 0, 0},
|
||||||
{-0.5, 0, 0, 0.5, 0.25, 0.5},
|
{-0.5, 0, 0, 0.5, 0.25, 0.25},
|
||||||
{-0.5, 0.25, 0.25, 0.5, 0.5, 0.5}
|
{-0.5, 0.25, 0.25, 0.5, 0.5, 0.5}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,8 +16,8 @@ function scifi_nodes.register_slope(name, desc, texture, light, soundtype)
|
|||||||
drawtype = "mesh",
|
drawtype = "mesh",
|
||||||
mesh = "scifi_nodes_slope.obj",
|
mesh = "scifi_nodes_slope.obj",
|
||||||
tiles = texture,
|
tiles = texture,
|
||||||
selection_box = scifi_nodes.slope_selection_box,
|
selection_box = scifi_nodes.slope_box,
|
||||||
collision_box = scifi_nodes.slope_collision_box,
|
collision_box = scifi_nodes.slope_box,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
use_texture_alpha = "clip",
|
use_texture_alpha = "clip",
|
||||||
|
12
models/scifi_nodes_slope_simple.obj
Normal file
12
models/scifi_nodes_slope_simple.obj
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
g top
|
||||||
|
v 0.500000 0.500000 0.500000
|
||||||
|
v -0.500000 0.500000 0.500000
|
||||||
|
v -0.500000 -0.500000 -0.500000
|
||||||
|
v 0.500000 -0.500000 -0.500000
|
||||||
|
vt 1.0000 1.0000
|
||||||
|
vt 0.0000 1.0000
|
||||||
|
vt 0.0000 0.0000
|
||||||
|
vt 1.0000 0.0000
|
||||||
|
vn 0.0000 0.7071 -0.7071
|
||||||
|
s off
|
||||||
|
f 2/1/1 1/2/1 4/3/1 3/4/1
|
@ -19,26 +19,6 @@ local function register_glass(key, name)
|
|||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
sounds = scifi_nodes.node_sound_glass_defaults(),
|
sounds = scifi_nodes.node_sound_glass_defaults(),
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("scifi_nodes:" .. key .. "_slope", {
|
|
||||||
description = "Octagon Glass slope",
|
|
||||||
sunlight_propagates = true,
|
|
||||||
drawtype = "mesh",
|
|
||||||
mesh = "scifi_nodes_slope.obj",
|
|
||||||
tiles = tiles,
|
|
||||||
paramtype = "light",
|
|
||||||
paramtype2 = "facedir",
|
|
||||||
use_texture_alpha = "blend",
|
|
||||||
light_source = 10,
|
|
||||||
groups = {
|
|
||||||
cracky = 2,
|
|
||||||
dig_generic = 3
|
|
||||||
},
|
|
||||||
selection_box = scifi_nodes.slope_selection_box,
|
|
||||||
collision_box = scifi_nodes.slope_collision_box,
|
|
||||||
is_ground_content = false,
|
|
||||||
sounds = scifi_nodes.node_sound_glass_defaults()
|
|
||||||
})
|
|
||||||
end
|
end
|
||||||
|
|
||||||
register_glass("octppl", "Purple")
|
register_glass("octppl", "Purple")
|
||||||
|
@ -1,13 +1,15 @@
|
|||||||
|
|
||||||
local function register(basename, description, texture)
|
local function register(basename, color, texture)
|
||||||
local nodename_single = "scifi_nodes:" .. basename .. "_pane"
|
local nodename_single = "scifi_nodes:" .. basename .. "_pane"
|
||||||
local nodename_double = "scifi_nodes:" .. basename .. "_pane_double"
|
local nodename_double = "scifi_nodes:" .. basename .. "_pane_double"
|
||||||
local nodename_offset = "scifi_nodes:" .. basename .. "_pane_offset"
|
local nodename_offset = "scifi_nodes:" .. basename .. "_pane_offset"
|
||||||
|
local nodename_slope = "scifi_nodes:" .. basename .. "_slope"
|
||||||
local recipe_ingredient = "scifi_nodes:" .. basename
|
local recipe_ingredient = "scifi_nodes:" .. basename
|
||||||
|
local base_decription = color .. " octagon glass"
|
||||||
|
|
||||||
-- single height
|
-- single height
|
||||||
minetest.register_node(nodename_single, {
|
minetest.register_node(nodename_single, {
|
||||||
description = description,
|
description = base_decription .. " pane",
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
tiles = {
|
tiles = {
|
||||||
texture
|
texture
|
||||||
@ -35,7 +37,7 @@ local function register(basename, description, texture)
|
|||||||
|
|
||||||
-- double height
|
-- double height
|
||||||
minetest.register_node(nodename_double, {
|
minetest.register_node(nodename_double, {
|
||||||
description = description,
|
description = base_decription .. " pane (double)",
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
tiles = {
|
tiles = {
|
||||||
texture
|
texture
|
||||||
@ -63,7 +65,7 @@ local function register(basename, description, texture)
|
|||||||
|
|
||||||
-- single height with offset
|
-- single height with offset
|
||||||
minetest.register_node(nodename_offset, {
|
minetest.register_node(nodename_offset, {
|
||||||
description = description,
|
description = base_decription .. " pane (offset)",
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
tiles = {
|
tiles = {
|
||||||
texture
|
texture
|
||||||
@ -90,6 +92,28 @@ local function register(basename, description, texture)
|
|||||||
sounds = scifi_nodes.node_sound_glass_defaults()
|
sounds = scifi_nodes.node_sound_glass_defaults()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- slope pane
|
||||||
|
minetest.register_node(nodename_slope, {
|
||||||
|
description = base_decription .. " pane (slope)",
|
||||||
|
sunlight_propagates = true,
|
||||||
|
drawtype = "mesh",
|
||||||
|
mesh = "scifi_nodes_slope_simple.obj",
|
||||||
|
tiles = {
|
||||||
|
texture
|
||||||
|
},
|
||||||
|
paramtype = "light",
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
use_texture_alpha = "blend",
|
||||||
|
light_source = 10,
|
||||||
|
groups = {
|
||||||
|
cracky = 2,
|
||||||
|
dig_generic = 3
|
||||||
|
},
|
||||||
|
selection_box = scifi_nodes.slope_box_simple,
|
||||||
|
collision_box = scifi_nodes.slope_box_simple,
|
||||||
|
is_ground_content = false,
|
||||||
|
sounds = scifi_nodes.node_sound_glass_defaults()
|
||||||
|
})
|
||||||
-- register recipes
|
-- register recipes
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
@ -99,6 +123,15 @@ local function register(basename, description, texture)
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = nodename_slope .. " 16",
|
||||||
|
recipe = {
|
||||||
|
{"", "", recipe_ingredient},
|
||||||
|
{"", recipe_ingredient, ""},
|
||||||
|
{recipe_ingredient, "", ""}
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = nodename_double .. " 16",
|
output = nodename_double .. " 16",
|
||||||
recipe = {
|
recipe = {
|
||||||
@ -114,8 +147,9 @@ local function register(basename, description, texture)
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
register("octrng", "Orange Octagon Glass pane", "scifi_nodes_octrng.png")
|
register("octrng", "Orange", "scifi_nodes_octrng.png")
|
||||||
register("octgrn", "Green Octagon Glass pane", "scifi_nodes_octgrn.png")
|
register("octgrn", "Green", "scifi_nodes_octgrn.png")
|
||||||
register("octbl", "Blue Octagon Glass pane", "scifi_nodes_octbl.png")
|
register("octbl", "Blue", "scifi_nodes_octbl.png")
|
||||||
register("octppl", "Purple Octagon Glass pane", "scifi_nodes_octppl.png")
|
register("octppl", "Purple", "scifi_nodes_octppl.png")
|
||||||
|
register("octwht", "White", "scifi_nodes_octwht.png")
|
||||||
register("glass", "Dark Glass pane", "scifi_nodes_glass.png")
|
register("glass", "Dark Glass pane", "scifi_nodes_glass.png")
|
||||||
|
Loading…
Reference in New Issue
Block a user