fork from InfinityProject's mod

http://minetest.net/forum/viewtopic.php?id=3191
This commit is contained in:
Brett O'Donnell 2012-09-27 06:40:17 +09:30
commit d74ca6d82d
4 changed files with 60 additions and 0 deletions

11
README.txt Normal file
View File

@ -0,0 +1,11 @@
Xray Mod by InfinityProject version 0.1
License: Code GPLv3 Textures WTFPL It's just transparnecy :)
Inspired by the famous Minecraft mod.
Please note that this is a beta release. There may be bugs
and the transformation between regular stone and invisible
stone takes a while.
I will speed this up in later versions.

1
xray/depends.txt Normal file
View File

@ -0,0 +1 @@
default

48
xray/init.lua Normal file
View File

@ -0,0 +1,48 @@
local function xray(mode)
XRAY_MODE = mode
end
minetest.register_chatcommand("xray", {
params = "<mode>",
description = "Make stone invisible.",
privs = {shout=true},
func = function(name, param)
if param == 'on' then xray(1)
minetest.chat_send_player(name, "Xray turned on.")
elseif param == 'off' then xray(2)
minetest.chat_send_player(name, "Xray turned off.")
else
minetest.chat_send_player(name, "Please enter 'on' or 'off'.")
end
end,
})
minetest.register_abm({
nodenames = {"default:stone", "xray:stone"},
interval = 0,
chance = 4,
action = function(pos, node, active_object_count, active_object_count_wider)
if XRAY_MODE == 1 then
if node.name == "default:stone" then
minetest.env:add_node(pos,{name="xray:stone"})
elseif XRAY_MODE == 2 then
if node.name == "xray:stone" then
minetest.env:add_node(pos,{name="xray:stone"})
end
end
end
end
})
minetest.register_node("xray:stone", {
description = "Xray Stone",
tiles = {"xray_stone.png"},
is_ground_content = true,
groups = {cracky=3},
drop = 'default:cobble',
legacy_mineral = true,
sounds = default.node_sound_stone_defaults(),
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB