Ajoute alias pour rétro compatibilité

This commit is contained in:
Sys Quatre 2020-03-06 13:03:17 +01:00
parent 605c82107a
commit e5bc2a979b
2 changed files with 66 additions and 57 deletions

102
items.lua
View File

@ -20,6 +20,8 @@ local function add_more_nodes(name)
)
minetest.register_alias("stairs:stair_"..name, "hell"..":stair_"..name)
minetest.register_alias("stairs:slab_"..name, "hell"..":slab_"..name)
minetest.register_alias("nether"..":stair_"..name, "hell"..":stair_"..name)
minetest.register_alias("nether"..":slab_"..name, "hell"..":slab_"..name)
else
stairs.register_stair_and_slab(
name, nd,
@ -84,6 +86,7 @@ minetest.register_node("hell:hellrack", {
end,
})
add_more_nodes("hellrack")
minetest.register_alias("nether:netherrack", "hell:hellrack")
minetest.register_node("hell:hellrack_tiled", {
description = "Tiled Hellrack",
@ -95,6 +98,7 @@ minetest.register_node("hell:hellrack_tiled", {
end,
})
add_more_nodes("hellrack_tiled")
minetest.register_alias("nether:netherrack_tiled", "hell:hellrack_tiled")
minetest.register_node("hell:hellrack_soil", {
description = "Dirty Hellrack",
@ -105,6 +109,7 @@ minetest.register_node("hell:hellrack_soil", {
return digging_allowed(player, 2)
end,
})
minetest.register_alias("nether::netherrack_soil", "hell:hellrack_soil")
minetest.register_node("hell:hellrack_black", {
description = "Black Hellrack",
@ -116,6 +121,7 @@ minetest.register_node("hell:hellrack_black", {
end,
})
add_more_nodes("hellrack_black")
minetest.register_alias("nether:netherrack_black", "hell:hellrack_black")
minetest.register_node("hell:hellrack_blue", {
description = "Blue Hellrack",
@ -127,6 +133,7 @@ minetest.register_node("hell:hellrack_blue", {
end,
})
add_more_nodes("hellrack_blue")
minetest.register_alias("nether:netherrack_blue", "hell:hellrack_blue")
-- Hellbrick
minetest.register_node("hell:hellrack_brick", {
@ -139,6 +146,7 @@ minetest.register_node("hell:hellrack_brick", {
end,
})
add_more_nodes("hellrack_brick")
minetest.register_alias("nether:netherrack_brick", "hell:hellrack_brick")
minetest.register_node("hell:hellrack_brick_blue", {
description = "Blue Hellrack Brick",
@ -150,6 +158,7 @@ minetest.register_node("hell:hellrack_brick_blue", {
end,
})
add_more_nodes("hellrack_brick_blue")
minetest.register_alias("nether:netherrack_brick_blue", "hell:hellrack_brick_blue")
minetest.register_node("hell:hellrack_brick_black", {
description = "Black Hellrack Brick",
@ -161,6 +170,7 @@ minetest.register_node("hell:hellrack_brick_black", {
end,
})
add_more_nodes("hellrack_brick_black")
minetest.register_alias("nether:netherrack_brick_black", "hell:hellrack_brick_black")
minetest.register_node("hell:white", {
description = "Siwtonic block",
@ -172,7 +182,7 @@ minetest.register_node("hell:white", {
end,
})
add_more_nodes("white")
minetest.register_alias("nether:white", "hell:white")
-- Hell blood
minetest.register_node("hell:sapling", {
@ -190,6 +200,7 @@ minetest.register_node("hell:sapling", {
groups = {snappy=2, oddly_breakable_by_hand=2, attached_node=1},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_alias("nether:sapling", "hell:sapling")
minetest.register_node("hell:blood", {
description = "Hell Blood",
@ -198,6 +209,7 @@ minetest.register_node("hell:blood", {
sounds = default.node_sound_wood_defaults(),
})
add_more_nodes("blood")
minetest.register_alias("nether:blood", "hell:blood")
minetest.register_node("hell:blood_cooked", {
description = "Cooked Hell Blood",
@ -210,6 +222,7 @@ minetest.register_node("hell:blood_cooked", {
end,
})
add_more_nodes("blood_cooked")
minetest.register_alias("nether:blood_cooked", "hell:blood_cooked")
minetest.register_node("hell:blood_empty", {
description = "Hell Blood Extracted",
@ -218,7 +231,7 @@ minetest.register_node("hell:blood_empty", {
sounds = default.node_sound_wood_defaults(),
})
add_more_nodes("blood_empty")
minetest.register_alias("nether:blood_empty", "hell:blood_empty")
minetest.register_node("hell:blood_top", {
description = "Hell Blood Head",
@ -227,6 +240,7 @@ minetest.register_node("hell:blood_top", {
sounds = default.node_sound_wood_defaults(),
})
add_more_nodes("blood_top")
minetest.register_alias("nether:blood_top", "hell:blood_top")
minetest.register_node("hell:blood_top_cooked", {
description = "Cooked Hell Blood Head",
@ -239,6 +253,7 @@ minetest.register_node("hell:blood_top_cooked", {
end,
})
add_more_nodes("blood_top_cooked")
minetest.register_alias("nether:blood_top_cooked", "hell:blood_top_cooked")
minetest.register_node("hell:blood_top_empty", {
description = "Hell Blood Head Extracted",
@ -247,7 +262,7 @@ minetest.register_node("hell:blood_top_empty", {
sounds = default.node_sound_wood_defaults(),
})
add_more_nodes("blood_top_empty")
minetest.register_alias("nether:blood_top_empty", "hell:blood_top_empty")
minetest.register_node("hell:blood_stem", {
description = "Hell Blood Stem",
@ -256,6 +271,7 @@ minetest.register_node("hell:blood_stem", {
sounds = default.node_sound_wood_defaults(),
})
add_more_nodes("blood_stem")
minetest.register_alias("nether:blood_stem", "hell:blood_stem")
minetest.register_node("hell:blood_stem_cooked", {
description = "Cooked Hell Blood Stem",
@ -268,6 +284,7 @@ minetest.register_node("hell:blood_stem_cooked", {
end,
})
add_more_nodes("blood_stem_cooked")
minetest.register_alias("nether:blood_stem_cooked", "hell:blood_stem_cooked")
minetest.register_node("hell:blood_stem_empty", {
description = "Hell Blood Stem Extracted",
@ -276,7 +293,7 @@ minetest.register_node("hell:blood_stem_empty", {
sounds = default.node_sound_wood_defaults(),
})
add_more_nodes("blood_stem_empty")
minetest.register_alias("nether:blood_stem_empty", "hell:blood_stem_empty")
minetest.register_node("hell:wood", {
description = "Hell Blood Wood",
@ -285,6 +302,7 @@ minetest.register_node("hell:wood", {
sounds = default.node_sound_wood_defaults(),
})
add_more_nodes("wood")
minetest.register_alias("nether:wood", "hell:wood")
minetest.register_node("hell:wood_cooked", {
description = "Cooked Hell Blood Wood",
@ -297,6 +315,7 @@ minetest.register_node("hell:wood_cooked", {
end,
})
add_more_nodes("wood_cooked")
minetest.register_alias("nether:wood_cooked", "hell:wood_cooked")
minetest.register_node("hell:wood_empty", {
description = "Hell Wood",
@ -305,6 +324,7 @@ minetest.register_node("hell:wood_empty", {
sounds = default.node_sound_wood_defaults(),
})
add_more_nodes("wood_empty")
minetest.register_alias("nether:wood_empty", "hell:wood_empty")
minetest.register_node("hell:extractor", {
description = "Hell Blood Extractor",
@ -315,6 +335,7 @@ minetest.register_node("hell:extractor", {
return digging_allowed(player, 3)
end,
})
minetest.register_alias("nether:extractor", "hell:extractor")
-- Hell fruit
minetest.register_node("hell:fruit_leaves", {
@ -325,6 +346,7 @@ minetest.register_node("hell:fruit_leaves", {
furnace_burntime = 18,
})
add_more_nodes("fruit_leaves")
minetest.register_alias("nether:fruit_leaves", "hell:fruit_leaves")
local function room_for_items(inv)
local free_slots = 0
@ -389,6 +411,7 @@ minetest.register_node("hell:apple", {
furnace_burntime = 6,
on_use = minetest.item_eat(-5, "hell:blood_extracted 2"),
})
minetest.register_alias("nether:apple", "hell:apple")
local drop_fruit = minetest.registered_nodes["hell:apple"].on_drop
minetest.override_item("hell:apple", {
@ -433,7 +456,7 @@ minetest.register_node("hell:vine", {
end
end
})
minetest.register_alias("nether:vine", "hell:vine")
-- forest stuff
@ -456,6 +479,7 @@ for n,i in pairs({"small", "middle", "big"}) do
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
},
})
minetest.register_alias("nether:grass_"..i, "hell:grass_"..i)
end
minetest.register_node("hell:glowflower", {
@ -476,6 +500,7 @@ minetest.register_node("hell:glowflower", {
fixed = { -0.15, -0.5, -0.15, 0.15, 0.2, 0.15 },
},
})
minetest.register_alias("nether:glowflower", "hell:glowflower")
minetest.register_node("hell:tree_sapling", {
description = "Hell Tree Sapling",
@ -492,6 +517,7 @@ minetest.register_node("hell:tree_sapling", {
groups = {snappy=2, oddly_breakable_by_hand=2, attached_node=1},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_alias("nether:tree_sapling", "hell:tree_sapling")
minetest.register_node("hell:tree", {
description = "Hell Trunk",
@ -502,6 +528,7 @@ minetest.register_node("hell:tree", {
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node
})
minetest.register_alias("nether:tree", "hell:tree")
minetest.register_node("hell:tree_corner", {
description = "Hell Trunk Corner",
@ -514,6 +541,7 @@ minetest.register_node("hell:tree_corner", {
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node
})
minetest.register_alias("nether:tree_corner", "hell:tree_corner")
minetest.register_node("hell:forest_wood", {
description = "Hell Wood Block",
@ -522,6 +550,7 @@ minetest.register_node("hell:forest_wood", {
sounds = default.node_sound_wood_defaults(),
})
add_more_nodes("forest_wood")
minetest.register_alias("nether:forest_wood", "hell:forest_wood")
minetest.register_node("hell:leaves", {
description = "Hell Leaves",
@ -549,6 +578,7 @@ minetest.register_node("hell:leaves", {
},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_alias("nether:leaves", "hell:leaves")
minetest.register_node("hell:dirt", {
description = "Hell Dirt",
@ -556,6 +586,7 @@ minetest.register_node("hell:dirt", {
groups = {crumbly=3,soil=1,hell_dirt=1},
sounds = default.node_sound_dirt_defaults(),
})
minetest.register_alias("nether:dirt", "hell:dirt")
minetest.register_node("hell:dirt_top", {
description = "Hell Dirt Top",
@ -568,6 +599,7 @@ minetest.register_node("hell:dirt_top", {
footstep = {name="default_grass_footstep", gain=0.25},
}),
})
minetest.register_alias("nether:dirt_top", "hell:dirt_top")
minetest.register_node("hell:dirt_bottom", {
description = "Hellrack Dirt Transition",
@ -584,7 +616,7 @@ minetest.register_node("hell:dirt_bottom", {
return digging_allowed(player, 2)
end,
})
minetest.register_alias("nether:dirt_bottom", "hell:dirt_bottom")
-- Hell torch
minetest.register_node("hell:torch", {
@ -618,69 +650,48 @@ minetest.register_node("hell:torch", {
legacy_wallmounted = true,
sounds = default.node_sound_defaults(),
})
local invisible = "hell_transparent.png"
minetest.register_node("hell:portal", {
description = "Hell Portal Essence",
tiles = {invisible, invisible, invisible, invisible, "hell_portal_stuff.png"},
inventory_image = "hell_portal_stuff.png",
wield_image = "hell_portal_stuff.png",
light_source = 12,
paramtype = "light",
sunlight_propagates = true,
use_texture_alpha = true,
walkable = false,
pointable = false,
buildable_to = false,
drop = "",
diggable = false,
groups = {not_in_creative_inventory=1},
post_effect_color = {a=200, r=50, g=0, b=60},--{a=180, r=128, g=0, b=128}
drawtype = "nodebox",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.1, 0.5, 0.5, 0.1},
},
},
})
minetest.register_alias("nether:torch", "hell:torch")
minetest.register_craftitem("hell:grass", {
description = "Hell Grass",
inventory_image = "hell_grass.png",
})
minetest.register_alias("nether:grass", "hell:grass")
minetest.register_craftitem("hell:grass_dried", {
description = "Dried Hell Grass",
inventory_image = "hell_grass_dried.png",
furnace_burntime = 1,
})
minetest.register_alias("nether:grass_dried", "hell:grass_dried")
minetest.register_craftitem("hell:forest_planks", {
description = "Hell Wooden Planks",
inventory_image = "hell_forest_planks.png",
stack_max = 990,
})
minetest.register_alias("nether:forest_planks", "hell:forest_planks")
minetest.register_craftitem("hell:bark", {
description = "Hell Trunk Bark",
inventory_image = "hell_bark.png",
furnace_burntime = 5,
})
minetest.register_alias("nether:bark", "hell:bark")
-- Hell Pearl
minetest.register_craftitem("hell:pearl", {
description = "Hell Pearl",
inventory_image = "hell_pearl.png",
})
minetest.register_alias("nether:pearl", "hell:pearl")
minetest.register_craftitem("hell:stick", {
description = "Hell Stick",
inventory_image = "hell_stick.png",
groups = {stick=1},
})
minetest.register_alias("nether:stick", "hell:stick")
local tmp = {}
minetest.register_craftitem("hell:shroom_head", {
@ -709,30 +720,35 @@ minetest.register_craftitem("hell:shroom_head", {
end
end
})
minetest.register_alias("nether:shroom_head", "hell:shroom_head")
minetest.register_craftitem("hell:shroom_stem", {
description = "Hell Mushroom Stem",
inventory_image = "hell_shroom_stem.png",
furnace_burntime = 3,
})
minetest.register_alias("nether:shroom_stem", "hell:shroom_stem")
minetest.register_craftitem("hell:fruit_leaf", {
description = "Hell Fruit Leaf",
inventory_image = "hell_fruit_leaf.png",
furnace_burntime = 2,
})
minetest.register_alias("nether:fruit_leaf", "hell:fruit_leaf")
minetest.register_craftitem("hell:fruit_no_leaf", {
description = "Hell Fruit Without Leaf",
inventory_image = "hell_fruit_no_leaf.png",
furnace_burntime = 4,
})
minetest.register_alias("nether:fruit_no_leaf", "hell:fruit_no_leaf")
minetest.register_craftitem("hell:fim", {
description = "Hell FIM", --fruit in mushroom
inventory_image = "hell_fim.png",
furnace_burntime = 10,
})
minetest.register_alias("nether:fim", "hell:fim")
local blood_exno = {}
for _,i in ipairs({"hell:blood", "hell:blood_top", "hell:blood_stem"}) do
@ -791,6 +807,7 @@ minetest.register_craftitem("hell:blood_extracted", {
return itemstack
end
})
minetest.register_alias("nether:blood_extracted", "hell:blood_extracted")
minetest.register_craftitem("hell:hotbed", {
description = "Cooked Blood",
@ -816,7 +833,7 @@ minetest.register_craftitem("hell:hotbed", {
return itemstack
end
})
minetest.register_alias("nether:hotbed", "hell:hotbed")
minetest.register_tool("hell:pick_mushroom", {
description = "Hell Mushroom Pickaxe",
@ -829,6 +846,7 @@ minetest.register_tool("hell:pick_mushroom", {
},
},
})
minetest.register_alias("nether:pick_musroom", "hell:pick_mushroom")
minetest.register_tool("hell:pick_wood", {
description = "Hell Wood Pickaxe",
@ -843,6 +861,7 @@ minetest.register_tool("hell:pick_wood", {
damage_groups = {fleshy=2},
},
})
minetest.register_alias("nether:pick_wood", "hell:pick_wood")
minetest.register_tool("hell:pick_hellrack", {
description = "Hellrack Pickaxe",
@ -857,6 +876,7 @@ minetest.register_tool("hell:pick_hellrack", {
damage_groups = {fleshy=3},
},
})
minetest.register_alias("nether:pick_netherrack", "hell:pick_hellrack")
minetest.register_tool("hell:pick_hellrack_blue", {
description = "Blue Hellrack Pickaxe",
@ -871,6 +891,7 @@ minetest.register_tool("hell:pick_hellrack_blue", {
damage_groups = {fleshy=4},
},
})
minetest.register_alias("nether:pick_netherrack_blue", "hell:pick_hellrack_blue")
minetest.register_tool("hell:pick_white", {
description = "Siwtonic Pickaxe",
@ -885,6 +906,7 @@ minetest.register_tool("hell:pick_white", {
damage_groups = {fleshy=5},
},
})
minetest.register_alias("nether:pick_white", "hell:pick_white")
minetest.register_tool("hell:axe_hellrack", {
description = "Hellrack Axe",
@ -898,6 +920,7 @@ minetest.register_tool("hell:axe_hellrack", {
damage_groups = {fleshy=4},
},
})
minetest.register_alias("nether:axe_netherrack", "hell:axe_hellrack")
minetest.register_tool("hell:axe_hellrack_blue", {
description = "Blue Hellrack Axe",
@ -911,6 +934,7 @@ minetest.register_tool("hell:axe_hellrack_blue", {
damage_groups = {fleshy=6},
},
})
minetest.register_alias("nether:axe_netherrack_blue", "hell:axe_hellrack_blue")
minetest.register_tool("hell:axe_white", {
description = "Siwtonic Axe",
@ -924,6 +948,7 @@ minetest.register_tool("hell:axe_white", {
damage_groups = {fleshy=8},
},
})
minetest.register_alias("nether:axe_white", "hell:axe_white")
minetest.register_tool("hell:shovel_hellrack", {
description = "Hellrack Shovel",
@ -938,6 +963,7 @@ minetest.register_tool("hell:shovel_hellrack", {
damage_groups = {fleshy=2},
},
})
minetest.register_alias("nether:shovel_netherrack", "hell:shovel_hellrack")
minetest.register_tool("hell:shovel_hellrack_blue", {
description = "Blue Hellrack Shovel",
@ -952,6 +978,7 @@ minetest.register_tool("hell:shovel_hellrack_blue", {
damage_groups = {fleshy=3},
},
})
minetest.register_alias("nether:shovel_netherrack_blue", "hell:shovel_hellrack_blue")
minetest.register_tool("hell:shovel_white", {
description = "Siwtonic Shovel",
@ -966,6 +993,7 @@ minetest.register_tool("hell:shovel_white", {
damage_groups = {fleshy=4},
},
})
minetest.register_alias("nether:shovel_white", "hell:shovel_white")
minetest.register_tool("hell:sword_hellrack", {
description = "Hellrack Sword",
@ -979,6 +1007,7 @@ minetest.register_tool("hell:sword_hellrack", {
damage_groups = {fleshy=5},
},
})
minetest.register_alias("nether:sword_netherrack", "hell:sword_hellrack")
minetest.register_tool("hell:sword_hellrack_blue", {
description = "Blue Hellrack Sword",
@ -992,6 +1021,7 @@ minetest.register_tool("hell:sword_hellrack_blue", {
damage_groups = {fleshy=7},
},
})
minetest.register_alias("nether:sword_netherrack_blue", "hell:sword_hellrack_blue")
minetest.register_tool("hell:sword_white", {
description = "Siwtonic Sword",
@ -1006,7 +1036,7 @@ minetest.register_tool("hell:sword_white", {
damage_groups = {fleshy=11},
},
})
minetest.register_alias("nether:sword_white", "hell:sword_white")
-- override creative hand
if minetest.settings:get_bool("creative_mode") then

View File

@ -68,27 +68,6 @@ local function teleport_player(pos, player)
return true
end
--[[
local dg_ps = {}
local function forceload(pos)
dg_ps[#dg_ps+1] = pos
minetest.forceload_block(pos)
minetest.after(5, function(pos)
minetest.forceload_free_block(pos)
for i,p in pairs(dg_ps) do
if vector.equals(p, pos) then
dg_ps[i] = nil
return
end
end
end, pos)
end
minetest.register_on_shutdown(function()
for _,p in pairs(dg_ps) do
minetest.forceload_free_block(p)
end
end)--]]
minetest.register_entity("hell:pearl_entity", {
collisionbox = {0,0,0,0,0,0}, --not pointable
visual_size = {x=0.1, y=0.1},