From 66952a26acb269cf6a61aae151159f8bf7fc85ec Mon Sep 17 00:00:00 2001 From: mckaygerhard Date: Sun, 12 Dec 2021 20:39:01 -0600 Subject: [PATCH] up to date to minenux gameid mods stable-4.0 version 4.0.17.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * this cherry pĂ­cked from comit at https://codeberg.org/minenux/minetest-game-minetest/commit/6861a44b605b23bce4795a2b011e0a1dc476fa3c * https://codeberg.org/minenux/minetest-game-minetest/commit/74702c6ada3a62e03fe1d861681129bfb791383d * Carts: Replace old, deprecated function names mods/carts/cart_entity.lua * Mushroom spread: make overridable and reduce spread * Move mushroom spread ABM action into a global and overridable function. but do not optimise spread code mods/flowers/init.lua * backported bcf98df5fac3eb59b02d9fdb066ab92c6228d787 * Reduce spread range to reduce spread through walls. * https://codeberg.org/minenux/minetest-game-minetest/commit/657f7cee6edabacd2582c7031ae9def05aada4a1 set art and game default, use minenux name and logo venenux * backported https://codeberg.org/minenux/minetest-game-minetest/commit/d5cc8c46f66420eb14f23c83a3b57eff731ceb89 * Flowers: More flowers * now we are into minenux so minetest4 stable-4.0 branch for engine * https://codeberg.org/minenux/minetest-game-minetest/commit/95e70da3a68fd46083b640ee74ea3995dfa327d7 Default: Increase the maximum level of the diamond axe to 3 * backported https://github.com/minetest/minetest_game/pull/1854 * This is the maximum level of the other diamond tools and makes the number of uses similar to them at mods/default/tools.lua * fixed https://github.com/minetest/minetest_game/issues/1456 Diamond axe breaks earlier than mese axe * https://codeberg.org/minenux/minetest-game-minetest/commit/535204298e95a84f6169a6a9c8c1f970e1ed4e25 * Farming: Make cotton look like cotton, add crafted string item * Remove string -> cotton alias. * mods/farming/README.txt, mods/farming/init.lua, mods/farming/textures/farming_cotton.png, mods/farming/textures/farming_string.png * https://codeberg.org/minenux/minetest-game-minetest/commit/2b6de659cb52826388db870fb63cd05571df7bf5 Floatland biomes: Add ocean biomes to fix missing sandstone * Update biome lists for blob ores mods/default/mapgen.lua * backported bdc09d2313e5734400d2283549c4906d77a546d0 * https://codeberg.org/minenux/minetest-game-minetest/commit/e07ad71d11ea9b3700f945d4a3fc1587c41994c6 https://codeberg.org/minenux/minetest-game-minetest/commit/aa7f6cd0603e563d81ea7563baaef063aec0550e https://codeberg.org/minenux/minetest-game-minetest/commit/4a1fc02e8270d5ad0e6136bdfde3290b612ef4a5 Make sapling, leaves and fence descriptions consistent Descriptions: Make capitalization consistent also in Improve node descriptions for most default items and nodes * backported https://github.com/minetest/minetest_game/pull/1834 * addressed consistency issues previously discussed in: * https://github.com/minetest/minetest_game/issues/1473 Bad item descriptions: Too generic descriptions among specific descriptions also cos has a strong tendency towards mixing generic item names * https://github.com/minetest/minetest_game/issues/1817 Add tree species to descriptions for appletree and jungletree No change to node technical names though. Normal wood is obviously an appletree * mods/default/nodes.lua, mods/doors/init.lua, mods/flowers/init.lua, mods/vessels/init.lua, mods/default/nodes.lua, mods/doors/init.lua, mods/flowers/init.lua, mods/carts/rails.lua, mods/dye/init.lua, mods/farming/init.lua and mods/xpanes/init.lua * backported https://github.com/minetest/minetest_game/pull/1795 * https://codeberg.org/minenux/minetest-game-minetest/commit/fb610ffa59ee1f14dccd1d07ac8f2cdd294b4187 Allow mossy cobble slabs to combine mods/stairs/init.lua * backported https://github.com/minetest/minetest_game/pull/1791 * fixed https://github.com/minetest/minetest_game/issues/1790 * https://codeberg.org/minenux/minetest-game-minetest/commit/d37c1d231259f659fd1f6c95b4e2c2115d6ef423 * Creative: Do not give creative priv to admin mods/creative/init.lua * https://codeberg.org/minenux/minetest-game-minetest/commit/commit fea78bdf541e6106408018441937d77d163963e5 * Creative: Add 'creative' privilege for survival servers * This adds a 'creative' privilege to survival servers which OPs can bestow on admin or competent builders to give access to the creative inventory. * backported from 0157175346f9af8cf9ea5ffeb5f3d91fa474d044 --- mods/carts/cart_entity.lua | 26 +++++++++--------- mods/creative/init.lua | 3 ++- mods/farming/README.txt | 3 +++ mods/farming/init.lua | 32 ++++++++++++++++++++++- mods/farming/textures/farming_cotton.png | Bin 166 -> 316 bytes mods/farming/textures/farming_string.png | Bin 0 -> 166 bytes mods/flowers/init.lua | 31 ++++++++++++++-------- 7 files changed, 69 insertions(+), 26 deletions(-) create mode 100644 mods/farming/textures/farming_string.png diff --git a/mods/carts/cart_entity.lua b/mods/carts/cart_entity.lua index 031e456..3755499 100644 --- a/mods/carts/cart_entity.lua +++ b/mods/carts/cart_entity.lua @@ -57,8 +57,8 @@ function cart_entity:get_staticdata() end function cart_entity:on_punch(puncher, time_from_last_punch, tool_capabilities, direction) - local pos = self.object:getpos() - local vel = self.object:getvelocity() + local pos = self.object:get_pos() + local vel = self.object:get_velocity() if not self.railtype or vector.equals(vel, {x=0, y=0, z=0}) then local node = minetest.get_node(pos).name self.railtype = minetest.get_item_group(node, "connect_to_raillike") @@ -81,7 +81,7 @@ function cart_entity:on_punch(puncher, time_from_last_punch, tool_capabilities, -- Detach driver and items if self.driver then if self.old_pos then - self.object:setpos(self.old_pos) + self.object:set_pos(self.old_pos) end local player = minetest.get_player_by_name(self.driver) carts:manage_attachment(player, nil) @@ -99,7 +99,7 @@ function cart_entity:on_punch(puncher, time_from_last_punch, tool_capabilities, local leftover = inv:add_item("main", "carts:cart") -- If no room in inventory add a replacement cart to the world if not leftover:is_empty() then - minetest.add_item(self.object:getpos(), leftover) + minetest.add_item(self.object:get_pos(), leftover) end end self.object:remove() @@ -152,7 +152,7 @@ local function rail_sound(self, dtime) self.sound_handle = nil minetest.after(0.2, minetest.sound_stop, handle) end - local vel = self.object:getvelocity() + local vel = self.object:get_velocity() local speed = vector.length(vel) if speed > 0 then self.sound_handle = minetest.sound_play( @@ -170,16 +170,16 @@ local function get_railparams(pos) end local function rail_on_step(self, dtime) - local vel = self.object:getvelocity() + local vel = self.object:get_velocity() if self.punched then vel = vector.add(vel, self.velocity) - self.object:setvelocity(vel) + self.object:set_velocity(vel) self.old_dir.y = 0 elseif vector.equals(vel, {x=0, y=0, z=0}) then return end - local pos = self.object:getpos() + local pos = self.object:get_pos() local update = {} -- stop cart if velocity vector flips @@ -187,8 +187,8 @@ local function rail_on_step(self, dtime) (self.old_vel.x * vel.x < 0 or self.old_vel.z * vel.z < 0) then self.old_vel = {x = 0, y = 0, z = 0} self.old_pos = pos - self.object:setvelocity(vector.new()) - self.object:setacceleration(vector.new()) + self.object:set_velocity(vector.new()) + self.object:set_acceleration(vector.new()) rail_on_step_event(get_railparams(pos).on_step, self, dtime) return end @@ -294,7 +294,7 @@ local function rail_on_step(self, dtime) end end - self.object:setacceleration(new_acc) + self.object:set_acceleration(new_acc) self.old_pos = vector.new(pos) if not vector.equals(dir, {x=0, y=0, z=0}) then self.old_dir = vector.new(dir) @@ -342,9 +342,9 @@ local function rail_on_step(self, dtime) end self.object:set_animation(anim, 1, 0) - self.object:setvelocity(vel) + self.object:set_velocity(vel) if update.pos then - self.object:setpos(pos) + self.object:set_pos(pos) end -- call event handler diff --git a/mods/creative/init.lua b/mods/creative/init.lua index 32d2979..ef190b8 100644 --- a/mods/creative/init.lua +++ b/mods/creative/init.lua @@ -2,7 +2,8 @@ creative = {} minetest.register_privilege("creative", { description = "Allow player to use creative inventory", - give_to_singleplayer = false + give_to_singleplayer = false, + give_to_admin = false }) local creative_mode_cache = minetest.settings:get_bool("creative_mode") diff --git a/mods/farming/README.txt b/mods/farming/README.txt index 3ccd8c3..d46748d 100644 --- a/mods/farming/README.txt +++ b/mods/farming/README.txt @@ -35,3 +35,6 @@ Created by Gambit (CC BY 3.0): farming_flour.png farming_cotton_seed.png farming_wheat_seed.png + +Created by Napiophelios (CC BY-SA 3.0): + farming_cotton.png diff --git a/mods/farming/init.lua b/mods/farming/init.lua index 667a668..fff48fa 100644 --- a/mods/farming/init.lua +++ b/mods/farming/init.lua @@ -1,13 +1,18 @@ -- Global farming namespace + farming = {} farming.path = minetest.get_modpath("farming") + -- Load files + dofile(farming.path .. "/api.lua") dofile(farming.path .. "/nodes.lua") dofile(farming.path .. "/hoes.lua") + -- WHEAT + farming.register_plant("farming:wheat", { description = "Wheat Seed", paramtype2 = "meshoptions", @@ -19,6 +24,7 @@ farming.register_plant("farming:wheat", { groups = {flammable = 4}, place_param2 = 3, }) + minetest.register_craftitem("farming:flour", { description = "Flour", inventory_image = "farming_flour.png", @@ -45,7 +51,9 @@ minetest.register_craft({ recipe = "farming:flour" }) + -- Cotton + farming.register_plant("farming:cotton", { description = "Cotton Seed", inventory_image = "farming_cotton_seed.png", @@ -56,7 +64,11 @@ farming.register_plant("farming:cotton", { groups = {flammable = 4}, }) -minetest.register_alias("farming:string", "farming:cotton") +minetest.register_craftitem("farming:string", { + description = "String", + inventory_image = "farming_string.png", + groups = {flammable = 2}, +}) minetest.register_craft({ output = "wool:white", @@ -66,7 +78,17 @@ minetest.register_craft({ } }) +minetest.register_craft({ + output = "farming:string 2", + recipe = { + {"farming:cotton"}, + {"farming:cotton"}, + } +}) + + -- Straw + minetest.register_craft({ output = "farming:straw 3", recipe = { @@ -83,7 +105,9 @@ minetest.register_craft({ } }) + -- Fuels + minetest.register_craft({ type = "fuel", recipe = "farming:straw", @@ -102,6 +126,12 @@ minetest.register_craft({ burntime = 1, }) +minetest.register_craft({ + type = "fuel", + recipe = "farming:string", + burntime = 1, +}) + minetest.register_craft({ type = "fuel", recipe = "farming:hoe_wood", diff --git a/mods/farming/textures/farming_cotton.png b/mods/farming/textures/farming_cotton.png index e2bbfd7af486b64c658bcc7c6101b22ca95ab7e7..8aa50e4e38c75bce9f41cbee1ed6535adb7c7f9c 100644 GIT binary patch delta 300 zcmZ3+xQA(iWIZzj1A~Sxe=v}$3-AeX1=8t3ve^;Jxsl45aXJOD8W~B3SxJW3$;P?K z23cw5Ica9OX{LEVGTl5s-7G)DyfDZ1^&1d)`}Xa-ckkZ52ZIkF@cPrIj~_pN_yhu< zKY#x81q8kV!MAVUzkmPv^Jo3fU%!3>!5=XA`*+o}`G$v}klz+>jX%2nYTLpB_LCHif@qmYK$KgskD%6%UkXBkHe85=Ij(pH*q zEPLs#tw&tWOrCbnzN6FRS5fT$vL=W8uUAjqRXmYY-#P90WwT=$tg14XY;L}3WKDZo f75>OO@IgLvdpv4THu6{1-oD!M<@%x*6 delta 149 zcmdnPw2X0rWIY2ASj||l7f3Oc1o;IsFqBO`YXRiNd%8G=NJz3CT*%vCz`%0gc0H3= z0$0}(IjxBvLbC)`&9??=WmxfiH-p;^W`_%^416&UUo{BGzj08P<492YUYwu1&SAsB uDkis!0ec!E(s{TO4u~*3@n8pO`@nqP-XMGaG`@3>L0nH)KbLh*2~7ZC129Vf diff --git a/mods/farming/textures/farming_string.png b/mods/farming/textures/farming_string.png new file mode 100644 index 0000000000000000000000000000000000000000..e2bbfd7af486b64c658bcc7c6101b22ca95ab7e7 GIT binary patch literal 166 zcmeAS@N?(olHy`uVBq!ia0vp^0wBx*Bp9q_EZ7UAm`Z~Df*BafCZDwc^5Q*R977}| zSr0DcZ7^V9IdHq4Ni2b@Yl)oJL=T}^0;}d*gS0ZNc)pv#?FO^M1yu&Vn1`<#1mxd1 zsLOFAD19%^&t2!R;b0Y$+r@xA4H4-)+zAIn7@l~rgS35MzHe`kJ%8G{#~_}ktDnm{ Hr-UW|pV=_A literal 0 HcmV?d00001 diff --git a/mods/flowers/init.lua b/mods/flowers/init.lua index 51ade79..00a82ee 100644 --- a/mods/flowers/init.lua +++ b/mods/flowers/init.lua @@ -214,19 +214,28 @@ function flowers.mushroom_spread(pos, node) minetest.remove_node(pos) return end - local positions = minetest.find_nodes_in_area_under_air( - {x = pos.x - 1, y = pos.y - 2, z = pos.z - 1}, - {x = pos.x + 1, y = pos.y + 1, z = pos.z + 1}, - {"group:soil", "group:tree"}) - if #positions == 0 then - return + local random = { + x = pos.x + math.random(-2, 2), + y = pos.y + math.random(-1, 1), + z = pos.z + math.random(-2, 2) + } + local random_node = minetest.get_node_or_nil(random) + if not random_node or random_node.name ~= "air" then + return end - local pos2 = positions[math.random(#positions)] - pos2.y = pos2.y + 1 - if minetest.get_node_light(pos, 0.5) <= 3 and - minetest.get_node_light(pos2, 0.5) <= 3 then - minetest.set_node(pos2, {name = node.name}) + local node_under = minetest.get_node_or_nil({x = random.x, + y = random.y - 1, z = random.z}) + if not node_under then + return end + + if (minetest.get_item_group(node_under.name, "soil") ~= 0 or + minetest.get_item_group(node_under.name, "tree") ~= 0) and + minetest.get_node_light(pos, 0.5) <= 3 and + minetest.get_node_light(random, 0.5) <= 3 then + minetest.set_node(random, {name = node.name}) + end + end minetest.register_abm({