Update alternode mod to Git commit 990b6bb...

https://github.com/AntumMT/mod-alternode/tree/990b6bb
master
Jordan Irwin 2021-05-17 11:49:12 -07:00
parent 9d45221612
commit 5bd5c65f89
6 changed files with 29 additions and 20 deletions

View File

@ -12,7 +12,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m
***"UPDATES" Denotes updates available***
* admin/
* [alternode][] ([MIT][lic.alternode]) -- version: [19b258a Git][ver.alternode] *2021-05-16*
* [alternode][] ([MIT][lic.alternode]) -- version: [990b6bb Git][ver.alternode] *2021-05-17*
* [cleaner][] ([CC0][lic.cc0]) -- version: [0.4 (68222b1 Git)][ver.cleaner] *2017-08-30*
* [invisible][] ([LGPL][lic.lgpl2.1] / [CC BY-SA][lic.ccbysa4.0]) -- version: [4 (a2a6504 Git)][ver.invisible]
* [no_fall_damage][] ([MIT][lic.no_fall_damage]) -- version [1.0.0][ver.no_fall_damage] *2020-12-19*
@ -451,7 +451,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m
[ver.3d_armor]: https://github.com/minetest-mods/3d_armor/tree/f07f050
[ver.airtanks]: https://github.com/minetest-mods/airtanks/tree/b686694
[ver.alternode]: https://github.com/AntumMT/mod-alternode/tree/19b258a
[ver.alternode]: https://github.com/AntumMT/mod-alternode/tree/990b6bb
[ver.amber]: https://github.com/theraven262/amber/tree/56627fa
[ver.ambience]: https://notabug.org/TenPlus1/ambience/src/e317f727d00d5c034226c0e7217ed0559c208038
[ver.animals_aggressive]: https://github.com/AntumMT/mp-animals_aggressive/tree/4eede4d

View File

@ -37,7 +37,7 @@ The `alternode:pencil` is a tool for players to set/unset the `infotext` meta va
- Code: [MIT](LICENSE.txt)
- Textures: CC0
- `alternode_infostick.png & alternode_pencil.png:` by AntumDeluge
- `alternode_wand.png:` by [rcorre](https://opengameart.org/node/40598)
- [`alternode_wand.png`](https://opengameart.org/node/120374)
### Links:

View File

@ -32,7 +32,7 @@ Infotext=
Write=
Erase=
Ownit Wand=
Node Key=
Tool for setting node owner=
You cannot take ownership of a node owned by @1=
You cannot take ownership of nodes in areas you do not own=

Binary file not shown.

After

Width:  |  Height:  |  Size: 397 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 238 B

View File

@ -17,15 +17,6 @@ local function check_permissions(player)
return true
end
local function target_is_node(target)
if target.type ~= "node" then
core.chat_send_player(pname, S("This item only works on nodes"))
return false
end
return true
end
local function is_area_owner(pos, pname)
if not pname then return false end
@ -61,9 +52,14 @@ core.register_craftitem(alternode.modname .. ":infostick", {
on_use = function(itemstack, user, pointed_thing)
if not user:is_player() then return end
if not check_permissions(user) then return end
if not target_is_node(pointed_thing) then return end
local pname = user:get_player_name()
if pointed_thing.type ~= "node" then
core.chat_send_player(pname, S("This item only works on nodes"))
return
end
local pos = core.get_pointed_thing_position(pointed_thing, false)
local node = core.get_node_or_nil(pos)
if not node then
@ -88,7 +84,13 @@ core.register_craftitem(alternode.modname .. ":infostick", {
on_place = function(itemstack, placer, pointed_thing)
if not placer:is_player() then return end
if not check_permissions(placer) then return end
if not target_is_node(pointed_thing) then return end
local pname = user:get_player_name()
if pointed_thing.type ~= "node" then
core.chat_send_player(pname, S("This item only works on nodes"))
return
end
local pos = core.get_pointed_thing_position(pointed_thing, false)
local node = core.get_node_or_nil(pos)
@ -118,6 +120,12 @@ core.register_craftitem(alternode.modname .. ":pencil", {
if not pos then return end
local pname = user:get_player_name()
if pointed_thing.type ~= "node" then
core.chat_send_player(pname, S("This item only works on nodes"))
return
end
if not is_area_owner(pos, pname) then
core.chat_send_player(pname, S("You cannot alter nodes in areas you do not own"))
return
@ -161,13 +169,13 @@ end)
--- Player tool to set/unset *owner* meta value.
--
-- @craftitem alternode:wand
-- @craftitem alternode:key
-- @use
-- @place
core.register_craftitem(alternode.modname .. ":wand", {
core.register_craftitem(alternode.modname .. ":key", {
description = S("Tool for setting node owner"),
short_description = S("Ownit Wand"),
inventory_image = "alternode_wand.png",
short_description = S("Node Key"),
inventory_image = "alternode_key.png",
stack_max = 1,
on_use = function(itemstack, user, pointed_thing)
if not user:is_player() then return end
@ -214,4 +222,5 @@ core.register_craftitem(alternode.modname .. ":wand", {
end
end,
})
core.register_alias("ownit:wand", alternode.modname .. ":wand")
core.register_alias("ownit:wand", alternode.modname .. ":key")
core.register_alias(alternode.modname .. ":wand", alternode.modname .. ":key")