Modifie le sang cuit qui devient mangeable

Nettoyage du code
This commit is contained in:
Sys Quatre 2020-03-15 13:47:32 +01:00
parent b22d8707b5
commit 3b01f2b9b7
3 changed files with 6 additions and 55 deletions

View File

@ -121,6 +121,8 @@ end
local path = minetest.get_modpath("hell")
dofile(path.."/weird_mapgen_noise.lua")
dofile(path.."/items.lua")
minetest.register_privilege("hell",
"Allows sending players to hell and extracting them")
dofile(path.."/portal.lua")
--dofile(path.."/furnace.lua")
dofile(path.."/pearl.lua")
@ -1027,10 +1029,6 @@ minetest.register_abm({
end
})
minetest.register_privilege("hell",
"Allows sending players to hell and extracting them")
dofile(path.."/crafting.lua")
dofile(path.."/guide.lua")

View File

@ -831,7 +831,8 @@ minetest.register_craftitem("hell:hotbed", {
itemstack:take_item()
return itemstack
end
end,
on_use = minetest.item_eat(1),
})
minetest.register_alias("nether:hotbed", "hell:hotbed")

View File

@ -47,21 +47,6 @@ else
function update_background() end
end
-- returns nodename if area is generated, else calls generation function
local function generated_or_generate(pos)
local node = minetest.get_node_or_nil(pos)
if node then
return node.name
end
minetest.get_voxel_manip():read_from_map(pos, pos)
node = minetest.get_node_or_nil(pos)
if not node then
minetest.emerge_area(vector.subtract(pos, 80), vector.add(pos, 80))
return false
end
return node.name
end
-- where the player appears after dying
local function get_player_died_target(player)
local target = vector.add(player:get_pos(),
@ -166,7 +151,6 @@ minetest.register_chatcommand("from_hell", {
end
})
if hell_prisons then
-- randomly set player position when he/she dies in hell
minetest.register_on_respawnplayer(function(player)
@ -264,39 +248,6 @@ else
end)
end
-- teleports player to hell (obsidian portal)
local function obsi_teleport_player(player, pos, target)
local pname = player:get_player_name()
if players_in_hell[pname] then
return
end
local objpos = player:get_pos()
objpos.y = objpos.y+0.1 -- Fix some glitches at -8000
if minetest.get_node(vector.round(objpos)).name ~= "hell:portal" then
return
end
local has_teleported
if obsidian_portal_kills then
obsidian_teleport(player, pname)
has_teleported = true
elseif not mclike_portal then
local target = vector.round(get_player_died_target(player))
if generated_or_generate(target) then
obsidian_teleport(player, pname, target)
has_teleported = true
end
end
if not has_teleported then
-- e.g. ungenerated area
return
end
minetest.sound_play("hell_portal_usual", {to_player=pname, gain=1})
end
-- a not filled square
vector.square = vector.square or
function(r)
@ -381,7 +332,7 @@ local function hell_port(player, pos)
end
minetest.sound_play("hell_teleporter", {pos=pos})
local meta = minetest.get_meta({x=pos.x, y=pos.y-1, z=pos.z})
if pos.y < hell.start then
if pos.y < hell.start and pos.y > hell.DEPTH-510 then
set_portal(known_portals_d, pos.z,pos.x, pos.y)
local my = tonumber(meta:get_string("y"))
@ -537,6 +488,7 @@ if hell.HELL_REALM_ENABLED then
end
obsidian_teleport(player, pname)
minetest.sound_play("hell_portal_usual", {to_player=pname, gain=1})
end,
})
end