summaryrefslogtreecommitdiff
path: root/entities.lua
diff options
context:
space:
mode:
authorFaceDeer <derksenmobile@gmail.com>2017-01-17 19:57:20 -0700
committerFaceDeer <derksenmobile@gmail.com>2017-01-17 19:57:20 -0700
commit5a30fe40e30b20290ad349d5ec0a4eeb69569381 (patch)
tree0cb1d7a6efe53b935e03f07b99e0edd43aff0cce /entities.lua
parenta3a1402e1b9ef6578375b07654a1c25765104955 (diff)
Add "Doc" modpack support. Also fix up some bugs with crate marker entities, and make them show protected nodes.
Diffstat (limited to 'entities.lua')
-rw-r--r--entities.lua45
1 files changed, 31 insertions, 14 deletions
diff --git a/entities.lua b/entities.lua
index 5f265a9..cafe962 100644
--- a/entities.lua
+++ b/entities.lua
@@ -1,9 +1,9 @@
minetest.register_entity("digtron:marker", {
initial_properties = {
visual = "cube",
- visual_size = {x=1.1, y=1.1},
+ visual_size = {x=1.05, y=1.05},
textures = {"digtron_marker_side.png","digtron_marker_side.png","digtron_marker.png","digtron_marker.png","digtron_marker_side.png","digtron_marker_side.png"},
- collisionbox = {-0.55, -0.55, -0.55, 0.55, 0.55, 0.55},
+ collisionbox = {-0.525, -0.525, -0.525, 0.525, 0.525, 0.525},
physical = false,
},
@@ -27,9 +27,9 @@ minetest.register_entity("digtron:marker", {
minetest.register_entity("digtron:marker_vertical", {
initial_properties = {
visual = "cube",
- visual_size = {x=1.1, y=1.1},
+ visual_size = {x=1.05, y=1.05},
textures = {"digtron_marker.png","digtron_marker.png","digtron_marker_side.png^[transformR90","digtron_marker_side.png^[transformR90","digtron_marker_side.png^[transformR90","digtron_marker_side.png^[transformR90"},
- collisionbox = {-0.55, -0.55, -0.55, 0.55, 0.55, 0.55},
+ collisionbox = {-0.525, -0.525, -0.525, 0.525, 0.525, 0.525},
physical = false,
},
@@ -50,7 +50,7 @@ minetest.register_entity("digtron:marker_vertical", {
end,
})
-minetest.register_entity("digtron:marker_crate", {
+minetest.register_entity("digtron:marker_crate_good", {
initial_properties = {
visual = "cube",
visual_size = {x=1.05, y=1.05},
@@ -60,15 +60,32 @@ minetest.register_entity("digtron:marker_crate", {
},
on_activate = function(self, staticdata)
- local pos = self.object:getpos()
- local node = minetest.get_node(pos)
- local node_def = minetest.registered_nodes[node.name]
- if not node_def.buildable_to then
- local props = self.object:get_properties()
- props.textures = {"digtron_no_entry.png", "digtron_no_entry.png", "digtron_no_entry.png", "digtron_no_entry.png", "digtron_no_entry.png", "digtron_no_entry.png"}
- self.object:set_properties(props)
- end
-
+ minetest.after(5.0,
+ function(self)
+ self.object:remove()
+ end,
+ self)
+ end,
+
+ on_rightclick=function(self, clicker)
+ self.object:remove()
+ end,
+
+ on_punch = function(self, hitter)
+ self.object:remove()
+ end,
+})
+
+minetest.register_entity("digtron:marker_crate_bad", {
+ initial_properties = {
+ visual = "cube",
+ visual_size = {x=1.05, y=1.05},
+ textures = {"digtron_no_entry.png", "digtron_no_entry.png", "digtron_no_entry.png", "digtron_no_entry.png", "digtron_no_entry.png", "digtron_no_entry.png"},
+ collisionbox = {-0.525, -0.525, -0.525, 0.525, 0.525, 0.525},
+ physical = false,
+ },
+
+ on_activate = function(self, staticdata)
minetest.after(5.0,
function(self)
self.object:remove()