Modifie le sang cuit qui devient mangeable
Nettoyage du code
This commit is contained in:
parent
b22d8707b5
commit
3b01f2b9b7
6
hell.lua
6
hell.lua
@ -121,6 +121,8 @@ end
|
|||||||
local path = minetest.get_modpath("hell")
|
local path = minetest.get_modpath("hell")
|
||||||
dofile(path.."/weird_mapgen_noise.lua")
|
dofile(path.."/weird_mapgen_noise.lua")
|
||||||
dofile(path.."/items.lua")
|
dofile(path.."/items.lua")
|
||||||
|
minetest.register_privilege("hell",
|
||||||
|
"Allows sending players to hell and extracting them")
|
||||||
dofile(path.."/portal.lua")
|
dofile(path.."/portal.lua")
|
||||||
--dofile(path.."/furnace.lua")
|
--dofile(path.."/furnace.lua")
|
||||||
dofile(path.."/pearl.lua")
|
dofile(path.."/pearl.lua")
|
||||||
@ -1027,10 +1029,6 @@ minetest.register_abm({
|
|||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
minetest.register_privilege("hell",
|
|
||||||
"Allows sending players to hell and extracting them")
|
|
||||||
|
|
||||||
dofile(path.."/crafting.lua")
|
dofile(path.."/crafting.lua")
|
||||||
dofile(path.."/guide.lua")
|
dofile(path.."/guide.lua")
|
||||||
|
|
||||||
|
@ -831,7 +831,8 @@ minetest.register_craftitem("hell:hotbed", {
|
|||||||
|
|
||||||
itemstack:take_item()
|
itemstack:take_item()
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end,
|
||||||
|
on_use = minetest.item_eat(1),
|
||||||
})
|
})
|
||||||
minetest.register_alias("nether:hotbed", "hell:hotbed")
|
minetest.register_alias("nether:hotbed", "hell:hotbed")
|
||||||
|
|
||||||
|
52
portal.lua
52
portal.lua
@ -47,21 +47,6 @@ else
|
|||||||
function update_background() end
|
function update_background() end
|
||||||
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
|
-- where the player appears after dying
|
||||||
local function get_player_died_target(player)
|
local function get_player_died_target(player)
|
||||||
local target = vector.add(player:get_pos(),
|
local target = vector.add(player:get_pos(),
|
||||||
@ -166,7 +151,6 @@ minetest.register_chatcommand("from_hell", {
|
|||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
if hell_prisons then
|
if hell_prisons then
|
||||||
-- randomly set player position when he/she dies in hell
|
-- randomly set player position when he/she dies in hell
|
||||||
minetest.register_on_respawnplayer(function(player)
|
minetest.register_on_respawnplayer(function(player)
|
||||||
@ -264,39 +248,6 @@ else
|
|||||||
end)
|
end)
|
||||||
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
|
-- a not filled square
|
||||||
vector.square = vector.square or
|
vector.square = vector.square or
|
||||||
function(r)
|
function(r)
|
||||||
@ -381,7 +332,7 @@ local function hell_port(player, pos)
|
|||||||
end
|
end
|
||||||
minetest.sound_play("hell_teleporter", {pos=pos})
|
minetest.sound_play("hell_teleporter", {pos=pos})
|
||||||
local meta = minetest.get_meta({x=pos.x, y=pos.y-1, z=pos.z})
|
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)
|
set_portal(known_portals_d, pos.z,pos.x, pos.y)
|
||||||
|
|
||||||
local my = tonumber(meta:get_string("y"))
|
local my = tonumber(meta:get_string("y"))
|
||||||
@ -537,6 +488,7 @@ if hell.HELL_REALM_ENABLED then
|
|||||||
end
|
end
|
||||||
|
|
||||||
obsidian_teleport(player, pname)
|
obsidian_teleport(player, pname)
|
||||||
|
minetest.sound_play("hell_portal_usual", {to_player=pname, gain=1})
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user