From 75e0a665ce2a45e1158a427d3f70f854f5f4d5a8 Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Fri, 16 Jun 2017 18:12:21 -0400 Subject: Updated several mods for Minetest 0.4.16 castles modpack, areas, biome_lib, blox, boost_cart, plantlife modpack caverealms, coloredwood, concrete, currency, farming redo, home decor, ilights, mesecons, moreores, pipeworks, signs_lib, technic, unified inventory unified bricks, unified dyes, worldedit, and xban2 --- pipeworks/default_settings.lua | 40 +++++++++++ pipeworks/flowing_logic.lua | 2 +- pipeworks/init.lua | 4 +- pipeworks/item_transport.lua | 4 +- pipeworks/luaentity.lua | 2 +- pipeworks/settingtypes.txt | 70 +++++++++++++++++++ pipeworks/signal_tubes.lua | 2 +- .../textures/pipeworks_nodebreaker_front_on.png | Bin 544 -> 588 bytes .../textures/pipeworks_nodebreaker_side1_on.png | Bin 589 -> 481 bytes .../textures/pipeworks_nodebreaker_side2_on.png | Bin 589 -> 475 bytes pipeworks/vacuum_tubes.lua | 74 ++++++++++----------- 11 files changed, 152 insertions(+), 46 deletions(-) create mode 100644 pipeworks/default_settings.lua create mode 100644 pipeworks/settingtypes.txt (limited to 'pipeworks') diff --git a/pipeworks/default_settings.lua b/pipeworks/default_settings.lua new file mode 100644 index 0000000..99b86fe --- /dev/null +++ b/pipeworks/default_settings.lua @@ -0,0 +1,40 @@ +-- Various settings + +local prefix = "pipeworks_" + +local settings = { + enable_pipes = true, + enable_autocrafter = true, + enable_deployer = true, + enable_dispenser = true, + enable_node_breaker = true, + enable_teleport_tube = true, + enable_pipe_devices = true, + enable_redefines = true, + enable_mese_tube = true, + enable_detector_tube = true, + enable_digiline_detector_tube = true, + enable_conductor_tube = true, + enable_accelerator_tube = true, + enable_crossing_tube = true, + enable_sand_tube = true, + enable_mese_sand_tube = true, + enable_one_way_tube = true, + enable_priority_tube = true, + enable_cyclic_mode = true, + drop_on_routing_fail = false, + + delete_item_on_clearobject = true, +} + +for name, value in pairs(settings) do + local setting_type = type(value) + if setting_type == "boolean" then + pipeworks[name] = minetest.settings:get_bool(prefix..name) + if pipeworks[name] == nil then + pipeworks[name] = value + end + else + pipeworks[name] = value + end +end diff --git a/pipeworks/flowing_logic.lua b/pipeworks/flowing_logic.lua index e1c0bf5..632baa6 100644 --- a/pipeworks/flowing_logic.lua +++ b/pipeworks/flowing_logic.lua @@ -4,7 +4,7 @@ -- Contributed by mauvebic, 2013-01-03, rewritten a bit by Vanessa Ezekowitz -- -local finitewater = minetest.setting_getbool("liquid_finite") +local finitewater = minetest.settings:get_bool("liquid_finite") pipeworks.check_for_liquids = function(pos) local coords = { diff --git a/pipeworks/init.lua b/pipeworks/init.lua index ab5cf3c..a3f31c7 100644 --- a/pipeworks/init.lua +++ b/pipeworks/init.lua @@ -13,7 +13,7 @@ local DEBUG = false pipeworks.worldpath = minetest.get_worldpath() pipeworks.modpath = minetest.get_modpath("pipeworks") -dofile(pipeworks.modpath.."/default_settings.txt") +dofile(pipeworks.modpath.."/default_settings.lua") -- Read the external config file if it exists. local worldsettingspath = pipeworks.worldpath.."/pipeworks_settings.txt" @@ -26,7 +26,7 @@ end -- Random variables pipeworks.expect_infinite_stacks = true -if minetest.get_modpath("unified_inventory") or not minetest.setting_getbool("creative_mode") then +if minetest.get_modpath("unified_inventory") or not minetest.settings:get_bool("creative_mode") then pipeworks.expect_infinite_stacks = false end diff --git a/pipeworks/item_transport.lua b/pipeworks/item_transport.lua index 43adeea..b2d2aa2 100644 --- a/pipeworks/item_transport.lua +++ b/pipeworks/item_transport.lua @@ -1,6 +1,6 @@ local luaentity = pipeworks.luaentity -local enable_max_limit = minetest.setting_get("pipeworks_enable_items_per_tube_limit") -local max_tube_limit = tonumber(minetest.setting_get("pipeworks_max_items_per_tube")) or 30 +local enable_max_limit = minetest.settings:get("pipeworks_enable_items_per_tube_limit") +local max_tube_limit = tonumber(minetest.settings:get("pipeworks_max_items_per_tube")) or 30 if enable_max_limit == nil then enable_max_limit = true end function pipeworks.tube_item(pos, item) diff --git a/pipeworks/luaentity.lua b/pipeworks/luaentity.lua index ab7280c..382b0c1 100644 --- a/pipeworks/luaentity.lua +++ b/pipeworks/luaentity.lua @@ -71,7 +71,7 @@ end local active_blocks = {} -- These only contain active blocks near players (i.e., not forceloaded ones) local move_entities_globalstep_part1 = function(dtime) - local active_block_range = tonumber(minetest.setting_get("active_block_range")) or 2 + local active_block_range = tonumber(minetest.settings:get("active_block_range")) or 2 local new_active_blocks = {} for _, player in ipairs(minetest.get_connected_players()) do local blockpos = get_blockpos(player:getpos()) diff --git a/pipeworks/settingtypes.txt b/pipeworks/settingtypes.txt new file mode 100644 index 0000000..1d3c10c --- /dev/null +++ b/pipeworks/settingtypes.txt @@ -0,0 +1,70 @@ +#Enable pipes. +pipeworks_enable_pipes (Enable Pipes) bool true + +#Enable autocrafter. +pipeworks_enable_autocrafter (Enable Autocrafter) bool true + +#Enable deployer. +pipeworks_enable_deployer (Enable Deployer) bool true + +#Enable dispenser. +pipeworks_enable_dispenser (Enable Dispenser) bool true + +#Enable node breaker. +pipeworks_enable_node_breaker (Enable Node Breaker) bool true + +#Enable teleport tube. +pipeworks_enable_teleport_tube (Enable Teleport Tube) bool true + +#Enable pipe devices. +pipeworks_enable_pipe_devices (Enable Pipe Devices) bool true + +#Enable redefines. +pipeworks_enable_redefines (Enable Node Redefines) bool true + +#Enable sorting tube. +pipeworks_enable_mese_tube (Enable Sorting Tube) bool true + +#Enable detector tube. +pipeworks_enable_detector_tube (Enable Detector Tube) bool true + +#Enable digiline detector tube. +pipeworks_enable_digiline_detector_tube (Enable Digiline Detector Tube) bool true + +#Enable mesecon signal conducting tube. +pipeworks_enable_conductor_tube (Enable Conductor Tube) bool true + +#Enable accelerator tube. +pipeworks_enable_accelerator_tube (Enable Accelerator Tube) bool true + +#Enable crossing tube. +#It sends all incoming items to the other side, or if there is no other tube, it sends them back. +pipeworks_enable_crossing_tube (Enable Crossing Tube) bool true + +#Enable vacuum tube. +#It picks up all items that lay around next to it. +pipeworks_enable_sand_tube (Enable Vacuum Tube) bool true + +#Enable mese vacuum tube. +#It's like the normal vacuum tube with the +#differance that you can set the radius up to 8 nodes. +pipeworks_enable_mese_sand_tube (Enable Mese Vacuum Tube) bool true + +#Enable one way tube. +#It sends items only in one direction. +#Use it to drop items out of tubes. +pipeworks_enable_one_way_tube (Enable One Way Tube) bool true + +#Enable high priority tube. +#It has a very high priority and so, on crossings, the items will +#always go to it if there are multible ways. +pipeworks_enable_priority_tube (Enable High Priority Tube) bool true + +#Enable cyclic mode. +pipeworks_enable_cyclic_mode (Enable Cyclic Mode) bool true + +#Drop on routing fail. +pipeworks_drop_on_routing_fail (Drop On Routing Fail) bool false + +#Delete item on clearobject. +pipeworks_delete_item_on_clearobject (Delete Item On Clearobject) bool true \ No newline at end of file diff --git a/pipeworks/signal_tubes.lua b/pipeworks/signal_tubes.lua index 3b2653c..a0a8039 100644 --- a/pipeworks/signal_tubes.lua +++ b/pipeworks/signal_tubes.lua @@ -1,5 +1,5 @@ if pipeworks.enable_detector_tube then - local detector_tube_step = 5 * tonumber(minetest.setting_get("dedicated_server_step")) + local detector_tube_step = 5 * tonumber(minetest.settings:get("dedicated_server_step")) pipeworks.register_tube("pipeworks:detector_tube_on", { description = "Detecting Pneumatic Tube Segment on (you hacker you)", inventory_image = "pipeworks_detector_tube_inv.png", diff --git a/pipeworks/textures/pipeworks_nodebreaker_front_on.png b/pipeworks/textures/pipeworks_nodebreaker_front_on.png index bf7fe70..2b3a4a3 100644 Binary files a/pipeworks/textures/pipeworks_nodebreaker_front_on.png and b/pipeworks/textures/pipeworks_nodebreaker_front_on.png differ diff --git a/pipeworks/textures/pipeworks_nodebreaker_side1_on.png b/pipeworks/textures/pipeworks_nodebreaker_side1_on.png index ff0a893..96480ef 100644 Binary files a/pipeworks/textures/pipeworks_nodebreaker_side1_on.png and b/pipeworks/textures/pipeworks_nodebreaker_side1_on.png differ diff --git a/pipeworks/textures/pipeworks_nodebreaker_side2_on.png b/pipeworks/textures/pipeworks_nodebreaker_side2_on.png index ed0e12e..4c8fc40 100644 Binary files a/pipeworks/textures/pipeworks_nodebreaker_side2_on.png and b/pipeworks/textures/pipeworks_nodebreaker_side2_on.png differ diff --git a/pipeworks/vacuum_tubes.lua b/pipeworks/vacuum_tubes.lua index 51f6f81..211c3ee 100644 --- a/pipeworks/vacuum_tubes.lua +++ b/pipeworks/vacuum_tubes.lua @@ -1,27 +1,27 @@ if pipeworks.enable_sand_tube then pipeworks.register_tube("pipeworks:sand_tube", { - description = "Vacuuming Pneumatic Tube Segment", - inventory_image = "pipeworks_sand_tube_inv.png", - short = "pipeworks_sand_tube_short.png", - noctr = { "pipeworks_sand_tube_noctr.png" }, - plain = { "pipeworks_sand_tube_plain.png" }, - ends = { "pipeworks_sand_tube_end.png" }, - node_def = { groups = {vacuum_tube = 1}}, + description = "Vacuuming Pneumatic Tube Segment", + inventory_image = "pipeworks_sand_tube_inv.png", + short = "pipeworks_sand_tube_short.png", + noctr = {"pipeworks_sand_tube_noctr.png"}, + plain = {"pipeworks_sand_tube_plain.png"}, + ends = {"pipeworks_sand_tube_end.png"}, + node_def = {groups = {vacuum_tube = 1}}, }) minetest.register_craft( { output = "pipeworks:sand_tube_1 2", recipe = { - { "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" }, - { "group:sand", "group:sand", "group:sand" }, - { "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" } + {"homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting"}, + {"group:sand", "group:sand", "group:sand"}, + {"homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting"} }, }) minetest.register_craft( { output = "pipeworks:sand_tube_1", recipe = { - { "group:sand", "pipeworks:tube_1", "group:sand" }, + {"group:sand", "pipeworks:tube_1", "group:sand"}, }, }) end @@ -31,9 +31,9 @@ if pipeworks.enable_mese_sand_tube then description = "Adjustable Vacuuming Pneumatic Tube Segment", inventory_image = "pipeworks_mese_sand_tube_inv.png", short = "pipeworks_mese_sand_tube_short.png", - noctr = { "pipeworks_mese_sand_tube_noctr.png" }, - plain = { "pipeworks_mese_sand_tube_plain.png" }, - ends = { "pipeworks_mese_sand_tube_end.png" }, + noctr = {"pipeworks_mese_sand_tube_noctr.png"}, + plain = {"pipeworks_mese_sand_tube_plain.png"}, + ends = {"pipeworks_mese_sand_tube_end.png"}, node_def = { groups = {vacuum_tube = 1}, on_construct = function(pos) @@ -63,9 +63,9 @@ if pipeworks.enable_mese_sand_tube then minetest.register_craft( { output = "pipeworks:mese_sand_tube_1 2", recipe = { - { "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" }, - { "group:sand", "default:mese_crystal", "group:sand" }, - { "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" } + {"homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" }, + {"group:sand", "default:mese_crystal", "group:sand" }, + {"homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" } }, }) @@ -82,23 +82,19 @@ if pipeworks.enable_mese_sand_tube then }) end -local sqrt_3 = math.sqrt(3) -local tube_inject_item = pipeworks.tube_inject_item -local get_objects_inside_radius = minetest.get_objects_inside_radius local function vacuum(pos, radius) radius = radius + 0.5 - for _, object in pairs(get_objects_inside_radius(pos, sqrt_3 * radius)) do + for _, object in pairs(minetest.get_objects_inside_radius(pos, math.sqrt(3) * radius)) do local lua_entity = object:get_luaentity() if not object:is_player() and lua_entity and lua_entity.name == "__builtin:item" then local obj_pos = object:getpos() - local x1, y1, z1 = pos.x, pos.y, pos.z - local x2, y2, z2 = obj_pos.x, obj_pos.y, obj_pos.z - - if x1 - radius <= x2 and x2 <= x1 + radius - and y1 - radius <= y2 and y2 <= y1 + radius - and z1 - radius <= z2 and z2 <= z1 + radius then + local minpos = vector.subtract(pos, radius) + local maxpos = vector.add(pos, radius) + if obj_pos.x >= minpos.x and obj_pos.x <= maxpos.x + and obj_pos.y >= minpos.y and obj_pos.y <= maxpos.y + and obj_pos.z >= minpos.z and obj_pos.z <= maxpos.z then if lua_entity.itemstring ~= "" then - tube_inject_item(pos, pos, vector.new(0, 0, 0), lua_entity.itemstring) + pipeworks.tube_inject_item(pos, pos, vector.new(0, 0, 0), lua_entity.itemstring) lua_entity.itemstring = "" end object:remove() @@ -108,15 +104,15 @@ local function vacuum(pos, radius) end minetest.register_abm({nodenames = {"group:vacuum_tube"}, - interval = 1, - chance = 1, - label = "Vacuum tubes", - action = function(pos, node, active_object_count, active_object_count_wider) - if node.name:find("pipeworks:sand_tube") then - vacuum(pos, 2) - else - local radius = minetest.get_meta(pos):get_int("dist") - vacuum(pos, radius) - end - end + interval = 1, + chance = 1, + label = "Vacuum tubes", + action = function(pos, node, active_object_count, active_object_count_wider) + if node.name:find("pipeworks:sand_tube") then + vacuum(pos, 2) + else + local radius = minetest.get_meta(pos):get_int("dist") + vacuum(pos, radius) + end + end }) -- cgit v1.2.3