fork from InfinityProject's mod
http://minetest.net/forum/viewtopic.php?id=3191
This commit is contained in:
commit
d74ca6d82d
11
README.txt
Normal file
11
README.txt
Normal 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
1
xray/depends.txt
Normal file
@ -0,0 +1 @@
|
||||
default
|
48
xray/init.lua
Normal file
48
xray/init.lua
Normal 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(),
|
||||
})
|
||||
|
BIN
xray/textures/xray_stone.png
Normal file
BIN
xray/textures/xray_stone.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.7 KiB |
Loading…
x
Reference in New Issue
Block a user