Merge branch 'minetest-mods:master' into master

This commit is contained in:
Niklp 2022-02-27 17:22:00 +01:00 committed by GitHub
commit 0ccefb9623
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
32 changed files with 76 additions and 45 deletions

View File

@ -12,9 +12,9 @@ MESECONS by Jeija and contributors
Mezzee-what? Mezzee-what?
------------ ------------
[Mesecons](http://mesecons.net/)! They're yellow, they're conductive, and they'll add a whole new dimension to Minetest's gameplay. [Mesecons](https://mesecons.net/)! They're yellow, they're conductive, and they'll add a whole new dimension to Minetest's gameplay.
Mesecons is a mod for [Minetest](http://minetest.net/) that implements a ton of items related to digital circuitry, such as wires, buttons, lights, and even programmable controllers. Among other things, there are also pistons, solar panels, pressure plates, and note blocks. Mesecons is a mod for [Minetest](https://www.minetest.net/) that implements a ton of items related to digital circuitry, such as wires, buttons, lights, and even programmable controllers. Among other things, there are also pistons, solar panels, pressure plates, and note blocks.
Mesecons has a similar goal to Redstone in Minecraft, but works in its own way, with different rules and mechanics. Mesecons has a similar goal to Redstone in Minecraft, but works in its own way, with different rules and mechanics.
@ -74,8 +74,10 @@ There are also a whole bunch of other people helping with everything from code t
Alright, how can I use it? Alright, how can I use it?
-------------------------- --------------------------
All textures in this project are licensed under the CC-BY-SA 3.0 (Creative Commons Attribution-ShareAlike 3.0 Generic). That means you can distribute and remix them as much as you want to, under the condition that you give credit to the authors and the project, and that if you remix and release them, they must be under the same or similar license to this one. All textures in this project are licensed under the CC-BY-SA 3.0 (Creative Commons Attribution-ShareAlike 3.0 Generic).
That means you can distribute and remix them as much as you want to, under the condition that you give credit to the authors and the project, and that if you remix and release them, they must be under the same or similar license to this one.
All code in this project is licensed under the LGPL version 3 or later. That means you have unlimited freedom to distribute and modify the work however you see fit, provided that if you decide to distribute it or any modified versions of it, you must also use the same license. The LGPL also grants the additional freedom to write extensions for the software and distribute them without the extensions being subject to the terms of the LGPL, although the software itself retains its license. All code in this project is licensed under the LGPL version 3.
That means you have unlimited freedom to distribute and modify the work however you see fit, provided that if you decide to distribute it or any modified versions of it, you must also use the same license. The LGPL also grants the additional freedom to write extensions for the software and distribute them without the extensions being subject to the terms of the LGPL, although the software itself retains its license.
No warranty is provided, express or implied, for any part of the project. No warranty is provided, express or implied, for any part of the project.

View File

@ -1,9 +1,9 @@
{ {
"name": "mesecons", "name": "mesecons",
"description": "Mesecons is a mod for Minetest that implements items related to digital circuitry: wires, buttons, lights, and programmable controllers.", "description": "Mesecons is a mod for Minetest that implements items related to digital circuitry: wires, buttons, lights, and programmable controllers.",
"homepage": "http://mesecons.net", "homepage": "https://mesecons.net",
"authors": "Jeija", "authors": ["Jeija"],
"license": "LGPL-3.0+", "license": "LGPL-3.0",
"keywords": [ "keywords": [
"mesecons", "mesecons",
"minetest", "minetest",

View File

@ -1,2 +1,4 @@
name = mesecons name = mesecons
depends = default # default is an optional dependency as some mods may expect it as a transitory
# dependency when they depend on mesecons.
optional_depends = default

View File

@ -326,6 +326,9 @@ end
-- Nil if no VM-based transaction is in progress. -- Nil if no VM-based transaction is in progress.
local vm_cache = nil local vm_cache = nil
-- Whether the current transaction will need a light update afterward.
local vm_update_light = false
-- Starts a VoxelManipulator-based transaction. -- Starts a VoxelManipulator-based transaction.
-- --
-- During a VM transaction, calls to vm_get_node and vm_swap_node operate on a -- During a VM transaction, calls to vm_get_node and vm_swap_node operate on a
@ -334,6 +337,7 @@ local vm_cache = nil
-- vm_abort. -- vm_abort.
function mesecon.vm_begin() function mesecon.vm_begin()
vm_cache = {} vm_cache = {}
vm_update_light = false
end end
-- Finishes a VoxelManipulator-based transaction, freeing the VMs and map data -- Finishes a VoxelManipulator-based transaction, freeing the VMs and map data
@ -343,7 +347,7 @@ function mesecon.vm_commit()
if tbl.dirty then if tbl.dirty then
local vm = tbl.vm local vm = tbl.vm
vm:set_data(tbl.data) vm:set_data(tbl.data)
vm:write_to_map(tbl.update_light) vm:write_to_map(vm_update_light)
vm:update_map() vm:update_map()
end end
end end
@ -364,7 +368,7 @@ local function vm_get_or_create_entry(pos)
local vm = minetest.get_voxel_manip(pos, pos) local vm = minetest.get_voxel_manip(pos, pos)
local min_pos, max_pos = vm:get_emerged_area() local min_pos, max_pos = vm:get_emerged_area()
local va = VoxelArea:new{MinEdge = min_pos, MaxEdge = max_pos} local va = VoxelArea:new{MinEdge = min_pos, MaxEdge = max_pos}
tbl = {vm = vm, va = va, data = vm:get_data(), param1 = vm:get_light_data(), param2 = vm:get_param2_data(), dirty = false, update_light = false} tbl = {vm = vm, va = va, data = vm:get_data(), param1 = vm:get_light_data(), param2 = vm:get_param2_data(), dirty = false}
vm_cache[hash] = tbl vm_cache[hash] = tbl
end end
return tbl return tbl
@ -391,8 +395,11 @@ end
-- --
-- The swap will necessitate a light update unless update_light equals false. -- The swap will necessitate a light update unless update_light equals false.
function mesecon.vm_swap_node(pos, name, update_light) function mesecon.vm_swap_node(pos, name, update_light)
-- If one node needs a light update, all VMs should use light updates to
-- prevent newly calculated light from being overwritten by other VMs.
vm_update_light = vm_update_light or update_light ~= false
local tbl = vm_get_or_create_entry(pos) local tbl = vm_get_or_create_entry(pos)
tbl.update_light = update_light ~= false or tbl.update_light
local index = tbl.va:indexp(pos) local index = tbl.va:indexp(pos)
tbl.data[index] = minetest.get_content_id(name) tbl.data[index] = minetest.get_content_id(name)
tbl.dirty = true tbl.dirty = true

View File

@ -1,2 +1,2 @@
name = mesecons_blinkyplant name = mesecons_blinkyplant
depends = mesecons depends = default, mesecons

View File

@ -1,2 +1,2 @@
name = mesecons_button name = mesecons_button
depends = mesecons, mesecons_receiver depends = default, mesecons, mesecons_receiver

View File

@ -1,2 +1,2 @@
name = mesecons_commandblock name = mesecons_commandblock
depends = mesecons depends = default, mesecons

View File

@ -1,2 +1,2 @@
name = mesecons_delayer name = mesecons_delayer
depends = mesecons depends = default, mesecons

View File

@ -1,2 +1,2 @@
name = mesecons_detector name = mesecons_detector
depends = mesecons, mesecons_materials depends = default, mesecons, mesecons_materials

View File

@ -1,3 +1,3 @@
name = mesecons_fpga name = mesecons_fpga
depends = mesecons depends = default, mesecons
optional_depends = screwdriver optional_depends = screwdriver

View File

@ -1,2 +1,2 @@
name = mesecons_gates name = mesecons_gates
depends = mesecons, mesecons_microcontroller, mesecons_delayer, mesecons_torch, mesecons_materials depends = default, mesecons, mesecons_microcontroller, mesecons_delayer, mesecons_torch, mesecons_materials

View File

@ -1,2 +1,2 @@
name = mesecons_hydroturbine name = mesecons_hydroturbine
depends = mesecons depends = default, mesecons

View File

@ -1,3 +1,3 @@
name = mesecons_insulated name = mesecons_insulated
depends = mesecons depends = default, mesecons
optional_depends = screwdriver optional_depends = screwdriver

View File

@ -1,2 +1,2 @@
name = mesecons_lamp name = mesecons_lamp
depends = mesecons depends = default, mesecons

View File

@ -1,2 +1,2 @@
name = mesecons_lightstone name = mesecons_lightstone
depends = mesecons, dye depends = default, mesecons, dye

View File

@ -1,2 +1,2 @@
name = mesecons_luacontroller name = mesecons_luacontroller
depends = mesecons depends = default, mesecons

View File

@ -1,2 +1,2 @@
name = mesecons_materials name = mesecons_materials
depends = mesecons depends = default, mesecons

View File

@ -1,2 +1,2 @@
name = mesecons_microcontroller name = mesecons_microcontroller
depends = mesecons depends = default, mesecons

View File

@ -1,2 +1,2 @@
name = mesecons_movestones name = mesecons_movestones
depends = mesecons, mesecons_materials, mesecons_mvps depends = default, mesecons, mesecons_materials, mesecons_mvps

View File

@ -46,9 +46,9 @@ local function on_mvps_move(moved_nodes)
end end
end end
function mesecon.mvps_process_stack(stack) function mesecon.mvps_process_stack()
-- This function is kept for compatibility. -- This function is kept for compatibility.
-- It used to call on_placenode on the moved nodes, but that is now done automatically. -- It used to call on_placenode on moved nodes, but that is now done automatically.
end end
-- tests if the node can be pushed into, e.g. air, water, grass -- tests if the node can be pushed into, e.g. air, water, grass
@ -328,11 +328,31 @@ end
-- TODO: load blocks instead, as with wires. -- TODO: load blocks instead, as with wires.
mesecon.register_mvps_stopper("ignore") mesecon.register_mvps_stopper("ignore")
mesecon.register_mvps_stopper("doors:door_steel_b_1") -- All of the locked and internal nodes in Minetest Game
mesecon.register_mvps_stopper("doors:door_steel_t_1") for _, name in ipairs({
mesecon.register_mvps_stopper("doors:door_steel_b_2") "default:chest_locked",
mesecon.register_mvps_stopper("doors:door_steel_t_2") "default:chest_locked_open",
mesecon.register_mvps_stopper("default:chest_locked") "doors:door_steel_b_1", -- old style doors
"doors:door_steel_b_2", --
"doors:door_steel_t_1", --
"doors:door_steel_t_2", --
"doors:door_steel_a", -- new style doors
"doors:door_steel_b", --
"doors:door_steel_c", --
"doors:door_steel_d", --
"doors:hidden",
"doors:trapdoor_steel",
"doors:trapdoor_steel_open",
"xpanes:door_steel_bar_a",
"xpanes:door_steel_bar_b",
"xpanes:door_steel_bar_c",
"xpanes:door_steel_bar_d",
"xpanes:trapdoor_steel_bar",
"xpanes:trapdoor_steel_bar_open",
}) do
mesecon.register_mvps_stopper(name)
end
mesecon.register_on_mvps_move(mesecon.move_hot_nodes) mesecon.register_on_mvps_move(mesecon.move_hot_nodes)
mesecon.register_on_mvps_move(function(moved_nodes) mesecon.register_on_mvps_move(function(moved_nodes)
for i = 1, #moved_nodes do for i = 1, #moved_nodes do

View File

@ -1,2 +1,2 @@
name = mesecons_noteblock name = mesecons_noteblock
depends = mesecons depends = default, mesecons

View File

@ -1,2 +1,2 @@
name = mesecons_pistons name = mesecons_pistons
depends = mesecons, mesecons_mvps depends = default, mesecons, mesecons_mvps

View File

@ -1,2 +1,2 @@
name = mesecons_powerplant name = mesecons_powerplant
depends = mesecons depends = default, mesecons

View File

@ -1,2 +1,2 @@
name = mesecons_pressureplates name = mesecons_pressureplates
depends = mesecons depends = default, mesecons

View File

@ -1,2 +1,2 @@
name = mesecons_random name = mesecons_random
depends = mesecons depends = default, mesecons

View File

@ -1,2 +1,2 @@
name = mesecons_receiver name = mesecons_receiver
depends = mesecons depends = default, mesecons

View File

@ -1,2 +1,2 @@
name = mesecons_solarpanel name = mesecons_solarpanel
depends = mesecons, mesecons_materials depends = default, mesecons, mesecons_materials

View File

@ -1,2 +1,2 @@
name = mesecons_stickyblocks name = mesecons_stickyblocks
depends = mesecons, mesecons_mvps depends = default, mesecons, mesecons_mvps

View File

@ -1,2 +1,2 @@
name = mesecons_switch name = mesecons_switch
depends = mesecons depends = default, mesecons

View File

@ -1,2 +1,2 @@
name = mesecons_torch name = mesecons_torch
depends = mesecons depends = default, mesecons

View File

@ -1,2 +1,2 @@
name = mesecons_walllever name = mesecons_walllever
depends = mesecons, mesecons_receiver depends = default, mesecons, mesecons_receiver

View File

@ -1,2 +1,2 @@
name = mesecons_wires name = mesecons_wires
depends = mesecons depends = default, mesecons