mirror of
https://github.com/minetest-mods/nether.git
synced 2024-11-16 15:30:38 +01:00
Use Minetest_game fences API if it's available
Fixes #56, and adds netherbrick rails (for consistency with MTG) if the fences API is found. Using the MTG fence system adds interop between different fence types, and support for the "Tall fences and walls" option. I've left the nether's register_craft() call unchanged, it overrides the recipe that default.register_fence() registers, granting 6 fences per crafting instead of MTG's 4.
This commit is contained in:
parent
d3f79e961b
commit
e2690e8f57
|
@ -66,6 +66,7 @@ Lava crust is strong enough to walk on, but still hot enough to inflict burns.=
|
|||
Nether Basalt=
|
||||
Nether Brick=Brique du Nether
|
||||
Nether Brick Fence=Barrière en briques du Nether
|
||||
Nether Brick Fence Rail=Clôture en briques du Nether
|
||||
Nether Slab=Dalle du Nether
|
||||
Nether Stair=Escalier du Nether
|
||||
Netherrack=Roche du Nether
|
||||
|
|
|
@ -65,6 +65,7 @@ Lava crust is strong enough to walk on, but still hot enough to inflict burns.=
|
|||
Nether Basalt=
|
||||
Nether Brick=
|
||||
Nether Brick Fence=
|
||||
Nether Brick Fence Rail=
|
||||
Nether Slab=
|
||||
Nether Stair=
|
||||
Netherrack=
|
||||
|
|
69
nodes.lua
69
nodes.lua
|
@ -249,26 +249,6 @@ minetest.register_node("nether:brick_cracked", {
|
|||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
local fence_texture =
|
||||
"default_fence_overlay.png^nether_brick.png^default_fence_overlay.png^[makealpha:255,126,126"
|
||||
|
||||
minetest.register_node("nether:fence_nether_brick", {
|
||||
description = S("Nether Brick Fence"),
|
||||
drawtype = "fencelike",
|
||||
tiles = {"nether_brick.png"},
|
||||
inventory_image = fence_texture,
|
||||
wield_image = fence_texture,
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = false,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7},
|
||||
},
|
||||
groups = {cracky = 2, level = 2},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("nether:brick_deep", {
|
||||
description = S("Deep Nether Brick"),
|
||||
tiles = {{
|
||||
|
@ -281,6 +261,55 @@ minetest.register_node("nether:brick_deep", {
|
|||
sounds = default.node_sound_stone_defaults()
|
||||
})
|
||||
|
||||
-- Register fence and rails
|
||||
|
||||
local fence_texture =
|
||||
"default_fence_overlay.png^nether_brick.png^default_fence_overlay.png^[makealpha:255,126,126"
|
||||
|
||||
if minetest.get_modpath("default") and minetest.global_exists("default") and default.register_fence ~= nil then
|
||||
-- The Minetest_Game fences API is available,
|
||||
-- using it adds interop between different fences, and the "Tall fences and walls" option.
|
||||
default.register_fence("nether:fence_nether_brick", {
|
||||
description = S("Nether Brick Fence"),
|
||||
texture = "nether_brick.png",
|
||||
inventory_image = fence_texture,
|
||||
wield_image = fence_texture,
|
||||
material = "nether:brick",
|
||||
groups = {cracky = 2, level = 2},
|
||||
sounds = default.node_sound_stone_defaults()
|
||||
})
|
||||
|
||||
default.register_fence_rail("nether:fence_rail_nether_brick", {
|
||||
description = S("Nether Brick Fence Rail"),
|
||||
texture = "nether_brick.png",
|
||||
inventory_image = "default_fence_rail_overlay.png^nether_brick.png^" ..
|
||||
"default_fence_rail_overlay.png^[makealpha:255,126,126",
|
||||
wield_image = "default_fence_rail_overlay.png^nether_brick.png^" ..
|
||||
"default_fence_rail_overlay.png^[makealpha:255,126,126",
|
||||
material = "nether:brick",
|
||||
groups = {cracky = 2, level = 2},
|
||||
sounds = default.node_sound_stone_defaults()
|
||||
})
|
||||
else
|
||||
-- Original nether fence code, preserved to avoid deeper coupling with MTG
|
||||
minetest.register_node("nether:fence_nether_brick", {
|
||||
description = S("Nether Brick Fence"),
|
||||
drawtype = "fencelike",
|
||||
tiles = {"nether_brick.png"},
|
||||
inventory_image = fence_texture,
|
||||
wield_image = fence_texture,
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = false,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7},
|
||||
},
|
||||
groups = {cracky = 2, level = 2},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
end
|
||||
|
||||
-- Register stair and slab
|
||||
|
||||
-- Nether bricks can be made into stairs, slabs, inner stairs, and outer stairs
|
||||
|
|
Loading…
Reference in New Issue
Block a user