From 334330dfc069946c04440118d66b6ccbb1c6e0e7 Mon Sep 17 00:00:00 2001 From: Treer Date: Sat, 31 Jul 2021 15:39:53 +1000 Subject: [PATCH] geode bugfixes --- .luacheckrc | 1 + mapgen.lua | 5 +++-- mapgen_dungeons.lua | 12 ++++++------ mapgen_geodes.lua | 5 +++-- nodes.lua | 6 +++--- 5 files changed, 16 insertions(+), 13 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index 29d0418..319eba3 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -30,5 +30,6 @@ read_globals = { "vector", "VoxelArea", "VoxelManip", + xpanes = { fields = { "register_pane" } }, } diff --git a/mapgen.lua b/mapgen.lua index df6e6fc..e2316b1 100644 --- a/mapgen.lua +++ b/mapgen.lua @@ -384,7 +384,8 @@ local function on_generated(minp, maxp, seed) if cave_noise > tcave then -- Prime region -- This was the only region in initial versions of the Nether mod. - -- It is the only region which portals from the surface will open into. + -- It is the only region which portals from the surface will open into, + -- getting to any other regions in the Nether will require Shanks' Pony. data[vi] = c_air contains_nether = true @@ -394,7 +395,7 @@ local function on_generated(minp, maxp, seed) -- Reaching here would require the player to first find and journey through the central region, -- as it's always separated from the Prime region by the central region. - data[vi] = mapgen.getGeodeInteriorNodeId(x, y, z) + data[vi] = mapgen.getGeodeInteriorNodeId(x, y, z)-- function from mapgen_geodes.lua -- Only set contains_nether to true here if you want tunnels created between the secondary region -- and the central region. diff --git a/mapgen_dungeons.lua b/mapgen_dungeons.lua index d58b0fd..ca77ae1 100644 --- a/mapgen_dungeons.lua +++ b/mapgen_dungeons.lua @@ -165,7 +165,7 @@ nether.mapgen.excavate_dungeons = function(data, area, rooms) vi = area:index(room_min.x, y, z) for x = room_min.x, room_max.x do node_id = data[vi] - if node_id == c_netherrack or node_id == c_netherrack_deep or node_id == c_crystaldark then data[vi] = c_air end + if node_id == c_netherrack or node_id == c_netherrack_deep or node_id == c_crystaldark then data[vi] = c_air end vi = vi + 1 end end @@ -182,7 +182,7 @@ nether.mapgen.excavate_dungeons = function(data, area, rooms) vi = vi + area.ystride node_id = data[vi] -- searching forward of the stairs could also be done - if node_id == c_netherrack or node_id == c_netherrack_deep then data[vi] = c_air end + if node_id == c_netherrack or node_id == c_netherrack_deep or node_id == c_crystaldark then data[vi] = c_air end end end end @@ -232,11 +232,11 @@ nether.mapgen.decorate_dungeons = function(data, area, rooms) and room_min.z > minEdge.z and room_max.z < maxEdge.z then --data[area:indexp(roomInfo)] = minetest.get_content_id("default:mese_post_light") -- debug - -- Can't use glass panes because they need the param data set. - -- Until whisper glass is added, every window will be made of netherbrick fence (rather - -- than material depending on room_seed) + -- Glass panes can't go in the windows because we aren't setting param data. + -- Until a Nether glass is added, every window will be made of netherbrick fence rather + -- than material depending on room_seed. local window_node = c_netherfence - --if c_netherglass ~= nil and room_seed % 20 >= 12 then window_node = c_crystallight end + --if c_netherglass ~= nil and room_seed % 20 >= 12 then window_node = c_netherglass end local function placeWindow(vi, viOutsideOffset, windowNo) if is_dungeon_brick(data[vi]) and is_dungeon_brick(data[vi + yStride]) then diff --git a/mapgen_geodes.lua b/mapgen_geodes.lua index 030c8cd..810e19e 100644 --- a/mapgen_geodes.lua +++ b/mapgen_geodes.lua @@ -127,8 +127,9 @@ end local distSquaredList = {} local adj_x = 0 -local adj_y = 0, lasty -local adj_z = 0, lastz +local adj_y = 0 +local adj_z = 0 +local lasty, lastz local warpx, warpz diff --git a/nodes.lua b/nodes.lua index fc9754c..1c42d77 100644 --- a/nodes.lua +++ b/nodes.lua @@ -190,14 +190,14 @@ minetest.register_node("nether:geode", { align_style = "world", scale = 4 }}, - --light_source = 1, is_ground_content = true, groups = {cracky = 3, oddly_breakable_by_hand = 3, nether_crystal = 1}, sounds = default.node_sound_glass_defaults(), }) -- Nether Berylite is a Beryl that can seen in the dark, used to light up the internal structure --- of the geode, so to avoid player confusion we'll just have it drop plain Beryl. +-- of the geode, so to avoid player confusion we'll just have it drop plain Beryl, and have only +-- plain Beryl in the creative inventory. minetest.register_node("nether:geodelite", { description = S("Nether Berylite"), _doc_items_longdesc = S("Nether geode crystal. A crystalline structure with faint glow found inside large Nether geodes"), @@ -209,7 +209,7 @@ minetest.register_node("nether:geodelite", { light_source = 2, drop = "nether:geode", is_ground_content = true, - groups = {cracky = 3, oddly_breakable_by_hand = 3, nether_crystal = 1}, + groups = {cracky = 3, oddly_breakable_by_hand = 3, nether_crystal = 1, not_in_creative_inventory = 1}, sounds = default.node_sound_glass_defaults(), })