From f400b577b050578742a666e23ef045d2c316ab4a Mon Sep 17 00:00:00 2001 From: Vanessa Dannenberg Date: Mon, 1 Mar 2021 20:49:32 -0500 Subject: [PATCH] update basic_signs, digistuff, farming redo, led_marqueee, mesecons, moreblocks, pipeworks, and signs_lib --- build-date | 1 + mods/basic_signs/init.lua | 8 ++++--- mods/digistuff/docs/gpu.txt | 16 ++++++++++++- mods/digistuff/gpu.lua | 35 +++++++++++++++++++++++++++++ mods/farming/soil.lua | 2 +- mods/led_marquee/init.lua | 2 +- mods/mesecons_commandblock/init.lua | 1 + mods/mesecons_extrawires/corner.lua | 2 -- mods/moreblocks/CHANGELOG.md | 2 ++ mods/moreblocks/redefinitions.lua | 15 ++++++++++--- mods/pipeworks/.luacheckrc | 24 ++++++++++++++++++++ mods/signs_lib/depends.txt | 7 ------ mods/signs_lib/description.txt | 1 - mods/signs_lib/mod.conf | 4 ++++ mods/signs_lib/standard_signs.lua | 6 +++-- 15 files changed, 105 insertions(+), 21 deletions(-) create mode 100644 build-date create mode 100644 mods/pipeworks/.luacheckrc delete mode 100644 mods/signs_lib/depends.txt delete mode 100644 mods/signs_lib/description.txt diff --git a/build-date b/build-date new file mode 100644 index 00000000..359cfb99 --- /dev/null +++ b/build-date @@ -0,0 +1 @@ +20210301-2049 diff --git a/mods/basic_signs/init.lua b/mods/basic_signs/init.lua index da2a34bc..c657fa38 100644 --- a/mods/basic_signs/init.lua +++ b/mods/basic_signs/init.lua @@ -23,6 +23,7 @@ signs_lib.register_sign("basic_signs:sign_wall_locked", { allow_onpole = true, allow_onpole_horizontal = true, allow_yard = true, + use_texture_alpha = "clip", }) signs_lib.register_sign("basic_signs:sign_wall_glass", { @@ -45,7 +46,7 @@ signs_lib.register_sign("basic_signs:sign_wall_glass", { allow_onpole = true, allow_onpole_horizontal = true, allow_yard = true, - use_texture_alpha = true, + use_texture_alpha = "blend", }) signs_lib.register_sign("basic_signs:sign_wall_obsidian_glass", { @@ -68,7 +69,7 @@ signs_lib.register_sign("basic_signs:sign_wall_obsidian_glass", { allow_onpole = true, allow_onpole_horizontal = true, allow_yard = true, - use_texture_alpha = true, + use_texture_alpha = "blend", }) minetest.register_alias("locked_sign:sign_wall_locked", "basic_signs:sign_wall_locked") @@ -93,7 +94,7 @@ signs_lib.register_sign("basic_signs:sign_wall_plastic", { allow_onpole = true, allow_onpole_horizontal = true, allow_yard = true, - use_texture_alpha = true, + use_texture_alpha = "clip", }) -- array : color, translated color, default text color @@ -137,6 +138,7 @@ for i, color in ipairs(sign_colors) do allow_onpole = true, allow_onpole_horizontal = true, allow_yard = true, + use_texture_alpha = "clip", }) minetest.register_alias("basic_signs:sign_wall_steel_"..color[1].."_onpole", "basic_signs:sign_steel_"..color[1].."_onpole") diff --git a/mods/digistuff/docs/gpu.txt b/mods/digistuff/docs/gpu.txt index 80427ada..a2ea3c76 100644 --- a/mods/digistuff/docs/gpu.txt +++ b/mods/digistuff/docs/gpu.txt @@ -23,7 +23,7 @@ Parameters: buffer [integer 0-7]: The slot number to create the new buffer in. If the slot is already occupied, the existing contents will be erased. xsize [integer 1-64]: The width of the new buffer in pixels. ysize [integer 1-64]: The height of the new buffer in pixels. -color [hex color, default "000000"]: A color to fill the new buffer with. +fill [hex color, default "000000"]: A color to fill the new buffer with. Command: send ------------- @@ -133,3 +133,17 @@ x [integer 1-64]: The X position of the left side of the text. y [integer 1-64]: The Y position of the right side of the text. color [hex color, default "ff6600"]: The color of the text. text: The text string to draw. + +Command: drawline +----------------- + +Draws a line on a buffer. + +Parameters: +buffer [integer 0-7]: The buffer to draw the line on. +x1 [integer 1-64]: The X position of the start of the line. +x2 [integer 1-64]: The X position of the end of the line. +y1 [integer 1-64]: The Y position of the start of the line. +y2 [integer 1-64]: The Y position of the end of the line. +color [hex color, default "000000"]: The nominal color of the line (may not be the color of every pixel, see the "antialias" setting) +antialias [boolean, default false]: Whether to apply a (very) crude smoothing algorithm to the line to reduce jagged edges at the expense of making the line slightly blurry. diff --git a/mods/digistuff/gpu.lua b/mods/digistuff/gpu.lua index 9529002a..4d0e3459 100644 --- a/mods/digistuff/gpu.lua +++ b/mods/digistuff/gpu.lua @@ -268,6 +268,41 @@ local function runcommand(pos,meta,command) end end meta:set_string("buffer"..bufnum,minetest.serialize(buffer)) + elseif command.command == "drawline" then + if type(command.buffer) ~= "number" or type(command.x1) ~= "number" or type(command.y1) ~= "number" or type(command.x2) ~= "number" or type(command.y2) ~= "number" then return end + local bufnum = math.floor(command.buffer) + if bufnum < 0 or bufnum > 7 then return end + local x1 = math.min(64,math.floor(command.x1)) + local y1 = math.min(64,math.floor(command.y1)) + local x2 = math.min(64,math.floor(command.x2)) + local y2 = math.min(64,math.floor(command.y2)) + if x1 < 1 or y1 < 1 or x2 < 1 or y2 < 1 then return end + local buffer = meta:get_string("buffer"..bufnum) + if string.len(buffer) == 0 then return end + buffer = minetest.deserialize(buffer) + if type(buffer) ~= "table" then return end + x2 = math.min(x2,buffer.xsize) + y2 = math.min(y2,buffer.ysize) + local color = command.color + if type(color) ~= "string" or string.len(color) > 7 or string.len(color) < 6 then color = "000000" end + if string.sub(color,1,1) == "#" then color = string.sub(color,2,7) end + if not tonumber(color,16) then color = "000000" end + local p1 = vector.new(x1,y1,0) + local p2 = vector.new(x2,y2,0) + local length = vector.distance(p1,p2) + local dir = vector.direction(p1,p2) + if length > 0 then + for i=0,length,0.3 do + local point = vector.add(p1,vector.multiply(dir,i)) + point = vector.floor(point) + if command.antialias then + buffer[point.y][point.x] = blend(buffer[point.y][point.x],color,"average") + else + buffer[point.y][point.x] = color + end + end + end + meta:set_string("buffer"..bufnum,minetest.serialize(buffer)) elseif command.command == "drawpoint" then if type(command.buffer) ~= "number" or type(command.x) ~= "number" or type(command.y) ~= "number" then return end local bufnum = math.floor(command.buffer) diff --git a/mods/farming/soil.lua b/mods/farming/soil.lua index ab8be15b..fbb11f87 100644 --- a/mods/farming/soil.lua +++ b/mods/farming/soil.lua @@ -148,7 +148,7 @@ minetest.register_abm({ if minetest.registered_nodes[nn] and minetest.registered_nodes[nn].walkable and minetest.get_item_group(nn, "plant") == 0 then - minetest.set_node(pos, {name = "default:dirt"}) + minetest.set_node(pos, {name = ndef.soil.base}) return end diff --git a/mods/led_marquee/init.lua b/mods/led_marquee/init.lua index 02afc440..013848c5 100644 --- a/mods/led_marquee/init.lua +++ b/mods/led_marquee/init.lua @@ -437,7 +437,7 @@ for i = 31, 255 do inventory_image = wimage, wield_image = wimage, palette="led_marquee_palette.png", - use_texture_alpha = true, + use_texture_alpha = "blend", groups = groups, paramtype = "light", paramtype2 = "colorwallmounted", diff --git a/mods/mesecons_commandblock/init.lua b/mods/mesecons_commandblock/init.lua index f68ac4aa..f8acce89 100644 --- a/mods/mesecons_commandblock/init.lua +++ b/mods/mesecons_commandblock/init.lua @@ -10,6 +10,7 @@ minetest.register_chatcommand("say", { minetest.register_chatcommand("tell", { params = " ", description = "Say to privately", + privs = {shout=true}, func = function(name, param) local found, _, target, message = param:find("^([^%s]+)%s+(.*)$") if found == nil then diff --git a/mods/mesecons_extrawires/corner.lua b/mods/mesecons_extrawires/corner.lua index b25c2a26..9c220a8d 100644 --- a/mods/mesecons_extrawires/corner.lua +++ b/mods/mesecons_extrawires/corner.lua @@ -30,7 +30,6 @@ minetest.register_node("mesecons_extrawires:corner_on", { walkable = false, sunlight_propagates = true, selection_box = corner_selectionbox, - node_box = corner_nodebox, groups = {dig_immediate = 3, not_in_creative_inventory = 1}, drop = "mesecons_extrawires:corner_off", sounds = default.node_sound_defaults(), @@ -58,7 +57,6 @@ minetest.register_node("mesecons_extrawires:corner_off", { walkable = false, sunlight_propagates = true, selection_box = corner_selectionbox, - node_box = corner_nodebox, groups = {dig_immediate = 3}, sounds = default.node_sound_defaults(), mesecons = {conductor = diff --git a/mods/moreblocks/CHANGELOG.md b/mods/moreblocks/CHANGELOG.md index e050101b..1fe879ca 100644 --- a/mods/moreblocks/CHANGELOG.md +++ b/mods/moreblocks/CHANGELOG.md @@ -16,6 +16,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed +- [Shapeless crafting recipes are now handled in redefinitions.](https://github.com/minetest-mods/moreblocks/pull/171) +- [Aliases are now resolved in Stairs+ circular saw cost calculation.](https://github.com/minetest-mods/moreblocks/pull/175) - [Fixed strange placement behavior for non-default Stairs+ nodes.](https://github.com/minetest-mods/moreblocks/pull/168) - [Fixed stairs placement over oddly-shaped nodes.](https://github.com/minetest-mods/moreblocks/pull/166) diff --git a/mods/moreblocks/redefinitions.lua b/mods/moreblocks/redefinitions.lua index e9c5ff7e..4d59c3c2 100644 --- a/mods/moreblocks/redefinitions.lua +++ b/mods/moreblocks/redefinitions.lua @@ -17,9 +17,10 @@ local reconstruct_internal_craft = function(recipe) { "", "", "" }, { "", "", "" }, } + local width = recipe.width for idx, item in pairs(recipe.items) do - local row = math.ceil(idx / recipe.width) - local col = idx - (row-1)*recipe.width + local row = math.ceil(idx / width) + local col = idx - (row-1)*width recp[row][col] = item end return recp @@ -27,7 +28,11 @@ end -- Change the amount produced by recipe by apply func to the old amount local change_recipe_amount = function(product, recipe, func) - local recp = reconstruct_internal_craft(recipe) + -- if width == 0, this is a shapeless recipe, for which the + -- internal and Lua API recipe table is the same. + -- Otherwise we need to reconstruct the table for the shaped recipe. + local shapeless = (recipe.width == 0) + local recp = shapeless and recipe.items or reconstruct_internal_craft(recipe) local oldamount = tonumber(recipe.output:match(" [0-9]+$") or "1") @@ -35,6 +40,10 @@ local change_recipe_amount = function(product, recipe, func) -- remove old crafting recipe local redo = { recipe = recp } + -- preserve shapelessness + if shapeless then + redo.type = "shapeless" + end minetest.clear_craft(redo) -- new output diff --git a/mods/pipeworks/.luacheckrc b/mods/pipeworks/.luacheckrc new file mode 100644 index 00000000..9ba8cad2 --- /dev/null +++ b/mods/pipeworks/.luacheckrc @@ -0,0 +1,24 @@ +unused_args = false +max_line_length= 240 +redefined = false + +globals = { + "pipeworks", + "luaentity" +} + +read_globals = { + -- Stdlib + string = {fields = {"split"}}, + table = {fields = {"copy", "getn"}}, + + -- Minetest + "vector", "ItemStack", + "dump", "minetest", + "VoxelManip", "VoxelArea", + + -- mods + "default", "mesecon", "digiline", + "screwdriver" + +} diff --git a/mods/signs_lib/depends.txt b/mods/signs_lib/depends.txt deleted file mode 100644 index d3cb3790..00000000 --- a/mods/signs_lib/depends.txt +++ /dev/null @@ -1,7 +0,0 @@ -default -intllib? -screwdriver? -streetspoles? -streetlamps? -cottages? -prefab_redo? \ No newline at end of file diff --git a/mods/signs_lib/description.txt b/mods/signs_lib/description.txt deleted file mode 100644 index d157852b..00000000 --- a/mods/signs_lib/description.txt +++ /dev/null @@ -1 +0,0 @@ -Adds signs with readable text. diff --git a/mods/signs_lib/mod.conf b/mods/signs_lib/mod.conf index 2781b60b..11641653 100644 --- a/mods/signs_lib/mod.conf +++ b/mods/signs_lib/mod.conf @@ -1,2 +1,6 @@ name = signs_lib +author = VanessaE +depends = default +optional_depends = intllib, screwdriver, streetspoles, streetlamps, cottages, prefab_redo +description = Adds signs with readable text. min_minetest_version = 5.2.0 diff --git a/mods/signs_lib/standard_signs.lua b/mods/signs_lib/standard_signs.lua index 1513d730..8d7a9e78 100644 --- a/mods/signs_lib/standard_signs.lua +++ b/mods/signs_lib/standard_signs.lua @@ -14,7 +14,8 @@ signs_lib.register_sign("default:sign_wall_wood", { allow_widefont = true, allow_onpole = true, allow_onpole_horizontal = true, - allow_yard = true + allow_yard = true, + use_texture_alpha = "clip", }) signs_lib.register_sign("default:sign_wall_steel", { @@ -35,7 +36,8 @@ signs_lib.register_sign("default:sign_wall_steel", { allow_widefont = true, allow_onpole = true, allow_onpole_horizontal = true, - allow_yard = true + allow_yard = true, + use_texture_alpha = "clip", }) minetest.register_alias("signs:sign_hanging", "default:sign_wood_hanging")