support mapsync change dispatch
This commit is contained in:
parent
f26ad98d23
commit
c89ab557a0
@ -11,5 +11,8 @@ read_globals = {
|
||||
"vector", "ItemStack",
|
||||
"dump", "dump2",
|
||||
"VoxelArea",
|
||||
"minetest"
|
||||
"minetest",
|
||||
|
||||
-- mods
|
||||
"mapsync"
|
||||
}
|
||||
|
3
mod.conf
3
mod.conf
@ -1,3 +1,4 @@
|
||||
name = pick_and_place
|
||||
description = Pick and place utility
|
||||
depends = wield_events
|
||||
depends = wield_events
|
||||
optional_depends = mapsync
|
@ -1,3 +1,5 @@
|
||||
local has_mapsync = minetest.get_modpath("mapsync")
|
||||
|
||||
minetest.register_tool("pick_and_place:place", {
|
||||
description = "Placement tool",
|
||||
inventory_image = "pick_and_place_plus.png^[colorize:#0000ff",
|
||||
@ -47,6 +49,10 @@ minetest.register_tool("pick_and_place:place", {
|
||||
-- build preview
|
||||
pick_and_place.show_preview(playername, "pick_and_place_plus.png", "#0000ff", pos1, pos2)
|
||||
end
|
||||
|
||||
if has_mapsync then
|
||||
mapsync.mark_changed(pos1, pos2)
|
||||
end
|
||||
end,
|
||||
on_deselect = function(_, player)
|
||||
local playername = player:get_player_name()
|
||||
|
Loading…
x
Reference in New Issue
Block a user