diff options
author | Joshua <ehlodex@users.noreply.github.com> | 2017-12-14 13:41:11 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-14 13:41:11 -0500 |
commit | 98e3e01610071c9b7f0dbfc6a1c55d62d95b699f (patch) | |
tree | 466ff07da2d9980e4f86ef49c27b5256892f723d | |
parent | 92553776cd72d80df995f3edfc275089f1e5e042 (diff) | |
download | ehlphabet-98e3e01610071c9b7f0dbfc6a1c55d62d95b699f.tar.gz ehlphabet-98e3e01610071c9b7f0dbfc6a1c55d62d95b699f.tar.bz2 ehlphabet-98e3e01610071c9b7f0dbfc6a1c55d62d95b699f.zip |
Prevent digging with blocks inside
-rw-r--r-- | init.lua | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -22,6 +22,18 @@ minetest.register_node("ehlphabet:machine", { paramtype = "light",
groups = {cracky=2},
+ can_dig = function(pos, player) -- "Can you dig it?" -Cyrus
+ local meta = minetest.env:get_meta(pos)
+ local inv = meta:get_inventory()
+ if not inv:is_empty("input") or not inv:is_empty("output") then
+ if player then
+ minetest.chat_send_player(player:get_player_name(), "You cannot dig the Letter Machine with blocks inside")
+ end -- end if player
+ return false
+ end -- end if not empty
+ return true
+ end, -- end can_dig function
+
after_place_node = function(pos, placer)
local meta = minetest.env:get_meta(pos)
end,
@@ -59,7 +71,7 @@ minetest.register_node("ehlphabet:machine", { })
minetest.register_node("ehlphabet:block", {
- description = "Blank Ehlphabet Block",
+ description = "Ehlphabet Block (blank)",
tiles = {"ehlphabet_000.png"},
groups = {cracky=3},
})
|