1 worldedit.marker1 = {}
\r
2 worldedit.marker2 = {}
\r
4 --marks worldedit region position 1
\r
5 worldedit.mark_pos1 = function(name)
\r
6 local pos = worldedit.pos1[name]
\r
7 if worldedit.marker1[name] ~= nil then --marker already exists
\r
8 worldedit.marker1[name]:remove() --remove marker
\r
9 worldedit.marker1[name] = nil
\r
11 if pos ~= nil then --add marker
\r
12 worldedit.marker1[name] = minetest.env:add_entity(pos, "worldedit:pos1")
\r
13 worldedit.marker1[name]:get_luaentity().active = true
\r
17 --marks worldedit region position 2
\r
18 worldedit.mark_pos2 = function(name)
\r
19 local pos = worldedit.pos2[name]
\r
20 if worldedit.marker2[name] ~= nil then --marker already exists
\r
21 worldedit.marker2[name]:remove() --remove marker
\r
22 worldedit.marker2[name] = nil
\r
24 if pos ~= nil then --add marker
\r
25 worldedit.marker2[name] = minetest.env:add_entity(pos, "worldedit:pos2")
\r
26 worldedit.marker2[name]:get_luaentity().active = true
\r
30 minetest.register_entity(":worldedit:pos1", {
\r
31 initial_properties = {
\r
33 visual_size = {x=1.1, y=1.1},
\r
34 textures = {"worldedit_pos1.png", "worldedit_pos1.png",
\r
35 "worldedit_pos1.png", "worldedit_pos1.png",
\r
36 "worldedit_pos1.png", "worldedit_pos1.png"},
\r
37 collisionbox = {-0.55, -0.55, -0.55, 0.55, 0.55, 0.55},
\r
39 on_step = function(self, dtime)
\r
40 if self.active == nil then
\r
41 self.object:remove()
\r
44 on_punch = function(self, hitter)
\r
45 self.object:remove()
\r
46 local name = hitter:get_player_name()
\r
47 worldedit.marker1[name] = nil
\r
51 minetest.register_entity(":worldedit:pos2", {
\r
52 initial_properties = {
\r
54 visual_size = {x=1.1, y=1.1},
\r
55 textures = {"worldedit_pos2.png", "worldedit_pos2.png",
\r
56 "worldedit_pos2.png", "worldedit_pos2.png",
\r
57 "worldedit_pos2.png", "worldedit_pos2.png"},
\r
58 collisionbox = {-0.55, -0.55, -0.55, 0.55, 0.55, 0.55},
\r
60 on_step = function(self, dtime)
\r
61 if self.active == nil then
\r
62 self.object:remove()
\r
65 on_punch = function(self, hitter)
\r
66 self.object:remove()
\r
67 local name = hitter:get_player_name()
\r
68 worldedit.marker2[name] = nil
\r