summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFaceDeer <derksenmobile@gmail.com>2017-01-17 11:50:02 -0700
committerFaceDeer <derksenmobile@gmail.com>2017-01-17 11:50:02 -0700
commita3a1402e1b9ef6578375b07654a1c25765104955 (patch)
treede3e588a0fae28533a1e246b31775b156be03b09
parent960d4e4155c3156c029c5be14c0ac4dbf1e08b45 (diff)
Crate marker entities will indicate when they're in a non-buildable node. Doesn't show protection though.
-rw-r--r--entities.lua9
-rw-r--r--textures/digtron_no_entry.pngbin0 -> 556 bytes
2 files changed, 9 insertions, 0 deletions
diff --git a/entities.lua b/entities.lua
index fa109b7..5f265a9 100644
--- a/entities.lua
+++ b/entities.lua
@@ -60,6 +60,15 @@ 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()
diff --git a/textures/digtron_no_entry.png b/textures/digtron_no_entry.png
new file mode 100644
index 0000000..89c4875
--- /dev/null
+++ b/textures/digtron_no_entry.png
Binary files differ