From 5e3ec2d4dd14f690d3cecad8dcf161cf39aa9b49 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Thu, 16 Jul 2015 18:45:10 +0100 Subject: [PATCH] Remove bones mod --- mods/bones/README.txt | 17 --- mods/bones/depends.txt | 1 - mods/bones/init.lua | 219 --------------------------- mods/bones/textures/bones_bottom.png | Bin 181 -> 0 bytes mods/bones/textures/bones_front.png | Bin 183 -> 0 bytes mods/bones/textures/bones_rear.png | Bin 187 -> 0 bytes mods/bones/textures/bones_side.png | Bin 188 -> 0 bytes mods/bones/textures/bones_top.png | Bin 182 -> 0 bytes 8 files changed, 237 deletions(-) delete mode 100644 mods/bones/README.txt delete mode 100644 mods/bones/depends.txt delete mode 100644 mods/bones/init.lua delete mode 100644 mods/bones/textures/bones_bottom.png delete mode 100644 mods/bones/textures/bones_front.png delete mode 100644 mods/bones/textures/bones_rear.png delete mode 100644 mods/bones/textures/bones_side.png delete mode 100644 mods/bones/textures/bones_top.png diff --git a/mods/bones/README.txt b/mods/bones/README.txt deleted file mode 100644 index b0ebed8..0000000 --- a/mods/bones/README.txt +++ /dev/null @@ -1,17 +0,0 @@ -Minetest 0.4 mod: bones -======================= - -License of source code: ------------------------ -Copyright (C) 2012 PilzAdam - -WTFPL - -License of media (textures and sounds) --------------------------------------- -Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) -http://creativecommons.org/licenses/by-sa/3.0/ - -Authors of media files ----------------------- -Bad_Command_ diff --git a/mods/bones/depends.txt b/mods/bones/depends.txt deleted file mode 100644 index 4ad96d5..0000000 --- a/mods/bones/depends.txt +++ /dev/null @@ -1 +0,0 @@ -default diff --git a/mods/bones/init.lua b/mods/bones/init.lua deleted file mode 100644 index f35d519..0000000 --- a/mods/bones/init.lua +++ /dev/null @@ -1,219 +0,0 @@ --- Minetest 0.4 mod: bones --- See README.txt for licensing and other information. - -bones = {} - -local function is_owner(pos, name) - local owner = minetest.get_meta(pos):get_string("owner") - if owner == "" or owner == name then - return true - end - return false -end - -bones.bones_formspec = - "size[8,9]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "list[current_name;main;0,0.3;8,4;]".. - "list[current_player;main;0,4.85;8,1;]".. - "list[current_player;main;0,6.08;8,3;8]".. - default.get_hotbar_bg(0,4.85) - -local share_bones_time = tonumber(minetest.setting_get("share_bones_time") or 1200) -local share_bones_time_early = tonumber(minetest.setting_get("share_bones_time_early") or (share_bones_time/4)) - -minetest.register_node("bones:bones", { - description = "Bones", - tiles = { - "bones_top.png", - "bones_bottom.png", - "bones_side.png", - "bones_side.png", - "bones_rear.png", - "bones_front.png" - }, - paramtype2 = "facedir", - groups = {dig_immediate=2}, - sounds = default.node_sound_dirt_defaults({ - footstep = {name="default_gravel_footstep", gain=0.5}, - dug = {name="default_gravel_footstep", gain=1.0}, - }), - - can_dig = function(pos, player) - local inv = minetest.get_meta(pos):get_inventory() - return is_owner(pos, player:get_player_name()) and inv:is_empty("main") - end, - - allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) - if is_owner(pos, player:get_player_name()) then - return count - end - return 0 - end, - - allow_metadata_inventory_put = function(pos, listname, index, stack, player) - return 0 - end, - - allow_metadata_inventory_take = function(pos, listname, index, stack, player) - if is_owner(pos, player:get_player_name()) then - return stack:get_count() - end - return 0 - end, - - on_metadata_inventory_take = function(pos, listname, index, stack, player) - local meta = minetest.get_meta(pos) - if meta:get_inventory():is_empty("main") then - minetest.remove_node(pos) - end - end, - - on_punch = function(pos, node, player) - if(not is_owner(pos, player:get_player_name())) then - return - end - - local inv = minetest.get_meta(pos):get_inventory() - local player_inv = player:get_inventory() - local has_space = true - - for i=1,inv:get_size("main") do - local stk = inv:get_stack("main", i) - if player_inv:room_for_item("main", stk) then - inv:set_stack("main", i, nil) - player_inv:add_item("main", stk) - else - has_space = false - break - end - end - - -- remove bones if player emptied them - if has_space then - minetest.remove_node(pos) - end - end, - - on_timer = function(pos, elapsed) - local meta = minetest.get_meta(pos) - local time = meta:get_int("time") + elapsed - if time >= share_bones_time then - meta:set_string("infotext", meta:get_string("owner").."'s old bones") - meta:set_string("owner", "") - else - meta:set_int("time", time) - return true - end - end, -}) - -local function may_replace(pos, player) - local node_name = minetest.get_node(pos).name - local node_definition = minetest.registered_nodes[node_name] - - -- if the node is unknown, we let the protection mod decide - -- this is consistent with when a player could dig or not dig it - -- unknown decoration would often be removed - -- while unknown building materials in use would usually be left - if not node_definition then - -- only replace nodes that are not protected - return not minetest.is_protected(pos, player:get_player_name()) - end - - -- allow replacing air and liquids - if node_name == "air" or node_definition.liquidtype ~= "none" then - return true - end - - -- don't replace filled chests and other nodes that don't allow it - local can_dig_func = node_definition.can_dig - if can_dig_func and not can_dig_func(pos, player) then - return false - end - - -- default to each nodes buildable_to; if a placed block would replace it, why shouldn't bones? - -- flowers being squished by bones are more realistical than a squished stone, too - -- exception are of course any protected buildable_to - return node_definition.buildable_to and not minetest.is_protected(pos, player:get_player_name()) -end - -minetest.register_on_dieplayer(function(player) - if minetest.setting_getbool("creative_mode") then - return - end - - local player_inv = player:get_inventory() - if player_inv:is_empty("main") and - player_inv:is_empty("craft") then - return - end - - local pos = player:getpos() - pos.x = math.floor(pos.x+0.5) - pos.y = math.floor(pos.y+0.5) - pos.z = math.floor(pos.z+0.5) - local param2 = minetest.dir_to_facedir(player:get_look_dir()) - local player_name = player:get_player_name() - local player_inv = player:get_inventory() - - if (not may_replace(pos, player)) then - if (may_replace({x=pos.x, y=pos.y+1, z=pos.z}, player)) then - -- drop one node above if there's space - -- this should solve most cases of protection related deaths in which players dig straight down - -- yet keeps the bones reachable - pos.y = pos.y+1 - else - -- drop items instead of delete - for i=1,player_inv:get_size("main") do - minetest.add_item(pos, player_inv:get_stack("main", i)) - end - for i=1,player_inv:get_size("craft") do - minetest.add_item(pos, player_inv:get_stack("craft", i)) - end - -- empty lists main and craft - player_inv:set_list("main", {}) - player_inv:set_list("craft", {}) - return - end - end - - minetest.set_node(pos, {name="bones:bones", param2=param2}) - - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - inv:set_size("main", 8*4) - inv:set_list("main", player_inv:get_list("main")) - - for i=1,player_inv:get_size("craft") do - local stack = player_inv:get_stack("craft", i) - if inv:room_for_item("main", stack) then - inv:add_item("main", stack) - else - --drop if no space left - minetest.add_item(pos, stack) - end - end - - player_inv:set_list("main", {}) - player_inv:set_list("craft", {}) - - meta:set_string("formspec", bones.bones_formspec) - meta:set_string("owner", player_name) - - if share_bones_time ~= 0 then - meta:set_string("infotext", player_name.."'s fresh bones") - - if share_bones_time_early == 0 or not minetest.is_protected(pos, player_name) then - meta:set_int("time", 0) - else - meta:set_int("time", (share_bones_time - share_bones_time_early)) - end - - minetest.get_node_timer(pos):start(10) - else - meta:set_string("infotext", player_name.."'s bones") - end -end) diff --git a/mods/bones/textures/bones_bottom.png b/mods/bones/textures/bones_bottom.png deleted file mode 100644 index ada72ceaee53f83beb0963a5e5788ed423c7155b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 181 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJe}GSjE0C6zm9@3CUA}zzojZ4e z0=A_9g%Uko978G?eUCG?xduucexUOA`~GKzyyt&v@E-bfEK6wOcSbkGwXXwK6>th| z<$ApC?oHVPVR`W(%w_y-szu8uF8CgxapPUmlkL?e7nb~=&v=)=VChXqNF3e+S6qotDB-O*HXRdf4)^; z(c+Q2Vaj~tm3G#FPY+Ufb~jz;ytVJBpvWGZPwQ41%;7cJ-_PS=`^|&r|8%|MQtvhe f8m2s(vcz8CJmdGv!Tb7v)-iax`njxgN@xNAqqaf7 diff --git a/mods/bones/textures/bones_rear.png b/mods/bones/textures/bones_rear.png deleted file mode 100644 index 8e1ac10b4f0ee0956c6e19a6ca4d75c2d8f2c783..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 187 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJe}GSjE0C6zm9@3CUA}zzojZ4e z0=A_9h0;A;978G?MNczwF&GLQI-v6HfBwGcoJdK5#G4VmyDIz>L@qt*x^h?b_!TRT zYi6$*bDmE7aPPL~IX!y=9l@*eEV+9Y9e=zeugCCHoppkRbO!tNlMVBx8%)qP3z(jK i_eb91q!VW}J>_rvGA=2(GXD_JN(N6?KbLh*2~7ZtuS0SG diff --git a/mods/bones/textures/bones_side.png b/mods/bones/textures/bones_side.png deleted file mode 100644 index 3b4810c659c69e6dc25dbafaf33638a3c2d1269d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 188 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJe}GSjE0C6zm9@3CUA}zzojZ4e z0=A_9g)%%{978G?WxE-<90EC-uay2buD>VmxP&+HW`wWOr`|igPEjJ|dmjkxDSyv? zaMx_phPCs=eqCIDR<9?qyyKp0lUbNeqtn5*!Y3z|9on(^<95#9o(1}8Hx$2J`2VtK k&Es!ni<3^w44!27$)EAGJ