Compare commits

...

12 Commits

16 changed files with 130 additions and 11 deletions

View File

@ -1,6 +1,6 @@
{
"name": "worldeditadditions",
"version": "1.14.4",
"version": "1.14.5",
"description": "Documentation website for WorldEditAdditions",
"main": "index.js",
"private": true,

26
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,26 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''
---
**Describe the bug**
What's the bug? Be clear and concise in our explanation. Don't forget to include any context, error messages, logs, and screenshots required to understand the issue if applicable.
**Reproduction steps:**
Steps to reproduce the behaviour:
1. Go to '...'
2. Click on '....'
3. Enter this command to '....'
4. See error
**System information (please complete the following information):**
- **Operating system and version:** [e.g. iOS]
- **Minetest version:** [e.g. 5.8.0]
- **WorldEdit version:**
- **WorldEditAdditions version:**
Please add any other additional specific system information here too if you think it would help.

View File

@ -0,0 +1,22 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''
---
## Problem
A clear and concise description of what the problem you want to solve is. e.g. I'm always frustrated when [...]
## Solution
Describe clearly the solution you'd like.
## Alternatives
A clear and concise description of any alternative solutions or features you've considered, and how they relate to your proposed feature.
## Additional context
Add any other context or screenshots about the feature request here.
Don't forget to remove replace descriptions, but keep the headers.

View File

@ -4,6 +4,11 @@ It's about time I started a changelog! This will serve from now on as the main c
Note to self: See the bottom of this file for the release template text.
## v1.14.5: The multipoint update, hotfix 5 (1st August 2023)
- Fix a bug where creative players in survival couldn't punch out position markers
- Added `//listentities`, which lists all currently loaded `ObjectRef`s. This is intended for debugging mods - thanks to @Zughy in #103
## v1.14.4: The multipoint update, hotfix 4 (31st July 2023)
- When any segment of the marker wall is punched, unmark the entire wall
@ -11,6 +16,7 @@ Note to self: See the bottom of this file for the release template text.
## v1.14.3: The multipoint update, hotfix 3 (18th July 2023)
- Fix regions not remembering their state and being unresettable
## v1.14.2: The multipoint update, hotfix 2 (15th July 2023)
- Fix crash in `//subdivide`, again due to the new position system

View File

@ -1349,6 +1349,17 @@ Here are some more examples:
```
### `//listentities`
Lists all currently loaded ObjectRefs. Displays their IDs, Names (if possible), and possitions.
This command is intended for development and modding. You will not normally need to use this command using WorldEditAdditions.
`//listentities` takes no arguments.
```
//listentities
```
## Extras
<!--

View File

@ -1,5 +1,5 @@
# ![](https://raw.githubusercontent.com/sbrl/Minetest-WorldEditAdditions/main/worldeditadditions-64.png) Minetest-WorldEditAdditions
![GitHub release (latest by date)](https://img.shields.io/github/v/release/sbrl/Minetest-WorldEditAdditions?color=green&label=latest%20release) [![View the changelog](https://img.shields.io/badge/%F0%9F%93%B0-Changelog-informational)](https://github.com/sbrl/Minetest-WorldEditAdditions/blob/main/CHANGELOG.md) [![ContentDB](https://content.minetest.net/packages/Starbeamrainbowlabs/worldeditadditions/shields/downloads/)](https://content.minetest.net/packages/Starbeamrainbowlabs/worldeditadditions/)
# ![](https://raw.githubusercontent.com/sbrl/Minetest-WorldEditAdditions/main/worldeditadditions-64.png) WorldEditAdditions
![GitHub release (latest by date)](https://img.shields.io/github/v/release/sbrl/Minetest-WorldEditAdditions?color=green&label=latest%20release) [![View the changelog](https://img.shields.io/badge/%F0%9F%93%B0-Changelog-informational)](https://github.com/sbrl/Minetest-WorldEditAdditions/blob/main/CHANGELOG.md) [![ContentDB](https://content.minetest.net/packages/Starbeamrainbowlabs/worldeditadditions/shields/downloads/)](https://content.minetest.net/packages/Starbeamrainbowlabs/worldeditadditions/) [![Join the official discord server](https://worldeditadditions.mooncarrot.space/img/shield-discord.svg)](https://discord.gg/FzD73kuhsk)
> Extra tools and commands to extend WorldEdit for Minetest

View File

@ -2,10 +2,10 @@
set -e;
# current_branch="$(git rev-parse --abbrev-ref HEAD)";
is_main="$(git branch --contains HEAD | awk '/HEAD/ { next } /main/ { print $1 }')";
is_main="$(git branch --contains HEAD | awk '/HEAD/ { next } /dev/ { print $1 }')";
if [[ "${1}" == "ci" ]] && [[ ! -z "${is_main}" ]]; then
echo "Skipping build, because this commit does not appear to be on the 'main' branch, and we only deploy commits on the 'main' branch.";
echo "Skipping build, because this commit does not appear to be on the 'dev' branch, and we only deploy commits on the 'main' branch.";
fi
# ██████ ██ ██████ ██ ██ ██ ██ ██████

View File

@ -1,6 +1,6 @@
--- WorldEditAdditions
-- @namespace worldeditadditions
-- @release 1.14.4
-- @release 1.14.5
-- @copyright 2023 Starbeamrainbowlabs
-- @license Mozilla Public License, 2.0
-- @author Starbeamrainbowlabs

View File

@ -1,6 +1,7 @@
local wea = worldeditadditions
--- Noise generation algorithm engines.
-- @namespace worldeditadditions.noise.engines
return {
available = { "perlin", "perlinmt", "sin", "white", "red", "infrared" },
Perlin = dofile(wea.modpath.."/lib/noise/engines/perlin.lua"),

View File

@ -1,5 +1,8 @@
local wea = worldeditadditions
--- System to manipulate the world using noise generation functions.
-- @namespace worldeditadditions.noise
wea.noise = {}
-- The command itself

View File

@ -16,3 +16,5 @@ dofile(we_cmdpath.."many.lua")
dofile(we_cmdpath.."multi.lua")
dofile(we_cmdpath.."noiseapply2d.lua")
dofile(we_cmdpath.."subdivide.lua")
dofile(we_cmdpath.."listentities.lua")

View File

@ -0,0 +1,39 @@
-- Lists all currently loaded entities.
local weac = worldeditadditions_core
minetest.register_chatcommand("/listentities", {
params = "",
description =
"Lists all currently loaded entities. This is a command for debugging and development. You will not need this unless you are developing a mod.",
privs = { worldedit = true },
func = function(name, params_text)
local table_vals = {
{ "ID", "Name", "Position" },
{ "------", "-------", "---------" },
}
for id, obj in pairs(minetest.object_refs) do
local obj_name = "[ObjectRef]"
if obj.get_luaentity then
local luaentity = obj:get_luaentity()
if luaentity then
obj_name = "[LuaEntity:"..luaentity.name.."]"
else
obj_name = "[LuaEntity:__UNKNOWN__]"
end
end
local pos = weac.Vector3.clone(obj:get_pos())
table.insert(table_vals, {
id,
obj_name,
tostring(pos)
})
end
worldedit.player_notify(name, table.concat({
"Currently loaded entities:",
weac.format.make_ascii_table(table_vals),
"",
"Total "..tostring(#table_vals).." objects"
}, "\n"))
end
})

View File

@ -18,6 +18,7 @@ local WEAPositionMarker = {
collisionbox = { -0.55, -0.55, -0.55, 0.55, 0.55, 0.55 },
physical = false,
collide_with_objects = false,
hp_max = 1,
textures = {
"worldeditadditions_core_bg.png",
@ -31,6 +32,7 @@ local WEAPositionMarker = {
on_activate = function(self, staticdata)
local data = minetest.parse_json(staticdata)
print("DEBUG:pos_marker ON_ACTIVATE data", data)
if type(data) ~= "table" or data.id ~= last_reset then
-- print("DEBUG:marker_wall/remove staticdata", staticdata, "last_reset", last_reset)
self.object:remove()
@ -52,6 +54,7 @@ local WEAPositionMarker = {
anchor.set_number(self.object, self.display_number)
end,
on_punch = function(self, _)
print("DEBUG:pos_marker on_punch")
anchor.delete(self)
end,
on_blast = function(self, damage)
@ -155,5 +158,5 @@ anchor = EventEmitter.new({
delete = delete,
set_number = set_number
})
anchor.debug = true
return anchor

View File

@ -22,7 +22,8 @@ local WEAPositionMarkerWall = {
-- ^^ { xmin, ymin, zmin, xmax, ymax, zmax } relative to obj pos
physical = false,
collide_with_objects = false,
hp_max = 1,
textures = {
"worldeditadditions_core_marker_wall.png",
"worldeditadditions_core_marker_wall.png",
@ -53,6 +54,7 @@ local WEAPositionMarkerWall = {
})
end,
on_punch = function(self, _)
print("DEBUG:pos_marker_wall on_punch")
anchor.delete(self)
-- Only unmark the rest of the walls
-- Unmark for the player that created this wall.... NOT the player who punched it!

View File

@ -1,6 +1,6 @@
--- WorldEditAdditions-Core
-- @namespace worldeditadditions_core
-- @release 1.14.4
-- @release 1.14.5
-- @copyright 2021 Starbeamrainbowlabs and VorTechnix
-- @license Mozilla Public License, 2.0
-- @author Starbeamrainbowlabs and VorTechnix

View File

@ -58,8 +58,12 @@ end
-- @param event_name string The name of the event to emit.
-- @param args table|any The argument(s) to pass to listener functions. It is strongly advised you pass a table here.
function EventEmitter.emit(this, event_name, args)
if this.debug then
listeners = 0
if this.events[event_name] ~= nil then listeners = #this.events[event_name] end
print("DEBUG:EventEmitter emit", event_name, "listeners", listeners, "args", wea_c.inspect(args))
end
if this.events[event_name] == nil then return end
if this.debug then print("DEBUG:EventEmitter emit", event_name, "args", wea_c.inspect(args)) end
for index,next_func in ipairs(this.events[event_name]) do
next_func(args)