From c8b37b686b656834fca3ac1a7bca7b11aeeef829 Mon Sep 17 00:00:00 2001 From: jojoa1997 Date: Sat, 16 Mar 2013 15:00:43 -0400 Subject: [PATCH] adds wifi chests from 0gb.us's chest mod --- mods/default/init.lua | 48 ++++++++++++++++++ .../default_chest_wifi_front_animated.png | Bin 0 -> 462 bytes .../textures/default_chest_wifi_side.png | Bin 0 -> 244 bytes .../textures/default_chest_wifi_top.png | Bin 0 -> 239 bytes 4 files changed, 48 insertions(+) create mode 100644 mods/default/textures/default_chest_wifi_front_animated.png create mode 100644 mods/default/textures/default_chest_wifi_side.png create mode 100644 mods/default/textures/default_chest_wifi_top.png diff --git a/mods/default/init.lua b/mods/default/init.lua index 99f7cb82..ca8d1cbd 100644 --- a/mods/default/init.lua +++ b/mods/default/init.lua @@ -389,6 +389,15 @@ minetest.register_craft({ } }) +minetest.register_craft({ + output = 'default:chest_wifi', + recipe = { + {'group:wood','default:mese','group:wood'}, + {'group:wood','default:steel_ingot','group:wood'}, + {'group:wood','group:wood','default:wood'} + } +}) + minetest.register_craft({ output = 'default:furnace', recipe = { @@ -1382,6 +1391,38 @@ minetest.register_node("default:chest_locked", { end, }) +minetest.register_node("default:chest_wifi", { + description = "Wifi Chest", + tiles = {"default_chest_wifi_top.png", "default_chest_wifi_top.png", "default_chest_wifi_side.png", + "default_chest_wifi_side.png", "default_chest_wifi_side.png", +{name="default_chest_wifi_front_animated.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0}} +}, + paramtype2 = "facedir", + groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, + legacy_facedir_simple = true, + sounds = default.node_sound_wood_defaults(), + on_construct = function(pos) + local meta = minetest.env:get_meta(pos) + meta:set_string("formspec", + "size[8,9]".. + "list[current_player;default:chest_wifi;0,0;8,4;]".. + "list[current_player;main;0,5;8,4;]") + meta:set_string("infotext", "Wifi Chest") + end, + on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) + minetest.log("action", player:get_player_name().. + " moves stuff in wifi chest at "..minetest.pos_to_string(pos)) + end, + on_metadata_inventory_put = function(pos, listname, index, stack, player) + minetest.log("action", player:get_player_name().. + " moves stuff to wifi chest at "..minetest.pos_to_string(pos)) + end, + on_metadata_inventory_take = function(pos, listname, index, stack, player) + minetest.log("action", player:get_player_name().. + " takes stuff from wifi chest at "..minetest.pos_to_string(pos)) + end, +}) + default.furnace_inactive_formspec = "size[8,9]".. "image[2,2;1,1;default_furnace_fire_bg.png]".. @@ -1735,6 +1776,13 @@ minetest.register_craftitem("default:obsidian_shard", { inventory_image = "default_obsidian_shard.png", }) +-- Wifi stuff +minetest.register_on_joinplayer(function(player) + local inv = player:get_inventory() + inv:set_size("default:chest_wifi", 8*4) +end) + + -- Support old code function default.spawn_falling_node(p, nodename) spawn_falling_node(p, nodename) diff --git a/mods/default/textures/default_chest_wifi_front_animated.png b/mods/default/textures/default_chest_wifi_front_animated.png new file mode 100644 index 0000000000000000000000000000000000000000..77bcb445e079bfeee19427bc467930578535a95e GIT binary patch literal 462 zcmV;<0WtoGP)N-6{J+j zP}kAn5!+I{qgO8Ha;B}t+gJY|KavH`j58lLsaU3>^)AYQ~gJqeab-yvd=c+u2WgP2&U*bevodkqijh6km3 z&-Djfx7r`lmN4%>V!Z07*qoM6N<$ Eg1gqr*Z=?k literal 0 HcmV?d00001 diff --git a/mods/default/textures/default_chest_wifi_side.png b/mods/default/textures/default_chest_wifi_side.png new file mode 100644 index 0000000000000000000000000000000000000000..f58fae953ab70fc10aa8eec832df4074db24e485 GIT binary patch literal 244 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE+c0ifI^L)E{-7tA5`PoA>45A_UxD28a|^b* ztyKJWFPO8dqsM;JSDP5|yeAX5r7}Fjblv~nW1atNb9rrC*v-{B;n$S?S

L^Sy8R hd1e~-JljC+_~wQl;OXk;vd$@?2>{96PNM(- literal 0 HcmV?d00001 diff --git a/mods/default/textures/default_chest_wifi_top.png b/mods/default/textures/default_chest_wifi_top.png new file mode 100644 index 0000000000000000000000000000000000000000..35c01d0f9d8deb6111caffde111a447368384271 GIT binary patch literal 239 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE7~I31rI22ERJzc;QoGJ z%X*8x?UO|pPI;eGVL7;Z>$ek*ca)UU!kCz6Y+!Ja?c!nJ%Tf e;bVyVPo`&u-k;dG8S;VdVDNPHb6Mw<&;$SmXj9Ap literal 0 HcmV?d00001