mirror of
https://github.com/minetest-mods/nether.git
synced 2025-07-29 13:50:30 +02:00
Compare commits
17 Commits
v3
...
776a8c95b0
Author | SHA1 | Date | |
---|---|---|---|
776a8c95b0 | |||
00099f2aa2 | |||
89a467698a | |||
4950143a00 | |||
979493ed64 | |||
ddd27690eb | |||
e0656eacae | |||
89db416d09 | |||
bfdd8d18b4 | |||
60d4f8c7df | |||
281d6fc07f | |||
97cf3250e4 | |||
c0481ea4ca | |||
3577fd1f5e | |||
9ab325fa8c | |||
9e3d5bf997 | |||
c5ef9136ec |
4
init.lua
4
init.lua
@ -51,8 +51,8 @@ nether.useBiomes = minetest.get_mapgen_setting("mg_name") ~= "v6" and minet
|
||||
|
||||
|
||||
-- Settings
|
||||
nether.DEPTH_CEILING = -5000 -- The y location of the Nether's celing
|
||||
nether.DEPTH_FLOOR = -11000 -- The y location of the Nether's floor
|
||||
nether.DEPTH_CEILING = -25000 -- The y location of the Nether's celing
|
||||
nether.DEPTH_FLOOR = -31000 -- The y location of the Nether's floor
|
||||
nether.FASTTRAVEL_FACTOR = 8 -- 10 could be better value for Minetest, since there's no sprint, but ex-Minecraft players will be mathing for 8
|
||||
nether.PORTAL_BOOK_LOOT_WEIGHTING = 0.9 -- Likelyhood of finding the Book of Portals (guide) in dungeon chests. Set to 0 to disable.
|
||||
nether.NETHER_REALM_ENABLED = true -- Setting to false disables the Nether and Nether portal
|
||||
|
27
mapgen.lua
27
mapgen.lua
@ -108,7 +108,7 @@ local function override_underground_biomes()
|
||||
end
|
||||
for old_ore_key, old_ore_def in pairs(minetest.registered_ores) do
|
||||
registered_ores_copy[old_ore_key] = old_ore_def
|
||||
end
|
||||
end
|
||||
|
||||
-- clear biomes, decorations, and ores
|
||||
minetest.clear_registered_decorations()
|
||||
@ -117,23 +117,36 @@ local function override_underground_biomes()
|
||||
|
||||
-- Restore biomes, adjusted to not overlap the Nether
|
||||
for biome_key, new_biome_def in pairs(registered_biomes_copy) do
|
||||
local biome_y_max, biome_y_min = tonumber(new_biome_def.y_max), tonumber(new_biome_def.y_min)
|
||||
-- follow similar min_pos/max_pos processing logic as read_biome_def() in l_mapgen.cpp
|
||||
local biome_y_max, biome_y_min = 31000, -31000
|
||||
if type(new_biome_def.min_pos) == 'table' and type(new_biome_def.min_pos.y) == 'number' then biome_y_min = new_biome_def.min_pos.y end
|
||||
if type(new_biome_def.max_pos) == 'table' and type(new_biome_def.max_pos.y) == 'number' then biome_y_max = new_biome_def.max_pos.y end
|
||||
if type(new_biome_def.y_min) == 'number' then biome_y_min = new_biome_def.y_min end
|
||||
if type(new_biome_def.y_max) == 'number' then biome_y_max = new_biome_def.y_max end
|
||||
|
||||
if biome_y_max > NETHER_FLOOR and biome_y_min < NETHER_CEILING then
|
||||
-- This biome occupies some or all of the depth of the Nether, shift/crop it.
|
||||
local new_y_min, new_y_max
|
||||
local spaceOccupiedAbove = biome_y_max - NETHER_CEILING
|
||||
local spaceOccupiedBelow = NETHER_FLOOR - biome_y_min
|
||||
if spaceOccupiedAbove >= spaceOccupiedBelow or biome_y_min <= -30000 then
|
||||
-- place the biome above the Nether
|
||||
-- We also shift biomes which extend to the bottom of the map above the Nether, since they
|
||||
-- likely only extend that deep as a catch-all, and probably have a role nearer the surface.
|
||||
new_biome_def.y_min = NETHER_CEILING + 1
|
||||
new_biome_def.y_max = math_max(biome_y_max, NETHER_CEILING + 2)
|
||||
new_y_min = NETHER_CEILING + 1
|
||||
new_y_max = math_max(biome_y_max, NETHER_CEILING + 2)
|
||||
else
|
||||
-- shift the biome to below the Nether
|
||||
new_biome_def.y_max = NETHER_FLOOR - 1
|
||||
new_biome_def.y_min = math_min(biome_y_min, NETHER_CEILING - 2)
|
||||
new_y_max = NETHER_FLOOR - 1
|
||||
new_y_min = math_min(biome_y_min, NETHER_CEILING - 2)
|
||||
end
|
||||
|
||||
debugf("Moving biome \"%s\" from %s..%s to %s..%s", new_biome_def.name, new_biome_def.y_min, new_biome_def.y_max, new_y_min, new_y_max)
|
||||
|
||||
if type(new_biome_def.min_pos) == 'table' and type(new_biome_def.min_pos.y) == 'number' then new_biome_def.min_pos.y = new_y_min end
|
||||
if type(new_biome_def.max_pos) == 'table' and type(new_biome_def.max_pos.y) == 'number' then new_biome_def.max_pos.y = new_y_max end
|
||||
new_biome_def.y_min = new_y_min -- Ensure the new heights are saved, even if original biome never specified one
|
||||
new_biome_def.y_max = new_y_max
|
||||
end
|
||||
minetest.register_biome(new_biome_def)
|
||||
end
|
||||
@ -681,4 +694,4 @@ end
|
||||
-- if a biome defines the dungeon nodes
|
||||
minetest.set_gen_notify({dungeon = true})
|
||||
|
||||
minetest.register_on_generated(on_generated)
|
||||
minetest.register_on_generated(on_generated)
|
||||
|
@ -308,6 +308,8 @@ lavasea_source.tiles = {
|
||||
},
|
||||
},
|
||||
}
|
||||
lavasea_source.groups = { not_in_creative_inventory = 1 } -- Avoid having two lava source blocks in the inv.
|
||||
for key, value in pairs(lava_source.groups) do lavasea_source.groups[key] = value end
|
||||
lavasea_source.liquid_alternative_source = "nether:lava_source"
|
||||
lavasea_source.inventory_image = minetest.inventorycube(
|
||||
"nether_lava_source_animated.png^[sheet:2x16:0,0",
|
||||
@ -327,7 +329,7 @@ nether.cool_lava = function(pos, node)
|
||||
|
||||
-- Evaporate water sitting above lava, if it's in the Nether.
|
||||
-- (we don't want Nether mod to affect overworld lava mechanics)
|
||||
if minetest.get_node_group(node_above.name, "water") > 0 and
|
||||
if minetest.get_item_group(node_above.name, "water") > 0 and
|
||||
pos.y < nether.DEPTH_CEILING and pos.y > nether.DEPTH_FLOOR then
|
||||
-- cools_lava might be a better group to check for, but perhaps there's
|
||||
-- something in that group that isn't a liquid and shouldn't be evaporated?
|
||||
@ -374,7 +376,7 @@ minetest.register_on_mods_loaded(function()
|
||||
|
||||
-- register a bucket of Lava-sea source - but make it just the same bucket as default lava.
|
||||
-- (by doing this in register_on_mods_loaded we don't need to declare a soft dependency)
|
||||
if minetest.get_modpath("bucket") and minetest.global_exists("bucket") then
|
||||
if minetest.get_modpath("bucket") and minetest.global_exists("bucket") and type(bucket.liquids) == "table" then
|
||||
local lava_bucket = bucket.liquids["default:lava_source"]
|
||||
if lava_bucket ~= nil then
|
||||
local lavasea_bucket = {}
|
||||
|
@ -2169,18 +2169,23 @@ function nether.register_portal_ignition_item(item_name, ignition_failure_sound)
|
||||
|
||||
minetest.override_item(item_name, {
|
||||
on_place = function(stack, placer, pt)
|
||||
local node = minetest.get_node(pt.under)
|
||||
local def = minetest.registered_nodes[node.name]
|
||||
local done = false
|
||||
if pt.under and nether.is_frame_node[minetest.get_node(pt.under).name] then
|
||||
|
||||
if pt.under and nether.is_frame_node[node.name] then
|
||||
done = ignite_portal(pt.under, placer:get_player_name())
|
||||
if done and not minetest.settings:get_bool("creative_mode") then
|
||||
stack:take_item()
|
||||
end
|
||||
elseif def and def.on_rightclick then
|
||||
def.on_rightclick(pt.under, node, placer, stack, pt)
|
||||
end
|
||||
|
||||
if not done and ignition_failure_sound ~= nil then
|
||||
minetest.sound_play(ignition_failure_sound, {pos = pt.under, max_hear_distance = 10})
|
||||
end
|
||||
|
||||
|
||||
return stack
|
||||
end,
|
||||
})
|
||||
|
Reference in New Issue
Block a user