Use Minetest_game fences API if it's available (#57)

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.
pull/58/head
Treer 3 months ago committed by GitHub
parent d3f79e961b
commit a03375c5a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      README.md
  2. 1
      locale/nether.fr.tr
  3. 1
      locale/template.txt
  4. 46
      nodes.lua

@ -26,7 +26,7 @@ the nether first, or basalt might be a crafting ingredient required to reach
a particular branch of the tech-tree.
Netherbrick tools are provided (pick, shovel, axe, & sword), see tools.lua
The Nether pickaxe has a 10x bonus again wear when mining netherrack.
The Nether pickaxe has a 10x bonus against wear when mining netherrack.
## License of source code:

@ -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=

@ -249,34 +249,42 @@ minetest.register_node("nether:brick_cracked", {
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("nether:brick_deep", {
description = S("Deep Nether Brick"),
tiles = {{
name = "nether_brick_deep.png",
align_style = "world",
scale = 2
}},
is_ground_content = false,
groups = {cracky = 2, level = 2},
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"
minetest.register_node("nether:fence_nether_brick", {
local rail_texture =
"default_fence_rail_overlay.png^nether_brick.png^default_fence_rail_overlay.png^[makealpha:255,126,126"
default.register_fence("nether:fence_nether_brick", {
description = S("Nether Brick Fence"),
drawtype = "fencelike",
tiles = {"nether_brick.png"},
texture = "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},
},
material = "nether:brick",
groups = {cracky = 2, level = 2},
sounds = default.node_sound_stone_defaults(),
sounds = default.node_sound_stone_defaults()
})
minetest.register_node("nether:brick_deep", {
description = S("Deep Nether Brick"),
tiles = {{
name = "nether_brick_deep.png",
align_style = "world",
scale = 2
}},
is_ground_content = false,
default.register_fence_rail("nether:fence_rail_nether_brick", {
description = S("Nether Brick Fence Rail"),
texture = "nether_brick.png",
inventory_image = rail_texture,
wield_image = rail_texture,
material = "nether:brick",
groups = {cracky = 2, level = 2},
sounds = default.node_sound_stone_defaults()
})

Loading…
Cancel
Save