Compare commits
1 Commits
developmen
...
master
Author | SHA1 | Date | |
---|---|---|---|
71236002de |
0
.gitignore
vendored
Normal file → Executable file
@ -1,2 +1,2 @@
|
|||||||
GPLv3 (lkloel's version)
|
GPLv3 (lkloel's version)
|
||||||
MIT for the changes
|
WTFPL for the changes
|
||||||
|
25
README.md
@ -1,7 +1,22 @@
|
|||||||
For a description of this Minetest mod, please refer to the forum topic:
|
[Mod] nether-pack [nether-pack]
|
||||||
https://forum.minetest.net/viewtopic.php?f=9&t=10265
|
|
||||||
|
This is a modified version of lkjoel's nether mod.
|
||||||
|
Look here if you want to see the differences:
|
||||||
|
https://github.com/HybridDog/minetest-nether/compare/lkjoel:master...master
|
||||||
|
Sadly lkjoel's one disappeared…
|
||||||
|
|
||||||
|
**Depends:** see [depends.txt](https://raw.githubusercontent.com/HybridDog/nether-pack/master/nether/depends.txt)
|
||||||
|
**License:** see [LICENSE.txt](https://raw.githubusercontent.com/HybridDog/nether-pack/master/LICENSE.txt)
|
||||||
|
**Download:** [zip](https://github.com/HybridDog/nether-pack/archive/master.zip), [tar.gz](https://github.com/HybridDog/nether-pack/tarball/master)
|
||||||
|
|
||||||
|
this happens really selden to me
|
||||||
|

|
||||||
|
|
||||||
|
If you got ideas or found bugs, please tell them to me.
|
||||||
|
|
||||||
|
[How to install a mod?](http://wiki.minetest.net/Installing_Mods)
|
||||||
|
|
||||||
|
|
||||||
TODO:
|
TODO:
|
||||||
* Find a way to get the perlin noise inside [-1; 1] or use another noise
|
— find a way to get the perlin noise inside [-1; 1] or use another noise
|
||||||
* Add some node which containing items to the simple pyramid "buildings"
|
— add something containing items to that buildings
|
||||||
|
1
modpack.txt
Normal file → Executable file
@ -1 +0,0 @@
|
|||||||
0
|
|
||||||
|
@ -1,365 +0,0 @@
|
|||||||
--[[ Nether leaves
|
|
||||||
minetest.register_node("nether:leaves", {
|
|
||||||
description = "Nether Leaves",
|
|
||||||
drawtype = "allfaces_optional",
|
|
||||||
-- visual_scale = 1.189, --scale^2=sqrt(2)
|
|
||||||
tiles = {"nether_leaves.png"},
|
|
||||||
paramtype = "light",
|
|
||||||
groups = {snappy=3, leafdecay=2},
|
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
|
||||||
})]]
|
|
||||||
|
|
||||||
--[[ Nether Lava
|
|
||||||
minetest.register_node("nether:lava_flowing", {
|
|
||||||
description = "Nether Lava (flowing)",
|
|
||||||
inventory_image = minetest.inventorycube("default_lava.png"),
|
|
||||||
drawtype = "flowingliquid",
|
|
||||||
tiles = {"default_lava.png"},
|
|
||||||
paramtype = "light",
|
|
||||||
light_source = LIGHT_MAX - 1,
|
|
||||||
walkable = false,
|
|
||||||
pointable = false,
|
|
||||||
diggable = false,
|
|
||||||
buildable_to = true,
|
|
||||||
liquidtype = "flowing",
|
|
||||||
liquid_alternative_flowing = "nether:lava_flowing",
|
|
||||||
liquid_alternative_source = "default:lava_source",
|
|
||||||
liquid_viscosity = LAVA_VISC,
|
|
||||||
damage_per_second = 4*2,
|
|
||||||
post_effect_color = {a=192, r=255, g=64, b=0},
|
|
||||||
special_materials = {
|
|
||||||
{image="default_lava.png", backface_culling=false},
|
|
||||||
{image="default_lava.png", backface_culling=true},
|
|
||||||
},
|
|
||||||
groups = {lava=3, liquid=2, hot=3},
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_node("nether:lava_source", {
|
|
||||||
description = "Nether Lava",
|
|
||||||
inventory_image = minetest.inventorycube("default_lava.png"),
|
|
||||||
drawtype = "liquid",
|
|
||||||
tiles = {"default_lava.png"},
|
|
||||||
paramtype = "light",
|
|
||||||
light_source = LIGHT_MAX - 1,
|
|
||||||
walkable = false,
|
|
||||||
pointable = false,
|
|
||||||
diggable = false,
|
|
||||||
buildable_to = true,
|
|
||||||
liquidtype = "source",
|
|
||||||
liquid_alternative_flowing = "nether:lava_flowing",
|
|
||||||
liquid_alternative_source = "default:lava_source",
|
|
||||||
liquid_viscosity = LAVA_VISC,
|
|
||||||
damage_per_second = 4*2,
|
|
||||||
post_effect_color = {a=192, r=255, g=64, b=0},
|
|
||||||
special_materials = {
|
|
||||||
-- New-style lava source material (mostly unused)
|
|
||||||
{image="default_lava.png", backface_culling=false},
|
|
||||||
},
|
|
||||||
groups = {lava=3, liquid=2, hot=3},
|
|
||||||
})]]
|
|
||||||
|
|
||||||
-- Throne of Hades
|
|
||||||
HADES_THRONE = {
|
|
||||||
-- Lava Moat
|
|
||||||
{pos={x=-1,y=-1,z=-1}, block="default:lava_source"},
|
|
||||||
{pos={x=-1,y=-1,z=0}, block="default:lava_source"},
|
|
||||||
{pos={x=-1,y=-1,z=1}, block="default:lava_source"},
|
|
||||||
{pos={x=-1,y=-1,z=2}, block="default:lava_source"},
|
|
||||||
{pos={x=-1,y=-1,z=3}, block="default:lava_source"},
|
|
||||||
{pos={x=-1,y=-1,z=4}, block="default:lava_source"},
|
|
||||||
{pos={x=-1,y=-1,z=5}, block="default:lava_source"},
|
|
||||||
{pos={x=-1,y=-1,z=6}, block="default:lava_source"},
|
|
||||||
{pos={x=-1,y=-1,z=7}, block="default:lava_source"},
|
|
||||||
{pos={x=0,y=-1,z=7}, block="default:lava_source"},
|
|
||||||
{pos={x=1,y=-1,z=7}, block="default:lava_source"},
|
|
||||||
{pos={x=2,y=-1,z=7}, block="default:lava_source"},
|
|
||||||
{pos={x=3,y=-1,z=7}, block="default:lava_source"},
|
|
||||||
{pos={x=4,y=-1,z=7}, block="default:lava_source"},
|
|
||||||
{pos={x=5,y=-1,z=7}, block="default:lava_source"},
|
|
||||||
{pos={x=6,y=-1,z=7}, block="default:lava_source"},
|
|
||||||
{pos={x=6,y=-1,z=6}, block="default:lava_source"},
|
|
||||||
{pos={x=6,y=-1,z=5}, block="default:lava_source"},
|
|
||||||
{pos={x=6,y=-1,z=4}, block="default:lava_source"},
|
|
||||||
{pos={x=6,y=-1,z=3}, block="default:lava_source"},
|
|
||||||
{pos={x=6,y=-1,z=2}, block="default:lava_source"},
|
|
||||||
{pos={x=6,y=-1,z=1}, block="default:lava_source"},
|
|
||||||
{pos={x=6,y=-1,z=0}, block="default:lava_source"},
|
|
||||||
{pos={x=6,y=-1,z=-1}, block="default:lava_source"},
|
|
||||||
{pos={x=5,y=-1,z=-1}, block="default:lava_source"},
|
|
||||||
{pos={x=4,y=-1,z=-1}, block="default:lava_source"},
|
|
||||||
{pos={x=3,y=-1,z=-1}, block="default:lava_source"},
|
|
||||||
{pos={x=2,y=-1,z=-1}, block="default:lava_source"},
|
|
||||||
{pos={x=1,y=-1,z=-1}, block="default:lava_source"},
|
|
||||||
{pos={x=0,y=-1,z=-1}, block="default:lava_source"},
|
|
||||||
-- Floor 1
|
|
||||||
{pos={x=0,y=0,z=0}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=0,z=1}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=0,z=2}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=0,z=3}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=0,z=4}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=0,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=1,y=0,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=2,y=0,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=3,y=0,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=4,y=0,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=0,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=0,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=1,y=0,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=2,y=0,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=3,y=0,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=4,y=0,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=0,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=0,z=4}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=0,z=3}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=0,z=2}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=0,z=1}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=0,z=0}, block="nether:netherrack"},
|
|
||||||
{pos={x=4,y=0,z=0}, block="nether:netherrack"},
|
|
||||||
{pos={x=3,y=0,z=0}, block="nether:netherrack"},
|
|
||||||
{pos={x=2,y=0,z=0}, block="nether:netherrack"},
|
|
||||||
{pos={x=1,y=0,z=0}, block="nether:netherrack"},
|
|
||||||
-- Floor 2
|
|
||||||
{pos={x=0,y=1,z=0}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=1,z=1}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=1,z=2}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=1,z=3}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=1,z=4}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=1,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=1,y=1,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=2,y=1,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=3,y=1,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=4,y=1,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=1,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=1,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=1,y=1,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=2,y=1,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=3,y=1,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=4,y=1,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=1,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=1,z=4}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=1,z=3}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=1,z=2}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=1,z=1}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=1,z=0}, block="nether:netherrack"},
|
|
||||||
{pos={x=4,y=1,z=0}, block="nether:netherrack"},
|
|
||||||
{pos={x=3,y=1,z=1}, block="nether:netherrack"},
|
|
||||||
{pos={x=2,y=1,z=1}, block="nether:netherrack"},
|
|
||||||
{pos={x=1,y=1,z=0}, block="nether:netherrack"},
|
|
||||||
{pos={x=1,y=1,z=1}, block="nether:netherrack"},
|
|
||||||
{pos={x=4,y=1,z=1}, block="nether:netherrack"},
|
|
||||||
-- Floor 3
|
|
||||||
{pos={x=0,y=2,z=0}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=2,z=1}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=2,z=2}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=2,z=3}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=2,z=4}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=2,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=1,y=2,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=2,y=2,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=3,y=2,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=4,y=2,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=2,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=2,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=1,y=2,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=2,y=2,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=3,y=2,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=4,y=2,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=2,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=2,z=4}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=2,z=3}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=2,z=2}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=2,z=1}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=2,z=0}, block="nether:netherrack"},
|
|
||||||
{pos={x=4,y=2,z=0}, block="nether:netherrack"},
|
|
||||||
{pos={x=3,y=2,z=2}, block="nether:netherrack"},
|
|
||||||
{pos={x=2,y=2,z=2}, block="nether:netherrack"},
|
|
||||||
{pos={x=1,y=2,z=0}, block="nether:netherrack"},
|
|
||||||
{pos={x=1,y=2,z=1}, block="nether:netherrack"},
|
|
||||||
{pos={x=4,y=2,z=1}, block="nether:netherrack"},
|
|
||||||
{pos={x=1,y=2,z=2}, block="nether:netherrack"},
|
|
||||||
{pos={x=4,y=2,z=2}, block="nether:netherrack"},
|
|
||||||
-- Floor 4
|
|
||||||
{pos={x=0,y=3,z=0}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=3,z=1}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=3,z=2}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=3,z=3}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=3,z=4}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=3,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=1,y=3,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=2,y=3,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=3,y=3,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=4,y=3,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=3,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=3,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=1,y=3,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=2,y=3,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=3,y=3,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=4,y=3,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=3,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=3,z=4}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=3,z=3}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=3,z=2}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=3,z=1}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=3,z=0}, block="nether:netherrack"},
|
|
||||||
{pos={x=4,y=3,z=0}, block="nether:netherrack"},
|
|
||||||
{pos={x=3,y=3,z=3}, block="nether:netherrack"},
|
|
||||||
{pos={x=2,y=3,z=3}, block="nether:netherrack"},
|
|
||||||
{pos={x=1,y=3,z=0}, block="nether:netherrack"},
|
|
||||||
{pos={x=1,y=3,z=1}, block="nether:netherrack"},
|
|
||||||
{pos={x=4,y=3,z=1}, block="nether:netherrack"},
|
|
||||||
{pos={x=1,y=3,z=2}, block="nether:netherrack"},
|
|
||||||
{pos={x=4,y=3,z=2}, block="nether:netherrack"},
|
|
||||||
{pos={x=1,y=3,z=3}, block="nether:netherrack"},
|
|
||||||
{pos={x=4,y=3,z=3}, block="nether:netherrack"},
|
|
||||||
{pos={x=1,y=3,z=4}, block="nether:netherrack"},
|
|
||||||
{pos={x=4,y=3,z=4}, block="nether:netherrack"},
|
|
||||||
{pos={x=2,y=3,z=4}, block="nether:netherrack"},
|
|
||||||
{pos={x=2,y=3,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=3,y=3,z=4}, block="nether:netherrack"},
|
|
||||||
{pos={x=3,y=3,z=5}, block="nether:netherrack"},
|
|
||||||
-- Floor 5
|
|
||||||
{pos={x=2,y=4,z=4}, block="nether:netherrack"},
|
|
||||||
{pos={x=2,y=4,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=3,y=4,z=4}, block="nether:netherrack"},
|
|
||||||
{pos={x=3,y=4,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=2,y=4,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=3,y=4,z=6}, block="nether:netherrack"},
|
|
||||||
-- Torches on floor 5
|
|
||||||
{pos={x=0,y=4,z=4}, block="nether:torch_bottom"},
|
|
||||||
{pos={x=1,y=4,z=4}, block="nether:torch_bottom"},
|
|
||||||
{pos={x=0,y=4,z=5}, block="nether:torch_bottom"},
|
|
||||||
{pos={x=1,y=4,z=5}, block="nether:torch_bottom"},
|
|
||||||
{pos={x=4,y=4,z=4}, block="nether:torch_bottom"},
|
|
||||||
{pos={x=5,y=4,z=4}, block="nether:torch_bottom"},
|
|
||||||
{pos={x=4,y=4,z=5}, block="nether:torch_bottom"},
|
|
||||||
{pos={x=5,y=4,z=5}, block="nether:torch_bottom"},
|
|
||||||
{pos={x=0,y=4,z=0}, block="nether:torch_bottom"},
|
|
||||||
{pos={x=1,y=4,z=0}, block="nether:torch_bottom"},
|
|
||||||
{pos={x=0,y=4,z=1}, block="nether:torch_bottom"},
|
|
||||||
{pos={x=1,y=4,z=1}, block="nether:torch_bottom"},
|
|
||||||
{pos={x=4,y=4,z=0}, block="nether:torch_bottom"},
|
|
||||||
{pos={x=5,y=4,z=0}, block="nether:torch_bottom"},
|
|
||||||
{pos={x=4,y=4,z=1}, block="nether:torch_bottom"},
|
|
||||||
{pos={x=5,y=4,z=1}, block="nether:torch_bottom"},
|
|
||||||
{pos={x=0,y=4,z=2}, block="nether:torch_bottom"},
|
|
||||||
{pos={x=1,y=4,z=2}, block="nether:torch_bottom"},
|
|
||||||
{pos={x=0,y=4,z=3}, block="nether:torch_bottom"},
|
|
||||||
{pos={x=1,y=4,z=3}, block="nether:torch_bottom"},
|
|
||||||
{pos={x=4,y=4,z=2}, block="nether:torch_bottom"},
|
|
||||||
{pos={x=5,y=4,z=2}, block="nether:torch_bottom"},
|
|
||||||
{pos={x=4,y=4,z=3}, block="nether:torch_bottom"},
|
|
||||||
{pos={x=5,y=4,z=3}, block="nether:torch_bottom"},
|
|
||||||
{pos={x=4,y=4,z=6}, block="nether:torch_bottom"},
|
|
||||||
{pos={x=5,y=4,z=6}, block="nether:torch_bottom"},
|
|
||||||
{pos={x=0,y=4,z=6}, block="nether:torch_bottom"},
|
|
||||||
{pos={x=1,y=4,z=6}, block="nether:torch_bottom"},
|
|
||||||
-- Nether Portal
|
|
||||||
{pos={x=1,y=5,z=6}, portalblock=true},
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
minetest.register_on_generated(function(minp, maxp, seed)
|
|
||||||
if minp.y <= 99 then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
|
|
||||||
local data = vm:get_data()
|
|
||||||
local area = VoxelArea:new{MinEdge=emin, MaxEdge=emax}
|
|
||||||
|
|
||||||
local perlin1 = minetest.get_perlin(13,3, 0.5, 50) --Get map specific perlin
|
|
||||||
local perlin2 = minetest.get_perlin(133,3, 0.5, 10)
|
|
||||||
for x=minp.x, maxp.x, 1 do
|
|
||||||
for z=minp.z, maxp.z, 1 do
|
|
||||||
local test = perlin1:get2d({x=x, y=z})+1
|
|
||||||
local test2 = perlin2:get2d({x=x, y=z})
|
|
||||||
-- print(test)
|
|
||||||
if test2 < 0 then
|
|
||||||
h = 200+math.floor(test2*3+0.5)
|
|
||||||
else
|
|
||||||
h = 203+math.floor(test*3+0.5)
|
|
||||||
end
|
|
||||||
for y=minp.y, maxp.y, 1 do
|
|
||||||
p_addpos = area:index(x, y, z)
|
|
||||||
if y <= h then
|
|
||||||
data[p_addpos] = c_netherrack
|
|
||||||
elseif y <= 201 then
|
|
||||||
data[p_addpos] = c_lava
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
vm:set_data(data)
|
|
||||||
--vm:set_lighting({day=0, night=0})
|
|
||||||
vm:calc_lighting()
|
|
||||||
vm:update_liquids()
|
|
||||||
vm:write_to_map()
|
|
||||||
end)
|
|
||||||
|
|
||||||
|
|
||||||
We don't want the Throne of Hades to get regenerated (especially since it will screw up portals)
|
|
||||||
if (minp.x <= HADES_THRONE_STARTPOS_ABS.x)
|
|
||||||
and (maxp.x >= HADES_THRONE_STARTPOS_ABS.x)
|
|
||||||
and (minp.y <= HADES_THRONE_STARTPOS_ABS.y)
|
|
||||||
and (maxp.y >= HADES_THRONE_STARTPOS_ABS.y)
|
|
||||||
and (minp.z <= HADES_THRONE_STARTPOS_ABS.z)
|
|
||||||
and (maxp.z >= HADES_THRONE_STARTPOS_ABS.z)
|
|
||||||
and (nether:fileexists(HADES_THRONE_GENERATED) == false) then
|
|
||||||
-- Pass 3: Make way for the Throne of Hades!
|
|
||||||
for x=(HADES_THRONE_STARTPOS_ABS.x - 1), (HADES_THRONE_ENDPOS_ABS.x + 1), 1 do
|
|
||||||
for z=(HADES_THRONE_STARTPOS_ABS.z - 1), (HADES_THRONE_ENDPOS_ABS.z + 1), 1 do
|
|
||||||
-- Notice I did not put a -1 for the beginning. This is because we don't want the throne to float
|
|
||||||
for y=HADES_THRONE_STARTPOS_ABS.y, (HADES_THRONE_ENDPOS_ABS.y + 1), 1 do
|
|
||||||
addpos = {x=x, y=y, z=z}
|
|
||||||
minetest.add_node(addpos, {name="air"})
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- Pass 4: Throne of Hades
|
|
||||||
for i,v in ipairs(HADES_THRONE_ABS) do
|
|
||||||
if v.portalblock == true then
|
|
||||||
NETHER_PORTALS_FROM_NETHER[table.getn(NETHER_PORTALS_FROM_NETHER)+1] = v.pos
|
|
||||||
nether:save_portal_from_nether(v.pos)
|
|
||||||
nether:createportal(v.pos)
|
|
||||||
else
|
|
||||||
minetest.add_node(v.pos, {name=v.block})
|
|
||||||
end
|
|
||||||
end
|
|
||||||
nether:touch(HADES_THRONE_GENERATED)
|
|
||||||
end
|
|
||||||
|
|
||||||
--[[ Create a nether tree
|
|
||||||
function nether:grow_nethertree(pos)
|
|
||||||
--TRUNK
|
|
||||||
pos.y=pos.y+1
|
|
||||||
local trunkpos={x=pos.x, z=pos.z}
|
|
||||||
for y=pos.y, pos.y+4+math.random(2) do
|
|
||||||
trunkpos.y=y
|
|
||||||
minetest.add_node(trunkpos, {name="nether:tree"})
|
|
||||||
end
|
|
||||||
--LEAVES
|
|
||||||
local leafpos={}
|
|
||||||
for x=(trunkpos.x-NETHER_TREESIZE), (trunkpos.x+NETHER_TREESIZE), 1 do
|
|
||||||
for y=(trunkpos.y-NETHER_TREESIZE), (trunkpos.y+NETHER_TREESIZE), 1 do
|
|
||||||
for z=(trunkpos.z-NETHER_TREESIZE), (trunkpos.z+NETHER_TREESIZE), 1 do
|
|
||||||
if (x-trunkpos.x)*(x-trunkpos.x)
|
|
||||||
+(y-trunkpos.y)*(y-trunkpos.y)
|
|
||||||
+(z-trunkpos.z)*(z-trunkpos.z)
|
|
||||||
<= NETHER_TREESIZE*NETHER_TREESIZE + NETHER_TREESIZE then
|
|
||||||
leafpos={x=x, y=y, z=z}
|
|
||||||
if minetest.get_node(leafpos).name=="air" then
|
|
||||||
if math.random(NETHER_APPLE_FREQ) == 1 then
|
|
||||||
if math.random(NETHER_HEAL_APPLE_FREQ) == 1 then
|
|
||||||
minetest.add_node(leafpos, {name="default:apple"})
|
|
||||||
else
|
|
||||||
minetest.add_node(leafpos, {name="nether:apple"})
|
|
||||||
end
|
|
||||||
else
|
|
||||||
minetest.add_node(leafpos, {name="nether:leaves"})
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end]]
|
|
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 6.0 KiB |
Before Width: | Height: | Size: 319 B |
Before Width: | Height: | Size: 452 B |
Before Width: | Height: | Size: 572 B |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 762 B |
Before Width: | Height: | Size: 574 B |
Before Width: | Height: | Size: 612 B |
@ -1,166 +0,0 @@
|
|||||||
-- Floor 1
|
|
||||||
{pos={x=0,y=0,z=0}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=0,z=1}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=0,z=2}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=0,z=3}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=0,z=4}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=0,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=1,y=0,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=2,y=0,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=3,y=0,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=4,y=0,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=0,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=0,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=1,y=0,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=2,y=0,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=3,y=0,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=4,y=0,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=0,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=0,z=4}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=0,z=3}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=0,z=2}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=0,z=1}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=0,z=0}, block="nether:netherrack"},
|
|
||||||
{pos={x=4,y=0,z=0}, block="nether:netherrack"},
|
|
||||||
{pos={x=3,y=0,z=0}, block="nether:netherrack"},
|
|
||||||
{pos={x=2,y=0,z=0}, block="nether:netherrack"},
|
|
||||||
{pos={x=1,y=0,z=0}, block="nether:netherrack"},
|
|
||||||
-- Floor 2
|
|
||||||
{pos={x=0,y=1,z=0}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=1,z=1}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=1,z=2}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=1,z=3}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=1,z=4}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=1,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=1,y=1,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=2,y=1,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=3,y=1,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=4,y=1,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=1,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=1,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=1,y=1,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=2,y=1,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=3,y=1,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=4,y=1,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=1,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=1,z=4}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=1,z=3}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=1,z=2}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=1,z=1}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=1,z=0}, block="nether:netherrack"},
|
|
||||||
{pos={x=4,y=1,z=0}, block="nether:netherrack"},
|
|
||||||
{pos={x=3,y=1,z=1}, block="nether:netherrack"},
|
|
||||||
{pos={x=2,y=1,z=1}, block="nether:netherrack"},
|
|
||||||
{pos={x=1,y=1,z=0}, block="nether:netherrack"},
|
|
||||||
{pos={x=1,y=1,z=1}, block="nether:netherrack"},
|
|
||||||
{pos={x=4,y=1,z=1}, block="nether:netherrack"},
|
|
||||||
-- Floor 3
|
|
||||||
{pos={x=0,y=2,z=0}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=2,z=1}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=2,z=2}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=2,z=3}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=2,z=4}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=2,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=1,y=2,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=2,y=2,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=3,y=2,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=4,y=2,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=2,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=2,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=1,y=2,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=2,y=2,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=3,y=2,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=4,y=2,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=2,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=2,z=4}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=2,z=3}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=2,z=2}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=2,z=1}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=2,z=0}, block="nether:netherrack"},
|
|
||||||
{pos={x=4,y=2,z=0}, block="nether:netherrack"},
|
|
||||||
{pos={x=3,y=2,z=2}, block="nether:netherrack"},
|
|
||||||
{pos={x=2,y=2,z=2}, block="nether:netherrack"},
|
|
||||||
{pos={x=1,y=2,z=0}, block="nether:netherrack"},
|
|
||||||
{pos={x=1,y=2,z=1}, block="nether:netherrack"},
|
|
||||||
{pos={x=4,y=2,z=1}, block="nether:netherrack"},
|
|
||||||
{pos={x=1,y=2,z=2}, block="nether:netherrack"},
|
|
||||||
{pos={x=4,y=2,z=2}, block="nether:netherrack"},
|
|
||||||
-- Floor 4
|
|
||||||
{pos={x=0,y=3,z=0}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=3,z=1}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=3,z=2}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=3,z=3}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=3,z=4}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=3,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=1,y=3,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=2,y=3,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=3,y=3,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=4,y=3,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=3,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=0,y=3,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=1,y=3,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=2,y=3,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=3,y=3,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=4,y=3,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=3,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=3,z=4}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=3,z=3}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=3,z=2}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=3,z=1}, block="nether:netherrack"},
|
|
||||||
{pos={x=5,y=3,z=0}, block="nether:netherrack"},
|
|
||||||
{pos={x=4,y=3,z=0}, block="nether:netherrack"},
|
|
||||||
{pos={x=3,y=3,z=3}, block="nether:netherrack"},
|
|
||||||
{pos={x=2,y=3,z=3}, block="nether:netherrack"},
|
|
||||||
{pos={x=1,y=3,z=0}, block="nether:netherrack"},
|
|
||||||
{pos={x=1,y=3,z=1}, block="nether:netherrack"},
|
|
||||||
{pos={x=4,y=3,z=1}, block="nether:netherrack"},
|
|
||||||
{pos={x=1,y=3,z=2}, block="nether:netherrack"},
|
|
||||||
{pos={x=4,y=3,z=2}, block="nether:netherrack"},
|
|
||||||
{pos={x=1,y=3,z=3}, block="nether:netherrack"},
|
|
||||||
{pos={x=4,y=3,z=3}, block="nether:netherrack"},
|
|
||||||
{pos={x=1,y=3,z=4}, block="nether:netherrack"},
|
|
||||||
{pos={x=4,y=3,z=4}, block="nether:netherrack"},
|
|
||||||
{pos={x=2,y=3,z=4}, block="nether:netherrack"},
|
|
||||||
{pos={x=2,y=3,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=3,y=3,z=4}, block="nether:netherrack"},
|
|
||||||
{pos={x=3,y=3,z=5}, block="nether:netherrack"},
|
|
||||||
-- Floor 5
|
|
||||||
{pos={x=2,y=4,z=4}, block="nether:netherrack"},
|
|
||||||
{pos={x=2,y=4,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=3,y=4,z=4}, block="nether:netherrack"},
|
|
||||||
{pos={x=3,y=4,z=5}, block="nether:netherrack"},
|
|
||||||
{pos={x=2,y=4,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=3,y=4,z=6}, block="nether:netherrack"},
|
|
||||||
-- Torches on floor 5
|
|
||||||
{pos={x=0,y=4,z=4}, block="nether:nether_torch_bottom"},
|
|
||||||
{pos={x=1,y=4,z=4}, block="nether:nether_torch_bottom"},
|
|
||||||
{pos={x=0,y=4,z=5}, block="nether:nether_torch_bottom"},
|
|
||||||
{pos={x=1,y=4,z=5}, block="nether:nether_torch_bottom"},
|
|
||||||
{pos={x=4,y=4,z=4}, block="nether:nether_torch_bottom"},
|
|
||||||
{pos={x=5,y=4,z=4}, block="nether:nether_torch_bottom"},
|
|
||||||
{pos={x=4,y=4,z=5}, block="nether:nether_torch_bottom"},
|
|
||||||
{pos={x=5,y=4,z=5}, block="nether:nether_torch_bottom"},
|
|
||||||
{pos={x=0,y=4,z=0}, block="nether:nether_torch_bottom"},
|
|
||||||
{pos={x=1,y=4,z=0}, block="nether:nether_torch_bottom"},
|
|
||||||
{pos={x=0,y=4,z=1}, block="nether:nether_torch_bottom"},
|
|
||||||
{pos={x=1,y=4,z=1}, block="nether:nether_torch_bottom"},
|
|
||||||
{pos={x=4,y=4,z=0}, block="nether:nether_torch_bottom"},
|
|
||||||
{pos={x=5,y=4,z=0}, block="nether:nether_torch_bottom"},
|
|
||||||
{pos={x=4,y=4,z=1}, block="nether:nether_torch_bottom"},
|
|
||||||
{pos={x=5,y=4,z=1}, block="nether:nether_torch_bottom"},
|
|
||||||
{pos={x=0,y=4,z=2}, block="nether:nether_torch_bottom"},
|
|
||||||
{pos={x=1,y=4,z=2}, block="nether:nether_torch_bottom"},
|
|
||||||
{pos={x=0,y=4,z=3}, block="nether:nether_torch_bottom"},
|
|
||||||
{pos={x=1,y=4,z=3}, block="nether:nether_torch_bottom"},
|
|
||||||
{pos={x=4,y=4,z=2}, block="nether:nether_torch_bottom"},
|
|
||||||
{pos={x=5,y=4,z=2}, block="nether:nether_torch_bottom"},
|
|
||||||
{pos={x=4,y=4,z=3}, block="nether:nether_torch_bottom"},
|
|
||||||
{pos={x=5,y=4,z=3}, block="nether:nether_torch_bottom"},
|
|
||||||
{pos={x=4,y=4,z=6}, block="nether:nether_torch_bottom"},
|
|
||||||
{pos={x=5,y=4,z=6}, block="nether:nether_torch_bottom"},
|
|
||||||
-- Floor 6
|
|
||||||
{pos={x=2,y=5,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=3,y=5,z=6}, block="nether:netherrack"},
|
|
||||||
-- Floor 7
|
|
||||||
{pos={x=2,y=6,z=6}, block="nether:netherrack"},
|
|
||||||
{pos={x=3,y=6,z=6}, block="nether:netherrack"},
|
|
0
nether/crafting.lua
Normal file → Executable file
7
nether/depends.txt
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
default
|
||||||
|
glow
|
||||||
|
riesenpilz
|
||||||
|
stairs
|
||||||
|
vector_extras
|
||||||
|
fence_registration?
|
||||||
|
watershed?
|
2
nether/furnace.lua
Normal file → Executable file
@ -1,5 +1,5 @@
|
|||||||
-- minetest time speed
|
-- minetest time speed
|
||||||
local time_speed = tonumber(minetest.settings:get("time_speed"))
|
local time_speed = tonumber(minetest.setting_get("time_speed"))
|
||||||
if not time_speed then
|
if not time_speed then
|
||||||
time_speed = 1
|
time_speed = 1
|
||||||
else
|
else
|
||||||
|
18
nether/guide.lua
Normal file → Executable file
@ -247,11 +247,11 @@ local guide_infos = {
|
|||||||
{"y", 0.3},
|
{"y", 0.3},
|
||||||
{"text", "A nether portal requires following nodes:"},
|
{"text", "A nether portal requires following nodes:"},
|
||||||
{"y", 0.05},
|
{"y", 0.05},
|
||||||
{"text", "25 empty nether wooden planks\n"..
|
{"text", "21 empty nether wooden planks\n"..
|
||||||
"16 black netherrack\n"..
|
|
||||||
"12 blue netherrack bricks\n"..
|
"12 blue netherrack bricks\n"..
|
||||||
|
"12 black netherrack\n"..
|
||||||
"8 red netherrack\n"..
|
"8 red netherrack\n"..
|
||||||
"8 cooked nether blood\n"..
|
"8 cooked nether wood\n"..
|
||||||
"4 nether fruits\n"..
|
"4 nether fruits\n"..
|
||||||
"2 siwtonic blocks"},
|
"2 siwtonic blocks"},
|
||||||
{"y", 0.2},
|
{"y", 0.2},
|
||||||
@ -291,7 +291,7 @@ local guide_size = {x=40, y=10, cx=0.2, cy=0.2}
|
|||||||
local formspec_offset = {x=0.25, y=0.50}
|
local formspec_offset = {x=0.25, y=0.50}
|
||||||
local font_size
|
local font_size
|
||||||
if minetest.is_singleplayer() then
|
if minetest.is_singleplayer() then
|
||||||
font_size = tonumber(minetest.settings:get("font_size")) or 13
|
font_size = tonumber(minetest.setting_get("font_size")) or 13
|
||||||
else
|
else
|
||||||
font_size = 13
|
font_size = 13
|
||||||
end
|
end
|
||||||
@ -315,13 +315,13 @@ for n,data in ipairs(guide_infos) do
|
|||||||
elseif typ == "x" then
|
elseif typ == "x" then
|
||||||
x = math.max(x, content)
|
x = math.max(x, content)
|
||||||
elseif typ == "text" then
|
elseif typ == "text" then
|
||||||
local tab = minetest.wrap_text(content, guide_size.fx, true)
|
--local tab = minetest.splittext(content, guide_size.fx)
|
||||||
local l = guide_size.cx
|
local l = guide_size.cx
|
||||||
for _,str in ipairs(tab) do
|
--[[for _,str in ipairs(tab) do
|
||||||
form = form.."label["..guide_size.cx ..","..guide_size.cy+y..";"..str.."]"
|
form = form.."label["..guide_size.cx ..","..guide_size.cy+y..";"..str.."]"
|
||||||
y = y+guide_size.fy
|
y = y+guide_size.fy
|
||||||
l = math.max(l, #str)
|
l = math.max(l, #str)
|
||||||
end
|
end]]
|
||||||
x = math.max(x, l/font_size)
|
x = math.max(x, l/font_size)
|
||||||
elseif typ == "image" then
|
elseif typ == "image" then
|
||||||
local w, h, texture_name, px, py = unpack(content)
|
local w, h, texture_name, px, py = unpack(content)
|
||||||
@ -386,10 +386,10 @@ minetest.register_chatcommand("nether_help", {
|
|||||||
minetest.chat_send_player(name, "Something went wrong.")
|
minetest.chat_send_player(name, "Something went wrong.")
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
if player:getpos().y > nether.start then
|
--[[ if player:getpos().y > nether.start then
|
||||||
minetest.chat_send_player(name, "Usually you don't neet this guide here. You can view it in the nether.")
|
minetest.chat_send_player(name, "Usually you don't neet this guide here. You can view it in the nether.")
|
||||||
return false
|
return false
|
||||||
end
|
end --]]
|
||||||
minetest.chat_send_player(name, "Showing guide...")
|
minetest.chat_send_player(name, "Showing guide...")
|
||||||
show_guide(name)
|
show_guide(name)
|
||||||
return true
|
return true
|
||||||
|
372
nether/init.lua
Normal file → Executable file
@ -11,7 +11,7 @@
|
|||||||
-- godkiller447 (ideas)
|
-- godkiller447 (ideas)
|
||||||
-- If I didn't list you, please let me know!
|
-- If I didn't list you, please let me know!
|
||||||
|
|
||||||
local load_time_start = minetest.get_us_time()
|
local load_time_start = os.clock()
|
||||||
|
|
||||||
if not rawget(_G, "nether") then
|
if not rawget(_G, "nether") then
|
||||||
nether = {}
|
nether = {}
|
||||||
@ -52,6 +52,9 @@ local grass_rarity = 2
|
|||||||
-- Frequency of nether mushrooms in the nether forest (higher is less frequent)
|
-- Frequency of nether mushrooms in the nether forest (higher is less frequent)
|
||||||
local mushroom_rarity = 80
|
local mushroom_rarity = 80
|
||||||
|
|
||||||
|
-- Frequency of trees in the nether forest (higher is less frequent)
|
||||||
|
local tree_rarity = 200
|
||||||
|
|
||||||
local abm_tree_interval = 864
|
local abm_tree_interval = 864
|
||||||
local abm_tree_chance = 100
|
local abm_tree_chance = 100
|
||||||
|
|
||||||
@ -83,14 +86,11 @@ local NETHER_SHROOM_FREQ = 100
|
|||||||
--NETHER_APPLE_FREQ = 5
|
--NETHER_APPLE_FREQ = 5
|
||||||
-- Frequency of healing apples in a nether structure (higher is less frequent)
|
-- Frequency of healing apples in a nether structure (higher is less frequent)
|
||||||
--NETHER_HEAL_APPLE_FREQ = 10
|
--NETHER_HEAL_APPLE_FREQ = 10
|
||||||
-- Start position for the Throne of Hades (y is relative to the bottom of the
|
-- Start position for the Throne of Hades (y is relative to the bottom of the nether)
|
||||||
-- nether)
|
|
||||||
--HADES_THRONE_STARTPOS = {x=0, y=1, z=0}
|
--HADES_THRONE_STARTPOS = {x=0, y=1, z=0}
|
||||||
-- Spawn pos for when the nether hasn't been loaded yet (i.e. no portal in the
|
-- Spawn pos for when the nether hasn't been loaded yet (i.e. no portal in the nether) (y is relative to the bottom of the nether)
|
||||||
-- nether) (y is relative to the bottom of the nether)
|
|
||||||
--NETHER_SPAWNPOS = {x=0, y=5, z=0}
|
--NETHER_SPAWNPOS = {x=0, y=5, z=0}
|
||||||
-- Structure of the nether portal (all is relative to the nether portal creator
|
-- Structure of the nether portal (all is relative to the nether portal creator block)
|
||||||
-- block)
|
|
||||||
|
|
||||||
--== END OF EDITABLE OPTIONS ==--
|
--== END OF EDITABLE OPTIONS ==--
|
||||||
|
|
||||||
@ -99,42 +99,50 @@ if nether.info then
|
|||||||
if spam <= self.max_spam then
|
if spam <= self.max_spam then
|
||||||
local info
|
local info
|
||||||
if t then
|
if t then
|
||||||
info = "[nether] " .. msg .. (" after ca. %.3g s"):format(
|
info = string.format("[nether] "..msg.." after ca. %.2fs", os.clock() - t)
|
||||||
(minetest.get_us_time() - t) / 1000000)
|
|
||||||
else
|
else
|
||||||
info = "[nether] " .. msg
|
info = "[nether] "..msg
|
||||||
end
|
end
|
||||||
print(info)
|
minetest.log("action", info)
|
||||||
if self.inform_all then
|
if self.inform_all then
|
||||||
minetest.chat_send_all(info)
|
minetest.chat_send_all(info)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
function nether.inform()
|
function nether:inform()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
local path = minetest.get_modpath"nether"
|
local path = minetest.get_modpath("nether")
|
||||||
dofile(path.."/weird_mapgen_noise.lua")
|
dofile(path.."/weird_mapgen_noise.lua")
|
||||||
dofile(path.."/items.lua")
|
dofile(path.."/items.lua")
|
||||||
--dofile(path.."/furnace.lua")
|
--dofile(path.."/furnace.lua")
|
||||||
dofile(path.."/pearl.lua")
|
dofile(path.."/pearl.lua")
|
||||||
|
|
||||||
|
local function table_contains(t, v)
|
||||||
|
for _,i in pairs(t) do
|
||||||
|
if i == v then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
-- Weierstrass function stuff from https://github.com/slemonide/gen
|
-- Weierstrass function stuff from https://github.com/slemonide/gen
|
||||||
local SIZE = 1000
|
local SIZE = 1000
|
||||||
local ssize = math.ceil(math.abs(SIZE))
|
local ssize = math.ceil(math.abs(SIZE))
|
||||||
local function do_ws_func(depth, a, x)
|
local function do_ws_func(depth, a, x)
|
||||||
local n = math.pi * x / (16 * SIZE)
|
local n = x/(16*SIZE)
|
||||||
local y = 0
|
local y = 0
|
||||||
for k=1,depth do
|
for k=1,depth do
|
||||||
y = y + math.sin(k^a * n) / k^a
|
y = y + math.sin(math.pi * k^a * n)/(k^a)
|
||||||
end
|
end
|
||||||
return SIZE * y / math.pi
|
return SIZE*y/math.pi
|
||||||
end
|
end
|
||||||
|
|
||||||
local chunksize = minetest.settings:get"chunksize" or 5
|
local chunksize = minetest.setting_get("chunksize") or 5
|
||||||
local ws_lists = {}
|
local ws_lists = {}
|
||||||
local function get_ws_list(a,x)
|
local function get_ws_list(a,x)
|
||||||
ws_lists[a] = ws_lists[a] or {}
|
ws_lists[a] = ws_lists[a] or {}
|
||||||
@ -153,6 +161,10 @@ end
|
|||||||
|
|
||||||
|
|
||||||
local function dif(z1, z2)
|
local function dif(z1, z2)
|
||||||
|
if z1 < 0
|
||||||
|
and z2 < 0 then
|
||||||
|
z1,z2 = -z1,-z2
|
||||||
|
end
|
||||||
return math.abs(z1-z2)
|
return math.abs(z1-z2)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -170,25 +182,43 @@ end
|
|||||||
|
|
||||||
local function set_vm_data(manip, nodes, pos, t1, name, generated)
|
local function set_vm_data(manip, nodes, pos, t1, name, generated)
|
||||||
manip:set_data(nodes)
|
manip:set_data(nodes)
|
||||||
manip:write_to_map(not generated)
|
manip:write_to_map()
|
||||||
nether:inform(name.." grew at " .. minetest.pos_to_string(pos),
|
local spam = 2
|
||||||
generated and 3 or 2, t1)
|
if generated then
|
||||||
|
spam = 3
|
||||||
|
end
|
||||||
|
nether:inform(name.." grew at ("..pos.x.."|"..pos.y.."|"..pos.z..")", spam, t1)
|
||||||
|
if not generated then
|
||||||
|
local t1 = os.clock()
|
||||||
|
manip:update_map()
|
||||||
|
nether:inform("map updated", spam, t1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function fix_light(minp, maxp)
|
||||||
|
local manip = minetest.get_voxel_manip()
|
||||||
|
local emerged_pos1, emerged_pos2 = manip:read_from_map(minp, maxp)
|
||||||
|
local area = VoxelArea:new({MinEdge=emerged_pos1, MaxEdge=emerged_pos2})
|
||||||
|
local nodes = manip:get_data()
|
||||||
|
-- MODIFICATION MADE FOR MFF ^
|
||||||
|
|
||||||
|
manip:set_data(nodes)
|
||||||
|
manip:write_to_map()
|
||||||
|
manip:update_map()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Generated variables
|
-- Generated variables
|
||||||
local NETHER_BOTTOM = (nether_middle - NETHER_HEIGHT)
|
local NETHER_BOTTOM = (nether_middle - NETHER_HEIGHT)
|
||||||
nether.buildings = NETHER_BOTTOM+12
|
nether.buildings = NETHER_BOTTOM+12
|
||||||
--~ local NETHER_ROOF_ABS = (nether_middle - NETHER_RANDOM)
|
local NETHER_ROOF_ABS = (nether_middle - NETHER_RANDOM)
|
||||||
local f_yscale_top = (f_h_max-f_h_min)/2
|
local f_yscale_top = (f_h_max-f_h_min)/2
|
||||||
local f_yscale_bottom = f_yscale_top/2
|
local f_yscale_bottom = f_yscale_top/2
|
||||||
--HADES_THRONE_STARTPOS_ABS = {x=HADES_THRONE_STARTPOS.x, y=(NETHER_BOTTOM +
|
--HADES_THRONE_STARTPOS_ABS = {x=HADES_THRONE_STARTPOS.x, y=(NETHER_BOTTOM + HADES_THRONE_STARTPOS.y), z=HADES_THRONE_STARTPOS.z}
|
||||||
--HADES_THRONE_STARTPOS.y), z=HADES_THRONE_STARTPOS.z}
|
|
||||||
--LAVA_Y = (NETHER_BOTTOM + LAVA_HEIGHT)
|
--LAVA_Y = (NETHER_BOTTOM + LAVA_HEIGHT)
|
||||||
--HADES_THRONE_ABS = {}
|
--HADES_THRONE_ABS = {}
|
||||||
--HADES_THRONE_ENDPOS_ABS = {}
|
--HADES_THRONE_ENDPOS_ABS = {}
|
||||||
--HADES_THRONE_GENERATED = minetest.get_worldpath() .. "/netherhadesthrone.txt"
|
--HADES_THRONE_GENERATED = minetest.get_worldpath() .. "/netherhadesthrone.txt"
|
||||||
--NETHER_SPAWNPOS_ABS = {x=NETHER_SPAWNPOS.x, y=(NETHER_BOTTOM +
|
--NETHER_SPAWNPOS_ABS = {x=NETHER_SPAWNPOS.x, y=(NETHER_BOTTOM + NETHER_SPAWNPOS.y), z=NETHER_SPAWNPOS.z}
|
||||||
--NETHER_SPAWNPOS.y), z=NETHER_SPAWNPOS.z}
|
|
||||||
--[[for i,v in ipairs(HADES_THRONE) do
|
--[[for i,v in ipairs(HADES_THRONE) do
|
||||||
v.pos.x = v.pos.x + HADES_THRONE_STARTPOS_ABS.x
|
v.pos.x = v.pos.x + HADES_THRONE_STARTPOS_ABS.x
|
||||||
v.pos.y = v.pos.y + HADES_THRONE_STARTPOS_ABS.y
|
v.pos.y = v.pos.y + HADES_THRONE_STARTPOS_ABS.y
|
||||||
@ -211,7 +241,7 @@ for i,v in ipairs(HADES_THRONE_ABS) do
|
|||||||
end
|
end
|
||||||
HADES_THRONE_ENDPOS_ABS = {x=htx, y=hty, z=htz}]]
|
HADES_THRONE_ENDPOS_ABS = {x=htx, y=hty, z=htz}]]
|
||||||
|
|
||||||
local c, nether_tree_nodes
|
local c
|
||||||
local function define_contents()
|
local function define_contents()
|
||||||
c = {
|
c = {
|
||||||
ignore = minetest.get_content_id("ignore"),
|
ignore = minetest.get_content_id("ignore"),
|
||||||
@ -222,8 +252,7 @@ local function define_contents()
|
|||||||
diamond = minetest.get_content_id("default:stone_with_diamond"),
|
diamond = minetest.get_content_id("default:stone_with_diamond"),
|
||||||
mese = minetest.get_content_id("default:mese"),
|
mese = minetest.get_content_id("default:mese"),
|
||||||
|
|
||||||
--https://github.com/Zeg9/minetest-glow
|
glowstone = minetest.get_content_id("glow:stone"), --https://github.com/Zeg9/minetest-glow
|
||||||
glowstone = minetest.get_content_id("glow:stone"),
|
|
||||||
|
|
||||||
nether_shroom = minetest.get_content_id("riesenpilz:nether_shroom"),
|
nether_shroom = minetest.get_content_id("riesenpilz:nether_shroom"),
|
||||||
|
|
||||||
@ -253,12 +282,6 @@ local function define_contents()
|
|||||||
nether_dirt_top = minetest.get_content_id("nether:dirt_top"),
|
nether_dirt_top = minetest.get_content_id("nether:dirt_top"),
|
||||||
nether_dirt_bottom = minetest.get_content_id("nether:dirt_bottom"),
|
nether_dirt_bottom = minetest.get_content_id("nether:dirt_bottom"),
|
||||||
}
|
}
|
||||||
local trn = {c.nether_tree, c.nether_tree_corner, c.nether_leaves,
|
|
||||||
c.nether_fruit}
|
|
||||||
nether_tree_nodes = {}
|
|
||||||
for i = 1,#trn do
|
|
||||||
nether_tree_nodes[trn[i]] = true
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local pr, contents_defined
|
local pr, contents_defined
|
||||||
@ -285,14 +308,13 @@ end
|
|||||||
|
|
||||||
local f_perlins = {}
|
local f_perlins = {}
|
||||||
|
|
||||||
-- abs(v) < 1-(persistance^octaves))/(1-persistance) = amp
|
--local perlin1 = minetest.get_perlin(13,3, 0.5, 50) --Get map specific perlin
|
||||||
--local perlin1 = minetest.get_perlin(13,3, 0.5, 50) --Get map specific perlin
|
|
||||||
-- local perlin2 = minetest.get_perlin(133,3, 0.5, 10)
|
-- local perlin2 = minetest.get_perlin(133,3, 0.5, 10)
|
||||||
-- local perlin3 = minetest.get_perlin(112,3, 0.5, 5)
|
-- local perlin3 = minetest.get_perlin(112,3, 0.5, 5)
|
||||||
local tmp = f_yscale_top*4
|
local tmp = f_yscale_top*4
|
||||||
local tmp2 = tmp/f_bottom_scale
|
local tmp2 = tmp/f_bottom_scale
|
||||||
local perlins = {
|
local perlins = {
|
||||||
{ -- amp 1.75
|
{
|
||||||
seed = 13,
|
seed = 13,
|
||||||
octaves = 3,
|
octaves = 3,
|
||||||
persist = 0.5,
|
persist = 0.5,
|
||||||
@ -300,7 +322,7 @@ local perlins = {
|
|||||||
scale = 1,
|
scale = 1,
|
||||||
offset = 0,
|
offset = 0,
|
||||||
},
|
},
|
||||||
{-- amp 1.75
|
{
|
||||||
seed = 133,
|
seed = 133,
|
||||||
octaves = 3,
|
octaves = 3,
|
||||||
persist = 0.5,
|
persist = 0.5,
|
||||||
@ -308,7 +330,7 @@ local perlins = {
|
|||||||
scale = 1,
|
scale = 1,
|
||||||
offset = 0,
|
offset = 0,
|
||||||
},
|
},
|
||||||
{-- amp 1.75
|
{
|
||||||
seed = 112,
|
seed = 112,
|
||||||
octaves = 3,
|
octaves = 3,
|
||||||
persist = 0.5,
|
persist = 0.5,
|
||||||
@ -324,7 +346,7 @@ local perlins = {
|
|||||||
scale = 1,
|
scale = 1,
|
||||||
offset = 0,
|
offset = 0,
|
||||||
},]]
|
},]]
|
||||||
forest_top = {-- amp 2.44
|
forest_top = {
|
||||||
seed = 21,
|
seed = 21,
|
||||||
octaves = 3,
|
octaves = 3,
|
||||||
persist = 0.8,
|
persist = 0.8,
|
||||||
@ -334,26 +356,18 @@ local perlins = {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
-- buffers, see https://forum.minetest.net/viewtopic.php?f=18&t=16043
|
local info = true
|
||||||
local pelin_maps
|
|
||||||
local pmap1 = {}
|
|
||||||
local pmap2 = {}
|
|
||||||
local pmap3 = {}
|
|
||||||
local pmap_f_top = {}
|
|
||||||
local data = {}
|
|
||||||
|
|
||||||
local structures_enabled = true
|
local structures_enabled = true
|
||||||
local vine_maxlength = math.floor(NETHER_HEIGHT/4+0.5)
|
local vine_maxlength = math.floor(NETHER_HEIGHT/4+0.5)
|
||||||
-- Create the Nether
|
-- Create the Nether
|
||||||
minetest.register_on_generated(function(minp, maxp, seed)
|
minetest.register_on_generated(function(minp, maxp, seed)
|
||||||
--avoid big map generation
|
if not (maxp.y >= NETHER_BOTTOM-100 and minp.y <= nether.start) then --avoid big map generation
|
||||||
if not (maxp.y >= NETHER_BOTTOM-100 and minp.y <= nether.start) then
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
local addpos = {}
|
||||||
|
|
||||||
local t1 = minetest.get_us_time()
|
local t1 = os.clock()
|
||||||
nether:inform("generates at: x=["..minp.x.."; "..maxp.x.."]; y=[" ..
|
nether:inform("generates at: x=["..minp.x.."; "..maxp.x.."]; y=["..minp.y.."; "..maxp.y.."]; z=["..minp.z.."; "..maxp.z.."]", 2)
|
||||||
minp.y.."; "..maxp.y.."]; z=["..minp.z.."; "..maxp.z.."]", 2)
|
|
||||||
|
|
||||||
if not contents_defined then
|
if not contents_defined then
|
||||||
define_contents()
|
define_contents()
|
||||||
@ -368,50 +382,39 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
|
local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
|
||||||
vm:get_data(data)
|
local data = vm:get_data()
|
||||||
local area = VoxelArea:new{MinEdge=emin, MaxEdge=emax}
|
local area = VoxelArea:new{MinEdge=emin, MaxEdge=emax}
|
||||||
|
|
||||||
pr = PseudoRandom(seed+33)
|
pr = PseudoRandom(seed+33)
|
||||||
local tab,num = {},1
|
local tab,num = {},1
|
||||||
local trees,num_trees = {},1
|
local trees,num_trees = {},1
|
||||||
|
|
||||||
--local perlin1 = minetest.get_perlin(13,3, 0.5, 50)
|
--local perlin1 = minetest.get_perlin(13,3, 0.5, 50) --Get map specific perlin
|
||||||
--local perlin2 = minetest.get_perlin(133,3, 0.5, 10)
|
--local perlin2 = minetest.get_perlin(133,3, 0.5, 10)
|
||||||
--local perlin3 = minetest.get_perlin(112,3, 0.5, 5)
|
--local perlin3 = minetest.get_perlin(112,3, 0.5, 5)
|
||||||
|
|
||||||
local side_length = maxp.x - minp.x + 1
|
local side_length = maxp.x - minp.x + 1 -- maybe mistake here
|
||||||
local map_lengths_xyz = {x=side_length, y=side_length, z=side_length}
|
local map_lengths_xyz = {x=side_length, y=side_length, z=side_length}
|
||||||
|
|
||||||
if not pelin_maps then
|
local pmap1 = minetest.get_perlin_map(perlins[1], map_lengths_xyz):get2dMap_flat({x=minp.x, y=minp.z})
|
||||||
pelin_maps = {
|
local pmap2 = minetest.get_perlin_map(perlins[2], map_lengths_xyz):get2dMap_flat({x=minp.x, y=minp.z})
|
||||||
a = minetest.get_perlin_map(perlins[1], map_lengths_xyz),
|
local pmap3 = minetest.get_perlin_map(perlins[3], map_lengths_xyz):get2dMap_flat({x=minp.x, y=minp.z})
|
||||||
b = minetest.get_perlin_map(perlins[2], map_lengths_xyz),
|
|
||||||
c = minetest.get_perlin_map(perlins[3], map_lengths_xyz),
|
|
||||||
forest_top = minetest.get_perlin_map(perlins.forest_top,
|
|
||||||
map_lengths_xyz),
|
|
||||||
}
|
|
||||||
end
|
|
||||||
pelin_maps.a:get2dMap_flat({x=minp.x, y=minp.z}, pmap1)
|
|
||||||
pelin_maps.b:get2dMap_flat({x=minp.x, y=minp.z}, pmap2)
|
|
||||||
pelin_maps.c:get2dMap_flat({x=minp.x, y=minp.z}, pmap3)
|
|
||||||
|
|
||||||
local forest_possible = maxp.y > f_h_min and minp.y < f_h_max
|
local forest_possible = maxp.y > f_h_min and minp.y < f_h_max
|
||||||
|
|
||||||
--local pmap_f_bottom = minetest.get_perlin_map(perlins.forest_bottom,
|
--local pmap_f_bottom = minetest.get_perlin_map(perlins.forest_bottom, map_lengths_xyz):get2dMap_flat({x=minp.x, y=minp.z})
|
||||||
-- map_lengths_xyz):get2dMap_flat({x=minp.x, y=minp.z})
|
local perlin_f_bottom, pmap_f_top, strassx, strassz
|
||||||
local perlin_f_bottom, strassx, strassz
|
|
||||||
if forest_possible then
|
if forest_possible then
|
||||||
perlin_f_bottom = minetest.get_perlin(11, 3, 0.8, tmp2)
|
perlin_f_bottom = minetest.get_perlin(11, 3, 0.8, tmp2)
|
||||||
pelin_maps.forest_top:get2dMap_flat({x=minp.x, y=minp.z}, pmap_f_top)
|
pmap_f_top = minetest.get_perlin_map(perlins.forest_top, map_lengths_xyz):get2dMap_flat({x=minp.x, y=minp.z})
|
||||||
strassx = get_ws_list(2, minp.x)
|
strassx = get_ws_list(2, minp.x, side_length)
|
||||||
strassz = get_ws_list(2, minp.z)
|
strassz = get_ws_list(2, minp.z, side_length)
|
||||||
end
|
end
|
||||||
|
|
||||||
local num2, tab2
|
local num2, tab2
|
||||||
if buildings >= 1 then
|
if buildings >= 1 then
|
||||||
num2 = 1
|
num2 = 1
|
||||||
tab2 = nether_weird_noise({x=minp.x, y=nether.buildings-79, z=minp.z},
|
tab2 = nether_weird_noise({x=minp.x, y=nether.buildings-(maxp.y-minp.y), z=minp.z}, pymg, 200, 8, 10, maxp.y-minp.y)
|
||||||
pymg, 200, 8, 10, side_length-1)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local count = 0
|
local count = 0
|
||||||
@ -457,18 +460,17 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
py_h_g = nether.buildings-7
|
py_h_g = nether.buildings-7
|
||||||
end
|
end
|
||||||
|
|
||||||
local vi = area:index(x, minp.y, z)
|
|
||||||
if buildings == 1
|
if buildings == 1
|
||||||
and noisp then
|
and noisp then
|
||||||
if noisp == 1 then
|
if noisp == 1 then
|
||||||
for _ = 1,side_length do
|
for y=minp.y, maxp.y do
|
||||||
data[vi] = c.netherrack_brick
|
local p_addpos = area:index(x, y, z)
|
||||||
vi = vi + area.ystride
|
data[p_addpos] = c.netherrack_brick
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
for _ = 1,side_length do
|
for y=minp.y, maxp.y do
|
||||||
data[vi] = c.lava
|
local p_addpos = area:index(x, y, z)
|
||||||
vi = vi + area.ystride
|
data[p_addpos] = c.lava
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -480,19 +482,15 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
|
|
||||||
local f_bottom, f_top, is_forest, f_h_dirt
|
local f_bottom, f_top, is_forest, f_h_dirt
|
||||||
if forest_possible then
|
if forest_possible then
|
||||||
local p = {x=math.floor(x/f_bottom_scale),
|
local p = {x=math.floor(x/f_bottom_scale), z=math.floor(z/f_bottom_scale)}
|
||||||
z=math.floor(z/f_bottom_scale)}
|
|
||||||
local pstr = p.x.." "..p.z
|
local pstr = p.x.." "..p.z
|
||||||
if not f_perlins[pstr] then
|
if not f_perlins[pstr] then
|
||||||
f_perlins[pstr] = math.floor(f_h_min + (math.abs(
|
f_perlins[pstr] = math.floor(f_h_min+(math.abs(perlin_f_bottom:get2d({x=p.x, y=p.z})+1))*f_yscale_bottom+0.5)
|
||||||
perlin_f_bottom:get2d{x=p.x, y=p.z} + 1))
|
|
||||||
* f_yscale_bottom + 0.5)
|
|
||||||
end
|
end
|
||||||
local top_noise = pmap_f_top[count]+1
|
local top_noise = pmap_f_top[count]+1
|
||||||
if top_noise < 0 then
|
if top_noise < 0 then
|
||||||
top_noise = -top_noise/10
|
top_noise = -top_noise/10
|
||||||
--nether:inform("ERROR: (perlin noise) "..
|
--nether:inform("ERROR: (perlin noise) "..pmap_f_top[count].." is not inside [-1; 1]", 1)
|
||||||
-- pmap_f_top[count].." is not inside [-1; 1]", 1)
|
|
||||||
end
|
end
|
||||||
f_top = math.floor(f_h_max - top_noise*f_yscale_top + 0.5)
|
f_top = math.floor(f_h_max - top_noise*f_yscale_top + 0.5)
|
||||||
f_bottom = f_perlins[pstr]+pr:next(0,f_bottom_scale-1)
|
f_bottom = f_perlins[pstr]+pr:next(0,f_bottom_scale-1)
|
||||||
@ -501,74 +499,78 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
end
|
end
|
||||||
|
|
||||||
for y=minp.y, maxp.y do
|
for y=minp.y, maxp.y do
|
||||||
local d_p_addp = data[vi]
|
local p_addpos = area:index(x, y, z)
|
||||||
|
local d_p_addp = data[p_addpos]
|
||||||
--if py_h >= maxp.y-4 then
|
--if py_h >= maxp.y-4 then
|
||||||
if y <= py_h
|
if y <= py_h
|
||||||
and noisp then
|
and noisp then
|
||||||
if noisp == 1 then
|
if noisp == 1 then
|
||||||
data[vi] = c.netherrack_brick
|
data[p_addpos] = c.netherrack_brick
|
||||||
elseif noisp == 2 then
|
elseif noisp == 2 then
|
||||||
if y == py_h then
|
if y == py_h then
|
||||||
data[vi] = c.netherrack_brick
|
data[p_addpos] = c.netherrack_brick
|
||||||
elseif y == py_h_g
|
elseif y == py_h_g
|
||||||
and pr:next(1,3) <= 2 then
|
and pr:next(1,3) <= 2 then
|
||||||
data[vi] = c.netherrack
|
data[p_addpos] = c.netherrack
|
||||||
elseif y <= py_h_g then
|
elseif y <= py_h_g then
|
||||||
data[vi] = c.lava
|
data[p_addpos] = c.lava
|
||||||
else
|
else
|
||||||
data[vi] = c.air
|
data[p_addpos] = c.air
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif d_p_addp ~= c.air then
|
elseif d_p_addp ~= c.air then
|
||||||
|
|
||||||
if is_forest
|
if is_forest
|
||||||
and y == f_bottom then
|
and y == f_bottom then
|
||||||
data[vi] = c.nether_dirt_top
|
data[p_addpos] = c.nether_dirt_top
|
||||||
elseif is_forest
|
elseif is_forest
|
||||||
and y < f_bottom
|
and y < f_bottom
|
||||||
and y >= f_h_dirt then
|
and y >= f_h_dirt then
|
||||||
data[vi] = c.nether_dirt
|
data[p_addpos] = c.nether_dirt
|
||||||
elseif is_forest
|
elseif is_forest
|
||||||
and y == f_h_dirt-1 then
|
and y == f_h_dirt-1 then
|
||||||
data[vi] = c.nether_dirt_bottom
|
data[p_addpos] = c.nether_dirt_bottom
|
||||||
elseif is_forest
|
elseif is_forest
|
||||||
and y == f_h_dirt+1 then
|
and y == f_h_dirt+1 then
|
||||||
if pr:next(1,tree_rarity) == 1 then
|
if pr:next(1,tree_rarity) == 1 then
|
||||||
trees[num_trees] = {x=x, y=y, z=z}
|
trees[num_trees] = {x=x, y=y, z=z}
|
||||||
num_trees = num_trees+1
|
num_trees = num_trees+1
|
||||||
elseif pr:next(1,mushroom_rarity) == 1 then
|
elseif pr:next(1,mushroom_rarity) == 1 then
|
||||||
data[vi] = c.nether_shroom
|
data[p_addpos] = c.nether_shroom
|
||||||
elseif pr:next(1,glowflower_rarity) == 1 then
|
elseif pr:next(1,glowflower_rarity) == 1 then
|
||||||
data[vi] = c.glowflower
|
data[p_addpos] = c.glowflower
|
||||||
elseif pr:next(1,grass_rarity) == 1 then
|
elseif pr:next(1,grass_rarity) == 1 then
|
||||||
data[vi] = c.nether_grass[pr:next(1,3)]
|
data[p_addpos] = c.nether_grass[pr:next(1,3)]
|
||||||
else
|
else
|
||||||
data[vi] = c.air
|
data[p_addpos] = c.air
|
||||||
end
|
end
|
||||||
elseif is_forest
|
elseif is_forest
|
||||||
and y > f_bottom
|
and y > f_bottom
|
||||||
and y < f_top then
|
and y < f_top then
|
||||||
if not nether_tree_nodes[d_p_addp] then
|
if not table_contains(
|
||||||
data[vi] = c.air
|
{c.nether_tree, c.nether_tree_corner, c.nether_leaves, c.nether_fruit},
|
||||||
|
d_p_addp
|
||||||
|
) then
|
||||||
|
data[p_addpos] = c.air
|
||||||
end
|
end
|
||||||
elseif is_forest
|
elseif is_forest
|
||||||
and y == f_top then
|
and y == f_top then
|
||||||
local sel = math.floor(strassx[x]+strassz[z]+0.5)%10
|
local sel = math.floor(strassx[x]+strassz[z]+0.5)%10
|
||||||
if sel <= 5 then
|
if sel <= 5 then
|
||||||
data[vi] = return_nether_ore(d_p_addp, true)
|
data[p_addpos] = return_nether_ore(d_p_addp, true)
|
||||||
elseif sel == 6 then
|
elseif sel == 6 then
|
||||||
data[vi] = c.netherrack_black
|
data[p_addpos] = c.netherrack_black
|
||||||
elseif sel == 7 then
|
elseif sel == 7 then
|
||||||
data[vi] = c.glowstone
|
data[p_addpos] = c.glowstone
|
||||||
else
|
else
|
||||||
data[vi] = c.air
|
data[p_addpos] = c.air
|
||||||
end
|
end
|
||||||
|
|
||||||
elseif y <= NETHER_BOTTOM then
|
elseif y <= NETHER_BOTTOM then
|
||||||
if y <= bottom then
|
if y <= bottom then
|
||||||
data[vi] = return_nether_ore(d_p_addp, true)
|
data[p_addpos] = return_nether_ore(d_p_addp, true)
|
||||||
else
|
else
|
||||||
data[vi] = c.lava
|
data[p_addpos] = c.lava
|
||||||
end
|
end
|
||||||
elseif r_structure == 1
|
elseif r_structure == 1
|
||||||
and y == bottom then
|
and y == bottom then
|
||||||
@ -576,27 +578,26 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
num = num+1
|
num = num+1
|
||||||
elseif y <= bottom then
|
elseif y <= bottom then
|
||||||
if pr:next(1,LAVA_FREQ) == 1 then
|
if pr:next(1,LAVA_FREQ) == 1 then
|
||||||
data[vi] = c.lava
|
data[p_addpos] = c.lava
|
||||||
else
|
else
|
||||||
data[vi] = return_nether_ore(d_p_addp, false)
|
data[p_addpos] = return_nether_ore(d_p_addp, false)
|
||||||
end
|
end
|
||||||
elseif r_shroom == 1
|
elseif r_shroom == 1
|
||||||
and r_structure ~= 1
|
and r_structure ~= 1
|
||||||
and y == bottom+1 then
|
and y == bottom+1 then
|
||||||
data[vi] = c.nether_shroom
|
data[p_addpos] = c.nether_shroom
|
||||||
elseif (y == top and r_glowstone == 1) then
|
elseif (y == top and r_glowstone == 1) then
|
||||||
data[vi] = c.glowstone
|
data[p_addpos] = c.glowstone
|
||||||
elseif y >= top then
|
elseif y >= top then
|
||||||
data[vi] = return_nether_ore(d_p_addp, true)
|
data[p_addpos] = return_nether_ore(d_p_addp, true)
|
||||||
elseif y <= top-1
|
elseif y <= top-1
|
||||||
and generate_vine
|
and generate_vine
|
||||||
and y >= top-r_vine_length then
|
and y >= top-r_vine_length then
|
||||||
data[vi] = c.nether_vine
|
data[p_addpos] = c.nether_vine
|
||||||
else
|
else
|
||||||
data[vi] = c.air
|
data[p_addpos] = c.air
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
vi = vi + area.ystride
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -605,42 +606,37 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
-- vm:set_lighting(12)
|
-- vm:set_lighting(12)
|
||||||
-- vm:calc_lighting()
|
-- vm:calc_lighting()
|
||||||
-- vm:update_liquids()
|
-- vm:update_liquids()
|
||||||
vm:write_to_map(false)
|
vm:write_to_map()
|
||||||
|
|
||||||
nether:inform("nodes set", 2, t1)
|
nether:inform("nodes set", 2, t1)
|
||||||
|
|
||||||
local t2 = minetest.get_us_time()
|
local t2 = os.clock()
|
||||||
local tr_bl_cnt = 0
|
|
||||||
|
|
||||||
if structures_enabled then -- Blood netherstructures
|
if structures_enabled then --Trees:
|
||||||
tr_bl_cnt = #tab
|
for _,v in ipairs(tab) do
|
||||||
for i = 1,tr_bl_cnt do
|
nether.grow_netherstructure(v, true)
|
||||||
nether.grow_netherstructure(tab[i], true)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if forest_possible then -- Forest trees
|
if forest_possible then --Trees:
|
||||||
tr_bl_cnt = tr_bl_cnt + #trees
|
for _,v in ipairs(trees) do
|
||||||
for i = 1,#trees do
|
nether.grow_tree(v, true)
|
||||||
nether.grow_tree(trees[i], true)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if tr_bl_cnt > 0 then
|
nether:inform("trees set", 2, t2)
|
||||||
nether:inform(tr_bl_cnt .. " trees and blood structures set", 2, t2)
|
|
||||||
end
|
|
||||||
|
|
||||||
t2 = minetest.get_us_time()
|
t2 = os.clock()
|
||||||
minetest.fix_light(minp, maxp)
|
fix_light(minp, maxp)
|
||||||
|
|
||||||
nether:inform("light fixed", 2, t2)
|
nether:inform("map updated", 2, t2)
|
||||||
|
|
||||||
nether:inform("done", 1, t1)
|
nether:inform("done", 1, t1)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
||||||
function nether.grow_netherstructure(pos, generated)
|
function nether.grow_netherstructure(pos, generated)
|
||||||
local t1 = minetest.get_us_time()
|
local t1 = os.clock()
|
||||||
|
|
||||||
if not contents_defined then
|
if not contents_defined then
|
||||||
define_contents()
|
define_contents()
|
||||||
@ -657,10 +653,8 @@ function nether.grow_netherstructure(pos, generated)
|
|||||||
local area = r_area(manip, 2, height, pos)
|
local area = r_area(manip, 2, height, pos)
|
||||||
local nodes = manip:get_data()
|
local nodes = manip:get_data()
|
||||||
|
|
||||||
local vi = area:indexp(pos)
|
for i = 0, height-1 do
|
||||||
for _ = 0, height-1 do
|
nodes[area:index(pos.x, pos.y+i, pos.z)] = c.blood_stem
|
||||||
nodes[vi] = c.blood_stem
|
|
||||||
vi = vi + area.ystride
|
|
||||||
end
|
end
|
||||||
|
|
||||||
for i = -1,1 do
|
for i = -1,1 do
|
||||||
@ -699,8 +693,9 @@ function nether.grow_netherstructure(pos, generated)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
local poshash = minetest.hash_node_position
|
local set = vector.set_data_to_pos
|
||||||
local pos_from_hash = minetest.get_position_from_hash
|
local get = vector.get_data_from_pos
|
||||||
|
local remove = vector.remove_data_from_pos
|
||||||
|
|
||||||
local function soft_node(id)
|
local function soft_node(id)
|
||||||
return id == c.air or id == c.ignore
|
return id == c.air or id == c.ignore
|
||||||
@ -738,7 +733,7 @@ local leaf_thickness = 3 --a bigger number results in more blank trees
|
|||||||
local h_trunk_max = h_max-h_arm_max
|
local h_trunk_max = h_max-h_arm_max
|
||||||
|
|
||||||
function nether.grow_tree(pos, generated)
|
function nether.grow_tree(pos, generated)
|
||||||
local t1 = minetest.get_us_time()
|
local t1 = os.clock()
|
||||||
|
|
||||||
if not contents_defined then
|
if not contents_defined then
|
||||||
define_contents()
|
define_contents()
|
||||||
@ -781,17 +776,15 @@ function nether.grow_tree(pos, generated)
|
|||||||
for j = 1,r do
|
for j = 1,r do
|
||||||
local x = p.x+j*dir[1]
|
local x = p.x+j*dir[1]
|
||||||
local z = p.z+j*dir[2]
|
local z = p.z+j*dir[2]
|
||||||
trunks[poshash{x=x, y=p.y, z=z}] = dir[3]
|
set(trunks, z,p.y,x, dir[3])
|
||||||
end
|
end
|
||||||
r = r+1
|
r = r+1
|
||||||
p.x = p.x+r*dir[1]
|
p.x = p.x+r*dir[1]
|
||||||
p.z = p.z+r*dir[2]
|
p.z = p.z+r*dir[2]
|
||||||
trunk_corners[poshash(p)] = dir[4] or dir[3]
|
set(trunk_corners, p.z,p.y,p.x, dir[4] or dir[3])
|
||||||
local h = math.random(h_arm_min, h_arm_max)
|
local h = math.random(h_arm_min, h_arm_max)
|
||||||
for i = 1,h do
|
for i = 1,h do
|
||||||
p.y = p.y + i
|
set(trunks, p.z,p.y+i,p.x, true)
|
||||||
trunks[poshash(p)] = true
|
|
||||||
p.y = p.y - i
|
|
||||||
end
|
end
|
||||||
p.y = p.y+h
|
p.y = p.y+h
|
||||||
--n = #todo+1 -- caused small trees
|
--n = #todo+1 -- caused small trees
|
||||||
@ -807,16 +800,10 @@ function nether.grow_tree(pos, generated)
|
|||||||
local fruits = {}
|
local fruits = {}
|
||||||
local trunk_ps = {}
|
local trunk_ps = {}
|
||||||
local count = 0
|
local count = 0
|
||||||
|
local ps, trmin, trmax, trunk_count = vector.get_data_pos_table(trunks)
|
||||||
|
|
||||||
local ps = {}
|
update_minmax(min, max, trmin)
|
||||||
local trunk_count = 0
|
update_minmax(min, max, trmax)
|
||||||
for i,par2 in pairs(trunks) do
|
|
||||||
local pos = pos_from_hash(i)
|
|
||||||
update_minmax(min, max, pos)
|
|
||||||
local z,y,x = pos.z, pos.y, pos.x
|
|
||||||
trunk_count = trunk_count+1
|
|
||||||
ps[trunk_count] = {z,y,x, par2}
|
|
||||||
end
|
|
||||||
|
|
||||||
for _,d in pairs(ps) do
|
for _,d in pairs(ps) do
|
||||||
if d[4] == true then
|
if d[4] == true then
|
||||||
@ -837,14 +824,13 @@ function nether.grow_tree(pos, generated)
|
|||||||
local x = x+px
|
local x = x+px
|
||||||
local y = y+py
|
local y = y+py
|
||||||
local z = z+pz
|
local z = z+pz
|
||||||
local vi = poshash{x=x, y=y, z=z}
|
if not get(trunks, z,y,x) then
|
||||||
if not trunks[vi] then
|
|
||||||
if fruit_chance
|
if fruit_chance
|
||||||
and math.random(1, fruit_rarity) == 1
|
and math.random(1, fruit_rarity) == 1
|
||||||
and math.random(1, fruit_chance) == 1 then
|
and math.random(1, fruit_chance) == 1 then
|
||||||
fruits[vi] = true
|
set(fruits, z,y,x, true)
|
||||||
else
|
else
|
||||||
leaves[vi] = true
|
set(leaves, z,y,x, true)
|
||||||
end
|
end
|
||||||
update_minmax(min, max, {x=x, z=z})
|
update_minmax(min, max, {x=x, z=z})
|
||||||
end
|
end
|
||||||
@ -855,12 +841,8 @@ function nether.grow_tree(pos, generated)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--ps = nil
|
|
||||||
--collectgarbage()
|
|
||||||
|
|
||||||
for i = -1,h_stem+1 do
|
for i = -1,h_stem+1 do
|
||||||
-- param2 explicitly set 0 due to possibly previous leaves node
|
trunk_ps[#trunk_ps+1] = {pos.z, pos.y+i, pos.x, 0} -- par 0 because of leaves
|
||||||
trunk_ps[#trunk_ps+1] = {pos.z, pos.y+i, pos.x, 0}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local manip = minetest.get_voxel_manip()
|
local manip = minetest.get_voxel_manip()
|
||||||
@ -869,8 +851,8 @@ function nether.grow_tree(pos, generated)
|
|||||||
local nodes = manip:get_data()
|
local nodes = manip:get_data()
|
||||||
local param2s = manip:get_param2_data()
|
local param2s = manip:get_param2_data()
|
||||||
|
|
||||||
for i in pairs(leaves) do
|
for _,p in pairs(vector.get_data_pos_table(leaves)) do
|
||||||
local p = area:indexp(pos_from_hash(i))
|
p = area:index(p[3], p[2], p[1])
|
||||||
if soft_node(nodes[p]) then
|
if soft_node(nodes[p]) then
|
||||||
nodes[p] = c.nether_leaves
|
nodes[p] = c.nether_leaves
|
||||||
param2s[p] = math.random(0,179)
|
param2s[p] = math.random(0,179)
|
||||||
@ -878,15 +860,14 @@ function nether.grow_tree(pos, generated)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
for i in pairs(fruits) do
|
for _,p in pairs(vector.get_data_pos_table(fruits)) do
|
||||||
local p = area:indexp(pos_from_hash(i))
|
p = area:index(p[3], p[2], p[1])
|
||||||
if soft_node(nodes[p]) then
|
if soft_node(nodes[p]) then
|
||||||
nodes[p] = c.nether_apple
|
nodes[p] = c.nether_apple
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
for i = 1,#trunk_ps do
|
for _,p in pairs(trunk_ps) do
|
||||||
local p = trunk_ps[i]
|
|
||||||
local par = p[4]
|
local par = p[4]
|
||||||
p = area:index(p[3], p[2], p[1])
|
p = area:index(p[3], p[2], p[1])
|
||||||
if par then
|
if par then
|
||||||
@ -895,18 +876,25 @@ function nether.grow_tree(pos, generated)
|
|||||||
nodes[p] = c.nether_tree
|
nodes[p] = c.nether_tree
|
||||||
end
|
end
|
||||||
|
|
||||||
for i,par2 in pairs(trunk_corners) do
|
for _,p in pairs(vector.get_data_pos_table(trunk_corners)) do
|
||||||
local vi = area:indexp(pos_from_hash(i))
|
local vi = area:index(p[3], p[2], p[1])
|
||||||
nodes[vi] = c.nether_tree_corner
|
nodes[vi] = c.nether_tree_corner
|
||||||
param2s[vi] = par2
|
param2s[vi] = p[4]
|
||||||
end
|
end
|
||||||
|
|
||||||
manip:set_data(nodes)
|
manip:set_data(nodes)
|
||||||
manip:set_param2_data(param2s)
|
manip:set_param2_data(param2s)
|
||||||
manip:write_to_map(not generated)
|
manip:write_to_map()
|
||||||
nether:inform("a nether tree with " .. trunk_count ..
|
local spam = 2
|
||||||
" branch trunk nodes grew at " .. minetest.pos_to_string(pos),
|
if generated then
|
||||||
generated and 3 or 2, t1)
|
spam = 3
|
||||||
|
end
|
||||||
|
nether:inform("a nether tree with "..trunk_count.." branch trunk nodes grew at ("..pos.x.."|"..pos.y.."|"..pos.z..")", spam, t1)
|
||||||
|
if not generated then
|
||||||
|
local t1 = os.clock()
|
||||||
|
manip:update_map()
|
||||||
|
nether:inform("map updated", spam, t1)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -935,8 +923,7 @@ minetest.register_abm({
|
|||||||
action = function(pos)
|
action = function(pos)
|
||||||
if minetest.get_node({x=pos.x, y=pos.y+2, z=pos.z}).name == "air"
|
if minetest.get_node({x=pos.x, y=pos.y+2, z=pos.z}).name == "air"
|
||||||
and minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name == "air" then
|
and minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name == "air" then
|
||||||
local udata = minetest.registered_nodes[
|
local udata = minetest.registered_nodes[minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name]
|
||||||
minetest.get_node{x=pos.x, y=pos.y-1, z=pos.z}.name]
|
|
||||||
if udata
|
if udata
|
||||||
and udata.groups
|
and udata.groups
|
||||||
and udata.groups.nether_dirt then
|
and udata.groups.nether_dirt then
|
||||||
@ -957,15 +944,13 @@ minetest.register_abm({
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
pos.y = pos.y+1
|
pos.y = pos.y+1
|
||||||
--mushrooms grow at dark places
|
if (minetest.get_node_light(pos) or 16) > 7 then --mushrooms grow at dark places
|
||||||
if (minetest.get_node_light(pos) or 16) > 7 then
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if minetest.get_node(pos).name == "air" then
|
if minetest.get_node(pos).name == "air" then
|
||||||
minetest.set_node(pos, {name="riesenpilz:nether_shroom"})
|
minetest.set_node(pos, {name="riesenpilz:nether_shroom"})
|
||||||
pos.y = pos.y-1
|
pos.y = pos.y-1
|
||||||
minetest.set_node(pos,
|
minetest.set_node(pos, {name="nether:netherrack_soil", param2=par2-1})
|
||||||
{name="nether:netherrack_soil", param2=par2-1})
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
@ -979,10 +964,6 @@ local function grass_allowed(pos)
|
|||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
local data = minetest.registered_nodes[nd]
|
local data = minetest.registered_nodes[nd]
|
||||||
if not data then
|
|
||||||
-- unknown node
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
local drawtype = data.drawtype
|
local drawtype = data.drawtype
|
||||||
if drawtype
|
if drawtype
|
||||||
and drawtype ~= "normal"
|
and drawtype ~= "normal"
|
||||||
@ -1029,18 +1010,17 @@ minetest.register_abm({
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
minetest.register_privilege("nether",
|
minetest.register_privilege("nether", "Allows sending players to nether and extracting them")
|
||||||
"Allows sending players to nether and extracting them")
|
|
||||||
|
|
||||||
dofile(path.."/crafting.lua")
|
dofile(path.."/crafting.lua")
|
||||||
dofile(path.."/portal.lua")
|
dofile(path.."/portal.lua")
|
||||||
dofile(path.."/guide.lua")
|
dofile(path.."/guide.lua")
|
||||||
|
|
||||||
|
|
||||||
local time = (minetest.get_us_time() - load_time_start) / 1000000
|
local time = math.floor(tonumber(os.clock()-load_time_start)*100+0.5)/100
|
||||||
local msg = ("[nether] loaded after ca. %g seconds."):format(time)
|
local msg = "[nether] loaded after ca. "..time
|
||||||
if time > 0.01 then
|
if time > 0.05 then
|
||||||
print(msg)
|
minetest.log("warning", msg)
|
||||||
else
|
else
|
||||||
minetest.log("info", msg)
|
minetest.log("info", msg)
|
||||||
end
|
end
|
||||||
|
149
nether/items.lua
Normal file → Executable file
@ -35,17 +35,11 @@ local function add_fence(name)
|
|||||||
end
|
end
|
||||||
--]]
|
--]]
|
||||||
|
|
||||||
local creative_installed = minetest.global_exists("creative")
|
|
||||||
|
|
||||||
local function digging_allowed(player, v)
|
local function digging_allowed(player, v)
|
||||||
if not player then
|
if not player then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
if creative_installed and creative.is_enabled_for(player:get_player_name()) then
|
local tool = minetest.registered_tools[player:get_wielded_item():get_name()]
|
||||||
return true
|
|
||||||
end
|
|
||||||
local tool = player:get_wielded_item():get_name()
|
|
||||||
tool = minetest.registered_tools[tool] or tool == "" and minetest.registered_items[tool]
|
|
||||||
if not tool
|
if not tool
|
||||||
or not tool.tool_capabilities then
|
or not tool.tool_capabilities then
|
||||||
return false
|
return false
|
||||||
@ -382,6 +376,18 @@ minetest.register_node("nether:apple", {
|
|||||||
if nether_port(user, vector.round(user:getpos())) then
|
if nether_port(user, vector.round(user:getpos())) then
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local p_hunger = tonumber(hbhunger.hunger[user:get_player_name()])
|
||||||
|
if not p_hunger then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
p_hunger = p_hunger + 9
|
||||||
|
if p_hunger > 30 then
|
||||||
|
p_hunger = 30
|
||||||
|
end
|
||||||
|
hbhunger.hunger[user:get_player_name()] = p_hunger
|
||||||
|
hbhunger.set_hunger(user)
|
||||||
|
|
||||||
local amount = math.random(4, 6)
|
local amount = math.random(4, 6)
|
||||||
inv:add_item("main", {name="nether:blood_extracted", count=math.floor(amount/3)})
|
inv:add_item("main", {name="nether:blood_extracted", count=math.floor(amount/3)})
|
||||||
user:set_hp(user:get_hp()-amount)
|
user:set_hp(user:get_hp()-amount)
|
||||||
@ -528,7 +534,7 @@ minetest.register_node("nether:leaves", {
|
|||||||
description = "Nether Leaves",
|
description = "Nether Leaves",
|
||||||
drawtype = "plantlike",
|
drawtype = "plantlike",
|
||||||
waving = 1,
|
waving = 1,
|
||||||
visual_scale = math.sqrt(2) + 0.01,
|
visual_scale = math.sqrt(math.sqrt(2)),
|
||||||
tiles = {"nether_leaves.png"},
|
tiles = {"nether_leaves.png"},
|
||||||
inventory_image = "nether_leaves.png",
|
inventory_image = "nether_leaves.png",
|
||||||
wield_image = "nether_leaves.png",
|
wield_image = "nether_leaves.png",
|
||||||
@ -819,51 +825,53 @@ minetest.register_craftitem("nether:hotbed", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
-- Modif MFF the entire tool
|
||||||
minetest.register_tool("nether:pick_mushroom", {
|
minetest.register_tool("nether:pick_mushroom", {
|
||||||
description = "Nether Mushroom Pickaxe",
|
description = "Nether Mushroom Pickaxe",
|
||||||
inventory_image = "nether_pick_mushroom.png",
|
inventory_image = "nether_pick_mushroom.png",
|
||||||
tool_capabilities = {
|
tool_capabilities = {
|
||||||
max_drop_level=0,
|
max_drop_level=0,
|
||||||
groupcaps={
|
groupcaps={
|
||||||
cracky = {times={[3]=3}, uses=1, maxlevel=1},
|
cracky = {times={[3]=3.0}, uses=5, maxlevel=1},
|
||||||
nether = {times={[3]=3}, uses=1, maxlevel=1},
|
nether = {times={[3]=3}, uses=5, maxlevel=1},
|
||||||
},
|
},
|
||||||
|
damage_groups = {fleshy=2},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_tool("nether:pick_wood", {
|
minetest.register_tool("nether:pick_wood", { -- Modif MFF the entire tool
|
||||||
description = "Nether Wood Pickaxe",
|
description = "Nether Wood Pickaxe",
|
||||||
inventory_image = "nether_pick_wood.png",
|
inventory_image = "nether_pick_wood.png",
|
||||||
tool_capabilities = {
|
tool_capabilities = {
|
||||||
full_punch_interval = 1.2,
|
full_punch_interval = 1.2,
|
||||||
max_drop_level=0,
|
max_drop_level=0,
|
||||||
groupcaps={
|
groupcaps={
|
||||||
cracky = {times={[3]=1.6}, uses=10, maxlevel=1},
|
cracky = {times={[3]=1.60}, uses=10, maxlevel=1},
|
||||||
nether = {times={[2]=6, [3]=1.6}, uses=10, maxlevel=1},
|
nether = {times={[2]=6, [3]=1.60}, uses=10, maxlevel=1},
|
||||||
},
|
},
|
||||||
damage_groups = {fleshy=2},
|
damage_groups = {fleshy=2},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_tool("nether:pick_netherrack", {
|
minetest.register_tool("nether:pick_netherrack", { -- Modif MFF the entire tool
|
||||||
description = "Netherrack Pickaxe",
|
description = "Netherrack Pickaxe",
|
||||||
inventory_image = "nether_pick_netherrack.png",
|
inventory_image = "nether_pick_netherrack.png",
|
||||||
tool_capabilities = {
|
tool_capabilities = {
|
||||||
full_punch_interval = 1.3,
|
full_punch_interval = 1.2,
|
||||||
max_drop_level=0,
|
max_drop_level=0,
|
||||||
groupcaps={
|
groupcaps={
|
||||||
cracky = {times={[2]=2.0, [3]=1.20}, uses=20, maxlevel=1},
|
cracky = {times={[2]=2.00, [3]=1.20}, uses=20, maxlevel=2},
|
||||||
nether = {times={[1]=16, [2]=2, [3]=1.20}, uses=20, maxlevel=1},
|
nether = {times={[1]=16, [2]=2.00, [3]=1.20}, uses=20, maxlevel=1},
|
||||||
},
|
},
|
||||||
damage_groups = {fleshy=3},
|
damage_groups = {fleshy=3},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_tool("nether:pick_netherrack_blue", {
|
minetest.register_tool("nether:pick_netherrack_blue", { -- Modif MFF the entire tool
|
||||||
description = "Blue Netherrack Pickaxe",
|
description = "Blue Netherrack Pickaxe",
|
||||||
inventory_image = "nether_pick_netherrack_blue.png",
|
inventory_image = "nether_pick_netherrack_blue.png",
|
||||||
tool_capabilities = {
|
tool_capabilities = {
|
||||||
full_punch_interval = 1.0,
|
full_punch_interval = 0.8,
|
||||||
max_drop_level=1,
|
max_drop_level=1,
|
||||||
groupcaps={
|
groupcaps={
|
||||||
cracky = {times={[1]=4.00, [2]=1.60, [3]=0.80}, uses=30, maxlevel=2},
|
cracky = {times={[1]=4.00, [2]=1.60, [3]=0.80}, uses=30, maxlevel=2},
|
||||||
@ -873,60 +881,62 @@ minetest.register_tool("nether:pick_netherrack_blue", {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_tool("nether:pick_white", {
|
minetest.register_tool("nether:pick_white", { -- Modif MFF the entire tool
|
||||||
description = "Siwtonic Pickaxe",
|
description = "Siwtonic Pickaxe",
|
||||||
inventory_image = "nether_pick_white.png",
|
inventory_image = "nether_pick_white.png",
|
||||||
tool_capabilities = {
|
tool_capabilities = {
|
||||||
full_punch_interval = 0.9,
|
full_punch_interval = 0.5,
|
||||||
max_drop_level=3,
|
max_drop_level=3,
|
||||||
groupcaps={
|
groupcaps={
|
||||||
cracky = {times={[1]=1, [2]=0.8, [3]=0.3}, uses=180, maxlevel=3},
|
cracky = {times={[1]=1.75, [2]=0.85, [3]=0.40}, uses=125, maxlevel=3},
|
||||||
nether = {times={[1]=1, [2]=0.5, [3]=0.3}, uses=180, maxlevel=3},
|
nether = {times={[1]=1, [2]=0.5, [3]=0.3}, uses=125, maxlevel=3},
|
||||||
},
|
},
|
||||||
damage_groups = {fleshy=5},
|
damage_groups = {fleshy=5},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_tool("nether:axe_netherrack", {
|
-- Nether Axe
|
||||||
|
minetest.register_tool("nether:axe_netherrack", { -- Modif MFF the entire tool
|
||||||
description = "Netherrack Axe",
|
description = "Netherrack Axe",
|
||||||
inventory_image = "nether_axe_netherrack.png",
|
inventory_image = "nether_axe_netherrack.png",
|
||||||
tool_capabilities = {
|
tool_capabilities = {
|
||||||
full_punch_interval = 1.3,
|
full_punch_interval = 1.3,
|
||||||
max_drop_level=0,
|
max_drop_level=0,
|
||||||
groupcaps={
|
groupcaps={
|
||||||
choppy={times={[1]=2.9, [2]=1.9, [3]=1.4}, uses=20, maxlevel=1},
|
choppy={times={[1]=3.00, [2]=1.00, [3]=0.60}, uses=20, maxlevel=2},
|
||||||
},
|
},
|
||||||
damage_groups = {fleshy=4},
|
damage_groups = {fleshy=3},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_tool("nether:axe_netherrack_blue", {
|
minetest.register_tool("nether:axe_netherrack_blue", { -- Modif MFF the entire tool
|
||||||
description = "Blue Netherrack Axe",
|
description = "Blue Netherrack Axe",
|
||||||
inventory_image = "nether_axe_netherrack_blue.png",
|
inventory_image = "nether_axe_netherrack_blue.png",
|
||||||
tool_capabilities = {
|
tool_capabilities = {
|
||||||
full_punch_interval = 0.9,
|
full_punch_interval = 0.9,
|
||||||
max_drop_level=1,
|
max_drop_level=1,
|
||||||
groupcaps={
|
groupcaps={
|
||||||
choppy={times={[1]=2.5, [2]=1.5, [3]=1}, uses=30, maxlevel=2},
|
choppy={times={[1]=2.00, [2]=0.80, [3]=0.40}, uses=30, maxlevel=2},
|
||||||
},
|
},
|
||||||
damage_groups = {fleshy=6},
|
damage_groups = {fleshy=4},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_tool("nether:axe_white", {
|
minetest.register_tool("nether:axe_white", { -- Modif MFF the entire tool
|
||||||
description = "Siwtonic Axe",
|
description = "Siwtonic Axe",
|
||||||
inventory_image = "nether_axe_white.png",
|
inventory_image = "nether_axe_white.png",
|
||||||
tool_capabilities = {
|
tool_capabilities = {
|
||||||
full_punch_interval = 0.9,
|
full_punch_interval = 0.9,
|
||||||
max_drop_level=1,
|
max_drop_level=1,
|
||||||
groupcaps={
|
groupcaps={
|
||||||
choppy={times={[1]=1.2, [2]=0.5, [3]=0.3}, uses=180, maxlevel=2},
|
choppy={times={[1]=0.90, [2]=0.45, [3]=0.20}, uses=125, maxlevel=3},
|
||||||
},
|
},
|
||||||
damage_groups = {fleshy=8},
|
damage_groups = {fleshy=5},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_tool("nether:shovel_netherrack", {
|
-- Nether Shovel
|
||||||
|
minetest.register_tool("nether:shovel_netherrack", { -- Modif MFF the entire tool
|
||||||
description = "Netherrack Shovel",
|
description = "Netherrack Shovel",
|
||||||
inventory_image = "nether_shovel_netherrack.png",
|
inventory_image = "nether_shovel_netherrack.png",
|
||||||
wield_image = "nether_shovel_netherrack.png^[transformR90",
|
wield_image = "nether_shovel_netherrack.png^[transformR90",
|
||||||
@ -934,13 +944,13 @@ minetest.register_tool("nether:shovel_netherrack", {
|
|||||||
full_punch_interval = 1.4,
|
full_punch_interval = 1.4,
|
||||||
max_drop_level=0,
|
max_drop_level=0,
|
||||||
groupcaps={
|
groupcaps={
|
||||||
crumbly = {times={[1]=1.7, [2]=1.1, [3]=0.45}, uses=22, maxlevel=2},
|
crumbly = {times={[1]=3.30, [2]=2.20, [3]=1.32}, uses=20, maxlevel=2},
|
||||||
},
|
},
|
||||||
damage_groups = {fleshy=2},
|
damage_groups = {fleshy=3},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_tool("nether:shovel_netherrack_blue", {
|
minetest.register_tool("nether:shovel_netherrack_blue", { -- Modif MFF the entire tool
|
||||||
description = "Blue Netherrack Shovel",
|
description = "Blue Netherrack Shovel",
|
||||||
inventory_image = "nether_shovel_netherrack_blue.png",
|
inventory_image = "nether_shovel_netherrack_blue.png",
|
||||||
wield_image = "nether_shovel_netherrack_blue.png^[transformR90",
|
wield_image = "nether_shovel_netherrack_blue.png^[transformR90",
|
||||||
@ -948,13 +958,13 @@ minetest.register_tool("nether:shovel_netherrack_blue", {
|
|||||||
full_punch_interval = 1.1,
|
full_punch_interval = 1.1,
|
||||||
max_drop_level=1,
|
max_drop_level=1,
|
||||||
groupcaps={
|
groupcaps={
|
||||||
crumbly = {times={[1]=1.4, [2]=0.8, [3]=0.35}, uses=50, maxlevel=2},
|
crumbly = {times={[1]=4.40, [2]=1.76, [3]=0.88}, uses=30, maxlevel=2},
|
||||||
},
|
},
|
||||||
damage_groups = {fleshy=3},
|
damage_groups = {fleshy=4},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_tool("nether:shovel_white", {
|
minetest.register_tool("nether:shovel_white", { -- Modif MFF the entire tool
|
||||||
description = "Siwtonic Shovel",
|
description = "Siwtonic Shovel",
|
||||||
inventory_image = "nether_shovel_white.png",
|
inventory_image = "nether_shovel_white.png",
|
||||||
wield_image = "nether_shovel_white.png^[transformR90",
|
wield_image = "nether_shovel_white.png^[transformR90",
|
||||||
@ -962,56 +972,49 @@ minetest.register_tool("nether:shovel_white", {
|
|||||||
full_punch_interval = 1,
|
full_punch_interval = 1,
|
||||||
max_drop_level=1,
|
max_drop_level=1,
|
||||||
groupcaps={
|
groupcaps={
|
||||||
crumbly = {times={[1]=0.95, [2]=0.45, [3]=0.1}, uses=151, maxlevel=3},
|
crumbly = {times={[1]=1.93, [2]=0.94, [3]=0.44}, uses=125, maxlevel=3},
|
||||||
},
|
|
||||||
damage_groups = {fleshy=4},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_tool("nether:sword_netherrack", {
|
|
||||||
description = "Netherrack Sword",
|
|
||||||
inventory_image = "nether_sword_netherrack.png",
|
|
||||||
tool_capabilities = {
|
|
||||||
full_punch_interval = 1,
|
|
||||||
max_drop_level=0,
|
|
||||||
groupcaps={
|
|
||||||
snappy={times={[2]=1.3, [3]=0.38}, uses=40, maxlevel=1},
|
|
||||||
},
|
},
|
||||||
damage_groups = {fleshy=5},
|
damage_groups = {fleshy=5},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_tool("nether:sword_netherrack_blue", {
|
-- Nether Sword
|
||||||
description = "Blue Netherrack Sword",
|
minetest.register_tool("nether:sword_netherrack", { -- Modif MFF the entire tool
|
||||||
inventory_image = "nether_sword_netherrack_blue.png",
|
description = "Netherrack Sword",
|
||||||
|
inventory_image = "nether_sword_netherrack.png",
|
||||||
tool_capabilities = {
|
tool_capabilities = {
|
||||||
full_punch_interval = 0.8,
|
full_punch_interval = 0.9,
|
||||||
max_drop_level=1,
|
max_drop_level=0,
|
||||||
groupcaps={
|
groupcaps={
|
||||||
snappy={times={[1]=2.5, [2]=1.1, [3]=0.33}, uses=40, maxlevel=2},
|
snappy={times={[2]=1.3, [3]=0.38}, uses=40, maxlevel=1},
|
||||||
},
|
},
|
||||||
damage_groups = {fleshy=7},
|
damage_groups = {fleshy=4},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_tool("nether:sword_white", {
|
minetest.register_tool("nether:sword_netherrack_blue", { -- Modif MFF the entire tool
|
||||||
description = "Siwtonic Sword",
|
description = "Blue Netherrack Sword",
|
||||||
inventory_image = "nether_sword_white.png",
|
inventory_image = "nether_sword_netherrack_blue.png",
|
||||||
wield_image = "nether_sword_white.png^[transformR90",
|
|
||||||
tool_capabilities = {
|
tool_capabilities = {
|
||||||
full_punch_interval = 0.7,
|
full_punch_interval = 0.7,
|
||||||
max_drop_level=1,
|
max_drop_level=1,
|
||||||
groupcaps={
|
groupcaps={
|
||||||
snappy={times={[1]=1.7, [2]=0.8, [3]=0.2}, uses=100, maxlevel=3},
|
snappy={times={[1]=2.5, [2]=1.1, [3]=0.33}, uses=40, maxlevel=2},
|
||||||
},
|
},
|
||||||
damage_groups = {fleshy=11},
|
damage_groups = {fleshy=6},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
minetest.register_tool("nether:sword_white", { -- Modif MFF the entire tool
|
||||||
-- override creative hand
|
description = "Siwtonic Sword",
|
||||||
if minetest.settings:get_bool("creative_mode") then
|
inventory_image = "nether_sword_white.png",
|
||||||
local capas = minetest.registered_items[""].tool_capabilities
|
wield_image = "nether_sword_white.png^[transformR90",
|
||||||
capas.groupcaps.nether = capas.groupcaps.cracky
|
tool_capabilities = {
|
||||||
minetest.override_item("", {tool_capabilities = capas})
|
full_punch_interval = 0.6,
|
||||||
end
|
max_drop_level=1,
|
||||||
|
groupcaps={
|
||||||
|
snappy={times={[1]=1.7, [2]=0.8, [3]=0.2}, uses=100, maxlevel=3},
|
||||||
|
},
|
||||||
|
damage_groups = {fleshy=8},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
name = nether
|
|
||||||
depends = default,glow,riesenpilz,stairs,vector_extras
|
|
||||||
optional_depends = creative,fence_registration,function_delayer,watershed
|
|
2
nether/pearl.lua
Normal file → Executable file
@ -7,7 +7,7 @@ local function table_contains(t, v)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
local creative = minetest.settings:get_bool("creative_mode")
|
local creative = minetest.setting_getbool("creative_mode")
|
||||||
local function throw_pearl(item, player)
|
local function throw_pearl(item, player)
|
||||||
local playerpos = player:getpos()
|
local playerpos = player:getpos()
|
||||||
playerpos.y = playerpos.y+1.625
|
playerpos.y = playerpos.y+1.625
|
||||||
|
379
nether/portal.lua
Normal file → Executable file
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
-- kills the player if he uses PilzAdam portal
|
-- kills the player if he uses PilzAdam portal
|
||||||
local portal_target = nether.buildings+1
|
local portal_target = nether.buildings+1
|
||||||
local nether_prisons = minetest.settings:get_bool("enable_damage")
|
local nether_prisons = minetest.setting_getbool("enable_damage")
|
||||||
local obsidian_portal_kills = nether_prisons and true
|
local obsidian_portal_kills = nether_prisons and true
|
||||||
local mclike_portal = false
|
local mclike_portal = false
|
||||||
|
|
||||||
@ -11,39 +11,43 @@ minetest.after(5, function()
|
|||||||
abm_allowed = true
|
abm_allowed = true
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local save_path = minetest.get_worldpath() .. "/nether_players"
|
nether.spawn_point = minetest.string_to_pos(minetest.setting_get("nether_static_spawnpoint") or "")
|
||||||
local players_in_nether = {}
|
-- If nil then we use random spawn points
|
||||||
|
|
||||||
|
table.icontains = table.icontains or function(t, v)
|
||||||
|
for _,i in ipairs(t) do
|
||||||
|
if i == v then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
nether.players_in_nether = {}
|
||||||
-- only get info from file if nether prisons
|
-- only get info from file if nether prisons
|
||||||
if nether_prisons then
|
if nether_prisons then
|
||||||
local file = io.open(save_path, "r")
|
local file = io.open(minetest.get_worldpath()..'/nether_players', "r")
|
||||||
if not file then
|
if file then
|
||||||
return
|
local contents = file:read('*all')
|
||||||
end
|
io.close(file)
|
||||||
local contents = file:read"*all"
|
if contents then
|
||||||
io.close(file)
|
nether.players_in_nether = string.split(contents, " ")
|
||||||
if not contents then
|
end
|
||||||
return
|
|
||||||
end
|
|
||||||
local playernames = string.split(contents, " ")
|
|
||||||
for i = 1,#playernames do
|
|
||||||
players_in_nether[playernames[i]] = true
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function save_nether_players()
|
local function save_nether_players()
|
||||||
local playernames,n = {},1
|
local output = ''
|
||||||
for name in pairs(players_in_nether) do
|
for _,name in ipairs(nether.players_in_nether) do
|
||||||
playernames[n] = name
|
output = output..name..' '
|
||||||
n = n+1
|
|
||||||
end
|
end
|
||||||
local f = io.open(save_path, "w")
|
local f = io.open(minetest.get_worldpath()..'/nether_players', "w")
|
||||||
assert(f, "Could not open nether_players file for writing.")
|
f:write(output)
|
||||||
f:write(table.concat(playernames, " "))
|
|
||||||
io.close(f)
|
io.close(f)
|
||||||
end
|
end
|
||||||
|
|
||||||
local update_background
|
local update_background
|
||||||
if nether_prisons then
|
--if nether_prisons then
|
||||||
function update_background(player, down)
|
function update_background(player, down)
|
||||||
if down then
|
if down then
|
||||||
player:set_sky({r=15, g=0, b=0}, "plain")
|
player:set_sky({r=15, g=0, b=0}, "plain")
|
||||||
@ -51,97 +55,107 @@ if nether_prisons then
|
|||||||
player:set_sky(nil, "regular")
|
player:set_sky(nil, "regular")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
--else
|
||||||
function update_background()end
|
-- function update_background()end
|
||||||
end
|
--end
|
||||||
|
|
||||||
-- returns nodename if area is generated, else calls generation function
|
-- returns nodename if area is generated, else calls generation function
|
||||||
local function generated_or_generate(pos)
|
local function generated_or_generate(pos)
|
||||||
local node = minetest.get_node_or_nil(pos)
|
local name = minetest.get_node(pos).name
|
||||||
if node then
|
if name ~= "ignore" then
|
||||||
return node.name
|
return name
|
||||||
end
|
end
|
||||||
minetest.get_voxel_manip():read_from_map(pos, pos)
|
minetest.get_voxel_manip():read_from_map(pos, pos)
|
||||||
node = minetest.get_node_or_nil(pos)
|
name = minetest.get_node_or_nil(pos)
|
||||||
if not node then
|
if not name then
|
||||||
minetest.emerge_area(vector.subtract(pos, 80), vector.add(pos, 80))
|
minetest.emerge_area(vector.subtract(pos, 80), vector.add(pos, 80))
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
return node.name
|
return name.name
|
||||||
end
|
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:getpos(),
|
local target = vector.add(player:getpos(), {x=math.random(-100,100), y=0, z=math.random(-100,100)})
|
||||||
{x=math.random(-100,100), y=0, z=math.random(-100,100)})
|
|
||||||
target.y = portal_target + math.random(4)
|
target.y = portal_target + math.random(4)
|
||||||
return target
|
return target
|
||||||
end
|
end
|
||||||
|
nether.get_player_died_target = get_player_died_target
|
||||||
|
|
||||||
-- used for obsidian portal
|
-- used for obsidian portal
|
||||||
local function obsidian_teleport(player, pname, target)
|
local function obsidian_teleport(player, pname)
|
||||||
minetest.chat_send_player(pname, "For any reason you arrived here. Type " ..
|
minetest.chat_send_player(pname, "For any reason you arrived here. Type /nether_help to find out things like craft recipes.")
|
||||||
"/nether_help to find out things like craft recipes.")
|
if obsidian_portal_kills then
|
||||||
players_in_nether[pname] = true
|
|
||||||
save_nether_players()
|
|
||||||
update_background(player, true)
|
|
||||||
if target then
|
|
||||||
player:set_pos(target)
|
|
||||||
else
|
|
||||||
player:set_hp(0)
|
player:set_hp(0)
|
||||||
|
return true
|
||||||
end
|
end
|
||||||
|
if not mclike_portal then
|
||||||
|
-- Pick random for obsidian, poor people gotta suffer
|
||||||
|
local target = vector.round(get_player_died_target(player))
|
||||||
|
if generated_or_generate(target) then
|
||||||
|
player:moveto(target)
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
-- teleports players to nether or helps it
|
-- teleports players to nether or helps it
|
||||||
local function player_to_nether(player, pos)
|
function nether.player_to_nether(player, safe)
|
||||||
local pname = player:get_player_name()
|
local pname = player:get_player_name()
|
||||||
if players_in_nether[pname] then
|
if table.icontains(nether.players_in_nether, pname) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
players_in_nether[pname] = true
|
nether.players_in_nether[#nether.players_in_nether+1] = pname
|
||||||
save_nether_players()
|
save_nether_players()
|
||||||
|
if not safe then
|
||||||
|
minetest.chat_send_player(pname, "For any reason you arrived here. Type /nether_help to find out things like craft recipes.")
|
||||||
|
player:set_hp(0)
|
||||||
|
if not nether_prisons then
|
||||||
|
if nether.spawn_point then
|
||||||
|
player:moveto(nether.spawn_point)
|
||||||
|
else
|
||||||
|
player:moveto(get_player_died_target(player))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
update_background(player, true)
|
update_background(player, true)
|
||||||
if pos then
|
|
||||||
player:set_pos(pos)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
minetest.chat_send_player(pname, "For any reason you arrived here. " ..
|
|
||||||
"Type /nether_help to find out things like craft recipes.")
|
|
||||||
player:set_hp(0)
|
|
||||||
if not nether_prisons then
|
|
||||||
player:set_pos(get_player_died_target(player))
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function player_from_nether(player, pos)
|
function nether.player_from_nether(player)
|
||||||
local pname = player:get_player_name()
|
local pname = player:get_player_name()
|
||||||
if players_in_nether[pname] then
|
local changes
|
||||||
players_in_nether[pname] = nil
|
for n,i in ipairs(nether.players_in_nether) do
|
||||||
|
if i == pname then
|
||||||
|
table.remove(nether.players_in_nether, n)
|
||||||
|
changes = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if changes then
|
||||||
save_nether_players()
|
save_nether_players()
|
||||||
end
|
end
|
||||||
update_background(player)
|
update_background(player)
|
||||||
player:set_pos(pos)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
local function player_exists(name)
|
local function player_exists(name)
|
||||||
local players = minetest.get_connected_players()
|
for _,player in pairs(minetest.get_connected_players()) do
|
||||||
for i = 1,#players do
|
if player:get_player_name() == name then
|
||||||
if players[i]:get_player_name() == name then
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Chatcommands (edited) written by sss
|
|
||||||
|
-- Chatcommands removed
|
||||||
|
--[[ Chatcommands (edited) written by sss
|
||||||
minetest.register_chatcommand("to_hell", {
|
minetest.register_chatcommand("to_hell", {
|
||||||
params = "[<player_name>]",
|
params = "[<player_name>]",
|
||||||
description = "Send someone to hell",
|
description = "Send someone to hell",
|
||||||
func = function(name, pname)
|
func = function(name, pname)
|
||||||
if not minetest.check_player_privs(name, {nether=true}) then
|
if not minetest.check_player_privs(name, {nether=true}) then
|
||||||
return false,
|
return false, "You need the nether priv to execute this chatcommand."
|
||||||
"You need the nether privilege to execute this chatcommand."
|
|
||||||
end
|
end
|
||||||
if not player_exists(pname) then
|
if not player_exists(pname) then
|
||||||
pname = name
|
pname = name
|
||||||
@ -161,8 +175,7 @@ minetest.register_chatcommand("from_hell", {
|
|||||||
description = "Extract from hell",
|
description = "Extract from hell",
|
||||||
func = function(name, pname)
|
func = function(name, pname)
|
||||||
if not minetest.check_player_privs(name, {nether=true}) then
|
if not minetest.check_player_privs(name, {nether=true}) then
|
||||||
return false,
|
return false, "You need the nether priv to execute this chatcommand."
|
||||||
"You need the nether priv to execute this chatcommand."
|
|
||||||
end
|
end
|
||||||
if not player_exists(pname) then
|
if not player_exists(pname) then
|
||||||
pname = name
|
pname = name
|
||||||
@ -172,22 +185,33 @@ minetest.register_chatcommand("from_hell", {
|
|||||||
return false, "Something went wrong."
|
return false, "Something went wrong."
|
||||||
end
|
end
|
||||||
minetest.chat_send_player(pname, "You are free now")
|
minetest.chat_send_player(pname, "You are free now")
|
||||||
|
player_from_nether(player)
|
||||||
local pos = player:getpos()
|
local pos = player:getpos()
|
||||||
player_from_nether(player, {x=pos.x, y=100, z=pos.z})
|
local pos_togo = {x=pos.x, y=100, z=pos.z}
|
||||||
|
if minetest.setting_getbool("static_spawnpoint") ~= nil then
|
||||||
|
local stsp_conf = minetest.setting_get("static_spawnpoint")
|
||||||
|
pos_togo = {x = stsp_conf:split(",")[1]+0,y = stsp_conf:split(",")[2]+0,z = stsp_conf:split(",")[3]+0}
|
||||||
|
end
|
||||||
|
player:moveto(pos_togo)
|
||||||
return true, pname.." is now out of the nether."
|
return true, pname.." is now out of the nether."
|
||||||
end
|
end
|
||||||
})
|
})]]
|
||||||
|
|
||||||
|
|
||||||
if nether_prisons then
|
if nether_prisons then
|
||||||
-- randomly set player position when he/she dies in nether
|
-- randomly set player position when he/she dies in nether
|
||||||
minetest.register_on_respawnplayer(function(player)
|
minetest.register_on_respawnplayer(function(player)
|
||||||
local pname = player:get_player_name()
|
local pname = player:get_player_name()
|
||||||
if not players_in_nether[pname] then
|
if not table.icontains(nether.players_in_nether, pname) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local target = get_player_died_target(player)
|
local target
|
||||||
player:set_pos(target)
|
if nether.spawn_point then
|
||||||
|
target = nether.spawn_point
|
||||||
|
else
|
||||||
|
target = get_player_died_target(player)
|
||||||
|
end
|
||||||
|
player:moveto(target)
|
||||||
minetest.after(0, function(pname, target)
|
minetest.after(0, function(pname, target)
|
||||||
-- fixes respawn bug
|
-- fixes respawn bug
|
||||||
local player = minetest.get_player_by_name(pname)
|
local player = minetest.get_player_by_name(pname)
|
||||||
@ -198,79 +222,62 @@ if nether_prisons then
|
|||||||
return true
|
return true
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- override set_pos etc. to disallow player teleportion by e.g. travelnet
|
-- function for teleporting players where they belong to
|
||||||
local function can_teleport(player, pos)
|
local function update_players()
|
||||||
if not player:is_player() then
|
for _,player in pairs(minetest.get_connected_players()) do
|
||||||
-- the same metatable is used for entities
|
local pname = player:get_player_name()
|
||||||
return true
|
local ppos = player:getpos()
|
||||||
end
|
if table.icontains(nether.players_in_nether, pname) then
|
||||||
local pname = player:get_player_name()
|
if ppos.y > nether.start then
|
||||||
local in_nether = players_in_nether[pname] == true
|
player:moveto({x=ppos.x, y=portal_target, z=ppos.z})
|
||||||
|
update_background(player, true)
|
||||||
-- test if the target is valid
|
--[[minetest.kick_player(pname, "\n1. Maybe you were not allowed to teleport out of the nether."..
|
||||||
if pos.y < nether.start then
|
"\n2. Maybe the server lagged."..
|
||||||
if in_nether then
|
"\n3. please rejoin")]]
|
||||||
return true
|
|
||||||
end
|
|
||||||
elseif not in_nether then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
|
|
||||||
-- test if the current position is valid
|
|
||||||
local current_pos = player:get_pos()
|
|
||||||
local now_in_nether = current_pos.y < nether.start
|
|
||||||
if now_in_nether ~= in_nether then
|
|
||||||
if in_nether then
|
|
||||||
minetest.log("action", "Player \"" .. pname ..
|
|
||||||
"\" has to be in the nether, teleporting it!")
|
|
||||||
update_background(player, true)
|
|
||||||
current_pos.y = portal_target
|
|
||||||
player:set_pos(current_pos)
|
|
||||||
else
|
|
||||||
minetest.log("action", "Player \"" .. pname ..
|
|
||||||
"\" must not be in the nether, teleporting it!")
|
|
||||||
update_background(player)
|
|
||||||
current_pos.y = 20
|
|
||||||
player:set_pos(current_pos)
|
|
||||||
end
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
minetest.chat_send_player(pname,
|
|
||||||
"You can not simply teleport to or from the nether!")
|
|
||||||
minetest.log("action", "Player \"" .. pname ..
|
|
||||||
"\" attempted to teleport from or to the nether, ignoring.")
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
local methods = {"set_pos", "move_to", "setpos", "moveto"}
|
|
||||||
local metatable_overridden
|
|
||||||
minetest.register_on_joinplayer(function(player)
|
|
||||||
-- set the background when the player joins
|
|
||||||
if player:getpos().y < nether.start then
|
|
||||||
update_background(player, true)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- overide set_pos etc. if not yet done
|
|
||||||
if metatable_overridden then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
metatable_overridden = true
|
|
||||||
local mt = getmetatable(player)
|
|
||||||
for i = 1,#methods do
|
|
||||||
local methodname = methods[i]
|
|
||||||
local origfunc = mt[methodname]
|
|
||||||
mt[methodname] = function(...)
|
|
||||||
if can_teleport(...) then
|
|
||||||
origfunc(...)
|
|
||||||
end
|
end
|
||||||
|
elseif ppos.y < nether.start then
|
||||||
|
update_background(player)
|
||||||
|
player:moveto({x=ppos.x, y=20, z=ppos.z})
|
||||||
|
--[[minetest.kick_player(pname, "\n1. Maybe you were not allowed to teleport to the nether."..
|
||||||
|
"\n2. Maybe the server lagged."..
|
||||||
|
"\n3. please rejoin")]]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- fix wrong player positions
|
||||||
|
local function tick()
|
||||||
|
update_players()
|
||||||
|
minetest.after(2, tick)
|
||||||
|
end
|
||||||
|
tick()
|
||||||
|
|
||||||
|
-- set background when player joins
|
||||||
|
minetest.register_on_joinplayer(function(player)
|
||||||
|
minetest.after(0, function(player)
|
||||||
|
if player:getpos().y < nether.start then
|
||||||
|
update_background(player, true)
|
||||||
|
end
|
||||||
|
end, player)
|
||||||
end)
|
end)
|
||||||
else
|
else
|
||||||
-- test if player is in nether when he/she joins
|
-- test if player is in nether when he/she joins
|
||||||
minetest.register_on_joinplayer(function(player)
|
minetest.register_on_joinplayer(function(player)
|
||||||
players_in_nether[player:get_player_name()] =
|
minetest.after(0, function(player)
|
||||||
player:getpos().y < nether.start or nil
|
local pname = player:get_player_name()
|
||||||
|
if player:getpos().y < nether.start then
|
||||||
|
if not table.icontains(nether.players_in_nether, pname) then
|
||||||
|
nether.players_in_nether[#nether.players_in_nether+1] = pname
|
||||||
|
end
|
||||||
|
return
|
||||||
|
end
|
||||||
|
for i,name in pairs(nether.players_in_nether) do
|
||||||
|
if name == pname then
|
||||||
|
nether.players_in_nether[i] = nil
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end, player)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -306,7 +313,7 @@ local particledef = {
|
|||||||
-- teleports player to neter (obsidian portal)
|
-- teleports player to neter (obsidian portal)
|
||||||
local function obsi_teleport_player(player, pos, target)
|
local function obsi_teleport_player(player, pos, target)
|
||||||
local pname = player:get_player_name()
|
local pname = player:get_player_name()
|
||||||
if players_in_nether[pname] then
|
if table.icontains(nether.players_in_nether, pname) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -316,26 +323,19 @@ local function obsi_teleport_player(player, pos, target)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local has_teleported
|
if not obsidian_teleport(player, pname) then
|
||||||
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
|
-- e.g. ungenerated area
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
nether.players_in_nether[#nether.players_in_nether+1] = pname
|
||||||
|
save_nether_players()
|
||||||
|
update_background(player, true)
|
||||||
|
|
||||||
remove_portal_essence(pos)
|
remove_portal_essence(pos)
|
||||||
|
|
||||||
minetest.sound_play("nether_portal_usual", {to_player=pname, gain=1})
|
minetest.sound_play("nether_portal_usual", {to_player=pname, gain=1})
|
||||||
|
--obj:setpos(target)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- abm for particles of the obsidian portal essence and for teleporting
|
-- abm for particles of the obsidian portal essence and for teleporting
|
||||||
@ -350,8 +350,7 @@ minetest.register_abm({
|
|||||||
end
|
end
|
||||||
particledef.minpos = {x=pos.x-0.25, y=pos.y-0.5, z=pos.z-0.25}
|
particledef.minpos = {x=pos.x-0.25, y=pos.y-0.5, z=pos.z-0.25}
|
||||||
particledef.maxpos = {x=pos.x+0.25, y=pos.y+0.34, z=pos.z+0.25}
|
particledef.maxpos = {x=pos.x+0.25, y=pos.y+0.34, z=pos.z+0.25}
|
||||||
particledef.texture = "nether_portal_particle.png^[transform" ..
|
particledef.texture = "nether_portal_particle.png^[transform"..math.random(0,7)
|
||||||
math.random(0, 7)
|
|
||||||
minetest.add_particlespawner(particledef)
|
minetest.add_particlespawner(particledef)
|
||||||
for _,obj in pairs(minetest.get_objects_inside_radius(pos, 1)) do
|
for _,obj in pairs(minetest.get_objects_inside_radius(pos, 1)) do
|
||||||
if obj:is_player() then
|
if obj:is_player() then
|
||||||
@ -563,12 +562,14 @@ minetest.after(0.1, function()
|
|||||||
on_place = function(stack, player, pt)
|
on_place = function(stack, player, pt)
|
||||||
if pt.under
|
if pt.under
|
||||||
and minetest.get_node(pt.under).name == "default:obsidian" then
|
and minetest.get_node(pt.under).name == "default:obsidian" then
|
||||||
|
--print("[nether] tries to enable a portal")
|
||||||
local done = make_portal(pt.under)
|
local done = make_portal(pt.under)
|
||||||
if done then
|
if done then
|
||||||
minetest.chat_send_player(player:get_player_name(),
|
minetest.chat_send_player(
|
||||||
"Warning: If you are in the nether you may not be " ..
|
player:get_player_name(),
|
||||||
"able to find the way out!")
|
"Warning: If you are in the nether you may not be able to find the way out!"
|
||||||
if not minetest.settings:get_bool("creative_mode") then
|
)
|
||||||
|
if not minetest.setting_getbool("creative_mode") then
|
||||||
stack:take_item()
|
stack:take_item()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -594,7 +595,8 @@ function(r)
|
|||||||
return tab
|
return tab
|
||||||
end
|
end
|
||||||
|
|
||||||
local function is_netherportal(pos)
|
-- detects if it's a portal
|
||||||
|
local function netherport(pos)
|
||||||
local x, y, z = pos.x, pos.y, pos.z
|
local x, y, z = pos.x, pos.y, pos.z
|
||||||
for _,i in pairs({-1, 3}) do
|
for _,i in pairs({-1, 3}) do
|
||||||
if minetest.get_node({x=x, y=y+i, z=z}).name ~= "nether:white" then
|
if minetest.get_node({x=x, y=y+i, z=z}).name ~= "nether:white" then
|
||||||
@ -658,41 +660,52 @@ function nether_port(player, pos)
|
|||||||
minetest.log("error", "[nether] nether_port: something failed.")
|
minetest.log("error", "[nether] nether_port: something failed.")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if not is_netherportal(pos) then
|
if not netherport(pos) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
minetest.sound_play("nether_teleporter", {to_player=player:get_player_name()}) --MFF crabman (5/09/2015) fix positional sound don't work to player
|
||||||
minetest.sound_play("nether_teleporter", {pos=pos})
|
minetest.sound_play("nether_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 < nether.start then
|
if pos.y < nether.start then
|
||||||
set_portal(known_portals_d, pos.z,pos.x, pos.y)
|
set_portal(known_portals_d, pos.z,pos.x, pos.y)
|
||||||
|
nether.player_from_nether(player)
|
||||||
|
|
||||||
local my = tonumber(meta:get_string("y"))
|
if minetest.setting_getbool("static_spawnpoint") then
|
||||||
local y = get_portal(known_portals_u, pos.z,pos.x)
|
local stsp_conf = minetest.setting_get("static_spawnpoint")
|
||||||
if y then
|
pos = minetest.string_to_pos(stsp_conf)
|
||||||
if y ~= my then
|
|
||||||
meta:set_string("y", y)
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
y = my or 100
|
local my = tonumber(meta:get_string("y"))
|
||||||
|
local y = get_portal(known_portals_u, pos.z,pos.x)
|
||||||
|
if y then
|
||||||
|
if y ~= my then
|
||||||
|
meta:set_string("y", y)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
y = my or 100
|
||||||
|
end
|
||||||
|
pos.y = y
|
||||||
end
|
end
|
||||||
pos.y = y - 0.3
|
player:moveto(pos)
|
||||||
|
|
||||||
player_from_nether(player, pos)
|
|
||||||
else
|
else
|
||||||
set_portal(known_portals_u, pos.z,pos.x, pos.y)
|
if nether.spawn_point then
|
||||||
|
pos = nether.spawn_point
|
||||||
local my = tonumber(meta:get_string("y"))
|
|
||||||
local y = get_portal(known_portals_d, pos.z,pos.x)
|
|
||||||
if y then
|
|
||||||
if y ~= my then
|
|
||||||
meta:set_string("y", y)
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
y = my or portal_target+math.random(4)
|
set_portal(known_portals_u, pos.z,pos.x, pos.y)
|
||||||
end
|
|
||||||
pos.y = y - 0.3
|
|
||||||
|
|
||||||
player_to_nether(player, pos)
|
local my = tonumber(meta:get_string("y"))
|
||||||
|
local y = get_portal(known_portals_d, pos.z,pos.x)
|
||||||
|
if y then
|
||||||
|
if y ~= my then
|
||||||
|
meta:set_string("y", y)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
y = my or portal_target+math.random(4)
|
||||||
|
end
|
||||||
|
pos.y = y
|
||||||
|
|
||||||
|
end
|
||||||
|
player:moveto(pos)
|
||||||
|
nether.player_to_nether(player, true)
|
||||||
end
|
end
|
||||||
minetest.sound_play("nether_teleporter", {pos=pos})
|
minetest.sound_play("nether_teleporter", {pos=pos})
|
||||||
return true
|
return true
|
||||||
|
BIN
nether/sounds/nether_dig.1.ogg
Normal file → Executable file
BIN
nether/sounds/nether_dig.2.ogg
Normal file → Executable file
BIN
nether/sounds/nether_dug.1.ogg
Normal file → Executable file
BIN
nether/sounds/nether_dug.2.ogg
Normal file → Executable file
BIN
nether/sounds/nether_extract_blood.1.ogg
Normal file → Executable file
BIN
nether/sounds/nether_extract_blood.2.ogg
Normal file → Executable file
BIN
nether/sounds/nether_extract_blood.3.ogg
Normal file → Executable file
BIN
nether/sounds/nether_extract_blood.4.ogg
Normal file → Executable file
BIN
nether/sounds/nether_extract_blood.5.ogg
Normal file → Executable file
BIN
nether/sounds/nether_extract_blood.6.ogg
Normal file → Executable file
BIN
nether/sounds/nether_extract_blood.7.ogg
Normal file → Executable file
BIN
nether/sounds/nether_footstep.1.ogg
Normal file → Executable file
BIN
nether/sounds/nether_footstep.2.ogg
Normal file → Executable file
BIN
nether/sounds/nether_footstep.3.ogg
Normal file → Executable file
BIN
nether/sounds/nether_pearl.ogg
Normal file → Executable file
BIN
nether/sounds/nether_portal_usual.ogg
Normal file → Executable file
BIN
nether/sounds/nether_remove_leaf.1.ogg
Normal file → Executable file
BIN
nether/sounds/nether_remove_leaf.2.ogg
Normal file → Executable file
BIN
nether/sounds/nether_remove_leaf.3.ogg
Normal file → Executable file
BIN
nether/sounds/nether_teleporter.1.ogg
Normal file → Executable file
BIN
nether/sounds/nether_teleporter.2.ogg
Normal file → Executable file
BIN
nether/sounds/nether_teleporter.3.ogg
Normal file → Executable file
0
nether/textures/nether_axe_netherrack.png
Normal file → Executable file
Before Width: | Height: | Size: 198 B After Width: | Height: | Size: 198 B |
0
nether/textures/nether_axe_netherrack_blue.png
Normal file → Executable file
Before Width: | Height: | Size: 220 B After Width: | Height: | Size: 220 B |
0
nether/textures/nether_axe_white.png
Normal file → Executable file
Before Width: | Height: | Size: 289 B After Width: | Height: | Size: 289 B |
0
nether/textures/nether_bark.png
Normal file → Executable file
Before Width: | Height: | Size: 440 B After Width: | Height: | Size: 440 B |
0
nether/textures/nether_blood.png
Normal file → Executable file
Before Width: | Height: | Size: 448 B After Width: | Height: | Size: 448 B |
0
nether/textures/nether_blood_cooked.png
Normal file → Executable file
Before Width: | Height: | Size: 541 B After Width: | Height: | Size: 541 B |
0
nether/textures/nether_blood_empty.png
Normal file → Executable file
Before Width: | Height: | Size: 474 B After Width: | Height: | Size: 474 B |
0
nether/textures/nether_blood_extracted.png
Normal file → Executable file
Before Width: | Height: | Size: 303 B After Width: | Height: | Size: 303 B |
0
nether/textures/nether_blood_extractor.png
Normal file → Executable file
Before Width: | Height: | Size: 726 B After Width: | Height: | Size: 726 B |
0
nether/textures/nether_blood_side.png
Normal file → Executable file
Before Width: | Height: | Size: 478 B After Width: | Height: | Size: 478 B |
0
nether/textures/nether_blood_side_cooked.png
Normal file → Executable file
Before Width: | Height: | Size: 493 B After Width: | Height: | Size: 493 B |
0
nether/textures/nether_blood_side_empty.png
Normal file → Executable file
Before Width: | Height: | Size: 401 B After Width: | Height: | Size: 401 B |
0
nether/textures/nether_blood_stem.png
Normal file → Executable file
Before Width: | Height: | Size: 446 B After Width: | Height: | Size: 446 B |
0
nether/textures/nether_blood_stem_cooked.png
Normal file → Executable file
Before Width: | Height: | Size: 607 B After Width: | Height: | Size: 607 B |
0
nether/textures/nether_blood_stem_empty.png
Normal file → Executable file
Before Width: | Height: | Size: 532 B After Width: | Height: | Size: 532 B |
0
nether/textures/nether_blood_stem_top.png
Normal file → Executable file
Before Width: | Height: | Size: 442 B After Width: | Height: | Size: 442 B |
0
nether/textures/nether_blood_stem_top_cooked.png
Normal file → Executable file
Before Width: | Height: | Size: 764 B After Width: | Height: | Size: 764 B |
0
nether/textures/nether_blood_stem_top_empty.png
Normal file → Executable file
Before Width: | Height: | Size: 544 B After Width: | Height: | Size: 544 B |
0
nether/textures/nether_blood_top.png
Normal file → Executable file
Before Width: | Height: | Size: 463 B After Width: | Height: | Size: 463 B |
0
nether/textures/nether_blood_top_cooked.png
Normal file → Executable file
Before Width: | Height: | Size: 709 B After Width: | Height: | Size: 709 B |
0
nether/textures/nether_blood_top_empty.png
Normal file → Executable file
Before Width: | Height: | Size: 471 B After Width: | Height: | Size: 471 B |
0
nether/textures/nether_dirt.png
Normal file → Executable file
Before Width: | Height: | Size: 673 B After Width: | Height: | Size: 673 B |
0
nether/textures/nether_dirt_normal.png
Normal file → Executable file
Before Width: | Height: | Size: 449 B After Width: | Height: | Size: 449 B |
0
nether/textures/nether_dirt_top.png
Normal file → Executable file
Before Width: | Height: | Size: 699 B After Width: | Height: | Size: 699 B |
0
nether/textures/nether_dirt_top_normal.png
Normal file → Executable file
Before Width: | Height: | Size: 481 B After Width: | Height: | Size: 481 B |
0
nether/textures/nether_dirt_top_side.png
Normal file → Executable file
Before Width: | Height: | Size: 807 B After Width: | Height: | Size: 807 B |
0
nether/textures/nether_dirt_top_side_normal.png
Normal file → Executable file
Before Width: | Height: | Size: 669 B After Width: | Height: | Size: 669 B |
0
nether/textures/nether_dirt_transition.png
Normal file → Executable file
Before Width: | Height: | Size: 670 B After Width: | Height: | Size: 670 B |
0
nether/textures/nether_dirt_transition_normal.png
Normal file → Executable file
Before Width: | Height: | Size: 528 B After Width: | Height: | Size: 528 B |
0
nether/textures/nether_fim.png
Normal file → Executable file
Before Width: | Height: | Size: 222 B After Width: | Height: | Size: 222 B |
0
nether/textures/nether_forest_planks.png
Normal file → Executable file
Before Width: | Height: | Size: 488 B After Width: | Height: | Size: 488 B |
0
nether/textures/nether_forest_wood.png
Normal file → Executable file
Before Width: | Height: | Size: 775 B After Width: | Height: | Size: 775 B |
0
nether/textures/nether_forest_wood_normal.png
Normal file → Executable file
Before Width: | Height: | Size: 550 B After Width: | Height: | Size: 550 B |
0
nether/textures/nether_fruit.png
Normal file → Executable file
Before Width: | Height: | Size: 244 B After Width: | Height: | Size: 244 B |
0
nether/textures/nether_fruit_bottom.png
Normal file → Executable file
Before Width: | Height: | Size: 211 B After Width: | Height: | Size: 211 B |
0
nether/textures/nether_fruit_leaf.png
Normal file → Executable file
Before Width: | Height: | Size: 359 B After Width: | Height: | Size: 359 B |
0
nether/textures/nether_fruit_leaves.png
Normal file → Executable file
Before Width: | Height: | Size: 519 B After Width: | Height: | Size: 519 B |
0
nether/textures/nether_fruit_no_leaf.png
Normal file → Executable file
Before Width: | Height: | Size: 529 B After Width: | Height: | Size: 529 B |
0
nether/textures/nether_fruit_top.png
Normal file → Executable file
Before Width: | Height: | Size: 214 B After Width: | Height: | Size: 214 B |
0
nether/textures/nether_glowflower.png
Normal file → Executable file
Before Width: | Height: | Size: 516 B After Width: | Height: | Size: 516 B |
0
nether/textures/nether_grass.png
Normal file → Executable file
Before Width: | Height: | Size: 184 B After Width: | Height: | Size: 184 B |
0
nether/textures/nether_grass_big.png
Normal file → Executable file
Before Width: | Height: | Size: 352 B After Width: | Height: | Size: 352 B |
0
nether/textures/nether_grass_dried.png
Normal file → Executable file
Before Width: | Height: | Size: 218 B After Width: | Height: | Size: 218 B |
0
nether/textures/nether_grass_middle.png
Normal file → Executable file
Before Width: | Height: | Size: 232 B After Width: | Height: | Size: 232 B |
0
nether/textures/nether_grass_small.png
Normal file → Executable file
Before Width: | Height: | Size: 186 B After Width: | Height: | Size: 186 B |
0
nether/textures/nether_hotbed.png
Normal file → Executable file
Before Width: | Height: | Size: 280 B After Width: | Height: | Size: 280 B |
0
nether/textures/nether_leaves.png
Normal file → Executable file
Before Width: | Height: | Size: 427 B After Width: | Height: | Size: 427 B |
0
nether/textures/nether_netherrack.png
Normal file → Executable file
Before Width: | Height: | Size: 603 B After Width: | Height: | Size: 603 B |
0
nether/textures/nether_netherrack_black.png
Normal file → Executable file
Before Width: | Height: | Size: 582 B After Width: | Height: | Size: 582 B |
0
nether/textures/nether_netherrack_black_normal.png
Normal file → Executable file
Before Width: | Height: | Size: 490 B After Width: | Height: | Size: 490 B |
0
nether/textures/nether_netherrack_blue.png
Normal file → Executable file
Before Width: | Height: | Size: 831 B After Width: | Height: | Size: 831 B |
0
nether/textures/nether_netherrack_blue_normal.png
Normal file → Executable file
Before Width: | Height: | Size: 693 B After Width: | Height: | Size: 693 B |
0
nether/textures/nether_netherrack_brick.png
Normal file → Executable file
Before Width: | Height: | Size: 682 B After Width: | Height: | Size: 682 B |
0
nether/textures/nether_netherrack_brick_black.png
Normal file → Executable file
Before Width: | Height: | Size: 547 B After Width: | Height: | Size: 547 B |