diff --git a/README.md b/README.md index 2a85528..b75c184 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,31 @@ ta4_jetpack requires the modpack 3d_armor. 3d_armor is itself a modpack and can' ### History +#### 2023-11-05 + +Updated Mods: + +- techage v1.18: + - see readme.md +- ta4_jetpack: + - Fix translation issue +- minecart: + - Fix bug with missing techage mod +- signs_bot: + - Fix bug #36 (pattern/copy 5x3 is off center) + - Adapt bot box for techage assembly tool + - Escape equal sign in german translation (Niklp09) +- autobahn: + - Add support for player_monoids (Niklp09) +- compost: + - User proper player creative check (Niklp09) + - Fix drop bug +- techpack_stairway: + - Add stairways without handrails +- networks: + - Add support for colored nodes by unifieddyes + - Improve debugging tool + #### 2023-08-25 **The mod doclib is a new hard dependency !** diff --git a/autobahn/init.lua b/autobahn/init.lua index ae06c6d..1ee5e62 100644 --- a/autobahn/init.lua +++ b/autobahn/init.lua @@ -14,6 +14,7 @@ ]]-- local S = minetest.get_translator("autobahn") +local mod_player_monoids = minetest.get_modpath("player_monoids") autobahn = {} @@ -39,42 +40,46 @@ local function is_active(player) end local function set_player_privs(player) - local physics = player:get_physics_override() local meta = player:get_meta() -- Check access conflicts with other mods if meta:get_int("player_physics_locked") == 0 then meta:set_int("player_physics_locked", 1) - if meta and physics then + if mod_player_monoids then + player_monoids.speed:add_change(player, 3.5, "autobahn:speed") + else + local physics = player:get_physics_override() -- store the player privs default values meta:set_float("autobahn_speed", physics.speed) - -- set operator privs - meta:set_int("autobahn_isactive", 1) physics.speed = 3.5 - minetest.sound_play("autobahn_motor", { - pos = player:get_pos(), - gain = 0.5, - max_hear_distance = 5, - }) -- write back player:set_physics_override(physics) end + -- set operator privs + meta:set_int("autobahn_isactive", 1) + minetest.sound_play("autobahn_motor", { + pos = player:get_pos(), + gain = 0.5, + max_hear_distance = 5, + }) end end local function reset_player_privs(player) - local physics = player:get_physics_override() local meta = player:get_meta() - if meta and physics then - -- restore the player privs default values - meta:set_int("autobahn_isactive", 0) + -- restore the player privs default values + meta:set_int("autobahn_isactive", 0) + if mod_player_monoids then + player_monoids.speed:del_change(player, "autobahn:speed") + else + local physics = player:get_physics_override() physics.speed = meta:get_float("autobahn_speed") if physics.speed == 0 then physics.speed = 1 end -- delete stored default values meta:set_string("autobahn_speed", "") -- write back player:set_physics_override(physics) - meta:set_int("player_physics_locked", 0) end + meta:set_int("player_physics_locked", 0) end minetest.register_on_joinplayer(function(player) diff --git a/autobahn/mod.conf b/autobahn/mod.conf index c6be032..e862427 100644 --- a/autobahn/mod.conf +++ b/autobahn/mod.conf @@ -2,4 +2,4 @@ name=autobahn title=Autobahn description=Street mod for faster travelling. depends=default -optional_depends=moreblocks, techage, minecart \ No newline at end of file +optional_depends=moreblocks, techage, minecart, player_monoids diff --git a/compost/init.lua b/compost/init.lua index d5ed50e..9921739 100644 --- a/compost/init.lua +++ b/compost/init.lua @@ -77,7 +77,7 @@ end) local function next_state(pos, elapsed) local node = minetest.get_node(pos) - + if node.name == "compost:wood_barrel_1" then minetest.swap_node(pos, {name = "compost:wood_barrel_2"}) elseif node.name == "compost:wood_barrel_2" then @@ -102,13 +102,13 @@ end local function add_item(pos, stack) local meta = minetest.get_meta(pos) local num = meta:get_int("num") or 0 - + if num < NUM_LEAVES then -- add futher leaves meta:set_int("num", num + stack:get_count()) stack:set_count(0) end - + start_composter(pos) return stack end @@ -121,7 +121,6 @@ local function minecart_hopper_additem(pos, stack) end local function minecart_hopper_takeitem(pos, num) - local node = minetest.get_node(pos) minetest.swap_node(pos, {name = "compost:wood_barrel"}) start_composter(pos) return ItemStack("compost:compost") @@ -152,7 +151,7 @@ minetest.register_node("compost:wood_barrel", { if compost.can_compost(wielded_item) then minetest.swap_node(pos, {name = "compost:wood_barrel_1"}) local w = puncher:get_wielded_item() - if not(minetest.setting_getbool("creative_mode")) then + if not minetest.is_creative_enabled(puncher:get_player_name()) then w:take_item(1) puncher:set_wielded_item(w) end @@ -180,6 +179,7 @@ minetest.register_node("compost:wood_barrel_1", { paramtype = "light", is_ground_content = false, groups = {choppy = 3, not_in_creative_inventory=1}, + drop = "compost:wood_barrel", sounds = default.node_sound_wood_defaults(), on_timer = next_state, minecart_hopper_untakeitem = minecart_hopper_untakeitem, @@ -201,6 +201,7 @@ minetest.register_node("compost:wood_barrel_2", { paramtype = "light", is_ground_content = false, groups = {choppy = 3, not_in_creative_inventory=1}, + drop = "compost:wood_barrel", sounds = default.node_sound_wood_defaults(), on_timer = next_state, minecart_hopper_untakeitem = minecart_hopper_untakeitem, @@ -222,6 +223,7 @@ minetest.register_node("compost:wood_barrel_3", { paramtype = "light", is_ground_content = false, groups = {choppy = 3, not_in_creative_inventory=1}, + drop = "compost:wood_barrel", sounds = default.node_sound_wood_defaults(), on_punch = function(pos, node, player, pointed_thing) local p = {x = pos.x + math.random(0, 5)/5 - 0.5, y = pos.y+1, z = pos.z + math.random(0, 5)/5 - 0.5} @@ -273,7 +275,7 @@ minetest.register_craft({ if minetest.global_exists("techage") then techage.register_node( { - "compost:wood_barrel", + "compost:wood_barrel", "compost:wood_barrel_1", "compost:wood_barrel_2", "compost:wood_barrel_3", @@ -300,6 +302,6 @@ if minetest.global_exists("techage") then minetest.swap_node(pos, {name = "compost:wood_barrel_2"}) return true end, - }) + }) end diff --git a/minecart/manual.lua b/minecart/manual.lua index c18593c..5aef19d 100644 --- a/minecart/manual.lua +++ b/minecart/manual.lua @@ -14,6 +14,113 @@ local MP = minetest.get_modpath("minecart") +if not minetest.global_exists("techage") and + minetest.global_exists("doclib") then + + minetest.register_node("minecart:manual", { + description = "Minecart Manual (EN)", + inventory_image = "minecart_book_inv.png", + tiles = { + -- up, down, right, left, back, front + "minecart_book.png", + "minecart_book.png", + "minecart_book.png^[transformR270", + "minecart_book.png^[transformR90", + "minecart_book.png^[transformR180", + "minecart_book.png" + }, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + { -8/32, -16/32, -12/32, 8/32, -12/32, 12/32}, + }, + }, + + after_place_node = function(pos, placer, itemstack) + minetest.get_meta(pos):set_string("infotext", "Minecart Manual (EN)") + minetest.get_meta(pos):set_string("formspec", doclib.formspec(pos, "minecart", "EN")) + end, + + on_receive_fields = function(pos, formname, fields, player) + local player_name = player:get_player_name() + if minetest.is_protected(pos, player_name) then + return + end + minetest.get_meta(pos):set_string("formspec", doclib.formspec(pos, "minecart", "EN", fields)) + end, + + paramtype = "light", + sunlight_propagates = true, + paramtype2 = "facedir", + use_texture_alpha = "clip", + is_ground_content = false, + groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, + }) + + minetest.register_node("minecart:handbuch", { + description = "Minecart Handbuch (DE)", + inventory_image = "minecart_book_inv.png", + tiles = { + -- up, down, right, left, back, front + "minecart_book.png", + "minecart_book.png", + "minecart_book.png^[transformR270", + "minecart_book.png^[transformR90", + "minecart_book.png^[transformR180", + "minecart_book.png" + }, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + { -8/32, -16/32, -12/32, 8/32, -12/32, 12/32}, + }, + }, + + after_place_node = function(pos, placer, itemstack) + minetest.get_meta(pos):set_string("infotext", "Minecart Handbuch (DE)") + minetest.get_meta(pos):set_string("formspec", doclib.formspec(pos, "minecart", "DE")) + end, + + on_receive_fields = function(pos, formname, fields, player) + local player_name = player:get_player_name() + if minetest.is_protected(pos, player_name) then + return + end + minetest.get_meta(pos):set_string("formspec", doclib.formspec(pos, "minecart", "DE", fields)) + end, + + paramtype = "light", + sunlight_propagates = true, + paramtype2 = "facedir", + use_texture_alpha = "clip", + is_ground_content = false, + groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, + }) + + minetest.register_craft({ + output = "minecart:manual", + recipe = { + {"dye:red", "default:paper", "default:paper"}, + {"dye:black", "default:paper", "default:paper"}, + {"dye:red", "default:paper", "default:paper"}, + }, + }) + + minetest.register_craft({ + type = "shapeless", + output = "minecart:handbuch", + recipe = {"minecart:manual"}, + }) + + minetest.register_craft({ + type = "shapeless", + output = "minecart:manual", + recipe = {"minecart:handbuch"}, + }) +end + minetest.register_on_mods_loaded(function() if minetest.global_exists("techage") then @@ -38,108 +145,5 @@ minetest.register_on_mods_loaded(function() local content = dofile(MP.."/manual_DE.lua") doclib.add_to_manual("minecart", "DE", content) - minetest.register_node("minecart:manual", { - description = "Minecart Manual (EN)", - inventory_image = "minecart_book_inv.png", - tiles = { - -- up, down, right, left, back, front - "minecart_book.png", - "minecart_book.png", - "minecart_book.png^[transformR270", - "minecart_book.png^[transformR90", - "minecart_book.png^[transformR180", - "minecart_book.png" - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - { -8/32, -16/32, -12/32, 8/32, -12/32, 12/32}, - }, - }, - - after_place_node = function(pos, placer, itemstack) - minetest.get_meta(pos):set_string("infotext", "Minecart Manual (EN)") - minetest.get_meta(pos):set_string("formspec", doclib.formspec(pos, "minecart", "EN")) - end, - - on_receive_fields = function(pos, formname, fields, player) - local player_name = player:get_player_name() - if minetest.is_protected(pos, player_name) then - return - end - minetest.get_meta(pos):set_string("formspec", doclib.formspec(pos, "minecart", "EN", fields)) - end, - - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "facedir", - use_texture_alpha = "clip", - is_ground_content = false, - groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, - }) - - minetest.register_node("minecart:handbuch", { - description = "Minecart Handbuch (DE)", - inventory_image = "minecart_book_inv.png", - tiles = { - -- up, down, right, left, back, front - "minecart_book.png", - "minecart_book.png", - "minecart_book.png^[transformR270", - "minecart_book.png^[transformR90", - "minecart_book.png^[transformR180", - "minecart_book.png" - }, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - { -8/32, -16/32, -12/32, 8/32, -12/32, 12/32}, - }, - }, - - after_place_node = function(pos, placer, itemstack) - minetest.get_meta(pos):set_string("infotext", "Minecart Handbuch (DE)") - minetest.get_meta(pos):set_string("formspec", doclib.formspec(pos, "minecart", "DE")) - end, - - on_receive_fields = function(pos, formname, fields, player) - local player_name = player:get_player_name() - if minetest.is_protected(pos, player_name) then - return - end - minetest.get_meta(pos):set_string("formspec", doclib.formspec(pos, "minecart", "DE", fields)) - end, - - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "facedir", - use_texture_alpha = "clip", - is_ground_content = false, - groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, - }) - - minetest.register_craft({ - output = "minecart:manual", - recipe = { - {"dye:red", "default:paper", "default:paper"}, - {"dye:black", "default:paper", "default:paper"}, - {"dye:red", "default:paper", "default:paper"}, - }, - }) - - minetest.register_craft({ - type = "shapeless", - output = "minecart:handbuch", - recipe = {"minecart:manual"}, - }) - - minetest.register_craft({ - type = "shapeless", - output = "minecart:manual", - recipe = {"minecart:handbuch"}, - }) - end end) \ No newline at end of file diff --git a/networks/README.md b/networks/README.md index bb1d495..a5fa540 100644 --- a/networks/README.md +++ b/networks/README.md @@ -36,7 +36,7 @@ The mod uses a whitelist for filling material. The function Liquid networks consists of following node types: - Pumps, nodes pumping liquids from/to tanks -- Tanks, storuing liquids +- Tanks, storing liquids - Junctions, to connect pipes to networks - Valves, to turn on/off pipe segments diff --git a/networks/hidden.lua b/networks/hidden.lua index c3d55c3..c7780b2 100644 --- a/networks/hidden.lua +++ b/networks/hidden.lua @@ -103,6 +103,8 @@ function networks.hide_node(pos, node, placer) local ndef = minetest.registered_nodes[taken:get_name()] if ndef.paramtype2 and ndef.paramtype2 == "facedir" then param2 = minetest.dir_to_facedir(placer:get_look_dir(), true) + elseif ndef.paramtype2 and ndef.paramtype2 == "color" then + param2 = taken:get_meta():get_int("palette_index") end minetest.swap_node(pos, {name = taken:get_name(), param2 = param2}) inv:set_stack("main", 1, stack) @@ -121,8 +123,13 @@ function networks.open_node(pos, node, placer) minetest.swap_node(pos, {name = name, param2 = param2 % 32 + M(pos):get_int("netw_color_param2")}) local meta = M(pos) meta:set_string("netw_name", "") + local stack = ItemStack(node.name) local inv = placer:get_inventory() - inv:add_item("main", ItemStack(node.name)) + local ndef = minetest.registered_nodes[node.name] + if ndef and ndef.paramtype2 == "color" then + stack:get_meta():set_int("palette_index", node.param2) + end + inv:add_item("main", stack) return true end diff --git a/networks/test/test_tool.lua b/networks/test/test_tool.lua index 5a4a862..d8e694f 100644 --- a/networks/test/test_tool.lua +++ b/networks/test/test_tool.lua @@ -81,6 +81,11 @@ local function print_liquid_network_data(pos, api, netw_type, outdir) end end +local function is_junction(pos, tlib2) + local ndef = networks.net_def(pos, tlib2.tube_type) + return ndef.ntype == "junc" +end + local function print_netID(pos, api, netw_type) local tlib2 = networks.registered_networks[api][netw_type] for _,outdir in ipairs(networks.get_outdirs(pos, tlib2)) do @@ -93,6 +98,12 @@ local function print_netID(pos, api, netw_type) elseif api == "power" then print_power_network_data(pos, api, netw_type, outdir) end + elseif is_junction(pos, tlib2) then + netID = networks.get_netID(pos, 0) + if netID then + print("- " .. s .. ": Junction netwNum: " .. networks.netw_num(netID)) + break + end else print("- " .. s .. ": Node has no '" .. netw_type .. "' netID!!!") end @@ -160,7 +171,7 @@ local function debug_print(pos) print("#####################") end -local function action(itemstack, placer, pointed_thing) +local function on_use(itemstack, placer, pointed_thing) if pointed_thing.type == "node" then local pos = pointed_thing.under networks.register_observe_pos(pos) @@ -174,14 +185,28 @@ local function action(itemstack, placer, pointed_thing) end end +local function on_place(itemstack, placer, pointed_thing) + if pointed_thing.type == "node" then + local pos = pointed_thing.under + networks.register_observe_pos(nil) + if placer:get_player_control().sneak then + debug_print(pos) + else + debug_print(pos) + end + else + networks.register_observe_pos(nil) + end +end + minetest.register_tool("networks:tool2", { description = "Debugging Tool", inventory_image = "networks_tool.png", wield_image = "networks_tool.png", use_texture_alpha = "clip", groups = {cracky=1}, - on_use = action, - on_place = action, + on_use = on_use, + on_place = on_place, node_placement_prediction = "", stack_max = 1, }) diff --git a/signs_bot/lib.lua b/signs_bot/lib.lua index 2ff63e8..894ac2a 100644 --- a/signs_bot/lib.lua +++ b/signs_bot/lib.lua @@ -260,7 +260,7 @@ end local function start_pos(robot_pos, robot_param2, x_size, lvl_offs) local pos = next_pos(robot_pos, robot_param2) pos = {x=pos.x, y=pos.y+lvl_offs, z=pos.z} - if x_size == 5 then + if tonumber(x_size) == 5 then return dest_pos(pos, robot_param2, {3,3}) else return dest_pos(pos, robot_param2, {3}) diff --git a/signs_bot/locale/signs_bot.de.tr b/signs_bot/locale/signs_bot.de.tr index 83c898a..b86b446 100644 --- a/signs_bot/locale/signs_bot.de.tr +++ b/signs_bot/locale/signs_bot.de.tr @@ -105,7 +105,7 @@ Used to cut flowers on a 3x3 field.=Benötigt um ein 3x3 Blumenfeld zu ernten. ### cmd_item.lua ### -Take items from a chest like node@nand put it into the item inventory.@n is the bot inventory slot@n(1..8) or 0 for any one=Nehme Gegenstände aus der@nKiste oder dem Kisten-ähnlichen Block@nund tue diese in das eigene Inventar@nan der Position . Slot = (1..8)@noder 0 für irgend eine Position +Take items from a chest like node@nand put it into the item inventory.@n is the bot inventory slot@n(1..8) or 0 for any one=Nehme Gegenstände aus der@nKiste oder dem Kisten-ähnlichen Block@nund tue diese in das eigene Inventar@nan der Position . Slot @= (1..8)@noder 0 für irgend eine Position Check if there are @nitems in the chest like node.@nIf not, jump to