26 Commits

Author SHA1 Message Date
dc21f026f6 Merge remote-tracking branch 'upstream/master' 2021-07-16 23:50:56 +02:00
6f312d6999 Merge remote-tracking branch 'upstream/master' 2021-05-09 21:41:25 +02:00
e3e793d5be Merge remote-tracking branch 'upstream/master' 2021-03-26 19:29:55 +01:00
96ef16bf2a Merge branch 'github' 2021-03-26 19:29:39 +01:00
44f3912add Check minetest.features for use_texture_alpha_string_modes 2021-03-26 19:14:30 +01:00
4ff727909c Merge branch 'github' 2021-03-25 20:59:49 +01:00
7f5b4277dd Remove obsolete 'alpha' field 2021-03-25 20:57:23 +01:00
733ac1690a Merge branch 'github' 2021-03-21 11:06:39 +01:00
3b3fb6d1dd Fix deprecated use of use_texture_alpha in default portal def. 2021-03-21 11:05:14 +01:00
3292146e3c Merge branch 'github' 2021-03-06 12:38:24 +01:00
e5e74c839f Change deprecated get3d method to get_3d 2021-03-06 12:36:49 +01:00
bd2e065ad9 Merge remote-tracking branch 'upstream/master' 2021-02-13 14:17:31 +01:00
776a8c95b0 Merge remote-tracking branch 'upstream/master' 2021-02-07 13:12:33 +01:00
4950143a00 Merge remote-tracking branch 'upstream/master' 2021-01-29 17:43:11 +01:00
ddd27690eb Merge remote-tracking branch 'upstream/master' 2021-01-15 21:12:33 +01:00
e0656eacae Merge remote-tracking branch 'upstream/master' 2021-01-05 21:39:15 +01:00
89db416d09 Merge remote-tracking branch 'upstream/master' 2021-01-02 14:26:25 +01:00
bfdd8d18b4 Merge remote-tracking branch 'upstream/master' 2020-12-30 22:28:44 +01:00
60d4f8c7df Merge remote-tracking branch 'upstream/master' 2020-09-28 20:48:55 +02:00
281d6fc07f Merge remote-tracking branch 'upstream/master' 2020-08-02 14:07:44 +02:00
97cf3250e4 Merge remote-tracking branch 'upstream/master' 2020-07-31 22:23:04 +02:00
c0481ea4ca Fix mods comp. using callback on_rightclick with mese fragment 2020-07-15 01:46:52 +02:00
3577fd1f5e Merge remote-tracking branch 'upstream/master' into nalc-1.2-dev 2020-06-20 15:53:12 +02:00
9ab325fa8c Merge remote-tracking branch 'upstream/master' into nalc-1.2-dev 2020-06-14 17:04:59 +02:00
9e3d5bf997 Corrige crash au démarrage si moreblocks chargé 2020-05-08 20:15:12 +02:00
c5ef9136ec Modifie la profondeur du Nether à -25000 2020-03-06 12:04:32 +01:00
10 changed files with 43 additions and 132 deletions

View File

@ -60,7 +60,6 @@ SOFTWARE.
### [Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)](https://creativecommons.org/licenses/by-sa/4.0/)
* `nether_basalt`* (files starting with "nether_basalt"): Treer, 2020
* `nether_book_`* (files starting with "nether_book"): Treer, 2019-2020
* `nether_brick_deep.png`: Treer, 2021
* `nether_fumarole.ogg`: Treer, 2020
* `nether_lava_bubble`* (files starting with "nether_lava_bubble"): Treer, 2020
* `nether_lava_crust_animated.png`: Treer, 2019-2020
@ -75,4 +74,7 @@ SOFTWARE.
* `nether_rack`* (files starting with "nether_rack"): Zeg9
* `nether_tool_`* (files starting with "nether_tool_"): color adjusted versions from "[default](https://github.com/minetest/minetest_game/tree/master/mods/default)" mod, originals by BlockMen
### [Unlicensed but permission for inclusion by kovaszos_uborka](https://www.planetminecraft.com/member/kovaszos_uborka/)
* `nether_brick_deep.png` (edited by TenPlus1)
All other media: Copyright © 2013 PilzAdam, licensed under CC BY-SA 3.0 by PilzAdam.

