From a3a1402e1b9ef6578375b07654a1c25765104955 Mon Sep 17 00:00:00 2001 From: FaceDeer Date: Tue, 17 Jan 2017 11:50:02 -0700 Subject: Crate marker entities will indicate when they're in a non-buildable node. Doesn't show protection though. --- entities.lua | 9 +++++++++ textures/digtron_no_entry.png | Bin 0 -> 556 bytes 2 files changed, 9 insertions(+) create mode 100644 textures/digtron_no_entry.png 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 Binary files /dev/null and b/textures/digtron_no_entry.png differ -- cgit v1.2.3