From 9d856454441b065d6cd42e6ca93cb04c4a2692a5 Mon Sep 17 00:00:00 2001 From: VorTechnix <45538536+VorTechnix@users.noreply.github.com> Date: Tue, 8 Oct 2024 15:01:04 -0700 Subject: [PATCH 1/9] renamed edit folder to .edit --- worldeditadditions_farwand/{edit => .edit}/brush.piskel | 0 worldeditadditions_farwand/{edit => .edit}/worldedit_wand.piskel | 0 .../{edit => .edit}/worldeditadditions_movement.piskel | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename worldeditadditions_farwand/{edit => .edit}/brush.piskel (100%) rename worldeditadditions_farwand/{edit => .edit}/worldedit_wand.piskel (100%) rename worldeditadditions_farwand/{edit => .edit}/worldeditadditions_movement.piskel (100%) diff --git a/worldeditadditions_farwand/edit/brush.piskel b/worldeditadditions_farwand/.edit/brush.piskel similarity index 100% rename from worldeditadditions_farwand/edit/brush.piskel rename to worldeditadditions_farwand/.edit/brush.piskel diff --git a/worldeditadditions_farwand/edit/worldedit_wand.piskel b/worldeditadditions_farwand/.edit/worldedit_wand.piskel similarity index 100% rename from worldeditadditions_farwand/edit/worldedit_wand.piskel rename to worldeditadditions_farwand/.edit/worldedit_wand.piskel diff --git a/worldeditadditions_farwand/edit/worldeditadditions_movement.piskel b/worldeditadditions_farwand/.edit/worldeditadditions_movement.piskel similarity index 100% rename from worldeditadditions_farwand/edit/worldeditadditions_movement.piskel rename to worldeditadditions_farwand/.edit/worldeditadditions_movement.piskel From d53f4f8702c3faec9e2f51d0782a6ea94c96c821 Mon Sep 17 00:00:00 2001 From: VorTechnix <45538536+VorTechnix@users.noreply.github.com> Date: Wed, 9 Oct 2024 20:35:45 -0700 Subject: [PATCH 2/9] Initial refactor --- CHANGELOG.md | 4 +- CONTRIBUTING.md | 2 +- Chat-Command-Reference.md | 8 +- worldeditadditions_farwand/init.lua | 14 --- worldeditadditions_farwand/lib/do_raycast.lua | 17 ---- worldeditadditions_farwand/mod.conf | 3 - .../.edit/brush.piskel | 0 .../.edit/worldedit_wand.piskel | 0 .../.edit/worldeditadditions_movement.piskel | 0 .../commands/farwand_config.lua | 2 +- worldeditadditions_tools/commands/weatool.lua | 64 ++++++++++++ worldeditadditions_tools/init.lua | 24 +++++ .../items}/cloudwand.lua | 5 +- .../items}/farwand.lua | 12 ++- .../items}/movetool.lua | 11 +- .../items}/multiwand.lua | 3 +- worldeditadditions_tools/lib/do_raycast.lua | 17 ++++ .../lib/register_tool.lua | 94 ++++++++++++++++++ .../lib/settings.lua | 12 +-- worldeditadditions_tools/mod.conf | 3 + .../textures/worldeditadditions_chisel.png | Bin .../textures/worldeditadditions_cloudwand.png | Bin .../textures/worldeditadditions_farwand.png | Bin .../textures/worldeditadditions_movement.png | Bin .../textures/worldeditadditions_multiwand.png | Bin 25 files changed, 234 insertions(+), 61 deletions(-) delete mode 100644 worldeditadditions_farwand/init.lua delete mode 100644 worldeditadditions_farwand/lib/do_raycast.lua delete mode 100644 worldeditadditions_farwand/mod.conf rename {worldeditadditions_farwand => worldeditadditions_tools}/.edit/brush.piskel (100%) rename {worldeditadditions_farwand => worldeditadditions_tools}/.edit/worldedit_wand.piskel (100%) rename {worldeditadditions_farwand => worldeditadditions_tools}/.edit/worldeditadditions_movement.piskel (100%) rename worldeditadditions_farwand/lib/chatcommand.lua => worldeditadditions_tools/commands/farwand_config.lua (96%) create mode 100644 worldeditadditions_tools/commands/weatool.lua create mode 100644 worldeditadditions_tools/init.lua rename {worldeditadditions_farwand/lib => worldeditadditions_tools/items}/cloudwand.lua (87%) rename {worldeditadditions_farwand/lib => worldeditadditions_tools/items}/farwand.lua (82%) rename {worldeditadditions_farwand/lib => worldeditadditions_tools/items}/movetool.lua (83%) rename {worldeditadditions_farwand/lib => worldeditadditions_tools/items}/multiwand.lua (96%) create mode 100644 worldeditadditions_tools/lib/do_raycast.lua create mode 100644 worldeditadditions_tools/lib/register_tool.lua rename {worldeditadditions_farwand => worldeditadditions_tools}/lib/settings.lua (71%) create mode 100644 worldeditadditions_tools/mod.conf rename {worldeditadditions_farwand => worldeditadditions_tools}/textures/worldeditadditions_chisel.png (100%) rename {worldeditadditions_farwand => worldeditadditions_tools}/textures/worldeditadditions_cloudwand.png (100%) rename {worldeditadditions_farwand => worldeditadditions_tools}/textures/worldeditadditions_farwand.png (100%) rename {worldeditadditions_farwand => worldeditadditions_tools}/textures/worldeditadditions_movement.png (100%) rename {worldeditadditions_farwand => worldeditadditions_tools}/textures/worldeditadditions_multiwand.png (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index d8dd4d70..34ef0064 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ Note to self: See the bottom of this file for the release template text. - Added [`//ngroups`](https://worldeditadditions.mooncarrot.space/Reference/#ngroups), which lists the groups that a given node is a member of. Useful when paired with [`//nodeapply`](https://worldeditadditions.mooncarrot.space/Reference/#nodeapply)! - Added [`//rotate+`](https://worldeditadditions.mooncarrot.space/Reference/#rotate) to rotate regions through arbitrary series of potentially non-axis-aligned rotations. **Does not support slabs/stairs yet,** but this is on the todo list! - Added [`//speed`](https://worldeditadditions.mooncarrot.space/Reference/#speed) to adjust your own movement speed - - Also added an associated [movement speed adjustment tool](https://worldeditadditions.mooncarrot.space/Reference/#movement), which looks like this: ![A picture of the move speed adjustment tool. It looks like a monarch butterfly.](https://raw.githubusercontent.com/sbrl/Minetest-WorldEditAdditions/dev/worldeditadditions_farwand/textures/worldeditadditions_movement.png) + - Also added an associated [movement speed adjustment tool](https://worldeditadditions.mooncarrot.space/Reference/#movement), which looks like this: ![A picture of the move speed adjustment tool. It looks like a monarch butterfly.](https://raw.githubusercontent.com/sbrl/Minetest-WorldEditAdditions/dev/worldeditadditions_tools/textures/worldeditadditions_movement.png) - Added [`//set+`](https://worldeditadditions.mooncarrot.space/Reference/#set) for setting nodes and param2/light levels quickly. - NOTE TO SELF: Setting light values doesn't appear to be working very well for some reason - Added [`//ndef`](https://worldeditadditions.mooncarrot.space/Reference/#ndef) to print a given node's definition table. This is for debugging and development purposes. @@ -63,7 +63,7 @@ Note to self: See the bottom of this file for the release template text. - Add `//dome+`, which allows you to change the direction the dome is pointing in, and also create multiple domes at once - Add `//metaball`, which renders 2 or more [metaballs](https://en.wikipedia.org/wiki/Metaballs) in Minetest - Significant backend refactoring to tidy things up - - Add new multi-point selection wand ![A picture of the multi-point wand](https://raw.githubusercontent.com/sbrl/Minetest-WorldEditAdditions/main/worldeditadditions_farwand/textures/worldeditadditions_multiwand.png) to select many points at once. + - Add new multi-point selection wand ![A picture of the multi-point wand](https://raw.githubusercontent.com/sbrl/Minetest-WorldEditAdditions/main/worldeditadditions_tools/textures/worldeditadditions_multiwand.png) to select many points at once. - Implement custom region boxing UI, which replaces the WorldEdit region box when using WorldEditAdditions wands. - Is backwards compatible with regular WorldEdit wands and tools, as WorldEditAdditions keeps the new positioning system in sync with WorldEdit's. - The new multipoint wand required this as a prerequisite diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 791815c1..a72417e8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,7 +11,7 @@ Name | Description --------------------------------|------------------------ `worldeditadditions` | The main mod. Core world manipulation implementations (backed by the `*_core` mod ref core and utility functions) should go in here. `worldeditadditions_commands` | Chat commands. These interact with the core manipulators in `worldeditadditions` mod. -`worldeditadditions_farwand` | Everything to do with the far wand tool, and now other tools like the cloud wand, multi-point wand, etc. It's different enough to everything else that it warrants it's own separate mod to avoid muddling things. +`worldeditadditions_tools` | Everything to do with the far wand tool, and now other tools like the cloud wand, multi-point wand, etc. It's different enough to everything else that it warrants it's own separate mod to avoid muddling things. `worldeditadditions_core` | Core components such as the positioning system (`worldeditadditions_core.pos`), the command registration function, and utility functions go in here. Additionally, every command should be implemented in its own file. This helps keep things organised and files short. diff --git a/Chat-Command-Reference.md b/Chat-Command-Reference.md index d608396c..d45196b2 100644 --- a/Chat-Command-Reference.md +++ b/Chat-Command-Reference.md @@ -1897,7 +1897,7 @@ Prevents the execution of a command if it could potentially affect a large numbe --> ### Movement speed adjustment tool -The movement speed adjustment tool, as the name suggests, adjusts your local player movement speed. It looks like this: ![A picture of the move speed adjustment tool. It looks like a monarch butterfly.](https://raw.githubusercontent.com/sbrl/Minetest-WorldEditAdditions/dev/worldeditadditions_farwand/textures/worldeditadditions_movement.png). +The movement speed adjustment tool, as the name suggests, adjusts your local player movement speed. It looks like this: ![A picture of the move speed adjustment tool. It looks like a monarch butterfly.](https://raw.githubusercontent.com/sbrl/Minetest-WorldEditAdditions/dev/worldeditadditions_tools/textures/worldeditadditions_movement.png). Primary (left) clicking will increase your movement speed, and secondary (right) clicking will decrease it in x0.5 increments, down to a minimum of x0.5. @@ -1908,7 +1908,7 @@ See also [`//speed`](#speed). ### Far Wand > Added in v1.7 -The far wand (`worldeditadditions:farwand`) is a variant on the traditional WorldEdit wand (`worldedit:wand`). It looks like this: ![A picture of the far wand](https://raw.githubusercontent.com/sbrl/Minetest-WorldEditAdditions/main/worldeditadditions_farwand/textures/worldeditadditions_farwand.png) +The far wand (`worldeditadditions:farwand`) is a variant on the traditional WorldEdit wand (`worldedit:wand`). It looks like this: ![A picture of the far wand](https://raw.githubusercontent.com/sbrl/Minetest-WorldEditAdditions/main/worldeditadditions_tools/textures/worldeditadditions_tools.png) It functions very similarly to the regular WorldEdit wand, except that it has a _much_ longer range - which can be very useful for working on large-scale terrain for example. It also comes with an associated command to control it. @@ -1941,7 +1941,7 @@ Note that the number there isn't in blocks (because hard maths). It is however p ### Cloud Wand > Added in v1.11 -The cloud wand (`worldeditadditions:cloudwand`) is a another variant the above _Far Wand_. It looks like this: ![A picture of the far wand](https://raw.githubusercontent.com/sbrl/Minetest-WorldEditAdditions/main/worldeditadditions_farwand/textures/worldeditadditions_cloudwand.png) +The cloud wand (`worldeditadditions:cloudwand`) is a another variant the above _Far Wand_. It looks like this: ![A picture of the far wand](https://raw.githubusercontent.com/sbrl/Minetest-WorldEditAdditions/main/worldeditadditions_tools/textures/worldeditadditions_cloudwand.png) Unlike the other 2 wands, this wand functions in an additive manner. Left-click on a node to expand the currently defined region (creating a new one if one isn't defined already) to include that node. Right click to clear the currently defined region. @@ -1953,7 +1953,7 @@ Note that punching out the positions **does not unset them**. Use `//reset` to r ### MultiPoint Wand > Added in v1.14 -The third type of wand provided by WorldEditAdditions is completely different, in that it allows you to select up to **999 points** at once! It looks like this: ![A picture of the multi-point wand](https://raw.githubusercontent.com/sbrl/Minetest-WorldEditAdditions/main/worldeditadditions_farwand/textures/worldeditadditions_multiwand.png) +The third type of wand provided by WorldEditAdditions is completely different, in that it allows you to select up to **999 points** at once! It looks like this: ![A picture of the multi-point wand](https://raw.githubusercontent.com/sbrl/Minetest-WorldEditAdditions/main/worldeditadditions_tools/textures/worldeditadditions_multiwand.png) It is important to note that (at present) the points selected by this wand **are not compatible with normal points**. This will change in the future, but requires a lot of work to implement. diff --git a/worldeditadditions_farwand/init.lua b/worldeditadditions_farwand/init.lua deleted file mode 100644 index d5da5e9f..00000000 --- a/worldeditadditions_farwand/init.lua +++ /dev/null @@ -1,14 +0,0 @@ -worldeditadditions.farwand = { - player_data = {} -} - -local modpath = minetest.get_modpath("worldeditadditions_farwand") - -dofile(modpath.."/lib/do_raycast.lua") -dofile(modpath.."/lib/farwand.lua") -dofile(modpath.."/lib/cloudwand.lua") -dofile(modpath.."/lib/multiwand.lua") -dofile(modpath.."/lib/movetool.lua") - -dofile(modpath.."/lib/chatcommand.lua") -dofile(modpath.."/lib/settings.lua") diff --git a/worldeditadditions_farwand/lib/do_raycast.lua b/worldeditadditions_farwand/lib/do_raycast.lua deleted file mode 100644 index ea99022d..00000000 --- a/worldeditadditions_farwand/lib/do_raycast.lua +++ /dev/null @@ -1,17 +0,0 @@ -local wea_c = worldeditadditions_core ---- worldeditadditions.raycast() wrapper -function worldeditadditions.farwand.do_raycast(player) - if player == nil then return nil end - local player_name = player:get_player_name() - - if worldeditadditions.farwand.player_data[player_name] == nil then - worldeditadditions.farwand.player_data[player_name] = { maxdist = 1000, skip_liquid = true } - end - - local looking_pos, node_id = wea_c.raycast( - player, - worldeditadditions.farwand.player_data[player_name].maxdist, - worldeditadditions.farwand.player_data[player_name].skip_liquid - ) - return looking_pos, node_id -end diff --git a/worldeditadditions_farwand/mod.conf b/worldeditadditions_farwand/mod.conf deleted file mode 100644 index 6a00c479..00000000 --- a/worldeditadditions_farwand/mod.conf +++ /dev/null @@ -1,3 +0,0 @@ -name = worldeditadditions_farwand -description = worldeditadditions: convenient tool items -depends = worldedit, worldeditadditions diff --git a/worldeditadditions_farwand/.edit/brush.piskel b/worldeditadditions_tools/.edit/brush.piskel similarity index 100% rename from worldeditadditions_farwand/.edit/brush.piskel rename to worldeditadditions_tools/.edit/brush.piskel diff --git a/worldeditadditions_farwand/.edit/worldedit_wand.piskel b/worldeditadditions_tools/.edit/worldedit_wand.piskel similarity index 100% rename from worldeditadditions_farwand/.edit/worldedit_wand.piskel rename to worldeditadditions_tools/.edit/worldedit_wand.piskel diff --git a/worldeditadditions_farwand/.edit/worldeditadditions_movement.piskel b/worldeditadditions_tools/.edit/worldeditadditions_movement.piskel similarity index 100% rename from worldeditadditions_farwand/.edit/worldeditadditions_movement.piskel rename to worldeditadditions_tools/.edit/worldeditadditions_movement.piskel diff --git a/worldeditadditions_farwand/lib/chatcommand.lua b/worldeditadditions_tools/commands/farwand_config.lua similarity index 96% rename from worldeditadditions_farwand/lib/chatcommand.lua rename to worldeditadditions_tools/commands/farwand_config.lua index 4df3a083..5d71c46c 100644 --- a/worldeditadditions_farwand/lib/chatcommand.lua +++ b/worldeditadditions_tools/commands/farwand_config.lua @@ -1,5 +1,5 @@ local wea_c = worldeditadditions_core -local farwand = worldeditadditions.farwand -- Convenience shurtcut +local farwand = worldeditadditions_tools -- Convenience shurtcut local function parse_params_farwand(params_text) if params_text == nil then diff --git a/worldeditadditions_tools/commands/weatool.lua b/worldeditadditions_tools/commands/weatool.lua new file mode 100644 index 00000000..f8886c5a --- /dev/null +++ b/worldeditadditions_tools/commands/weatool.lua @@ -0,0 +1,64 @@ +-- ██ ██ ███████ █████ ████████ ██████ ██████ ██ +-- ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ +-- ██ █ ██ █████ ███████ ██ ██ ██ ██ ██ ██ +-- ██ ███ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ +-- ███ ███ ███████ ██ ██ ██ ██████ ██████ ███████ + +local wea_c = worldeditadditions_core +local wea_t = worldeditadditions_tools + +worldeditadditions_core.register_command("tool", { + params = "list || give|exists ", + description = "Give WEA tools by name to the calling player or list available tools.", + privs = { worldedit = true, give = true }, + require_pos = 0, + parse = function(params_text) + local ret = wea_c.split(params_text) + if #ret < 1 then return false, "Error: No params found!" end + + local commands = {list = true, give = true, exists = true} + if not commands[ret[1]] then + return false, "Invalid command: "..ret[1] + end + + if wea_t.registered_tools[ret[2]] or ret[1] == "list" then + return true, ret + else return false, "No such WEA tool: "..ret[2] end + end, + func = function(name, params_text) + if params_text[1] == "list" then + -- Return a list of available tools in rows of 7 + local ret = "WEA Registered Tools:\n" + local i = 0 + for k, _ in pairs(wea_t.registered_tools) do + i = i + 1 + if i % 7 == 0 then ret = ret..k.."\n" + else ret = ret..k.." " end + end + return true, ret + elseif params_text[1] == "exists" then + -- NOTE: If tool did not exist it would be flagged by parse function + return true, "WEA tool \""..params_text[2].."\" exists" + else + -- Initiate player variable and check if it is a valid player + local player = minetest.get_player_by_name(name) + if not player or not player:is_player() then + return false, "\""..name.."\" is not a valid player." + end + -- Create inventory and item instances + local inv = player:get_inventory() + local item = "worldeditadditions:"..params_text[2] + -- Make sure the player doesn't already have the item and has room for it + if inv:contains_item("main", item) then + return false, name.." already has (a) \""..params_text[2].."\"." + elseif not inv:room_for_item("main", item) then + return false, name.." does not have room for (a) \""..params_text[2].."\"." + else + -- Give the player the item + inv:add_item("main", item) + return true, "Gave \""..params_text[2].."\" to "..name + end + + end + end, +}) \ No newline at end of file diff --git a/worldeditadditions_tools/init.lua b/worldeditadditions_tools/init.lua new file mode 100644 index 00000000..98e80689 --- /dev/null +++ b/worldeditadditions_tools/init.lua @@ -0,0 +1,24 @@ +worldeditadditions_tools = { + player_data = {}, + registered_tools = {}, +} +local wea_t = worldeditadditions_tools + +local modpath = minetest.get_modpath("worldeditadditions_tools") + + +-- Libraries +dofile(modpath.."/lib/do_raycast.lua") +dofile(modpath.."/lib/settings.lua") + +wea_t.register_tool = dofile(modpath.."/lib/register_tool.lua") + +-- Items +dofile(modpath.."/items/farwand.lua") +dofile(modpath.."/items/cloudwand.lua") +dofile(modpath.."/items/multiwand.lua") +dofile(modpath.."/items/movetool.lua") + +-- Chat commands +dofile(modpath.."/commands/farwand_config.lua") +dofile(modpath.."/commands/weatool.lua") diff --git a/worldeditadditions_farwand/lib/cloudwand.lua b/worldeditadditions_tools/items/cloudwand.lua similarity index 87% rename from worldeditadditions_farwand/lib/cloudwand.lua rename to worldeditadditions_tools/items/cloudwand.lua index a880aea0..4df41a97 100644 --- a/worldeditadditions_farwand/lib/cloudwand.lua +++ b/worldeditadditions_tools/items/cloudwand.lua @@ -1,7 +1,8 @@ local wea = worldeditadditions local wea_c = worldeditadditions_core +local wea_t = worldeditadditions_tools -minetest.register_tool(":worldeditadditions:cloudwand", { +wea_t.register_tool("cloudwand", { description = "WorldEditAdditions far-reaching additive selector wand", inventory_image = "worldeditadditions_cloudwand.png", @@ -16,7 +17,7 @@ minetest.register_tool(":worldeditadditions:cloudwand", { on_use = function(itemstack, player, pointed_thing) local name = player:get_player_name() -- print("[farwand] on_use", name) - local looking_pos, node_id = worldeditadditions.farwand.do_raycast(player) + local looking_pos, node_id = worldeditadditions_tools.do_raycast(player) wea.selection.add_point(name, looking_pos) -- Left click when pointing at something or nothing end, diff --git a/worldeditadditions_farwand/lib/farwand.lua b/worldeditadditions_tools/items/farwand.lua similarity index 82% rename from worldeditadditions_farwand/lib/farwand.lua rename to worldeditadditions_tools/items/farwand.lua index 56a9a2ac..44114912 100644 --- a/worldeditadditions_farwand/lib/farwand.lua +++ b/worldeditadditions_tools/items/farwand.lua @@ -1,3 +1,5 @@ +local wea_t = worldeditadditions_tools + local function set_pos1(name, pos) if pos ~= nil then -- print("[set_pos1]", name, "("..pos.x..", "..pos.y..", "..pos.z..")") @@ -21,23 +23,23 @@ local function set_pos2(name, pos) end end -minetest.register_tool(":worldeditadditions:farwand", { +wea_t.register_tool("farwand", { description = "WorldEditAdditions far-reaching wand", - inventory_image = "worldeditadditions_farwand.png", + inventory_image = "worldeditadditions_tools.png", on_place = function(itemstack, player, pointed_thing) local name = player:get_player_name() -- print("[farwand] on_place", name) -- Right click when pointing at something -- Pointed thing: https://rubenwardy.com/minetest_modding_book/lua_api.html#pointed_thing - local looking_pos, node_id = worldeditadditions.farwand.do_raycast(player) + local looking_pos, node_id = worldeditadditions_tools.do_raycast(player) set_pos2(name, looking_pos) end, on_use = function(itemstack, player, pointed_thing) local name = player:get_player_name() -- print("[farwand] on_use", name) - local looking_pos, node_id = worldeditadditions.farwand.do_raycast(player) + local looking_pos, node_id = worldeditadditions_tools.do_raycast(player) set_pos1(name, looking_pos) -- Left click when pointing at something or nothing end, @@ -47,7 +49,7 @@ minetest.register_tool(":worldeditadditions:farwand", { -- Right click when pointing at nothing -- print("[farwand] on_secondary_use", name) - local looking_pos, node_id = worldeditadditions.farwand.do_raycast(player) + local looking_pos, node_id = worldeditadditions_tools.do_raycast(player) set_pos2(name, looking_pos) end }) diff --git a/worldeditadditions_farwand/lib/movetool.lua b/worldeditadditions_tools/items/movetool.lua similarity index 83% rename from worldeditadditions_farwand/lib/movetool.lua rename to worldeditadditions_tools/items/movetool.lua index d91528cd..8d1b241c 100644 --- a/worldeditadditions_farwand/lib/movetool.lua +++ b/worldeditadditions_tools/items/movetool.lua @@ -1,7 +1,8 @@ -local weac = worldeditadditions_core +local wea_c = worldeditadditions_core +local wea_t = worldeditadditions_tools local function adjust_speed_relative(player, offset) - local overrides = weac.player_get_physics_override( + local overrides = wea_c.player_get_physics_override( player, "worldeditadditions_movetool" ) if overrides == nil then overrides = {} end @@ -10,7 +11,7 @@ local function adjust_speed_relative(player, offset) local src_speed = overrides.speed or 1 local src_climb_speed = overrides.climb_speed or 1 - weac.player_set_physics_override( + wea_c.player_set_physics_override( player, "worldeditadditions_movetool", { speed = math.max(src_speed + offset, 0.5), climb_speed = math.max(src_climb_speed + offset, 0.5) @@ -20,7 +21,7 @@ local function adjust_speed_relative(player, offset) -- }) -- Completely paranoid is me - local overrides_after = weac.player_get_physics_override( + local overrides_after = wea_c.player_get_physics_override( player, "worldeditadditions_movetool" ) worldedit.player_notify(player:get_player_name(), "Movement speed is now x" .. tostring(overrides_after.speed)) @@ -36,7 +37,7 @@ local function use_secondary(player) end -minetest.register_tool(":worldeditadditions:movetool", { +wea_t.register_tool("movetool", { description = "WorldEditAdditions movement speed adjustment tool", inventory_image = "worldeditadditions_movement.png", diff --git a/worldeditadditions_farwand/lib/multiwand.lua b/worldeditadditions_tools/items/multiwand.lua similarity index 96% rename from worldeditadditions_farwand/lib/multiwand.lua rename to worldeditadditions_tools/items/multiwand.lua index 09cb1e1c..b036c615 100644 --- a/worldeditadditions_farwand/lib/multiwand.lua +++ b/worldeditadditions_tools/items/multiwand.lua @@ -1,4 +1,5 @@ local wea_c = worldeditadditions_core +local wea_t = worldeditadditions_tools local wea = worldeditadditions local Vector3 = wea_c.Vector3 @@ -25,7 +26,7 @@ local function pop_pos(player_name) end -minetest.register_tool(":worldeditadditions:multiwand", { +wea_t.register_tool("multiwand", { description = "WorldEditAdditions multi-point wand", inventory_image = "worldeditadditions_multiwand.png", diff --git a/worldeditadditions_tools/lib/do_raycast.lua b/worldeditadditions_tools/lib/do_raycast.lua new file mode 100644 index 00000000..bb08a76a --- /dev/null +++ b/worldeditadditions_tools/lib/do_raycast.lua @@ -0,0 +1,17 @@ +local wea_c = worldeditadditions_core +--- worldeditadditions.raycast() wrapper +function worldeditadditions_tools.do_raycast(player) + if player == nil then return nil end + local player_name = player:get_player_name() + + if worldeditadditions_tools.player_data[player_name] == nil then + worldeditadditions_tools.player_data[player_name] = { maxdist = 1000, skip_liquid = true } + end + + local looking_pos, node_id = wea_c.raycast( + player, + worldeditadditions_tools.player_data[player_name].maxdist, + worldeditadditions_tools.player_data[player_name].skip_liquid + ) + return looking_pos, node_id +end diff --git a/worldeditadditions_tools/lib/register_tool.lua b/worldeditadditions_tools/lib/register_tool.lua new file mode 100644 index 00000000..2182ea4f --- /dev/null +++ b/worldeditadditions_tools/lib/register_tool.lua @@ -0,0 +1,94 @@ +-- ██████ ███████ ██████ ██ ███████ ████████ ███████ ██████ +-- ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ +-- ██████ █████ ██ ███ ██ ███████ ██ █████ ██████ +-- ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ +-- ██ ██ ███████ ██████ ██ ███████ ██ ███████ ██ ██ +-- +-- ████████ ██████ ██████ ██ +-- ██ ██ ██ ██ ██ ██ +-- ██ ██ ██ ██ ██ ██ +-- ██ ██ ██ ██ ██ ██ +-- ██ ██████ ██████ ███████ + +--- WorldEditAdditions tool registration +-- A wrapper for registering tools for WorldEditAdditions. +-- @module worldeditadditions_core + +local wea_t = worldeditadditions_tools + +-- Helper functions -- +local function log_error(toolname, error_message) + minetest.log("error", "register_tool("..toolname..") error: "..error_message) +end + +local function log_warn(toolname, error_message) + minetest.log("warning", "register_tool("..toolname..") warning: "..error_message) +end + + +--- Registers a new WorldEditAdditions tool. +-- @param tool string The name of the tool to register. +-- @param options table A table of options for the tool: +-- - `description` (string) A description of the tool. +-- - `inventory_image` (string) The path to the image for the tool. +-- - `on_use` (function) A function that is called when right click while pointing at something. +-- - `on_place` (function) A function that is called when left click while pointing at something. +-- - `on_secondary_use` (function) A function that is called when left click while pointing at nothing. +-- - `stack_max` (number) The maximum number of the items that can be put in an ItemStack. +-- - `groups` (table) A table of groups that the tool belongs to. +local function register_tool(tool, options) + + --- + -- 1: Validation + --- + if type(options.description) ~= "string" then + log_error(tool, "The description option is not a string.") + return false + end + if type(options.inventory_image) ~= "string" then + log_error(tool, "The inventory_image option is not a string.") + return false + end + if not options.inventory_image:match("^.+%.png$") then + log_error(tool, "The inventory_image option is not a valid image path.") + return false + end + if type(options.on_use) ~= "function" then + if options.on_use == nil then + log_warn(tool, "The on_use option is nil.") + else + log_error(tool, "The on_use option is not a function.") + return false + end + end + if type(options.on_place) ~= "function" then + if options.on_place == nil then + log_warn(tool, "The on_place option is nil.") + else + log_error(tool, "The on_place option is not a function.") + return false + end + end + if type(options.on_secondary_use) ~= "function" then + if options.on_secondary_use == nil then + log_warn(tool, "The on_secondary_use option is nil.") + else + log_error(tool, "The on_secondary_use option is not a function.") + return false + end + end + + --- + -- 2: Normalisation + --- + if not options.stack_max then options.stack_max = 1 end + if not options.groups then options.groups = {wea = 1, wand = 1} end + + --- + -- 3: Registration + --- + minetest.register_tool(":worldeditadditions:" .. tool, options) + wea_t.registered_tools[tool] = options +end + +return register_tool \ No newline at end of file diff --git a/worldeditadditions_farwand/lib/settings.lua b/worldeditadditions_tools/lib/settings.lua similarity index 71% rename from worldeditadditions_farwand/lib/settings.lua rename to worldeditadditions_tools/lib/settings.lua index 8e1cddbd..d6dd939f 100644 --- a/worldeditadditions_farwand/lib/settings.lua +++ b/worldeditadditions_tools/lib/settings.lua @@ -1,9 +1,9 @@ --- If the settings object for the given player name doesn't exist, it is created. -- @param name The name of the player to ensure has a settings object. local function settings_init(name) - if worldeditadditions.farwand.player_data[name] == nil then + if worldeditadditions_tools.player_data[name] == nil then minetest.log("INFO", "Initialising settings for "..name) - worldeditadditions.farwand.player_data[name] = { + worldeditadditions_tools.player_data[name] = { maxdist = 1000, skip_liquid = true } @@ -14,10 +14,10 @@ end -- @param string name The name of the player to get the setting for. -- @param string setting_name The name of the setting to fetch. -- @return any The value of the setting. -function worldeditadditions.farwand.setting_get(name, setting_name) +function worldeditadditions_tools.setting_get(name, setting_name) if setting_name == nil then return nil end settings_init(name) - return worldeditadditions.farwand.player_data[name][setting_name] + return worldeditadditions_tools.player_data[name][setting_name] end --- Sets a given farwand setting for the given player name to the given value. @@ -25,9 +25,9 @@ end -- @param string setting_name The name of the setting to set. -- @param any setting_value The value to set the setting to. -- @return bool Whether setting the setting was successful or not. -function worldeditadditions.farwand.setting_set(name, setting_name, setting_value) +function worldeditadditions_tools.setting_set(name, setting_name, setting_value) if setting_name == nil then return false end settings_init(name) - worldeditadditions.farwand.player_data[name][setting_name] = setting_value + worldeditadditions_tools.player_data[name][setting_name] = setting_value return true end diff --git a/worldeditadditions_tools/mod.conf b/worldeditadditions_tools/mod.conf new file mode 100644 index 00000000..c5ce9faf --- /dev/null +++ b/worldeditadditions_tools/mod.conf @@ -0,0 +1,3 @@ +name = worldeditadditions_tools +description = worldeditadditions: convenient tool items +depends = worldedit, worldeditadditions, worldeditadditions_core diff --git a/worldeditadditions_farwand/textures/worldeditadditions_chisel.png b/worldeditadditions_tools/textures/worldeditadditions_chisel.png similarity index 100% rename from worldeditadditions_farwand/textures/worldeditadditions_chisel.png rename to worldeditadditions_tools/textures/worldeditadditions_chisel.png diff --git a/worldeditadditions_farwand/textures/worldeditadditions_cloudwand.png b/worldeditadditions_tools/textures/worldeditadditions_cloudwand.png similarity index 100% rename from worldeditadditions_farwand/textures/worldeditadditions_cloudwand.png rename to worldeditadditions_tools/textures/worldeditadditions_cloudwand.png diff --git a/worldeditadditions_farwand/textures/worldeditadditions_farwand.png b/worldeditadditions_tools/textures/worldeditadditions_farwand.png similarity index 100% rename from worldeditadditions_farwand/textures/worldeditadditions_farwand.png rename to worldeditadditions_tools/textures/worldeditadditions_farwand.png diff --git a/worldeditadditions_farwand/textures/worldeditadditions_movement.png b/worldeditadditions_tools/textures/worldeditadditions_movement.png similarity index 100% rename from worldeditadditions_farwand/textures/worldeditadditions_movement.png rename to worldeditadditions_tools/textures/worldeditadditions_movement.png diff --git a/worldeditadditions_farwand/textures/worldeditadditions_multiwand.png b/worldeditadditions_tools/textures/worldeditadditions_multiwand.png similarity index 100% rename from worldeditadditions_farwand/textures/worldeditadditions_multiwand.png rename to worldeditadditions_tools/textures/worldeditadditions_multiwand.png From d638a349a9070a0ada035ef6a655dfc7e260e78c Mon Sep 17 00:00:00 2001 From: VorTechnix <45538536+VorTechnix@users.noreply.github.com> Date: Wed, 9 Oct 2024 21:07:14 -0700 Subject: [PATCH 3/9] weatool priv & docs update --- CHANGELOG.md | 5 ++++- Chat-Command-Reference.md | 13 ++++++++++++- README.md | 1 + worldeditadditions_tools/commands/weatool.lua | 2 +- worldeditadditions_tools/init.lua | 5 +++++ 5 files changed, 23 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 34ef0064..68735500 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,8 +18,10 @@ Note to self: See the bottom of this file for the release template text. - Added [`//ndef`](https://worldeditadditions.mooncarrot.space/Reference/#ndef) to print a given node's definition table. This is for debugging and development purposes. - Added `//sgrow` and `//sshrink` commands to enlarge and shrink selection regions and aliased them over WorldEdit equivalents (`//expand`, `//outset` and `//contract`, `//inset` respectively). - Added Unified Axis Syntax (UAS) parser. - Implementation by @VorTechnix - - See [UAS System reference] for details. (Note to self hook up hyperlink) + - See [UAS System reference](https://worldeditadditions.mooncarrot.space/Reference/#unified-axis-syntax-uas) for details. - Added `//uasparse` command to show the vectors produced by a given UAS expression. - Implementation by @VorTechnix +- Added `//tool` command to list available tools and give tools to players. (Requires players to have the `weatool` privilege) - Implementation by @VorTechnix +- Added `weatool` privilege. - Implementation by @VorTechnix ### Bugfixes and changes - When commands produce an error, the name of the command that produced the error is now also printed. Useful when using e.g. [`//multi`](https://worldeditadditions.mooncarrot.space/Reference/#multi) etc. @@ -36,6 +38,7 @@ Note to self: See the bottom of this file for the release template text. ### Lua API changes - Add `core.pos.get12(player_name, sort=false)` +- Add `tools.register_tool(name, tool_def)` - Implementation by @VorTechnix ## v1.14.5: The multipoint update, hotfix 5 (1st August 2023) diff --git a/Chat-Command-Reference.md b/Chat-Command-Reference.md index d45196b2..a66fa717 100644 --- a/Chat-Command-Reference.md +++ b/Chat-Command-Reference.md @@ -1896,6 +1896,17 @@ Prevents the execution of a command if it could potentially affect a large numbe ██ ██████ ██████ ███████ ███████ --> +### `//tool list || give|exists ` +> Added in v1.15 + +Lists available tools, allowes player to check if a specific tool exists and gives tools on demand as long as the player doesn't already have them, has room in their inventory, and has the `weatool` privilege. + +```weacmd +//tool list +//tool give cloudwand +//tool exists multiwand +``` + ### Movement speed adjustment tool The movement speed adjustment tool, as the name suggests, adjusts your local player movement speed. It looks like this: ![A picture of the move speed adjustment tool. It looks like a monarch butterfly.](https://raw.githubusercontent.com/sbrl/Minetest-WorldEditAdditions/dev/worldeditadditions_tools/textures/worldeditadditions_movement.png). @@ -1908,7 +1919,7 @@ See also [`//speed`](#speed). ### Far Wand > Added in v1.7 -The far wand (`worldeditadditions:farwand`) is a variant on the traditional WorldEdit wand (`worldedit:wand`). It looks like this: ![A picture of the far wand](https://raw.githubusercontent.com/sbrl/Minetest-WorldEditAdditions/main/worldeditadditions_tools/textures/worldeditadditions_tools.png) +The far wand (`worldeditadditions:farwand`) is a variant on the traditional WorldEdit wand (`worldedit:wand`). It looks like this: ![A picture of the far wand](https://raw.githubusercontent.com/sbrl/Minetest-WorldEditAdditions/main/worldeditadditions_tools/textures/worldeditadditions_farwand.png) It functions very similarly to the regular WorldEdit wand, except that it has a _much_ longer range - which can be very useful for working on large-scale terrain for example. It also comes with an associated command to control it. diff --git a/README.md b/README.md index 56f1244f..fe0380a3 100644 --- a/README.md +++ b/README.md @@ -129,6 +129,7 @@ The detailed explanations have moved! Check them out [here](https://worldeditadd - [WorldEditAdditions Far Wand](https://github.com/sbrl/Minetest-WorldEditAdditions/blob/main/Chat-Command-Reference.md#far-wand) - [WorldEditAdditions Cloud Wand](https://github.com/sbrl/Minetest-WorldEditAdditions/blob/main/Chat-Command-Reference.md#cloud-wand) - [`//farwand skip_liquid (true|false) | maxdist `](https://github.com/sbrl/Minetest-WorldEditAdditions/blob/main/Chat-Command-Reference.md#farwand-skip_liquid-truefalse--maxdist-number) + - [`//tool list || give|exists `](https://github.com/sbrl/Minetest-WorldEditAdditions/blob/main/Chat-Command-Reference.md#tool-list-giveexists-tool-name) _(new in v1.15)_ ## Installation diff --git a/worldeditadditions_tools/commands/weatool.lua b/worldeditadditions_tools/commands/weatool.lua index f8886c5a..7565e980 100644 --- a/worldeditadditions_tools/commands/weatool.lua +++ b/worldeditadditions_tools/commands/weatool.lua @@ -10,7 +10,7 @@ local wea_t = worldeditadditions_tools worldeditadditions_core.register_command("tool", { params = "list || give|exists ", description = "Give WEA tools by name to the calling player or list available tools.", - privs = { worldedit = true, give = true }, + privs = { worldedit = true, weatool = true }, require_pos = 0, parse = function(params_text) local ret = wea_c.split(params_text) diff --git a/worldeditadditions_tools/init.lua b/worldeditadditions_tools/init.lua index 98e80689..7c50cc2d 100644 --- a/worldeditadditions_tools/init.lua +++ b/worldeditadditions_tools/init.lua @@ -4,6 +4,11 @@ worldeditadditions_tools = { } local wea_t = worldeditadditions_tools +minetest.register_privilege("weatool", { + description = "Allows players to use WEA tools.", + give_to_singleplayer = true, + give_to_admin = true, +}) local modpath = minetest.get_modpath("worldeditadditions_tools") From 8ab8bf2ed9db2f64cfc445896e788a739448a7b6 Mon Sep 17 00:00:00 2001 From: VorTechnix <45538536+VorTechnix@users.noreply.github.com> Date: Thu, 10 Oct 2024 09:21:08 -0700 Subject: [PATCH 4/9] use locals --- worldeditadditions_tools/items/cloudwand.lua | 2 +- worldeditadditions_tools/items/farwand.lua | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/worldeditadditions_tools/items/cloudwand.lua b/worldeditadditions_tools/items/cloudwand.lua index 4df41a97..9182de4e 100644 --- a/worldeditadditions_tools/items/cloudwand.lua +++ b/worldeditadditions_tools/items/cloudwand.lua @@ -17,7 +17,7 @@ wea_t.register_tool("cloudwand", { on_use = function(itemstack, player, pointed_thing) local name = player:get_player_name() -- print("[farwand] on_use", name) - local looking_pos, node_id = worldeditadditions_tools.do_raycast(player) + local looking_pos, node_id = wea_t.do_raycast(player) wea.selection.add_point(name, looking_pos) -- Left click when pointing at something or nothing end, diff --git a/worldeditadditions_tools/items/farwand.lua b/worldeditadditions_tools/items/farwand.lua index 44114912..1b174eb0 100644 --- a/worldeditadditions_tools/items/farwand.lua +++ b/worldeditadditions_tools/items/farwand.lua @@ -32,14 +32,14 @@ wea_t.register_tool("farwand", { -- print("[farwand] on_place", name) -- Right click when pointing at something -- Pointed thing: https://rubenwardy.com/minetest_modding_book/lua_api.html#pointed_thing - local looking_pos, node_id = worldeditadditions_tools.do_raycast(player) + local looking_pos, node_id = wea_t.do_raycast(player) set_pos2(name, looking_pos) end, on_use = function(itemstack, player, pointed_thing) local name = player:get_player_name() -- print("[farwand] on_use", name) - local looking_pos, node_id = worldeditadditions_tools.do_raycast(player) + local looking_pos, node_id = wea_t.do_raycast(player) set_pos1(name, looking_pos) -- Left click when pointing at something or nothing end, @@ -49,7 +49,7 @@ wea_t.register_tool("farwand", { -- Right click when pointing at nothing -- print("[farwand] on_secondary_use", name) - local looking_pos, node_id = worldeditadditions_tools.do_raycast(player) + local looking_pos, node_id = wea_t.do_raycast(player) set_pos2(name, looking_pos) end }) From f2a6b5531a6efeb53f95554909d09777cc90ed34 Mon Sep 17 00:00:00 2001 From: VorTechnix <45538536+VorTechnix@users.noreply.github.com> Date: Thu, 10 Oct 2024 09:21:34 -0700 Subject: [PATCH 5/9] code documentation tweaks --- worldeditadditions_tools/init.lua | 1 + worldeditadditions_tools/lib/register_tool.lua | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/worldeditadditions_tools/init.lua b/worldeditadditions_tools/init.lua index 7c50cc2d..876a863f 100644 --- a/worldeditadditions_tools/init.lua +++ b/worldeditadditions_tools/init.lua @@ -1,3 +1,4 @@ +---@diagnostic disable-next-line: lowercase-global worldeditadditions_tools = { player_data = {}, registered_tools = {}, diff --git a/worldeditadditions_tools/lib/register_tool.lua b/worldeditadditions_tools/lib/register_tool.lua index 2182ea4f..5ce61c9d 100644 --- a/worldeditadditions_tools/lib/register_tool.lua +++ b/worldeditadditions_tools/lib/register_tool.lua @@ -27,7 +27,13 @@ end --- Registers a new WorldEditAdditions tool. --- @param tool string The name of the tool to register. +-- @param tool string The name of the tool to register (sans the ":worldeditadditions:" prefix). +--[[ + === WARNING === + ":worldeditadditions:" will be prepended to the `tool` param so + calling `register_tool(":worldeditadditions:", def_table)` + may cause errors. +--]] -- @param options table A table of options for the tool: -- - `description` (string) A description of the tool. -- - `inventory_image` (string) The path to the image for the tool. From bb0d92ec36cf80771a16cadec2868e3347625efd Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Fri, 11 Oct 2024 00:12:11 +0100 Subject: [PATCH 6/9] multiwand: update dangling call to wea.farwand wea.farwand was renamed to worldeditadditions_tools, but this reference wasn't updated at the same time. This commit fixes that. --- worldeditadditions_tools/items/multiwand.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worldeditadditions_tools/items/multiwand.lua b/worldeditadditions_tools/items/multiwand.lua index b036c615..afbba488 100644 --- a/worldeditadditions_tools/items/multiwand.lua +++ b/worldeditadditions_tools/items/multiwand.lua @@ -44,7 +44,7 @@ wea_t.register_tool("multiwand", { local player_name = player:get_player_name() wea_c.pos.compat_worldedit_get(player_name) -- print("[farwand] on_use", player_name) - local looking_pos, node_id = wea.farwand.do_raycast(player) + local looking_pos, node_id = wea_t.do_raycast(player) push_pos(player_name, looking_pos) end, From b57b3e85ee42c10b191cdb46d3c16dfb4c3ca89f Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Fri, 11 Oct 2024 00:56:05 +0100 Subject: [PATCH 7/9] multiwand: don't call commpate_worldedit_get ....that is now handled transparently since this is the only call to that function we've hidden it so it isn't exported from weac.pos Finally, mark these functions as internal as they shouldn't be called except internally in pos.lua --- worldeditadditions_tools/items/multiwand.lua | 4 ---- 1 file changed, 4 deletions(-) diff --git a/worldeditadditions_tools/items/multiwand.lua b/worldeditadditions_tools/items/multiwand.lua index afbba488..c246c18a 100644 --- a/worldeditadditions_tools/items/multiwand.lua +++ b/worldeditadditions_tools/items/multiwand.lua @@ -34,7 +34,6 @@ wea_t.register_tool("multiwand", { -- Right click when pointing at something -- Pointed thing: https://rubenwardy.com/minetest_modding_book/lua_api.html#pointed_thing local player_name = player:get_player_name() - wea_c.pos.compat_worldedit_get(player_name) -- print("[farwand] on_place", player_name) pop_pos(player_name) end, @@ -42,7 +41,6 @@ wea_t.register_tool("multiwand", { on_use = function(itemstack, player, pointed_thing) -- Left click when pointing at something or nothing local player_name = player:get_player_name() - wea_c.pos.compat_worldedit_get(player_name) -- print("[farwand] on_use", player_name) local looking_pos, node_id = wea_t.do_raycast(player) push_pos(player_name, looking_pos) @@ -52,8 +50,6 @@ wea_t.register_tool("multiwand", { -- Right click when pointing at nothing local player_name = player:get_player_name() -- print("[farwand] on_secondary_use", player_name) - wea_c.pos.compat_worldedit_get(player_name) - -- local looking_pos, node_id = do_raycast(player) pop_pos(player_name) end }) From 90f97234a881de012fcadb69492dba985f873d16 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Fri, 11 Oct 2024 00:56:17 +0100 Subject: [PATCH 8/9] fixup --- worldeditadditions_core/core/pos.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/worldeditadditions_core/core/pos.lua b/worldeditadditions_core/core/pos.lua index 77728d62..73e13cf9 100644 --- a/worldeditadditions_core/core/pos.lua +++ b/worldeditadditions_core/core/pos.lua @@ -84,6 +84,7 @@ local function compat_worldedit_pos2_get(player_name) end --- Sets pos1/pos2 in worldedit for compatibility. +-- @internal -- @param player_name string The name of the player to set the position for. -- @param i number The index of the position to set. -- @param pos Vector3 The position to set. @@ -106,6 +107,7 @@ local function compat_worldedit_set(player_name, i, pos, do_update) end --- Fetches pos1/pos2 from WorldEdit (if available) and sets them in WorldEditAdditions' postional subsystem +-- @internal -- @param player_name string The name of the player to sync the positions for. local function compat_worldedit_get(player_name) compat_worldedit_pos1_get(player_name) @@ -334,7 +336,6 @@ anchor = wea_c.EventEmitter.new({ set_all = set_all, unmark = unmark, mark = mark, - compat_worldedit_get = compat_worldedit_get, }) anchor.debug = false From be38238ca346d9b148954352c5bdb85bc24a2536 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Fri, 11 Oct 2024 03:25:36 +0100 Subject: [PATCH 9/9] .luacheckrc: add worldeditadditions_tools as a global --- .luacheckrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.luacheckrc b/.luacheckrc index a7bd5d89..41422cae 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -22,6 +22,7 @@ globals = { "worldeditadditions", "worldeditadditions_commands", "worldeditadditions_core", + "worldeditadditions_tools" } -- Read-only globals read_globals = {