mirror of
https://github.com/minetest-mods/nether.git
synced 2024-11-15 15:00:40 +01:00
166 lines
4.1 KiB
Lua
166 lines
4.1 KiB
Lua
|
-- Portal node
|
||
|
|
||
|
minetest.register_node("nether:portal", {
|
||
|
description = "Nether Portal",
|
||
|
tiles = {
|
||
|
"nether_transparent.png",
|
||
|
"nether_transparent.png",
|
||
|
"nether_transparent.png",
|
||
|
"nether_transparent.png",
|
||
|
{
|
||
|
name = "nether_portal.png",
|
||
|
animation = {
|
||
|
type = "vertical_frames",
|
||
|
aspect_w = 16,
|
||
|
aspect_h = 16,
|
||
|
length = 0.5,
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
name = "nether_portal.png",
|
||
|
animation = {
|
||
|
type = "vertical_frames",
|
||
|
aspect_w = 16,
|
||
|
aspect_h = 16,
|
||
|
length = 0.5,
|
||
|
},
|
||
|
},
|
||
|
},
|
||
|
drawtype = "nodebox",
|
||
|
paramtype = "light",
|
||
|
paramtype2 = "colorfacedir",
|
||
|
palette = "nether_portals_palette.png",
|
||
|
post_effect_color = {
|
||
|
-- post_effect_color can't be changed dynamically in Minetest like the portal colour is.
|
||
|
-- If you need a different post_effect_color then create a custom node and set it as the
|
||
|
-- wormhole_node_name in your portaldef.
|
||
|
-- Hopefully this colour is close enough to magenta to work with the traditional magenta
|
||
|
-- portals, close enough to red to work for a red portal, and also close enough to red to
|
||
|
-- work with blue & cyan portals - since blue portals are sometimes portrayed as being red
|
||
|
-- from the opposite side / from the inside.
|
||
|
a = 160, r = 128, g = 0, b = 80
|
||
|
},
|
||
|
sunlight_propagates = true,
|
||
|
use_texture_alpha = true,
|
||
|
walkable = false,
|
||
|
diggable = false,
|
||
|
pointable = false,
|
||
|
buildable_to = false,
|
||
|
is_ground_content = false,
|
||
|
drop = "",
|
||
|
light_source = 5,
|
||
|
alpha = 192,
|
||
|
node_box = {
|
||
|
type = "fixed",
|
||
|
fixed = {
|
||
|
{-0.5, -0.5, -0.1, 0.5, 0.5, 0.1},
|
||
|
},
|
||
|
},
|
||
|
groups = {not_in_creative_inventory = 1}
|
||
|
})
|
||
|
|
||
|
|
||
|
-- Nether nodes
|
||
|
|
||
|
minetest.register_node("nether:rack", {
|
||
|
description = "Netherrack",
|
||
|
tiles = {"nether_rack.png"},
|
||
|
is_ground_content = true,
|
||
|
groups = {cracky = 3, level = 2},
|
||
|
sounds = default.node_sound_stone_defaults(),
|
||
|
})
|
||
|
|
||
|
minetest.register_node("nether:sand", {
|
||
|
description = "Nethersand",
|
||
|
tiles = {"nether_sand.png"},
|
||
|
is_ground_content = true,
|
||
|
groups = {crumbly = 3, level = 2, falling_node = 1},
|
||
|
sounds = default.node_sound_gravel_defaults({
|
||
|
footstep = {name = "default_gravel_footstep", gain = 0.45},
|
||
|
}),
|
||
|
})
|
||
|
|
||
|
minetest.register_node("nether:glowstone", {
|
||
|
description = "Glowstone",
|
||
|
tiles = {"nether_glowstone.png"},
|
||
|
is_ground_content = true,
|
||
|
light_source = 14,
|
||
|
paramtype = "light",
|
||
|
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
||
|
sounds = default.node_sound_glass_defaults(),
|
||
|
})
|
||
|
|
||
|
minetest.register_node("nether:brick", {
|
||
|
description = "Nether Brick",
|
||
|
tiles = {"nether_brick.png"},
|
||
|
is_ground_content = false,
|
||
|
groups = {cracky = 2, level = 2},
|
||
|
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 = "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(),
|
||
|
})
|
||
|
|
||
|
|
||
|
-- Register stair and slab
|
||
|
|
||
|
stairs.register_stair_and_slab(
|
||
|
"nether_brick",
|
||
|
"nether:brick",
|
||
|
{cracky = 2, level = 2},
|
||
|
{"nether_brick.png"},
|
||
|
"nether stair",
|
||
|
"nether slab",
|
||
|
default.node_sound_stone_defaults()
|
||
|
)
|
||
|
|
||
|
-- StairsPlus
|
||
|
|
||
|
if minetest.get_modpath("moreblocks") then
|
||
|
stairsplus:register_all(
|
||
|
"nether", "brick", "nether:brick", {
|
||
|
description = "Nether Brick",
|
||
|
groups = {cracky = 2, level = 2},
|
||
|
tiles = {"nether_brick.png"},
|
||
|
sounds = default.node_sound_stone_defaults(),
|
||
|
})
|
||
|
end
|
||
|
|
||
|
|
||
|
-- Crafting
|
||
|
|
||
|
minetest.register_craft({
|
||
|
output = "nether:brick 4",
|
||
|
recipe = {
|
||
|
{"nether:rack", "nether:rack"},
|
||
|
{"nether:rack", "nether:rack"},
|
||
|
}
|
||
|
})
|
||
|
|
||
|
minetest.register_craft({
|
||
|
output = "nether:fence_nether_brick 6",
|
||
|
recipe = {
|
||
|
{"nether:brick", "nether:brick", "nether:brick"},
|
||
|
{"nether:brick", "nether:brick", "nether:brick"},
|
||
|
},
|
||
|
})
|
||
|
|
||
|
|