From 5424ca8c2b5af9c1bafd00ab5178f6b95a288ed9 Mon Sep 17 00:00:00 2001 From: Michieal Date: Sun, 15 Jan 2023 20:39:51 -0500 Subject: [PATCH 01/22] Created Starting Chest that is given to players. Based on the "give_initial_stuff" mod. --- mods/PLAYER/mcl_starting_chest/README.txt | 11 +++++ mods/PLAYER/mcl_starting_chest/init.lua | 49 ++++++++++++++++++++++ mods/PLAYER/mcl_starting_chest/license.txt | 25 +++++++++++ mods/PLAYER/mcl_starting_chest/mod.conf | 3 ++ settingtypes.txt | 3 ++ 5 files changed, 91 insertions(+) create mode 100644 mods/PLAYER/mcl_starting_chest/README.txt create mode 100644 mods/PLAYER/mcl_starting_chest/init.lua create mode 100644 mods/PLAYER/mcl_starting_chest/license.txt create mode 100644 mods/PLAYER/mcl_starting_chest/mod.conf diff --git a/mods/PLAYER/mcl_starting_chest/README.txt b/mods/PLAYER/mcl_starting_chest/README.txt new file mode 100644 index 000000000..da63a662b --- /dev/null +++ b/mods/PLAYER/mcl_starting_chest/README.txt @@ -0,0 +1,11 @@ +Adapted for Mineclone 2 by Michieal. + +Based on: +Minetest Game mod: give_initial_stuff +===================================== +See license.txt for license information. + +Authors of source code +---------------------- +Perttu Ahola (celeron55) (MIT) +Various Minetest developers and contributors (MIT) diff --git a/mods/PLAYER/mcl_starting_chest/init.lua b/mods/PLAYER/mcl_starting_chest/init.lua new file mode 100644 index 000000000..5ee21e22b --- /dev/null +++ b/mods/PLAYER/mcl_starting_chest/init.lua @@ -0,0 +1,49 @@ +--- Copyright 2023, Michieal. (Modifications for the mod to be usable in Mineclone 2.) +--- Based on mtg mod, give_initial_stuff. "Written by C55 and various minetest developers." +--- +--- Copyright notice created for the license to be valid. (MIT 3) + +local stuff_string = minetest.settings:get("starter_chest_contents") or + "mcl_tools:pick_iron,mcl_tools:axe_iron,mcl_tools:shovel_iron," .. + "mcl_torches:torch 32,mcl_core:cobble 64" + +mcl_starting_chest = { + items = {} +} + +function mcl_starting_chest.give(player) + minetest.log("action", + "Giving initial stuff to player " .. player:get_player_name()) + local inv = player:get_inventory() + for _, stack in ipairs(mcl_starting_chest.items) do + inv:add_item("main", stack) + end +end + +function mcl_starting_chest.add(stack) + mcl_starting_chest.items[#mcl_starting_chest.items + 1] = ItemStack(stack) +end + +function mcl_starting_chest.clear() + mcl_starting_chest.items = {} +end + +function mcl_starting_chest.add_from_csv(str) + local items = str:split(",") + for _, itemname in ipairs(items) do + mcl_starting_chest.add(itemname) + end +end + +function mcl_starting_chest.set_list(list) + mcl_starting_chest.items = list +end + +function mcl_starting_chest.get_list() + return mcl_starting_chest.items +end + +mcl_starting_chest.add_from_csv(stuff_string) +if minetest.settings:get_bool("mcl_starting_chest") then + minetest.register_on_newplayer(mcl_starting_chest.give) +end diff --git a/mods/PLAYER/mcl_starting_chest/license.txt b/mods/PLAYER/mcl_starting_chest/license.txt new file mode 100644 index 000000000..8134c920e --- /dev/null +++ b/mods/PLAYER/mcl_starting_chest/license.txt @@ -0,0 +1,25 @@ +License of source code +---------------------- + +The MIT License (MIT) +Copyright (C) 2012-2016 Perttu Ahola (celeron55) +Copyright (C) 2012-2016 Various Minetest developers and contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy of this +software and associated documentation files (the "Software"), to deal in the Software +without restriction, including without limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +For more details: +https://opensource.org/licenses/MIT diff --git a/mods/PLAYER/mcl_starting_chest/mod.conf b/mods/PLAYER/mcl_starting_chest/mod.conf new file mode 100644 index 000000000..2232e117b --- /dev/null +++ b/mods/PLAYER/mcl_starting_chest/mod.conf @@ -0,0 +1,3 @@ +name = mcl_starting_chest +description = Mineclone 2 mod, Starting Chest. (Gives starter chest to players.) +depends = mcl_core, mcl_chests diff --git a/settingtypes.txt b/settingtypes.txt index d68b5793d..7854aa19a 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -231,6 +231,9 @@ mcl_extended_pet_control (Extended pet control) bool true # Enable hamburgers for villagers to follow mcl_enable_hamburger (Enable Hamburger) bool true +# Starting chest contents (given directly to the new player) type: string +starter_chest_contents (player starter pack) string "mcl_tools:pick_iron,mcl_tools:axe_iron,mcl_tools:shovel_iron,mcl_torches:torch 32,mcl_core:cobble 64" + [Debugging] # If enabled, this will show the itemstring of an item in the description. mcl_item_id_debug (Item ID Debug) bool false From 45b4b4a458871c206455d183300fe23da67a0713 Mon Sep 17 00:00:00 2001 From: Michieal Date: Sun, 15 Jan 2023 21:21:26 -0500 Subject: [PATCH 02/22] renamed to mcl_starting_inventory as that is what it is. --- mods/PLAYER/mcl_starting_chest/init.lua | 49 ------------------- .../README.txt | 2 +- mods/PLAYER/mcl_starting_inventory/init.lua | 49 +++++++++++++++++++ .../license.txt | 0 .../mod.conf | 2 +- 5 files changed, 51 insertions(+), 51 deletions(-) delete mode 100644 mods/PLAYER/mcl_starting_chest/init.lua rename mods/PLAYER/{mcl_starting_chest => mcl_starting_inventory}/README.txt (82%) create mode 100644 mods/PLAYER/mcl_starting_inventory/init.lua rename mods/PLAYER/{mcl_starting_chest => mcl_starting_inventory}/license.txt (100%) rename mods/PLAYER/{mcl_starting_chest => mcl_starting_inventory}/mod.conf (78%) diff --git a/mods/PLAYER/mcl_starting_chest/init.lua b/mods/PLAYER/mcl_starting_chest/init.lua deleted file mode 100644 index 5ee21e22b..000000000 --- a/mods/PLAYER/mcl_starting_chest/init.lua +++ /dev/null @@ -1,49 +0,0 @@ ---- Copyright 2023, Michieal. (Modifications for the mod to be usable in Mineclone 2.) ---- Based on mtg mod, give_initial_stuff. "Written by C55 and various minetest developers." ---- ---- Copyright notice created for the license to be valid. (MIT 3) - -local stuff_string = minetest.settings:get("starter_chest_contents") or - "mcl_tools:pick_iron,mcl_tools:axe_iron,mcl_tools:shovel_iron," .. - "mcl_torches:torch 32,mcl_core:cobble 64" - -mcl_starting_chest = { - items = {} -} - -function mcl_starting_chest.give(player) - minetest.log("action", - "Giving initial stuff to player " .. player:get_player_name()) - local inv = player:get_inventory() - for _, stack in ipairs(mcl_starting_chest.items) do - inv:add_item("main", stack) - end -end - -function mcl_starting_chest.add(stack) - mcl_starting_chest.items[#mcl_starting_chest.items + 1] = ItemStack(stack) -end - -function mcl_starting_chest.clear() - mcl_starting_chest.items = {} -end - -function mcl_starting_chest.add_from_csv(str) - local items = str:split(",") - for _, itemname in ipairs(items) do - mcl_starting_chest.add(itemname) - end -end - -function mcl_starting_chest.set_list(list) - mcl_starting_chest.items = list -end - -function mcl_starting_chest.get_list() - return mcl_starting_chest.items -end - -mcl_starting_chest.add_from_csv(stuff_string) -if minetest.settings:get_bool("mcl_starting_chest") then - minetest.register_on_newplayer(mcl_starting_chest.give) -end diff --git a/mods/PLAYER/mcl_starting_chest/README.txt b/mods/PLAYER/mcl_starting_inventory/README.txt similarity index 82% rename from mods/PLAYER/mcl_starting_chest/README.txt rename to mods/PLAYER/mcl_starting_inventory/README.txt index da63a662b..126504b04 100644 --- a/mods/PLAYER/mcl_starting_chest/README.txt +++ b/mods/PLAYER/mcl_starting_inventory/README.txt @@ -1,4 +1,4 @@ -Adapted for Mineclone 2 by Michieal. +Mcl_starting_inventory, adapted for Mineclone 2 by Michieal. Based on: Minetest Game mod: give_initial_stuff diff --git a/mods/PLAYER/mcl_starting_inventory/init.lua b/mods/PLAYER/mcl_starting_inventory/init.lua new file mode 100644 index 000000000..836cb17a6 --- /dev/null +++ b/mods/PLAYER/mcl_starting_inventory/init.lua @@ -0,0 +1,49 @@ +--- Copyright 2023, Michieal. (Modifications for the mod to be usable in Mineclone 2.) +--- Based on mtg mod, give_initial_stuff. "Written by C55 and various minetest developers." +--- +--- Copyright notice created for the license to be valid. (MIT 3) + +local stuff_string = minetest.settings:get("starter_chest_contents") or + "mcl_tools:pick_iron,mcl_tools:axe_iron,mcl_tools:shovel_iron," .. + "mcl_torches:torch 32,mcl_core:cobble 64" + +mcl_starting_inventory = { + items = {} +} + +function mcl_starting_inventory.give(player) + minetest.log("action", + "Giving initial stuff to player " .. player:get_player_name()) + local inv = player:get_inventory() + for _, stack in ipairs(mcl_starting_inventory.items) do + inv:add_item("main", stack) + end +end + +function mcl_starting_inventory.add(stack) + mcl_starting_inventory.items[#mcl_starting_inventory.items + 1] = ItemStack(stack) +end + +function mcl_starting_inventory.clear() + mcl_starting_inventory.items = {} +end + +function mcl_starting_inventory.add_from_csv(str) + local items = str:split(",") + for _, itemname in ipairs(items) do + mcl_starting_inventory.add(itemname) + end +end + +function mcl_starting_inventory.set_list(list) + mcl_starting_inventory.items = list +end + +function mcl_starting_inventory.get_list() + return mcl_starting_inventory.items +end + +mcl_starting_inventory.add_from_csv(stuff_string) +if minetest.settings:get_bool("mcl_starting_inventory") then + minetest.register_on_newplayer(mcl_starting_inventory.give) +end diff --git a/mods/PLAYER/mcl_starting_chest/license.txt b/mods/PLAYER/mcl_starting_inventory/license.txt similarity index 100% rename from mods/PLAYER/mcl_starting_chest/license.txt rename to mods/PLAYER/mcl_starting_inventory/license.txt diff --git a/mods/PLAYER/mcl_starting_chest/mod.conf b/mods/PLAYER/mcl_starting_inventory/mod.conf similarity index 78% rename from mods/PLAYER/mcl_starting_chest/mod.conf rename to mods/PLAYER/mcl_starting_inventory/mod.conf index 2232e117b..d79c6e0af 100644 --- a/mods/PLAYER/mcl_starting_chest/mod.conf +++ b/mods/PLAYER/mcl_starting_inventory/mod.conf @@ -1,3 +1,3 @@ -name = mcl_starting_chest +name = mcl_starting_inventory description = Mineclone 2 mod, Starting Chest. (Gives starter chest to players.) depends = mcl_core, mcl_chests From 26f3275b7c944847494a6e9929861da62826a164 Mon Sep 17 00:00:00 2001 From: Michieal Date: Sun, 15 Jan 2023 21:23:49 -0500 Subject: [PATCH 03/22] renamed to mcl_starting_inventory... continued. Fixed the setting in settingtypes.txt --- mods/PLAYER/mcl_starting_inventory/init.lua | 2 +- settingtypes.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mods/PLAYER/mcl_starting_inventory/init.lua b/mods/PLAYER/mcl_starting_inventory/init.lua index 836cb17a6..fa823810d 100644 --- a/mods/PLAYER/mcl_starting_inventory/init.lua +++ b/mods/PLAYER/mcl_starting_inventory/init.lua @@ -3,7 +3,7 @@ --- --- Copyright notice created for the license to be valid. (MIT 3) -local stuff_string = minetest.settings:get("starter_chest_contents") or +local stuff_string = minetest.settings:get("starting_inv_contents") or "mcl_tools:pick_iron,mcl_tools:axe_iron,mcl_tools:shovel_iron," .. "mcl_torches:torch 32,mcl_core:cobble 64" diff --git a/settingtypes.txt b/settingtypes.txt index 7854aa19a..c183da7ed 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -231,8 +231,8 @@ mcl_extended_pet_control (Extended pet control) bool true # Enable hamburgers for villagers to follow mcl_enable_hamburger (Enable Hamburger) bool true -# Starting chest contents (given directly to the new player) type: string -starter_chest_contents (player starter pack) string "mcl_tools:pick_iron,mcl_tools:axe_iron,mcl_tools:shovel_iron,mcl_torches:torch 32,mcl_core:cobble 64" +# Starting inventory contents (given directly to the new player) type: string +starting_inv_contents (player starter pack) string "mcl_tools:pick_iron,mcl_tools:axe_iron,mcl_tools:shovel_iron,mcl_torches:torch 32,mcl_core:cobble 64" [Debugging] # If enabled, this will show the itemstring of an item in the description. From c57a757510e3b540178f74707b8b80028ecc0a46 Mon Sep 17 00:00:00 2001 From: Michieal Date: Mon, 16 Jan 2023 00:21:15 -0500 Subject: [PATCH 04/22] Starting Inventory fix #1/ --- mods/PLAYER/mcl_starting_inventory/init.lua | 9 ++++++--- mods/PLAYER/mcl_starting_inventory/mod.conf | 4 ++-- settingtypes.txt | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/mods/PLAYER/mcl_starting_inventory/init.lua b/mods/PLAYER/mcl_starting_inventory/init.lua index fa823810d..dbb469cbd 100644 --- a/mods/PLAYER/mcl_starting_inventory/init.lua +++ b/mods/PLAYER/mcl_starting_inventory/init.lua @@ -3,9 +3,12 @@ --- --- Copyright notice created for the license to be valid. (MIT 3) -local stuff_string = minetest.settings:get("starting_inv_contents") or - "mcl_tools:pick_iron,mcl_tools:axe_iron,mcl_tools:shovel_iron," .. - "mcl_torches:torch 32,mcl_core:cobble 64" +local give_inventory = minetest.settings:get("starting_inv_contents", false) + +local stuff_string +if give_inventory then + stuff_string = "mcl_tools:pick_iron,mcl_tools:axe_iron,mcl_tools:shovel_iron,mcl_torches:torch 32,mcl_core:cobble 32" +end mcl_starting_inventory = { items = {} diff --git a/mods/PLAYER/mcl_starting_inventory/mod.conf b/mods/PLAYER/mcl_starting_inventory/mod.conf index d79c6e0af..de938b831 100644 --- a/mods/PLAYER/mcl_starting_inventory/mod.conf +++ b/mods/PLAYER/mcl_starting_inventory/mod.conf @@ -1,3 +1,3 @@ name = mcl_starting_inventory -description = Mineclone 2 mod, Starting Chest. (Gives starter chest to players.) -depends = mcl_core, mcl_chests +description = Mineclone 2 mod, Starting Inventory +depends = mcl_core, mcl_tools, diff --git a/settingtypes.txt b/settingtypes.txt index c183da7ed..fe93771c6 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -231,8 +231,8 @@ mcl_extended_pet_control (Extended pet control) bool true # Enable hamburgers for villagers to follow mcl_enable_hamburger (Enable Hamburger) bool true -# Starting inventory contents (given directly to the new player) type: string -starting_inv_contents (player starter pack) string "mcl_tools:pick_iron,mcl_tools:axe_iron,mcl_tools:shovel_iron,mcl_torches:torch 32,mcl_core:cobble 64" +# Starting Inventory contents (given directly to the new player) type: string +starting_inv_contents (Player Starter Pack) bool false [Debugging] # If enabled, this will show the itemstring of an item in the description. From 181628e5395f2ce6307c7a4327f7044643c58541 Mon Sep 17 00:00:00 2001 From: Michieal Date: Mon, 16 Jan 2023 00:51:23 -0500 Subject: [PATCH 05/22] Starting Inventory fix #2 --- mods/PLAYER/mcl_starting_inventory/init.lua | 24 ++++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/mods/PLAYER/mcl_starting_inventory/init.lua b/mods/PLAYER/mcl_starting_inventory/init.lua index dbb469cbd..a72515bc2 100644 --- a/mods/PLAYER/mcl_starting_inventory/init.lua +++ b/mods/PLAYER/mcl_starting_inventory/init.lua @@ -3,20 +3,18 @@ --- --- Copyright notice created for the license to be valid. (MIT 3) +local DEBUG = true + local give_inventory = minetest.settings:get("starting_inv_contents", false) local stuff_string -if give_inventory then - stuff_string = "mcl_tools:pick_iron,mcl_tools:axe_iron,mcl_tools:shovel_iron,mcl_torches:torch 32,mcl_core:cobble 32" -end mcl_starting_inventory = { items = {} } function mcl_starting_inventory.give(player) - minetest.log("action", - "Giving initial stuff to player " .. player:get_player_name()) + mcl_log("Giving initial stuff to player " .. player:get_player_name()) local inv = player:get_inventory() for _, stack in ipairs(mcl_starting_inventory.items) do inv:add_item("main", stack) @@ -46,7 +44,17 @@ function mcl_starting_inventory.get_list() return mcl_starting_inventory.items end -mcl_starting_inventory.add_from_csv(stuff_string) -if minetest.settings:get_bool("mcl_starting_inventory") then - minetest.register_on_newplayer(mcl_starting_inventory.give) +local function mcl_log(message) + if DEBUG then + minetest.log(message) + end +end + +if give_inventory then + stuff_string = "mcl_tools:pick_iron,mcl_tools:axe_iron,mcl_tools:shovel_iron,mcl_torches:torch 32,mcl_core:cobble 32" + mcl_starting_inventory.add_from_csv(stuff_string) + mcl_log("okay to give inventory: " .. stuff_string) + if minetest.settings:get_bool("mcl_starting_inventory") then + minetest.register_on_newplayer(mcl_starting_inventory.give) + end end From d68667beb977f1a2b069e759a4f98769d5ef74fc Mon Sep 17 00:00:00 2001 From: Michieal Date: Mon, 16 Jan 2023 01:53:35 -0500 Subject: [PATCH 06/22] Starting Inventory fix #2. add in chat command, /give_starting_inventory. add in debug code. --- .../mcl_starting_inventory/README.txt | 0 .../mcl_starting_inventory/init.lua | 37 +++++++++++++------ .../mcl_starting_inventory/license.txt | 0 .../mcl_starting_inventory/mod.conf | 0 4 files changed, 26 insertions(+), 11 deletions(-) rename mods/{PLAYER => ITEMS}/mcl_starting_inventory/README.txt (100%) rename mods/{PLAYER => ITEMS}/mcl_starting_inventory/init.lua (65%) rename mods/{PLAYER => ITEMS}/mcl_starting_inventory/license.txt (100%) rename mods/{PLAYER => ITEMS}/mcl_starting_inventory/mod.conf (100%) diff --git a/mods/PLAYER/mcl_starting_inventory/README.txt b/mods/ITEMS/mcl_starting_inventory/README.txt similarity index 100% rename from mods/PLAYER/mcl_starting_inventory/README.txt rename to mods/ITEMS/mcl_starting_inventory/README.txt diff --git a/mods/PLAYER/mcl_starting_inventory/init.lua b/mods/ITEMS/mcl_starting_inventory/init.lua similarity index 65% rename from mods/PLAYER/mcl_starting_inventory/init.lua rename to mods/ITEMS/mcl_starting_inventory/init.lua index a72515bc2..c6f1e9bea 100644 --- a/mods/PLAYER/mcl_starting_inventory/init.lua +++ b/mods/ITEMS/mcl_starting_inventory/init.lua @@ -5,6 +5,12 @@ local DEBUG = true +local function mcl_log(message) + if DEBUG then + minetest.log(message) + end +end + local give_inventory = minetest.settings:get("starting_inv_contents", false) local stuff_string @@ -17,7 +23,11 @@ function mcl_starting_inventory.give(player) mcl_log("Giving initial stuff to player " .. player:get_player_name()) local inv = player:get_inventory() for _, stack in ipairs(mcl_starting_inventory.items) do - inv:add_item("main", stack) + if inv:room_for_item("main", stack) then + inv:add_item("main", stack) + else + mcl_log("no room for the item: " .. dump(stack)) + end end end @@ -44,17 +54,22 @@ function mcl_starting_inventory.get_list() return mcl_starting_inventory.items end -local function mcl_log(message) - if DEBUG then - minetest.log(message) - end -end - if give_inventory then stuff_string = "mcl_tools:pick_iron,mcl_tools:axe_iron,mcl_tools:shovel_iron,mcl_torches:torch 32,mcl_core:cobble 32" mcl_starting_inventory.add_from_csv(stuff_string) - mcl_log("okay to give inventory: " .. stuff_string) - if minetest.settings:get_bool("mcl_starting_inventory") then - minetest.register_on_newplayer(mcl_starting_inventory.give) - end + mcl_log("Okay to give inventory:\n" .. dump(mcl_starting_inventory.get_list())) end + +minetest.register_on_newplayer(mcl_starting_inventory.give) + +minetest.register_chatcommand("give_starting_inventory", { + description = "Grant yourself the starting inventory.", + func = function(name, params) + stuff_string = "mcl_tools:pick_iron,mcl_tools:axe_iron,mcl_tools:shovel_iron,mcl_torches:torch 32,mcl_core:cobble 32" + mcl_log("manually giving inventory:\n" .. dump(mcl_starting_inventory.get_list())) + mcl_starting_inventory.add_from_csv(stuff_string) + + minetest.chat_send_player(name, "Granted Starting Inventory.") + return true + end +}) diff --git a/mods/PLAYER/mcl_starting_inventory/license.txt b/mods/ITEMS/mcl_starting_inventory/license.txt similarity index 100% rename from mods/PLAYER/mcl_starting_inventory/license.txt rename to mods/ITEMS/mcl_starting_inventory/license.txt diff --git a/mods/PLAYER/mcl_starting_inventory/mod.conf b/mods/ITEMS/mcl_starting_inventory/mod.conf similarity index 100% rename from mods/PLAYER/mcl_starting_inventory/mod.conf rename to mods/ITEMS/mcl_starting_inventory/mod.conf From 88493091b60d475f6234a48368d17371b27bfc85 Mon Sep 17 00:00:00 2001 From: Michieal Date: Mon, 16 Jan 2023 01:58:27 -0500 Subject: [PATCH 07/22] Starting Inventory fix #3. turn off debugging in code. Ready for testing. --- mods/ITEMS/mcl_starting_inventory/init.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mods/ITEMS/mcl_starting_inventory/init.lua b/mods/ITEMS/mcl_starting_inventory/init.lua index c6f1e9bea..5644e3d06 100644 --- a/mods/ITEMS/mcl_starting_inventory/init.lua +++ b/mods/ITEMS/mcl_starting_inventory/init.lua @@ -3,7 +3,7 @@ --- --- Copyright notice created for the license to be valid. (MIT 3) -local DEBUG = true +local DEBUG = false local function mcl_log(message) if DEBUG then @@ -66,9 +66,8 @@ minetest.register_chatcommand("give_starting_inventory", { description = "Grant yourself the starting inventory.", func = function(name, params) stuff_string = "mcl_tools:pick_iron,mcl_tools:axe_iron,mcl_tools:shovel_iron,mcl_torches:torch 32,mcl_core:cobble 32" - mcl_log("manually giving inventory:\n" .. dump(mcl_starting_inventory.get_list())) + mcl_log("Manually giving inventory:\n" .. dump(mcl_starting_inventory.get_list())) mcl_starting_inventory.add_from_csv(stuff_string) - minetest.chat_send_player(name, "Granted Starting Inventory.") return true end From d48b3dcaeec7523890029d88a21641bc37bebeb0 Mon Sep 17 00:00:00 2001 From: Michieal Date: Mon, 16 Jan 2023 02:12:39 -0500 Subject: [PATCH 08/22] Starting Inventory fix #4 Optimized and remove chatcommand. --- mods/ITEMS/mcl_starting_inventory/init.lua | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/mods/ITEMS/mcl_starting_inventory/init.lua b/mods/ITEMS/mcl_starting_inventory/init.lua index 5644e3d06..dfd2ba6db 100644 --- a/mods/ITEMS/mcl_starting_inventory/init.lua +++ b/mods/ITEMS/mcl_starting_inventory/init.lua @@ -13,7 +13,7 @@ end local give_inventory = minetest.settings:get("starting_inv_contents", false) -local stuff_string +local stuff_string = "mcl_tools:pick_iron,mcl_tools:axe_iron,mcl_tools:shovel_iron,mcl_torches:torch 32,mcl_core:cobble 32" mcl_starting_inventory = { items = {} @@ -55,20 +55,8 @@ function mcl_starting_inventory.get_list() end if give_inventory then - stuff_string = "mcl_tools:pick_iron,mcl_tools:axe_iron,mcl_tools:shovel_iron,mcl_torches:torch 32,mcl_core:cobble 32" mcl_starting_inventory.add_from_csv(stuff_string) mcl_log("Okay to give inventory:\n" .. dump(mcl_starting_inventory.get_list())) end minetest.register_on_newplayer(mcl_starting_inventory.give) - -minetest.register_chatcommand("give_starting_inventory", { - description = "Grant yourself the starting inventory.", - func = function(name, params) - stuff_string = "mcl_tools:pick_iron,mcl_tools:axe_iron,mcl_tools:shovel_iron,mcl_torches:torch 32,mcl_core:cobble 32" - mcl_log("Manually giving inventory:\n" .. dump(mcl_starting_inventory.get_list())) - mcl_starting_inventory.add_from_csv(stuff_string) - minetest.chat_send_player(name, "Granted Starting Inventory.") - return true - end -}) From 7dd0293616df344479320ee4c452e21810f4bbcb Mon Sep 17 00:00:00 2001 From: Adam Macumber Date: Sat, 28 Jan 2023 11:04:58 -0500 Subject: [PATCH 09/22] feat: Rain particles move straight down, increase acceleration slightly --- mods/ENVIRONMENT/mcl_weather/rain.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mods/ENVIRONMENT/mcl_weather/rain.lua b/mods/ENVIRONMENT/mcl_weather/rain.lua index 7dcc48637..8eceeb922 100644 --- a/mods/ENVIRONMENT/mcl_weather/rain.lua +++ b/mods/ENVIRONMENT/mcl_weather/rain.lua @@ -27,10 +27,10 @@ local psdef= { time=0, minpos = vector.new(-15,20,-15), maxpos = vector.new(15,25,15), - minvel = vector.new(-2,-17,-2), - maxvel = vector.new(2,-8,2), - minacc = vector.new(0,0,0), - maxacc = vector.new(0,-0.5,0), + minvel = vector.new(0,-20,0), + maxvel = vector.new(0,-15,0), + minacc = vector.new(0,-0.8,0), + maxacc = vector.new(0,-0.8,0), minexptime = 1, maxexptime = 4, minsize = 4, From 29597af73884e89ad5581939b5ea24ebcf2c3edd Mon Sep 17 00:00:00 2001 From: Michieal Date: Sun, 29 Jan 2023 13:12:24 -0500 Subject: [PATCH 10/22] Fixed noted errors from Pull Request. --- mods/ITEMS/mcl_starting_inventory/init.lua | 4 ++-- mods/ITEMS/mcl_starting_inventory/mod.conf | 6 +++--- settingtypes.txt | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mods/ITEMS/mcl_starting_inventory/init.lua b/mods/ITEMS/mcl_starting_inventory/init.lua index dfd2ba6db..137391bd3 100644 --- a/mods/ITEMS/mcl_starting_inventory/init.lua +++ b/mods/ITEMS/mcl_starting_inventory/init.lua @@ -11,7 +11,7 @@ local function mcl_log(message) end end -local give_inventory = minetest.settings:get("starting_inv_contents", false) +local give_inventory = minetest.settings:get_bool("give_starting_inv", false) local stuff_string = "mcl_tools:pick_iron,mcl_tools:axe_iron,mcl_tools:shovel_iron,mcl_torches:torch 32,mcl_core:cobble 32" @@ -54,7 +54,7 @@ function mcl_starting_inventory.get_list() return mcl_starting_inventory.items end -if give_inventory then +if give_inventory and give_inventory == true then mcl_starting_inventory.add_from_csv(stuff_string) mcl_log("Okay to give inventory:\n" .. dump(mcl_starting_inventory.get_list())) end diff --git a/mods/ITEMS/mcl_starting_inventory/mod.conf b/mods/ITEMS/mcl_starting_inventory/mod.conf index de938b831..e24d4522d 100644 --- a/mods/ITEMS/mcl_starting_inventory/mod.conf +++ b/mods/ITEMS/mcl_starting_inventory/mod.conf @@ -1,3 +1,3 @@ -name = mcl_starting_inventory -description = Mineclone 2 mod, Starting Inventory -depends = mcl_core, mcl_tools, +title = mcl_starting_inventory +description = Mineclone 2 mod, Give Starting Inventory +depends = mcl_core, mcl_tools, mcl_torches diff --git a/settingtypes.txt b/settingtypes.txt index 3644a70a1..8a891ea8e 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -236,8 +236,8 @@ mcl_extended_pet_control (Extended pet control) bool true # Enable hamburgers for villagers to follow mcl_enable_hamburger (Enable Hamburger) bool true -# Starting Inventory contents (given directly to the new player) type: string -starting_inv_contents (Player Starter Pack) bool false +# Starting Inventory contents (given directly to the new player) type: bool +give_starting_inv (Player Starter Pack) bool false [Debugging] # If enabled, this will show the itemstring of an item in the description. From 7d803e174c0ec16f064ea228c1eb1314a65b3623 Mon Sep 17 00:00:00 2001 From: ancientmarinerdev Date: Thu, 26 Jan 2023 21:35:41 +0000 Subject: [PATCH 11/22] Set freeze and warning when mobs too close to boundary of world --- mods/CORE/mcl_util/init.lua | 6 ++++++ mods/ENTITIES/mcl_mobs/api.lua | 28 ++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/mods/CORE/mcl_util/init.lua b/mods/CORE/mcl_util/init.lua index f37b34444..d55ec0430 100644 --- a/mods/CORE/mcl_util/init.lua +++ b/mods/CORE/mcl_util/init.lua @@ -1,5 +1,11 @@ mcl_util = {} +local MAPGEN_LIMIT = 32000 + +function mcl_util.get_mapgen_limit() + return MAPGEN_LIMIT +end + -- Updates all values in t using values from to*. function table.update(t, ...) for _, to in ipairs {...} do diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index f5e50ba2a..1a7982ece 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -24,6 +24,10 @@ local spawn_protected = minetest.settings:get_bool("mobs_spawn_protected") ~= fa local mobs_debug = minetest.settings:get_bool("mobs_debug", false) -- Shows helpful debug info above each mob local spawn_logging = minetest.settings:get_bool("mcl_logging_mobs_spawn",true) +local MAPGEN_LIMIT = mcl_util.get_mapgen_limit() +local MAPGEN_MOB_LIMIT = mcl_util.get_mapgen_limit() - 50 + + -- Peaceful mode message so players will know there are no monsters if minetest.settings:get_bool("only_peaceful_mobs", false) then minetest.register_on_joinplayer(function(player) @@ -328,6 +332,26 @@ local function update_timers (self, dtime) end end +function mob_class:outside_limits() + local pos = self.object:get_pos() + if pos then + local posx = math.abs(pos.x) + local posy = math.abs(pos.y) + local posz = math.abs(pos.z) + if posx > MAPGEN_MOB_LIMIT or posy > MAPGEN_MOB_LIMIT or posz > MAPGEN_MOB_LIMIT then + if posx > MAPGEN_LIMIT or posy > MAPGEN_LIMIT or posz > MAPGEN_LIMIT then + minetest.log("action", "Warning mob past limits of worldgen: " .. minetest.pos_to_string(pos)) + else + minetest.log("action", "Warning mob close to limits of worldgen: " .. minetest.pos_to_string(pos)) + self:set_velocity(0) + self.state = "stand" + self:set_animation( "stand") + end + return true + end + end +end + -- main mob function function mob_class:on_step(dtime) local pos = self.object:get_pos() @@ -335,6 +359,10 @@ function mob_class:on_step(dtime) if self:check_despawn(pos, dtime) then return true end + if self:outside_limits() then + return + end + if self:check_death_and_slow_mob() then --minetest.log("action", "Mob is dying: ".. tostring(self.name)) -- Do we abandon out of here now? From d583ccb986322fac20942626a985e4feb26d13d3 Mon Sep 17 00:00:00 2001 From: ancientmarinerdev Date: Thu, 26 Jan 2023 22:01:41 +0000 Subject: [PATCH 12/22] Oooops, wrong number --- mods/CORE/mcl_util/init.lua | 2 +- mods/ENTITIES/mcl_mobs/api.lua | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/mods/CORE/mcl_util/init.lua b/mods/CORE/mcl_util/init.lua index d55ec0430..5fe97850f 100644 --- a/mods/CORE/mcl_util/init.lua +++ b/mods/CORE/mcl_util/init.lua @@ -1,6 +1,6 @@ mcl_util = {} -local MAPGEN_LIMIT = 32000 +local MAPGEN_LIMIT = 31000 function mcl_util.get_mapgen_limit() return MAPGEN_LIMIT diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index 1a7982ece..531673609 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -25,7 +25,8 @@ local mobs_debug = minetest.settings:get_bool("mobs_debug", false) -- Shows help local spawn_logging = minetest.settings:get_bool("mcl_logging_mobs_spawn",true) local MAPGEN_LIMIT = mcl_util.get_mapgen_limit() -local MAPGEN_MOB_LIMIT = mcl_util.get_mapgen_limit() - 50 +local MAPGEN_MOB_LIMIT = mcl_util.get_mapgen_limit() - 100 +-- 30927 seems to be the edge of the world, so could be closer, but this is safer -- Peaceful mode message so players will know there are no monsters @@ -339,13 +340,16 @@ function mob_class:outside_limits() local posy = math.abs(pos.y) local posz = math.abs(pos.z) if posx > MAPGEN_MOB_LIMIT or posy > MAPGEN_MOB_LIMIT or posz > MAPGEN_MOB_LIMIT then + minetest.log("action", "Getting close to limits of worldgen: " .. minetest.pos_to_string(pos)) if posx > MAPGEN_LIMIT or posy > MAPGEN_LIMIT or posz > MAPGEN_LIMIT then minetest.log("action", "Warning mob past limits of worldgen: " .. minetest.pos_to_string(pos)) else minetest.log("action", "Warning mob close to limits of worldgen: " .. minetest.pos_to_string(pos)) - self:set_velocity(0) self.state = "stand" self:set_animation( "stand") + + self.object:set_acceleration(vector.zero()) + self.object:set_velocity(vector.zero()) end return true end From c209537cfe5a111ba88581c301b289e5d1d4f33b Mon Sep 17 00:00:00 2001 From: ancientmarinerdev Date: Thu, 26 Jan 2023 22:08:50 +0000 Subject: [PATCH 13/22] Make it a bit less chatty for logging --- mods/ENTITIES/mcl_mobs/api.lua | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index 531673609..9f47de185 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -340,16 +340,17 @@ function mob_class:outside_limits() local posy = math.abs(pos.y) local posz = math.abs(pos.z) if posx > MAPGEN_MOB_LIMIT or posy > MAPGEN_MOB_LIMIT or posz > MAPGEN_MOB_LIMIT then - minetest.log("action", "Getting close to limits of worldgen: " .. minetest.pos_to_string(pos)) + --minetest.log("action", "Getting close to limits of worldgen: " .. minetest.pos_to_string(pos)) if posx > MAPGEN_LIMIT or posy > MAPGEN_LIMIT or posz > MAPGEN_LIMIT then minetest.log("action", "Warning mob past limits of worldgen: " .. minetest.pos_to_string(pos)) else - minetest.log("action", "Warning mob close to limits of worldgen: " .. minetest.pos_to_string(pos)) - self.state = "stand" - self:set_animation( "stand") - - self.object:set_acceleration(vector.zero()) - self.object:set_velocity(vector.zero()) + if self.state ~= "stand" then + minetest.log("action", "Warning mob close to limits of worldgen: " .. minetest.pos_to_string(pos)) + self.state = "stand" + self:set_animation("stand") + self.object:set_acceleration(vector.zero()) + self.object:set_velocity(vector.zero()) + end end return true end From 1f107ec0c73c1210dd0d61662e46790249368760 Mon Sep 17 00:00:00 2001 From: ancientmarinerdev Date: Thu, 26 Jan 2023 22:10:49 +0000 Subject: [PATCH 14/22] Tidy --- mods/ENTITIES/mcl_mobs/api.lua | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index 9f47de185..05fe2f4f7 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -363,10 +363,7 @@ function mob_class:on_step(dtime) if not pos then return end if self:check_despawn(pos, dtime) then return true end - - if self:outside_limits() then - return - end + if self:outside_limits() then return end if self:check_death_and_slow_mob() then --minetest.log("action", "Mob is dying: ".. tostring(self.name)) From 245ce9922373dccd2663961c701248e4f3847db5 Mon Sep 17 00:00:00 2001 From: ancientmarinerdev Date: Mon, 30 Jan 2023 20:52:33 +0000 Subject: [PATCH 15/22] Using mcl_vars --- mods/CORE/mcl_util/init.lua | 6 ------ mods/ENTITIES/mcl_mobs/api.lua | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/mods/CORE/mcl_util/init.lua b/mods/CORE/mcl_util/init.lua index 5fe97850f..f37b34444 100644 --- a/mods/CORE/mcl_util/init.lua +++ b/mods/CORE/mcl_util/init.lua @@ -1,11 +1,5 @@ mcl_util = {} -local MAPGEN_LIMIT = 31000 - -function mcl_util.get_mapgen_limit() - return MAPGEN_LIMIT -end - -- Updates all values in t using values from to*. function table.update(t, ...) for _, to in ipairs {...} do diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index 05fe2f4f7..1e7c9168b 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -24,8 +24,8 @@ local spawn_protected = minetest.settings:get_bool("mobs_spawn_protected") ~= fa local mobs_debug = minetest.settings:get_bool("mobs_debug", false) -- Shows helpful debug info above each mob local spawn_logging = minetest.settings:get_bool("mcl_logging_mobs_spawn",true) -local MAPGEN_LIMIT = mcl_util.get_mapgen_limit() -local MAPGEN_MOB_LIMIT = mcl_util.get_mapgen_limit() - 100 +local MAPGEN_LIMIT = mcl_vars.mapgen_limit +local MAPGEN_MOB_LIMIT = MAPGEN_LIMIT - 90 -- 30927 seems to be the edge of the world, so could be closer, but this is safer From 8793ed211e943cffa0bf482edb1606c0077ec7ea Mon Sep 17 00:00:00 2001 From: Johannes Fritz Date: Wed, 1 Feb 2023 09:56:12 -0600 Subject: [PATCH 16/22] Fix ender chest crash + remove map hand reference --- mods/ITEMS/mcl_chests/init.lua | 4 ++-- mods/ITEMS/mcl_maps/init.lua | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/mods/ITEMS/mcl_chests/init.lua b/mods/ITEMS/mcl_chests/init.lua index 6d46103a3..d9d4bb9d0 100644 --- a/mods/ITEMS/mcl_chests/init.lua +++ b/mods/ITEMS/mcl_chests/init.lua @@ -1061,8 +1061,8 @@ minetest.register_allow_player_inventory_action(function(player, action, inv, in or action == "take" and info.listname == "enderchest" ) then local def = player:get_wielded_item():get_definition() - - if not minetest.find_node_near(player:get_pos(), def and def.range or ItemStack():get_definition().range, "mcl_chests:ender_chest_small", true) then + local range = (def and def.range or player:get_inventory():get_stack("hand", 1):get_definition().range) + 1 + if not minetest.find_node_near(player:get_pos(), range, "mcl_chests:ender_chest_small", true) then return 0 end end diff --git a/mods/ITEMS/mcl_maps/init.lua b/mods/ITEMS/mcl_maps/init.lua index 84f4019ea..9db300470 100644 --- a/mods/ITEMS/mcl_maps/init.lua +++ b/mods/ITEMS/mcl_maps/init.lua @@ -238,7 +238,6 @@ filled_wield_def.wield_scale = { x = 1, y = 1, z = 1 } filled_wield_def.paramtype = "light" filled_wield_def.drawtype = "mesh" filled_wield_def.node_placement_prediction = "" -filled_wield_def.range = minetest.registered_items[""].range filled_wield_def.on_place = mcl_util.call_on_rightclick filled_wield_def._mcl_wieldview_item = "mcl_maps:filled_map" From cbb326047183419162e3ffd0019165d9bd7917e0 Mon Sep 17 00:00:00 2001 From: FossFanatic Date: Wed, 1 Feb 2023 14:23:49 +0000 Subject: [PATCH 17/22] Make the palette fix LBM not run on v6 & singlenode This fixes a crash when loading a world that doesn't have any biomes and the LBM tries to give the grassy nodes a biome colour. --- mods/MAPGEN/mcl_mapgen_core/init.lua | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/mods/MAPGEN/mcl_mapgen_core/init.lua b/mods/MAPGEN/mcl_mapgen_core/init.lua index 470f2a8c6..960ce1cfe 100644 --- a/mods/MAPGEN/mcl_mapgen_core/init.lua +++ b/mods/MAPGEN/mcl_mapgen_core/init.lua @@ -424,13 +424,15 @@ minetest.register_lbm({ nodenames = {"mcl_core:dirt_with_grass", "mcl_flowers:tallgrass", "mcl_flowers:double_grass", "mcl_flowers:double_grass_top", "mcl_flowers:fern", "mcl_flowers:double_fern", "mcl_flowers:double_fern_top", "mcl_core:reeds", "mcl_core:dirt_with_grass_snow"}, run_at_every_load = true, action = function(pos, node) - local biome_data = minetest.get_biome_data(pos) - local biome = biome_data.biome - local biome_name = minetest.get_biome_name(biome) - local reg_biome = minetest.registered_biomes[biome_name] - if node.param2 ~= reg_biome._mcl_grass_palette_index then - node.param2 = reg_biome._mcl_grass_palette_index - minetest.set_node(pos, node) + if mg_name ~= "v6" and mg_name ~= "singlenode" then + local biome_data = minetest.get_biome_data(pos) + local biome = biome_data.biome + local biome_name = minetest.get_biome_name(biome) + local reg_biome = minetest.registered_biomes[biome_name] + if node.param2 ~= reg_biome._mcl_grass_palette_index then + node.param2 = reg_biome._mcl_grass_palette_index + minetest.set_node(pos, node) + end end end, }) From 1abd226e07112df5b96d8d79e914dbde939465f6 Mon Sep 17 00:00:00 2001 From: FossFanatic Date: Fri, 27 Jan 2023 15:46:53 +0000 Subject: [PATCH 18/22] Remove water HUD --- .../textures/mcl_playerplus_water.png | Bin 9421 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 mods/PLAYER/mcl_playerplus/textures/mcl_playerplus_water.png diff --git a/mods/PLAYER/mcl_playerplus/textures/mcl_playerplus_water.png b/mods/PLAYER/mcl_playerplus/textures/mcl_playerplus_water.png deleted file mode 100644 index 0524ce8d692852c626f5818d9160d069f0e86b2d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9421 zcmV;;Br@BHP) zaB^>EX>4U6ba`-PAZ2)IW&i+q+O1e?a>ghQ{Ld-&2q50a!C+VI4d(dUEn&xBl9`>U znmDmRU|ZcS2^@F+@!!k+2R~AycPZCadMO@1si!UjjppsA>pA$OXZ^W{(EqTzXFymvpaeO?I&jG|%{{d(JUDs;YbsD;n3K%Ur zqP)A=;XRmmfbyuf6&w|R8SSb^$I<-o6XGmC{efeK9t5gfE~K!+2v<1uI>UsENlvM_ zicE=WYq3g~8BHe~;X-2cxMG8nQ%)Bn%<}jW^u1l*H$%glSHM&Wcvw*R|KxCgHTX{s zcU_Yd1>YX7;FmCR;RcoC8M7crxVCOt3BHdlzkkIKLKO;TrMUs%@P|F($l)utqUszm zFXL)i5nNsS0iX!)&Ts}Pkb*BE=1_vKA~gi?*dWk==Yrfgpg_o37Mv7hMiEz~3Ez!- zYS6ior3lTaO%Ni-5-YUnaX_q;GUBJEh8P+-=9F_Tx#s3_&!fbWN-m|;!Xh_ntf}T& zYOSsII$CV0Q;SwX0v_QEjXG zHZDn9HjfH+b^muu5(irvn(X1J|g?T61;HI z#zJWV%it30$pOUd;fnxbHgTXe@oT6!-LfgI_b_Nwr8r z1BD%9$iY*s0@pAdkEpmEW~7KO*1QH^g$K;ZT5>e-*orD#cCZgMjBO z#Ay~hIe>$hP*Do9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DlTLJ9#73XWskid5gMH(mueR?&p@ZgEzWM5M=g1K1! zq3!~fN+3Wl9tcVKVC=U8K0f91C&AxS!0Rg};&~F(y#fsT^{C3qln9(``HuSklMjIq z@8zJYiedbekhQ3{N5J1(!LKjv#-1dBh`7$3x0Qk|DgqZ2;+_wXlSEl44#hlz@Z=Qt zV93R&SG|Q*@OuSVC4mGh|qtT8rPM*4nY((pAY;5@FVcE$KZ{@H#7S`C)a3f T Date: Fri, 27 Jan 2023 15:47:25 +0000 Subject: [PATCH 19/22] Remove water HUD code --- mods/PLAYER/mcl_playerplus/init.lua | 43 ++--------------------------- 1 file changed, 3 insertions(+), 40 deletions(-) diff --git a/mods/PLAYER/mcl_playerplus/init.lua b/mods/PLAYER/mcl_playerplus/init.lua index 28822d1bc..e01a7bd12 100644 --- a/mods/PLAYER/mcl_playerplus/init.lua +++ b/mods/PLAYER/mcl_playerplus/init.lua @@ -3,8 +3,6 @@ mcl_playerplus = { is_pressing_jump = {}, } -local hud_water = {} - local get_connected_players = minetest.get_connected_players local dir_to_yaw = minetest.dir_to_yaw local get_item_group = minetest.get_item_group @@ -27,26 +25,6 @@ local mcl_playerplus_internal = {} local time = 0 local look_pitch = 0 - -local function calculate_water_depth(pos) - for i=1, 50 do - if get_item_group(minetest.get_node(vector.new(pos.x,pos.y+i,pos.z)).name, "water") == 0 then - return i - end - end - return 50 -end - -local function remove_water_hud(player) - if hud_water[player] then - mcl_weather.skycolor.update_sky_color() - for i=1, #hud_water[player] do - player:hud_remove(hud_water[player][i]) - end - hud_water[player] = nil - end -end - local function player_collision(player) local pos = player:get_pos() @@ -417,23 +395,8 @@ minetest.register_globalstep(function(dtime) set_bone_pos(player,"Body_Control", nil, vector.new(0, -player_vel_yaw + yaw, 0)) end - if get_item_group(mcl_playerinfo[name].node_head, "water") ~= 0 then - if not hud_water[player] or hud_water[player] and calculate_water_depth(player:get_pos()) ~= #hud_water[player] then - remove_water_hud(player) - hud_water[player] = {} - for i=1, calculate_water_depth(player:get_pos()) do - table.insert(hud_water[player], player:hud_add({ - hud_elem_type = "image", - text = "mcl_playerplus_water.png", - position = {x = 0.5, y = 0.5}, - scale = {x = 32, y = 16}, - offset = {x = 0, y = 0}, - z_index = -1002, - })) - end - end - else - remove_water_hud(player) + if get_item_group(mcl_playerinfo[name].node_head, "water") ~= 0 or get_item_group(mcl_playerinfo[name].node_head, "water") ~= 1 then + mcl_weather.skycolor.update_sky_color() end elytra.last_yaw = player:get_look_horizontal() @@ -643,7 +606,7 @@ minetest.register_globalstep(function(dtime) local vi = area:indexp({x=x, y=y, z=z}) local nodename = get_name_from_content_id(data[vi]) local light_block_group = minetest.get_item_group(nodename, "light_block") - + local tex if nodename == "mcl_core:barrier" then tex = "mcl_core_barrier.png" From 24b1078b61f78d458206c74e96d68e6dba00c137 Mon Sep 17 00:00:00 2001 From: FossFanatic Date: Fri, 27 Jan 2023 15:49:58 +0000 Subject: [PATCH 20/22] Make the post effect alpha the same between water source and flow --- mods/ITEMS/mcl_core/nodes_liquid.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_core/nodes_liquid.lua b/mods/ITEMS/mcl_core/nodes_liquid.lua index 081f1978a..972c3b973 100644 --- a/mods/ITEMS/mcl_core/nodes_liquid.lua +++ b/mods/ITEMS/mcl_core/nodes_liquid.lua @@ -50,7 +50,7 @@ minetest.register_node("mcl_core:water_flowing", { liquid_viscosity = WATER_VISC, liquid_range = 7, waving = 3, - post_effect_color = {a=20, r=0x03, g=0x3C, b=0x5C}, + post_effect_color = {a=60, r=0x03, g=0x3C, b=0x5C}, groups = { water=3, liquid=3, puts_out_fire=1, not_in_creative_inventory=1, freezes=1, melt_around=1, dig_by_piston=1}, _mcl_blast_resistance = 100, -- Hardness intentionally set to infinite instead of 100 (Minecraft value) to avoid problems in creative mode From 0c0845c1bd189d222115d744c74f41a2a7dbd6d8 Mon Sep 17 00:00:00 2001 From: FossFanatic Date: Fri, 27 Jan 2023 16:29:24 +0000 Subject: [PATCH 21/22] Change the underwater detection code a bit --- mods/PLAYER/mcl_playerplus/init.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mods/PLAYER/mcl_playerplus/init.lua b/mods/PLAYER/mcl_playerplus/init.lua index e01a7bd12..0e774ee2f 100644 --- a/mods/PLAYER/mcl_playerplus/init.lua +++ b/mods/PLAYER/mcl_playerplus/init.lua @@ -395,8 +395,13 @@ minetest.register_globalstep(function(dtime) set_bone_pos(player,"Body_Control", nil, vector.new(0, -player_vel_yaw + yaw, 0)) end - if get_item_group(mcl_playerinfo[name].node_head, "water") ~= 0 or get_item_group(mcl_playerinfo[name].node_head, "water") ~= 1 then + local underwater + if get_item_group(mcl_playerinfo[name].node_head, "water") ~= 0 and underwater ~= true then mcl_weather.skycolor.update_sky_color() + local underwater = true + elseif get_item_group(mcl_playerinfo[name].node_head, "water") == 0 and underwater == true then + mcl_weather.skycolor.update_sky_color() + local underwater = false end elytra.last_yaw = player:get_look_horizontal() From 7daa79a3f8125ec7866a006fc91ab9a4ac539bbc Mon Sep 17 00:00:00 2001 From: ancientmarinerdev Date: Fri, 27 Jan 2023 01:55:29 +0000 Subject: [PATCH 22/22] Fix wither crash on certain version of Lua. --- mods/ENTITIES/mcl_mobs/effects.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mods/ENTITIES/mcl_mobs/effects.lua b/mods/ENTITIES/mcl_mobs/effects.lua index 66ae35454..d4b071f93 100644 --- a/mods/ENTITIES/mcl_mobs/effects.lua +++ b/mods/ENTITIES/mcl_mobs/effects.lua @@ -298,7 +298,14 @@ local function who_are_you_looking_at (self) elseif not self._locked_object then if math.random(1, 30) then --minetest.log("Change look check: ".. self.name) - local look_at_player_chance = math.random(20/self.curiosity) + + -- For the wither this was 20/60=0.33, so probably need to rebalance and divide rates. + -- but frequency of check isn't good as it is costly. Making others too infrequent requires testing + local chance = 20/self.curiosity + + if chance < 1 then chance = 1 end + local look_at_player_chance = math.random(chance) + -- was 5000 but called in loop based on entities. so div by 12 as estimate avg of entities found, -- then div by 20 as less freq lookup