I saw in the commitnotes that this worked with the playerfactions mod, however, when I went to use it, right clicking on the protector produced a fatal crash:
2020-12-24 18:21:44: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod '' in callback item_OnPlace(): ...e/games/minetest/games/mesecraft/mods/protector/init.lua:176: bad argument #1 to 'next' (table expected, got nil)
2020-12-24 18:21:44: ERROR[Main]: stack traceback:
2020-12-24 18:21:44: ERROR[Main]: [C]: in function 'next'
2020-12-24 18:21:44: ERROR[Main]: ...e/games/minetest/games/mesecraft/mods/protector/init.lua:176: in function 'protector_formspec'
2020-12-24 18:21:44: ERROR[Main]: ...e/games/minetest/games/mesecraft/mods/protector/init.lua:504: in function 'on_rightclick'
2020-12-24 18:21:44: ERROR[Main]: /usr/share/games/minetest/builtin/game/item.lua:426: in function </usr/share/games/minetest/builtin/game/item.lua:419>
2020-12-24 19:25:55: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod '' in callback node_on_punch(): /usr/share/games/minetest/builtin/game/auth.lua:13: assertion failed!
2020-12-24 19:25:55: ERROR[Main]: stack traceback:
2020-12-24 19:25:55: ERROR[Main]: [C]: in function 'assert'
2020-12-24 19:25:55: ERROR[Main]: /usr/share/games/minetest/builtin/game/auth.lua:13: in function 'get_auth'
2020-12-24 19:25:55: ERROR[Main]: /usr/share/games/minetest/builtin/game/misc.lua:87: in function 'player_exists'
2020-12-24 19:25:55: ERROR[Main]: ...es/minetest/games/mesecraft/mods/playerfactions/init.lua:51: in function 'player_is_in_faction'
2020-12-24 19:25:55: ERROR[Main]: ...e/games/minetest/games/mesecraft/mods/protector/init.lua:87: in function 'is_member'
2020-12-24 19:25:55: ERROR[Main]: ...e/games/minetest/games/mesecraft/mods/protector/init.lua:312: in function 'can_dig'
2020-12-24 19:25:55: ERROR[Main]: ...e/games/minetest/games/mesecraft/mods/protector/init.lua:363: in function 'is_protected'
2020-12-24 19:25:55: ERROR[Main]: ...e/games/minetest/games/mesecraft/mods/protector/init.lua:512: in function <...e/games/minetest/games/mesecraft/mods/protector/init.lua:510>
Last edited by MeseCraft on Fri Dec 25, 2020 01:54, edited 1 time in total.
2020-12-24 19:33:31: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod '' in callback item_OnPlace(): /usr/share/games/minetest/builtin/game/auth.lua:13: assertion failed!
2020-12-24 19:33:31: ERROR[Main]: stack traceback:
2020-12-24 19:33:31: ERROR[Main]: [C]: in function 'assert'
2020-12-24 19:33:31: ERROR[Main]: /usr/share/games/minetest/builtin/game/auth.lua:13: in function 'get_auth'
2020-12-24 19:33:31: ERROR[Main]: /usr/share/games/minetest/builtin/game/misc.lua:87: in function 'player_exists'
2020-12-24 19:33:31: ERROR[Main]: ...es/minetest/games/mesecraft/mods/playerfactions/init.lua:51: in function 'player_is_in_faction'
2020-12-24 19:33:31: ERROR[Main]: ...e/games/minetest/games/mesecraft/mods/protector/init.lua:87: in function 'is_member'
2020-12-24 19:33:31: ERROR[Main]: ...e/games/minetest/games/mesecraft/mods/protector/init.lua:312: in function 'can_dig'
2020-12-24 19:33:31: ERROR[Main]: ...e/games/minetest/games/mesecraft/mods/protector/init.lua:363: in function 'is_protected'
2020-12-24 19:33:31: ERROR[Main]: /usr/share/games/minetest/builtin/game/item.lua:299: in function 'item_place_node'
2020-12-24 19:33:31: ERROR[Main]: /usr/share/games/minetest/builtin/common/misc_helpers.lua:340: in function </usr/share/games/minetest/builtin/common/misc_helpers.lua:286>
MisterE did most of this, he said I'll try to make an issue in your repo.
We were able to resolve the problems as far as we can tell and its working well now. Ended up with a protector init file as below that is working correctly with playerfactions and protector.
now a conflict with mobs redo
2020-12-24 20:11:40: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod '' in callback LuaABM::trigger(): ...e/games/minetest/games/mesecraft/mods/protector/init.lua:85: bad argument #1 to 'ipairs' (table expected, got boolean)
2020-12-24 20:11:40: ERROR[Main]: stack traceback:
2020-12-24 20:11:40: ERROR[Main]: [C]: in function 'ipairs'
2020-12-24 20:11:40: ERROR[Main]: ...e/games/minetest/games/mesecraft/mods/protector/init.lua:85: in function 'is_member'
2020-12-24 20:11:40: ERROR[Main]: ...e/games/minetest/games/mesecraft/mods/protector/init.lua:312: in function 'can_dig'
2020-12-24 20:11:40: ERROR[Main]: ...e/games/minetest/games/mesecraft/mods/protector/init.lua:363: in function 'is_protected'
2020-12-24 20:11:40: ERROR[Main]: ...re/games/minetest/games/mesecraft/mods/mobs_redo/api.lua:3935: in function 'spawn_action'
2020-12-24 20:11:40: ERROR[Main]: ...re/games/minetest/games/mesecraft/mods/mobs_redo/api.lua:4015: in function <...re/games/minetest/games/mesecraft/mods/mobs_redo/api.lua:4014>
Being inspired by the areas-based protection, where you can set an area name and have it displayed on the hud, I thought that would be nice to have the same feature in the protector mod too! :)
The use case that gave me this idea is a player that's building beautiful PoIs and he nicely names them too, though the only place those names are displayed are in poorly-visible signs at their entrances.
I think it should easily be feasible by adding a new text field to the protector formspec and adding that field value to the hud too, where it already shows the owner.
The placer tool would also need to copy the value as it does with members when used with sneak pressed.
@hlqkj - Protector Redo already displays the owner's name in the bottom left of the screen using HUD and placing a protector using the tool while holding sneak already copies all of the members across to the new one.
@hlqkj - Protector Redo already displays the owner's name in the bottom left of the screen using HUD and placing a protector using the tool while holding sneak already copies all of the members across to the new one.
I know all this of course, indeed, I wasn't talking about the player name but the "area name", that is an additional text field that players could use to name their places...
Note that this wasn't meant to be a feature request, rather more like an opinion poll :)