View File

@ -57,8 +57,8 @@ nether.fogColor = { -- only used if climate_api is installed
-- 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
@ -76,19 +76,6 @@ if nether.DEPTH_FLOOR + 1000 > nether.DEPTH_CEILING then
end
nether.DEPTH = nether.DEPTH_CEILING -- Deprecated, use nether.DEPTH_CEILING instead.
-- DEPTH_FLOOR_LAYERS gives the bottom Y of all locations that wish to be
-- considered part of the Nether.
-- DEPTH_FLOOR_LAYERS Allows mods to insert extra layers below the
-- Nether, by knowing where their layer ceiling should start, and letting
-- the layers be included in effects which only happen in the Nether.
-- If a mod wishes to add a layer below the Nether it should read
-- nether.DEPTH_FLOOR_LAYERS to find the bottom Y of the Nether and any
-- other layers already under the Nether. The mod should leave a small gap
-- between DEPTH_FLOOR_LAYERS and its ceiling (e.g. use DEPTH_FLOOR_LAYERS - 6
-- for its ceiling Y, so there is room to shift edge-case biomes), then set
-- nether.DEPTH_FLOOR_LAYERS to reflect the mod's floor Y value, and call
-- shift_existing_biomes() with DEPTH_FLOOR_LAYERS as the floor_y argument.
nether.DEPTH_FLOOR_LAYERS = nether.DEPTH_FLOOR
-- A debug-print function that understands vectors etc. and does not
-- evaluate when debugging is turned off.
@ -176,7 +163,7 @@ The expedition parties have found no diamonds or gold, and after an experienced
local destination_pos = vector.divide(surface_anchorPos, nether.FASTTRAVEL_FACTOR)
destination_pos.x = math.floor(0.5 + destination_pos.x) -- round to int
destination_pos.z = math.floor(0.5 + destination_pos.z) -- round to int
destination_pos.y = nether.DEPTH_CEILING - 1 -- temp value so find_nearest_working_portal() returns nether portals
destination_pos.y = nether.DEPTH_CEILING - 1000 -- temp value so find_nearest_working_portal() returns nether portals
-- a y_factor of 0 makes the search ignore the altitude of the portals (as long as they are in the Nether)
local existing_portal_location, existing_portal_orientation =
@ -201,7 +188,7 @@ The expedition parties have found no diamonds or gold, and after an experienced
local destination_pos = vector.multiply(realm_anchorPos, nether.FASTTRAVEL_FACTOR)
destination_pos.x = math.min(30900, math.max(-30900, destination_pos.x)) -- clip to world boundary
destination_pos.z = math.min(30900, math.max(-30900, destination_pos.z)) -- clip to world boundary
destination_pos.y = nether.DEPTH_CEILING + 1 -- temp value so find_nearest_working_portal() doesn't return nether portals
destination_pos.y = 0 -- temp value so find_nearest_working_portal() doesn't return nether portals
-- a y_factor of 0 makes the search ignore the altitude of the portals (as long as they are outside the Nether)
local existing_portal_location, existing_portal_orientation =
@ -266,12 +253,12 @@ The expedition parties have found no diamonds or gold, and after an experienced
if pos.y <= nether.DEPTH_CEILING and pos.y >= nether.DEPTH_FLOOR then
result = "nether"
-- since mapgen_nobiomes.lua has no regions it doesn't implement get_region(),
-- so only use get_region() if it exists
if nether.mapgen.get_region ~= nil then
-- since mapgen_nobiomes.lua has no regions it doesn't implement getRegion(),
-- so only use getRegion() if it exists
if nether.mapgen.getRegion ~= nil then
-- the biomes-based mapgen supports 2 extra regions
local regions = nether.mapgen.RegionEnum
local region = nether.mapgen.get_region(pos)
local region = nether.mapgen.getRegion(pos)
if region == regions.CENTER or region == regions.CENTERSHELL then
result = "mantle"
elseif region == regions.NEGATIVE or region == regions.NEGATIVESHELL then

View File

@ -81,8 +81,7 @@ local math_max, math_min, math_abs, math_floor = math.max, math.min, math.abs, m
-- Inject nether_caverns biome
-- Move any existing biomes out of the y-range specified by 'floor_y' and 'ceiling_y'
mapgen.shift_existing_biomes = function(floor_y, ceiling_y)
local function override_underground_biomes()
-- https://forum.minetest.net/viewtopic.php?p=257522#p257522
-- Q: Is there a way to override an already-registered biome so I can get it out of the
-- way of my own underground biomes without disturbing the other biomes registered by
@ -125,21 +124,21 @@ mapgen.shift_existing_biomes = function(floor_y, ceiling_y)
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 > floor_y and biome_y_min < ceiling_y then
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 - ceiling_y
local spaceOccupiedBelow = floor_y - biome_y_min
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_y_min = ceiling_y + 1
new_y_max = math_max(biome_y_max, ceiling_y + 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_y_max = floor_y - 1
new_y_min = math_min(biome_y_min, floor_y - 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)
@ -163,7 +162,7 @@ mapgen.shift_existing_biomes = function(floor_y, ceiling_y)
end
-- Shift any overlapping biomes out of the way before we create the Nether biomes
mapgen.shift_existing_biomes(NETHER_FLOOR, NETHER_CEILING)
override_underground_biomes()
-- nether:native_mapgen is used to prevent ores and decorations being generated according
-- to landforms created by the native mapgen.
@ -260,12 +259,12 @@ mapgen.np_cave = {
local cavePointPerlin = nil
mapgen.get_cave_point_perlin = function()
mapgen.getCavePointPerlin = function()
cavePointPerlin = cavePointPerlin or minetest.get_perlin(mapgen.np_cave)
return cavePointPerlin
end
mapgen.get_cave_perlin_at = function(pos)
mapgen.getCavePerlinAt = function(pos)
cavePointPerlin = cavePointPerlin or minetest.get_perlin(mapgen.np_cave)
return cavePointPerlin:get_3d(pos)
end
@ -478,7 +477,7 @@ end
-- use knowledge of the nether mapgen algorithm to return a suitable ground level for placing a portal.
-- player_name is optional, allowing a player to spawn a remote portal in their own protected areas.
function nether.find_nether_ground_y(target_x, target_z, start_y, player_name)
local nobj_cave_point = mapgen.get_cave_point_perlin()
local nobj_cave_point = mapgen.getCavePointPerlin()
local air = 0 -- Consecutive air nodes found
local minp_schem, maxp_schem = nether.get_schematic_volume({x = target_x, y = 0, z = target_z}, nil, "nether_portal")

View File

@ -119,7 +119,7 @@ mapgen.add_basalt_columns = function(data, area, minp, maxp)
local yStride = area.ystride
local yCaveStride = x1 - x0 + 1
local cavePerlin = mapgen.get_cave_point_perlin()
local cavePerlin = mapgen.getCavePointPerlin()
nobj_basalt = nobj_basalt or minetest.get_perlin_map(np_basalt, {x = yCaveStride, y = yCaveStride})
local nvals_basalt = nobj_basalt:get_2d_map_flat({x=minp.x, y=minp.z}, {x=yCaveStride, y=yCaveStride}, nbuf_basalt)
@ -431,13 +431,13 @@ mapgen.RegionEnum = {
-- Returns (region, noise) where region is a value from mapgen.RegionEnum
-- and noise is the unadjusted cave perlin value
mapgen.get_region = function(pos)
mapgen.getRegion = function(pos)
if pos.y > nether.DEPTH_CEILING or pos.y < nether.DEPTH_FLOOR then
return mapgen.RegionEnum.OVERWORLD, nil
end
local caveNoise = mapgen.get_cave_perlin_at(pos)
local caveNoise = mapgen.getCavePerlinAt(pos)
local sealevel, cavern_limit_distance = mapgen.find_nearest_lava_sealevel(pos.y)
local tcave_adj, centerRegionLimit_adj = mapgen.get_mapgenblend_adjustments(pos.y)
local tcave = mapgen.TCAVE + tcave_adj
@ -482,7 +482,7 @@ minetest.register_chatcommand("nether_whereami",
if player == nil then return false, S("Unknown player position") end
local playerPos = vector.round(player:get_pos())
local region, caveNoise = mapgen.get_region(playerPos)
local region, caveNoise = mapgen.getRegion(playerPos)
local seaLevel, cavernLimitDistance = mapgen.find_nearest_lava_sealevel(playerPos.y)
local tcave_adj, centerRegionLimit_adj = mapgen.get_mapgenblend_adjustments(playerPos.y)

View File

@ -1,78 +0,0 @@
Modding/interop guide to Nether
===============================
For portals API see portal_api.txt
The Nether mod exposes some of its functions and data via the lua global
`nether` and `nether.mapgen`
* `nether.DEPTH_CEILING`: [read-only] Y value of the top of the Nether.
* `nether.DEPTH_FLOOR`: [read-only] Y value of the bottom of the Nether.
* `nether.DEPTH_FLOOR_LAYERS`: [writable] Gives the bottom Y of all
locations that wish to be considered part of the Nether.
DEPTH_FLOOR_LAYERS Allows mods to insert extra layers below the
Nether, by knowing where their layer ceiling should start, and letting
the layers be included in effects which only happen in the Nether.
If a mod wishes to add a layer below the Nether it should read
`nether.DEPTH_FLOOR_LAYERS` to find the bottom Y of the Nether and any
other layers already under the Nether. The mod should leave a small gap
between DEPTH_FLOOR_LAYERS and its ceiling (e.g. use DEPTH_FLOOR_LAYERS - 6
for its ceiling Y, so there is room to shift edge-case biomes), then set
`nether.DEPTH_FLOOR_LAYERS` to reflect the mod's floor Y value, and call
`shift_existing_biomes()` with DEPTH_FLOOR_LAYERS as the `floor_y` argument.
* `nether.NETHER_REALM_ENABLED`: [read-only] Gets the value of the "Enable
Nether realm & portal" setting the nether mod exposes in Minetest's
"All Settings" -> "Mods" -> "nether" options.
When false, the entire nether mapgen is disabled (not run), and the portal
to it is not registered. Reasons someone might disable the Nether realm
include if a nether-layer mod was to be used as the Nether instead, or if
the portal mechanic was desired in a game without the Nether, etc.
* `nether.useBiomes`: [read-only] When this is false, the Nether interop
functions below are not available (nil).
Indicates that the biomes-enabled mapgen is in use. The Nether mod falls back
to older mapgen code for v6 maps and old versions of Minetest, the older
mapgen code doesn't use biomes and doesn't provide API/interop functions.
Mapgen functions available when nether.useBiomes is true
--------------------------------------------------------
The following functions are nil if `nether.useBiomes` is false,
and also nil if `nether.NETHER_REALM_ENABLED` is false.
* `nether.mapgen.shift_existing_biomes(floor_y, ceiling_y)` Move any existing
biomes out of the y-range specified by `floor_y` and `ceiling_y`.
* `nether.mapgen.get_region(pos)`: Returns two values, (region, noise) where
`region` is a value from `nether.mapgen.RegionEnum` and `noise` is the
unadjusted cave perlin value.
* `nether.mapgen.RegionEnum` values are tables which contain an invariant
`name` and a localized `desc`. Current region names include overworld,
positive, positive shell, center, center shell, negative, and negative
shell.
"positive" corresponds to conventional Nether caverns, and "center"
corresponds to the Mantle region.
* `nether.mapgen.get_cave_point_perlin()`: Returns the PerlinNoise object for
the Nether's cavern noise.
* `nether.mapgen.get_cave_perlin_at(pos)`: Returns the Nether cavern noise
value at a given 3D position.
Other mapgen functions
-------------------------------------------
If the Nether realm is enabled, then this function will be available
regardless of whether `nether.useBiomes` is true:
* `nether.find_nether_ground_y(target_x, target_z, start_y, player_name)`
Uses knowledge of the nether mapgen algorithm to return a suitable ground
level for placing a portal.
* `player_name` is optional, allowing a player to spawn a remote portal
in their own protected areas.

View File

@ -163,11 +163,7 @@ minetest.register_node("nether:fence_nether_brick", {
minetest.register_node("nether:brick_deep", {
description = S("Deep Nether Brick"),
tiles = {{
name = "nether_brick_deep.png",
align_style = "world",
scale = 2
}},
tiles = {"nether_brick_deep.png"},
is_ground_content = false,
groups = {cracky = 2, level = 2},
sounds = default.node_sound_stone_defaults()
@ -341,7 +337,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_item_group(node_above.name, "water") > 0 and
pos.y < nether.DEPTH_CEILING and pos.y > nether.DEPTH_FLOOR_LAYERS then
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?
minetest.swap_node(pos_above, {name="air"})
@ -608,7 +604,7 @@ local function fumarole_onTimer(pos, elapsed)
-- Fumaroles in the Nether can catch fire.
-- (if taken to the surface and used as cottage chimneys, they don't catch fire)
local inNether = pos.y <= nether.DEPTH and pos.y >= nether.DEPTH_FLOOR_LAYERS
local inNether = pos.y <= nether.DEPTH and pos.y >= nether.DEPTH_FLOOR
local canCatchFire = inNether and minetest.registered_nodes["fire:permanent_flame"] ~= nil
local smoke_offset = 0
local timeout_factor = 1

View File

@ -2073,7 +2073,7 @@ function nether.register_portal(name, portaldef)
end
portaldef.name = name
portaldef.mod_name = minetest.get_current_modname() or "<mod name not recorded>"
portaldef.mod_name = minetest.get_current_modname()
-- use portaldef_default for any values missing from portaldef or portaldef.sounds
if portaldef.sounds ~= nil then setmetatable(portaldef.sounds, {__index = portaldef_default.sounds}) end
@ -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,
})

View File

@ -250,16 +250,16 @@ Used by `nether.register_portal`.
-- player_name may be "", e.g. if the portal was ignited by a mesecon,
-- and is provided for use with volume_is_natural_and_unprotected() etc.
on_run_wormhole = function(portalDef, anchorPos, orientation),
on_run_wormhole = function(portalDef, anochorPos, orientation),
-- invoked once per second per portal
on_extinguish = function(portalDef, anchorPos, orientation),
on_extinguish = function(portalDef, anochorPos, orientation),
-- invoked when a portal is extinguished, including when the portal
-- it connected to was extinguished.
on_player_teleported = function(portalDef, player, oldPos, newPos),
-- invoked immediately after a player is teleported
on_ignite = function(portalDef, anchorPos, orientation)
on_ignite = function(portalDef, anochorPos, orientation)
-- invoked when a player or mesecon ignites a portal
on_created = function(portalDef, anchorPos, orientation)
on_created = function(portalDef, anochorPos, orientation)
-- invoked when a portal creates a remote twin, this is usually when
-- a player travels through a portal for the first time.
}

View File

@ -106,7 +106,7 @@ end
-- Surface-travel portal, playable code example --
--==============================================--
-- These Moore Curve functions required by surface_portal's find_surface_anchorPos() will
-- These Moore Curve functions requred by surface_portal's find_surface_anchorPos() will
-- be assigned later in this file.
local get_moore_distance -- will be function get_moore_distance(cell_count, x, y): integer
local get_moore_coords -- will be function get_moore_coords(cell_count, distance): pos2d

Binary file not shown.

Before

Width:  |  Height:  |  Size: 765 B

After

Width:  |  Height:  |  Size: 198 B