From d74ca6d82d4ea94424c8f446b726d71488fb4fcb Mon Sep 17 00:00:00 2001 From: Brett O'Donnell Date: Thu, 27 Sep 2012 06:40:17 +0930 Subject: [PATCH] fork from InfinityProject's mod http://minetest.net/forum/viewtopic.php?id=3191 --- README.txt | 11 ++++++++ xray/depends.txt | 1 + xray/init.lua | 48 +++++++++++++++++++++++++++++++++++ xray/textures/xray_stone.png | Bin 0 -> 2776 bytes 4 files changed, 60 insertions(+) create mode 100644 README.txt create mode 100644 xray/depends.txt create mode 100644 xray/init.lua create mode 100644 xray/textures/xray_stone.png diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..d836881 --- /dev/null +++ b/README.txt @@ -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. diff --git a/xray/depends.txt b/xray/depends.txt new file mode 100644 index 0000000..331d858 --- /dev/null +++ b/xray/depends.txt @@ -0,0 +1 @@ +default \ No newline at end of file diff --git a/xray/init.lua b/xray/init.lua new file mode 100644 index 0000000..85cffd1 --- /dev/null +++ b/xray/init.lua @@ -0,0 +1,48 @@ +local function xray(mode) +XRAY_MODE = mode +end + +minetest.register_chatcommand("xray", { + params = "", + 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(), +}) + diff --git a/xray/textures/xray_stone.png b/xray/textures/xray_stone.png new file mode 100644 index 0000000000000000000000000000000000000000..39701ceead71d1c1fd9b468d1f1f5d0c2110d56f GIT binary patch literal 2776 zcmV;}3Mci6P)Oz@Z0f2-7z;ux~O9+4z06=<WDR*FRcSTFz- zW=q650N5=6FiBTtNC2?60Km==3$g$R3;-}uh=nNt1bYBr$Ri_o0EC$U6h`t_Jn<{8 z5a%iY0C<_QJh>z}MS)ugEpZ1|S1ukX&Pf+56gFW3VVXcL!g-k)GJ!M?;PcD?0HBc- z5#WRK{dmp}uFlRjj{U%*%WZ25jX z{P*?XzTzZ-GF^d31o+^>%=Ap99M6&ogks$0k4OBs3;+Bb(;~!4V!2o<6ys46agIcq zjPo+3B8fthDa9qy|77CdEc*jK-!%ZRYCZvbku9iQV*~a}ClFY4z~c7+0P?$U!PF=S z1Au6Q;m>#f??3%Vpd|o+W=WE9003S@Bra6Svp>fO002awfhw>;8}z{#EWidF!3EsG z3;bXU&9EIRU@z1_9W=mEXoiz;4lcq~xDGvV5BgyU zp1~-*fe8db$Osc*A=-!mVv1NJjtCc-h4>-CNCXm#Bp}I%6j35eku^v$Qi@a{RY)E3 zJ#qp$hg?Rwkvqr$GJ^buyhkyVfwECO)C{#lxu`c9ghrwZ&}4KmnvWKso6vH!8a<3Q zq36)6Xb;+tK10Vaz~~qUGsJ8#F2=(`u{bOVlVi)VBCHIn#u~6ztOL7=^<&SmcLWlF zMZgI*1b0FpVIDz9SWH+>*hr`#93(Um+6gxa1B6k+CnA%mOSC4s5&6UzVlpv@SV$}* z))J2sFA#f(L&P^E5{W}HC%KRUNwK6<(h|}}(r!{C=`5+6G)NjFlgZj-YqAG9lq?`C z$c5yc>d>VnA`E_*3F2Qp##d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