From 549bdeb6e9683e7b28048a56e36089d1e79c8f71 Mon Sep 17 00:00:00 2001 From: NO11 Date: Mon, 12 Jul 2021 21:41:57 +0000 Subject: [PATCH 1/6] Remove object:is_player --- mods/ITEMS/mcl_core/functions.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_core/functions.lua b/mods/ITEMS/mcl_core/functions.lua index 6e1a977d9..eceb81c51 100644 --- a/mods/ITEMS/mcl_core/functions.lua +++ b/mods/ITEMS/mcl_core/functions.lua @@ -203,7 +203,8 @@ minetest.register_abm({ chance = 1, action = function(pos, node, active_object_count, active_object_count_wider) for _,object in pairs(minetest.get_objects_inside_radius(pos, 0.9)) do - if not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "__builtin:item" then + local entity = object:get_luaentity() + if entity and entity.name == "__builtin:item" then object:remove() end end From 9d9e21301271da166248a2356b81e0225d738fde Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Sat, 10 Jul 2021 10:54:59 +0200 Subject: [PATCH 2/6] Fix some implicit hard and soft-dependencies These issues were found while testing minetest#8603 and are caused by relying on the undefined mod loading order --- mods/ITEMS/mcl_armor/mod.conf | 2 +- mods/ITEMS/mcl_brewing/mod.conf | 2 +- mods/PLAYER/mcl_playerplus/mod.conf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mods/ITEMS/mcl_armor/mod.conf b/mods/ITEMS/mcl_armor/mod.conf index 9264e8362..fad2e494c 100644 --- a/mods/ITEMS/mcl_armor/mod.conf +++ b/mods/ITEMS/mcl_armor/mod.conf @@ -1,5 +1,5 @@ name = mcl_armor author = stu description = Adds craftable armor that is visible to other players. -depends = mcl_core, mcl_player, mcl_enchanting +depends = mcl_core, mcl_player, mcl_enchanting, mcl_damage optional_depends = mcl_fire, ethereal, bakedclay diff --git a/mods/ITEMS/mcl_brewing/mod.conf b/mods/ITEMS/mcl_brewing/mod.conf index 2c27c979e..0f6217f09 100644 --- a/mods/ITEMS/mcl_brewing/mod.conf +++ b/mods/ITEMS/mcl_brewing/mod.conf @@ -1,4 +1,4 @@ name = mcl_brewing author = bzoss depends = mcl_init, mcl_formspec, mcl_sounds, mcl_potions, mcl_mobitems -optional_depends = mcl_core, doc, screwdriver +optional_depends = mcl_core, doc, screwdriver, mesecons_mvps diff --git a/mods/PLAYER/mcl_playerplus/mod.conf b/mods/PLAYER/mcl_playerplus/mod.conf index 6989957d7..b77c9e2e5 100644 --- a/mods/PLAYER/mcl_playerplus/mod.conf +++ b/mods/PLAYER/mcl_playerplus/mod.conf @@ -1,5 +1,5 @@ name = mcl_playerplus author = TenPlus1 description = Adds some simple player-related gameplay effects: Hurt by touching a cactus, suffocation and more. -depends = mcl_init, mcl_core, mcl_particles, mcl_hunger, playerphysics, mcl_playerinfo, mcl_weather, mcl_spawn, mcl_enchanting, mcl_damage +depends = mcl_init, mcl_core, mcl_particles, mcl_hunger, playerphysics, mcl_playerinfo, mcl_weather, mcl_spawn, mcl_enchanting, mcl_damage, mcl_sprint From 48166625d4ddba283d0ca5dca9c548dfb0595337 Mon Sep 17 00:00:00 2001 From: NO11 Date: Sun, 18 Jul 2021 17:21:53 +0000 Subject: [PATCH 3/6] Add mcl_item_id mod --- mods/HELP/mcl_item_id/init.lua | 35 ++++++++++++++++++++++++++++++++++ mods/HELP/mcl_item_id/mod.conf | 3 +++ 2 files changed, 38 insertions(+) create mode 100644 mods/HELP/mcl_item_id/init.lua create mode 100644 mods/HELP/mcl_item_id/mod.conf diff --git a/mods/HELP/mcl_item_id/init.lua b/mods/HELP/mcl_item_id/init.lua new file mode 100644 index 000000000..1d165d8c6 --- /dev/null +++ b/mods/HELP/mcl_item_id/init.lua @@ -0,0 +1,35 @@ +local game = "mineclone2" + +local same_id = { + heads = { "skeleton", "zombie", "creeper", "wither_skeleton" }, + mobitems = { "rabbit", "chicken" }, + walls = { + "andesite", "brick", "cobble", "diorite", "endbricks", + "granite", "mossycobble", "netherbrick", "prismarine", + "rednetherbrick", "redsandstone", "sandstone", + "stonebrick", "stonebrickmossy", + }, + wool = { + "black", "blue", "brown", "cyan", "green", + "grey", "light_blue", "lime", "magenta", "orange", + "pink", "purple", "red", "silver", "white", "yellow", + }, +} + +tt.register_snippet(function(itemstring) + local def = minetest.registered_items[itemstring] + local desc = def.description + local item_split = itemstring:find(":") + local new_id = game .. itemstring:sub(item_split) + for mod, ids in pairs(same_id) do + for _, id in pairs(ids) do + if itemstring == "mcl_" .. mod .. ":" .. id then + new_id = game .. ":" .. id .. "_" .. mod:gsub("s", "") + end + end + end + minetest.register_alias(new_id, itemstring) + if minetest.settings:get_bool("mcl_item_id_debug", true) then + return new_id, "#555555" + end +end) diff --git a/mods/HELP/mcl_item_id/mod.conf b/mods/HELP/mcl_item_id/mod.conf new file mode 100644 index 000000000..c45e17fd3 --- /dev/null +++ b/mods/HELP/mcl_item_id/mod.conf @@ -0,0 +1,3 @@ +name = mcl_item_id +author = NO11 +depends = tt \ No newline at end of file From f2a4d6bd561a6499ea24875c23046340b8b572e0 Mon Sep 17 00:00:00 2001 From: NO11 Date: Sun, 18 Jul 2021 17:23:12 +0000 Subject: [PATCH 4/6] Add item id setting --- settingtypes.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/settingtypes.txt b/settingtypes.txt index ea1c1a50a..f605019ad 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -153,3 +153,7 @@ fix_doubleplants (Mcimport double plant fixes) bool true # Allow players to create Minecraft-like maps. enable_real_maps (Enable Real Maps) bool true + +[Debugging] +# If enabled, this will show the itemstring of an item in the description. +mcl_item_id_debug (Item ID Debug) bool false \ No newline at end of file From 801d9a25715ee5ac1f7a99fc24b0b78fd4b60814 Mon Sep 17 00:00:00 2001 From: NO11 Date: Sun, 18 Jul 2021 18:01:55 +0000 Subject: [PATCH 5/6] Remove some spaces --- mods/HELP/mcl_item_id/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/HELP/mcl_item_id/init.lua b/mods/HELP/mcl_item_id/init.lua index 1d165d8c6..e715ac9e9 100644 --- a/mods/HELP/mcl_item_id/init.lua +++ b/mods/HELP/mcl_item_id/init.lua @@ -17,7 +17,7 @@ local same_id = { } tt.register_snippet(function(itemstring) - local def = minetest.registered_items[itemstring] + local def = minetest.registered_items[itemstring] local desc = def.description local item_split = itemstring:find(":") local new_id = game .. itemstring:sub(item_split) From 96e8e6a86f00835d2e7d5dc36974ec5cfcf2a919 Mon Sep 17 00:00:00 2001 From: NO11 Date: Mon, 19 Jul 2021 12:21:30 +0000 Subject: [PATCH 6/6] Use mineclone: instead of mineclone2: for item IDs --- mods/HELP/mcl_item_id/init.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mods/HELP/mcl_item_id/init.lua b/mods/HELP/mcl_item_id/init.lua index e715ac9e9..e7772d141 100644 --- a/mods/HELP/mcl_item_id/init.lua +++ b/mods/HELP/mcl_item_id/init.lua @@ -1,4 +1,4 @@ -local game = "mineclone2" +local game = "mineclone" local same_id = { heads = { "skeleton", "zombie", "creeper", "wither_skeleton" }, @@ -30,6 +30,6 @@ tt.register_snippet(function(itemstring) end minetest.register_alias(new_id, itemstring) if minetest.settings:get_bool("mcl_item_id_debug", true) then - return new_id, "#555555" - end + return new_id, "#555555" + end end)