-
Notifications
You must be signed in to change notification settings - Fork 7
Wrench support extend #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 129 commits
Commits
Show all changes
130 commits
Select commit
Hold shift + click to select a range
5605ed7
change <world>/technic.conf:enable_wrench_crafting -> minetest.conf:w…
nixnoxus 8590d7b
add bones support
nixnoxus 7ceec2a
add connected_chests support
nixnoxus c784eb9
add xdecor support
nixnoxus 9e99f5d
add pipeworks support [WIP]
nixnoxus b776d6e
add "technic:injector" support
nixnoxus e67ce4d
update luacheck
nixnoxus 803d391
update README.md
nixnoxus f646673
add "pipeworks:nodebreaker_*" support
nixnoxus c0fb5e0
Update README.md
nixnoxus 2581e19
support node timers
OgelGames 93c3806
adjust craft recipe
OgelGames 45edd1b
fixes
OgelGames ca83ab2
`more_chests` support
OgelGames 61b3b62
remove the use of translated()
nixnoxus 468ac9c
update README.md
nixnoxus b4063a5
fix node timers
nixnoxus 5453122
add "pipeworks:*filter" support
nixnoxus 23af4f0
if timeout then
nixnoxus 1fe5ea3
`3d_armor_stand` support
OgelGames 8cf6a7a
add missing optional deps
OgelGames 56d39bb
support node drop
nixnoxus 6a4550b
drop pipeworks wielder in state "off" like digging
nixnoxus d449bda
add some "pipeworks:*tube*" support
nixnoxus 91f9a8a
`def.drop` can be a string or a boolean
nixnoxus 166d073
nodes/pipeworks.lua
nixnoxus f73a8da
update luacheck
nixnoxus 26aa3a3
move handling for `def.drop` to `wrench.register_node()`
OgelGames 42c6585
add `def.after_pickup` and always update tube nodes
OgelGames 62f05cb
move api functions to api.lua
OgelGames 25a0965
little code fixes
OgelGames 5992fe1
`biofuel` refinery support
OgelGames b90694e
add setting wrench.enable_debug (very experimental)
nixnoxus 538488f
add `xdecor:hive` support
nixnoxus 179ac80
add `bees:hive_wild` support
nixnoxus bfba1b8
add `vessels:shelf` support
nixnoxus aaf9777
add `mesecons` support (WIP)
nixnoxus 3cc3faf
fix mesecons disconnection
nixnoxus 15a4729
update luacheck
nixnoxus 836ab3f
add `digilines` support
nixnoxus c4ba022
add `mobs:spawner` support
nixnoxus 3878f16
also update connections on place
OgelGames fddfbe4
meta:get_string always returns a string
OgelGames 9e2e68d
fix metas
OgelGames b53d9ce
use `drop_node` in get_description()
nixnoxus 17644a7
fix luacontroller* and descriptions added
nixnoxus 7e5cfae
add `realchess:chessboard` support
nixnoxus 99851e3
fix typo
nixnoxus 3c1d8ba
rename functions "wrench.*" to "wrench:*" (#3)
nixnoxus e43ff07
fix crash when `wrench.enable_debug = true`
nixnoxus b0947f8
fix typo in description for `realchess:chessboard`
nixnoxus de87e79
Revert "rename functions "wrench.*" to "wrench:*" (#3)"
OgelGames 3021731
add compatibility for `:`
OgelGames 820b8d5
Revert "add compatibility for `:`"
OgelGames 3a267e6
add `wrench.plus = true`
OgelGames d253340
fixes for lua nodes
OgelGames 4dd385c
Update README.md
nixnoxus d662feb
list supported modnames and nodes
nixnoxus b2b48cc
Update README.md
nixnoxus f9da60c
fix and update translations
nixnoxus f71f2a3
fix luacheck warning
nixnoxus c16ae41
modname is always "wrench"
OgelGames 76cbf7e
Revert "Revert "add compatibility for `:`""
nixnoxus 83b903e
pass `pointed_thing` to `def.after_place`
OgelGames e3fafc6
`signs_lib` support
OgelGames eda2143
only override nodes once
OgelGames 83cfbc3
mark log messages with "[wrench]"
OgelGames c836d97
luacheck and depends
OgelGames ab56941
`basic_signs` support
OgelGames e980721
fix glow items being dropped from signs
OgelGames 16028e9
add wrench.description_with_configuration()
nixnoxus 220d937
split `mesecons_*`
nixnoxus 7d996b4
fix `mesecons_microcontroller:microcontroller*` drop
nixnoxus 4fbc896
update german translation
nixnoxus c2d632b
use wrench.description_with_configuration() when `lists` and `descrip…
nixnoxus 219023e
add `protector` support
nixnoxus c38f0f7
restore nodes/pipeworks.lua
nixnoxus 1f4d352
fix spaces
nixnoxus 9edee9d
initial api.txt
nixnoxus 7010c44
api.txt -> API.md
nixnoxus 2c93dff
fix basic_signs: +metas.unifont
nixnoxus a146201
update README.md
nixnoxus 6cd14c0
fix signs_lib: +metas.unifont
nixnoxus 3aadf58
Update API.md
nixnoxus 3ac7d50
Update API.md
nixnoxus 76d40f5
add `wrench.unregister_node` and move drop check
OgelGames 53b485b
add `wrench.description_with_text`
OgelGames a56e7a8
change `has_*` to `wrench.has_*`
nixnoxus 2170179
*fix `technic:cnc_mk2` and `technic:*_battery_box*`: +metas.channel
nixnoxus 36e7e5b
add `technic:forcefield_emitter_*` and `technic:quarry`
nixnoxus 2654020
fix strip_esc()
nixnoxus e934fad
add `wrench.description_with_channel`
nixnoxus 3b8bf58
check `meta` and `lists` before pickup when `wrench.enable_debug = true`
nixnoxus 6778aaa
add `digistuff` support (WIP)
nixnoxus 2caf555
add `wrench.META_TYPE_IGNORE`
nixnoxus 2a3c410
more `digistuff` support (WIP)
nixnoxus 383f8be
fix: meta:to_table() before minetest.remove_node(pos)
nixnoxus 7c2b681
even more `digistuff` support (WIP)
nixnoxus fe7d42a
update README.md
nixnoxus e21c4b0
fix digilines lcd and remove unnecessary metas
OgelGames dc98615
complete `digistuff` support
nixnoxus 83fbb54
add `digiscreen` support
nixnoxus 1c7d089
fix `bones:bones` with `mapserver_mod` (see: https://github.com/minet…
nixnoxus 3066bfa
add misc `wrench.META_TYPE_IGNORE` keys
nixnoxus 75094d2
add meta `internal_EU_charge_max` for technic:*_battery_box*
nixnoxus 989fccb
add meta `tube_time` for technic:cnc_mk2
nixnoxus 8047a6b
add `technic:power_monitor` and `technic:switching_station` when `wre…
nixnoxus 39c1802
add `technic:supply_converter`
nixnoxus c0a675f
Update README.md
nixnoxus 0ef346c
add `digiline_detector_tube_*`
nixnoxus fbfbd9f
add `technic:*_generator*`
nixnoxus f4373cc
ignore `tube_time` and `formspec` on LV base machines
nixnoxus 5197e26
fix `technic:*_battery_box_*`: +metas.tube_time
nixnoxus f42ec58
add `def.lists_ignore` (used when `wrench.enable_debug = true`)
nixnoxus 03c6bfc
fix `metas` and add `lists_ignore` for `technic:*_chest`
nixnoxus 98706fc
move sanity checks to `wrench.pickup_node`
nixnoxus 708286d
add misc `wrench.META_TYPE_IGNORE` keys
nixnoxus 03a47ca
move debug.lua to debug/debug.lua
nixnoxus 1b56bef
Update API.md
nixnoxus 625caa2
rename `before_remove` to `before_pickup`
nixnoxus 4974c80
Update README.md (cleanup #Contributors)
nixnoxus 44181bc
make `debug/debug.lua` optional
nixnoxus 29a4857
Update digistuff.lua
OgelGames 6e619ea
fix `digistuff:detector` channel = wrench.META_TYPE_STRING
nixnoxus e470b46
fix `digistuff:movestone` state & active = wrench.META_TYPE_IGNORE
nixnoxus dc07739
Update digiscreen.lua
OgelGames 6806711
whitespace and typo fixes in API.md
OgelGames 85442cf
copy formspec of digistuff detector and camera
OgelGames 495d081
Update mesecons_detector.lua
OgelGames ebd8cbb
fix crash when node has no inventory
nixnoxus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,22 @@ | ||
| unused_args = false | ||
| allow_defined_top = true | ||
| max_line_length = 999 | ||
|
|
||
| globals = { | ||
| "technic", "minetest", | ||
| "minetest", | ||
| } | ||
|
|
||
| read_globals = { | ||
| string = {fields = {"split", "trim"}}, | ||
| table = {fields = {"copy", "getn"}}, | ||
| string = {fields = {"split"}}, | ||
| table = {fields = {"copy"}}, | ||
|
|
||
| "intllib", "ItemStack", "drawers", | ||
| } | ||
| -- Minetest | ||
| "ItemStack", | ||
|
|
||
| files["init.lua"].ignore = { "name", "stack" } | ||
| -- Mods | ||
| "digilines", | ||
| "drawers", | ||
| "mesecon", | ||
| "pipeworks", | ||
| "signs_lib", | ||
| "xdecor", | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| # API | ||
|
|
||
| ## Node registration | ||
|
|
||
| Schematic: | ||
| ```lua | ||
| wrench.register_node(node.name, { | ||
| lists = list, | ||
| -- inventory list | ||
|
|
||
| lists_ignore = lists_ignore, | ||
| -- ignored and not saved inventory list | ||
|
|
||
| metas = table, | ||
| -- Table for node metadata: | ||
| -- name: Meta name | ||
| -- type: Data type: | ||
| -- `wrench.META_TYPE_IGNORE` ignored and not saved | ||
| -- `wrench.META_TYPE_FLOAT` for float | ||
| -- `wrench.META_TYPE_STRING` for string | ||
| -- `wrench.META_TYPE_INT` for integer | ||
|
|
||
| description = nil, | ||
| -- Default behavior: | ||
| -- when `lists` is not `nil` | ||
| -- `minetest.registered_nodes[node.name].description` + " with items" | ||
| -- when `lists` is `nil` and only `metas.channel` is defined | ||
| -- `minetest.registered_nodes[node.name].description` + " with channel '<CHANNEL>'" | ||
| -- when `lists` is `nil` | ||
| -- `minetest.registered_nodes[node.name].description` + " with configuration" | ||
| description = `wrench.description_with_items`, | ||
| -- Description of the node + " with items" | ||
| description = `wrench.description_with_configuration`, | ||
| -- Description of the node + " with configuration" | ||
| description = `wrench.description_with_channel`, | ||
| -- Description of the node + " with channel " + channel | ||
| description = `wrench.description_with_text`, | ||
| -- Description of the node + " with text " + text | ||
| description = function(pos, meta, node, player), | ||
| -- Function returns description | ||
|
|
||
| drop = nil, | ||
| -- Default dropped item is the node itself | ||
| drop = true, | ||
| -- Use `minetest.registered_nodes[node.name].drop` | ||
| drop = "default:cobble", | ||
| -- Name of dropped item | ||
|
|
||
| owned = nil, | ||
| -- Default: anyone can pickup this node | ||
| owned = true, | ||
| -- Only `metas["owner"]` can pickup this node | ||
|
|
||
| timer = nil, | ||
| -- Default | ||
| timer = true, | ||
| -- Save node timers | ||
|
|
||
| before_pickup = nil, | ||
| -- Default | ||
| before_pickup = function(pos, meta, node, player) | ||
| -- Function called before pickup node | ||
|
|
||
| after_pickup = nil, | ||
| -- default | ||
| after_pickup = function(pos, node, meta_table, player) | ||
| -- Function called after pickup node | ||
|
|
||
| after_place = nil, | ||
| -- Default | ||
| after_place = function(pos, player, itemstack, pointed_thing), | ||
| -- Function called after place node | ||
| }) | ||
| ``` | ||
|
|
||
| Example: | ||
| ```lua | ||
| wrench.register_node("bones:bones", { | ||
| lists = {"main"}, | ||
| metas = { | ||
| owner = wrench.META_TYPE_STRING, | ||
| infotext = wrench.META_TYPE_STRING, | ||
| formspec = wrench.META_TYPE_STRING, | ||
| time = wrench.META_TYPE_INT, | ||
| }, | ||
| owned = true, | ||
| }) | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,161 @@ | ||
|  | ||
| [](https://www.gnu.org/licenses/old-licenses/lgpl-2.0.en.html) | ||
|
|
||
| <!-- | ||
| [](https://content.minetest.net/packages/mt-mods/wrench/) | ||
| --> | ||
|
|
||
| # Wrench | ||
|
|
||
| <img src="textures/technic_wrench.png"/> | ||
|
|
||
| The wrench tool allows you to left-click on nodes with inventories to pick them up. | ||
|
|
||
| This mod is a fork from wrench/ in https://github.com/mt-mods/technic | ||
|
|
||
| # Supported Mods and Nodes | ||
|
|
||
| * https://github.com/minetest/minetest_game | ||
| - bones:bones | ||
| - default:chest | ||
| - default:chest_locked | ||
| - default:furnace | ||
| - default:sign_wall_wood | ||
| - default:sign_wall_steel | ||
| - vessels:shelf | ||
| * https://github.com/minetest-mods/3d_armor | ||
| - 3d_armor_stand:armor_stand | ||
| - 3d_armor_stand:locked_armor_stand | ||
| * https://github.com/mt-mods/basic_signs | ||
| - basic_signs:sign_wall_glass | ||
| - basic_signs:sign_wall_locked | ||
| - basic_signs:sign_wall_obsidian_glass | ||
| - basic_signs:sign_wall_plastic | ||
| - basic_signs:sign_wall_steel_\* | ||
| * https://notabug.org/TenPlus1/bees | ||
| - bees:hive_wild | ||
| * https://github.com/Lokrates/Biofuel | ||
| - biofuel:refinery | ||
| * https://github.com/HybridDog/connected_chests | ||
| * https://github.com/minetest-mods/digilines | ||
| - digilines:chest | ||
| - digilines:lcd | ||
| - digilines:lightsensor | ||
| - digilines:rtc | ||
| * https://cheapiesystems.com/git/digiscreen/ | ||
| * https://github.com/mt-mods/digistuff | ||
| - digistuff:advtouchscreen | ||
| - digistuff:button_\* | ||
| - digistuff:camera | ||
| - digistuff:card_reader | ||
| - digistuff:controller_programmed | ||
| - digistuff:detector | ||
| - digistuff:eeprom | ||
| - digistuff:gpu | ||
| - digistuff:ioexpander_\* | ||
| - digistuff:light_\* | ||
| - digistuff:movestone | ||
| - digistuff:nic | ||
| - digistuff:noteblock | ||
| - digistuff:panel | ||
| - digistuff:piezo | ||
| - digistuff:piston\* | ||
| - digistuff:ram | ||
| - digistuff:timer | ||
| - digistuff:touchscreen | ||
| - digistuff:wall_knob_configured | ||
| * https://github.com/minetest-mods/digtron | ||
| - digtron:battery_holder | ||
| - digtron:inventory | ||
| - digtron:fuelstore | ||
| - digtron:combined_storage | ||
| * https://github.com/minetest-mods/drawers | ||
| - drawers:wood | ||
| - drawers:acacia_wood | ||
| - drawers:aspen_wood | ||
| - drawers:junglewood | ||
| - drawers:pine_wood | ||
| * https://github.com/minetest-mods/mesecons | ||
| - mesecons_commandblock:commandblock_\* | ||
| - mesecons_detector:node_detector_\* | ||
| - mesecons_detector:object_detector_\* | ||
| - mesecons_luacontroller:luacontroller\* | ||
| - mesecons_microcontroller:microcontroller\* | ||
| * https://notabug.org/tenplus1/mobs_redo | ||
| - mobs:spawner | ||
| * https://github.com/minetest-mods/more_chests | ||
| - more_chests:cobble | ||
| - more_chests:dropbox | ||
| - more_chests:fridge | ||
| - more_chests:big_fridge | ||
| - more_chests:shared | ||
| - more_chests:secret | ||
| - more_chests:toolbox_\* | ||
| * https://github.com/mt-mods/pipeworks | ||
| - pipeworks:autocrafter | ||
| - pipeworks:deployer_\* | ||
| - pipeworks:digiline_detector_tube_\* | ||
| - pipeworks:dispenser_\* | ||
| - pipeworks:nodebreaker_\* | ||
| - pipeworks:\*filter | ||
| - pipeworks:lua_tube\* | ||
| - pipeworks:mese_sand_tube_\* | ||
| - pipeworks:mese_tube_\* | ||
| - pipeworks:teleport_tube_\* | ||
| * https://notabug.org/tenplus1/protector | ||
| - protector:chest | ||
| - protector:protect | ||
| - protector:protect2 | ||
| * https://github.com/mt-mods/signs_lib | ||
| * https://github.com/mt-mods/technic | ||
| - technic:cnc\* | ||
| - technic:coal_alloy_furnace\* | ||
| - technic:\*chest\* | ||
| - technic:injector | ||
| - technic:power_monitor | ||
| - technic:supply_converter | ||
| - technic:switching_station | ||
| - technic:tool_workshop | ||
| - technic:\*_alloy_furnace\* | ||
| - technic:\*_battery_box\* | ||
| - technic:\*_centrifuge\* | ||
| - technic:\*_compressor\* | ||
| - technic:\*_electric_furnace\* | ||
| - technic:\*_extractor\* | ||
| - technic:\*_freezer\* | ||
| - technic:\*_generator\* | ||
| - technic:\*_grinder\* | ||
| * https://github.com/minetest-mods/xdecor | ||
| - realchess:chessboard | ||
| - xdecor:cabinet | ||
| - xdecor:cabinet_half | ||
| - xdecor:empty_shelf | ||
| - xdecor:multishelf | ||
| - xdecor:cauldron_\* | ||
| - xdecor:enchantment_table | ||
| - xdecor:itemframe | ||
| - xdecor:mailbox | ||
|
|
||
| # Settings in `minetest.conf` | ||
| ```ini | ||
| # Allows the wrench to be crafted if either the 'technic' or 'default' mod is installed. | ||
| wrench.enable_crafting = true | ||
| ``` | ||
|
|
||
| # Contributors | ||
|
|
||
| * Nekogloop | ||
| * ShadowNinja | ||
| * BuckarooBanzay | ||
| * OgelGames | ||
| * int-ua | ||
| * S-S-X | ||
| * H-V-Smacker | ||
| * groxxda | ||
| * And many others... | ||
|
|
||
| # License | ||
|
|
||
| Unless otherwise stated, all components of this modpack are licensed under the | ||
| LGPL, V2 or later. See also the individual mod folders for their | ||
| secondary/alternate licenses, if any. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
|
|
||
| function wrench.register_node(name, def) | ||
| assert(type(name) == "string", "wrench.register_node invalid type for name") | ||
| assert(type(def) == "table", "wrench.register_node invalid type for def") | ||
| local node_def = minetest.registered_nodes[name] | ||
| if node_def then | ||
| wrench.registered_nodes[name] = table.copy(def) | ||
| else | ||
| minetest.log("warning", "[wrench] Attempt to register unknown node: "..name) | ||
| end | ||
| end | ||
|
|
||
| function wrench.unregister_node(name) | ||
| assert(type(name) == "string", "wrench.unregister_node invalid type for name") | ||
| if wrench.registered_nodes[name] then | ||
| wrench.registered_nodes = nil | ||
| else | ||
| minetest.log("warning", "[wrench] Attempt to unregister unsupported node: "..name) | ||
| end | ||
| end | ||
|
|
||
| function wrench.blacklist_item(name) | ||
| assert(type(name) == "string", "wrench.blacklist_item invalid type for name") | ||
| local node_def = minetest.registered_items[name] | ||
| if node_def then | ||
| wrench.blacklisted_items[name] = true | ||
| else | ||
| minetest.log("warning", "[wrench] Attempt to blacklist unknown item: "..name) | ||
| end | ||
| end | ||
|
|
||
| minetest.register_on_mods_loaded(function() | ||
| for name, def in pairs(wrench.registered_nodes) do | ||
| local node_def = minetest.registered_nodes[name] | ||
| if node_def then | ||
| local old_after_place = node_def.after_place_node | ||
| minetest.override_item(name, { | ||
| after_place_node = function(...) | ||
| if not wrench.restore_node(...) and old_after_place then | ||
| return old_after_place(...) | ||
| end | ||
| end | ||
| }) | ||
| if def.drop == true and type(node_def.drop) == "string" then | ||
| def.drop = node_def.drop | ||
| elseif def.drop and type(def.drop) ~= "string" then | ||
| minetest.log("warning", "[wrench] Ignoring invalid type for drop in definition for "..name) | ||
| def.drop = nil | ||
| end | ||
| if def.drop and not wrench.registered_nodes[def.drop] then | ||
| minetest.log("warning", "[wrench] Ignoring unsupported node for drop in definition for "..name) | ||
| def.drop = nil | ||
| end | ||
| else | ||
| minetest.log("warning", "[wrench] Registered node is now unknown: "..name) | ||
| wrench.registered_nodes[name] = nil | ||
| end | ||
| end | ||
| end) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.