From ccb678a33a216ef85606e2c594f3a13e8af55be3 Mon Sep 17 00:00:00 2001 From: IamPyu Date: Fri, 6 Dec 2024 18:54:51 -0600 Subject: [PATCH] Minor change --- mods/ITEMS/pyutest_blocks/api/signs.lua | 36 ++++++++++++++----------- mods/WORLD/pyutest_mapgen/api.lua | 2 +- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/mods/ITEMS/pyutest_blocks/api/signs.lua b/mods/ITEMS/pyutest_blocks/api/signs.lua index be13288..9a06aa9 100644 --- a/mods/ITEMS/pyutest_blocks/api/signs.lua +++ b/mods/ITEMS/pyutest_blocks/api/signs.lua @@ -8,6 +8,22 @@ local function formspec(pos) return table.concat(t) end +local function after_place_node(pos, placer) + local meta = core.get_meta(pos) + meta:set_string("text", "Edit text.") + meta:set_string("infotext", "Edit text.") + meta:set_string("formspec", formspec(pos)) +end + +local function on_receive_fields(pos, formname, fields, player) + if fields.settext then + local text = fields.settext + local meta = core.get_meta(pos) + meta:set_string("text", text) + meta:set_string("infotext", text) + end +end + PyuTest.make_sign = function (name, desc, craftitem, texture, groups, extra) core.register_node(name, PyuTest.util.tableconcat({ description = Translate(desc), @@ -21,25 +37,13 @@ PyuTest.make_sign = function (name, desc, craftitem, texture, groups, extra) groups = PyuTest.util.tableconcat(groups, { block = 0, - sign = 1 + sign = 1, + attached_node = 3, }), tiles = texture, - after_place_node = function(pos, placer) - local meta = core.get_meta(pos) - meta:set_string("text", "Edit text.") - meta:set_string("infotext", "Edit text.") - meta:set_string("formspec", formspec(pos)) - end, - - on_receive_fields = function(pos, formname, fields, player) - if fields.settext then - local text = fields.settext - local meta = core.get_meta(pos) - meta:set_string("text", text) - meta:set_string("infotext", text) - end - end + after_place_node = after_place_node, + on_receive_fields = on_receive_fields, }, extra or {})) if craftitem ~= nil then diff --git a/mods/WORLD/pyutest_mapgen/api.lua b/mods/WORLD/pyutest_mapgen/api.lua index 861829e..9fb2342 100644 --- a/mods/WORLD/pyutest_mapgen/api.lua +++ b/mods/WORLD/pyutest_mapgen/api.lua @@ -162,7 +162,7 @@ PyuTest.register_overworld_biome = function(name, type, opts, only_base) nopts["_enable_beaches"] = true end - local y_min = (nopts["_enable_beaches"] and not only_base) and nopts["y_min"] + 2 or nopts["y_min"] + local y_min = (nopts["_enable_beaches"] and not only_base) and (nopts["y_min"] + 2) or nopts["y_min"] core.register_biome(PyuTest.util.tableconcat(nopts, { _pyutest_biome_type = type,