From d4ddbdb72bd5d75a1cf076ba34691288add94bda Mon Sep 17 00:00:00 2001 From: tacigar Date: Thu, 15 Sep 2016 10:52:05 +0900 Subject: [PATCH] [DELETE] Delete disused files --- api.lua | 162 ------------------ .../textures}/maidroid_maidroid.png | Bin .../textures}/maidroid_maidroid_mk2.png | Bin .../textures}/maidroid_maidroid_mk3.png | Bin textures/maidroid_chasing_player_module.png | Bin 379 -> 0 bytes textures/maidroid_empty_module.png | Bin 385 -> 0 bytes textures/maidroid_farming_module.png | Bin 404 -> 0 bytes textures/maidroid_lumberjack_module.png | Bin 409 -> 0 bytes util.lua | 23 --- 9 files changed, 185 deletions(-) delete mode 100644 api.lua rename {textures => maidroid/textures}/maidroid_maidroid.png (100%) mode change 100755 => 100644 rename {textures => maidroid/textures}/maidroid_maidroid_mk2.png (100%) rename {textures => maidroid/textures}/maidroid_maidroid_mk3.png (100%) delete mode 100644 textures/maidroid_chasing_player_module.png delete mode 100644 textures/maidroid_empty_module.png delete mode 100644 textures/maidroid_farming_module.png delete mode 100644 textures/maidroid_lumberjack_module.png delete mode 100644 util.lua diff --git a/api.lua b/api.lua deleted file mode 100644 index 7ff5cdc..0000000 --- a/api.lua +++ /dev/null @@ -1,162 +0,0 @@ ------------------------------------------------------------- --- Copyright (c) 2016 tacigar --- https://github.com/tacigar/maidroid ------------------------------------------------------------- - -local _aux = maidroid._aux - --- aux function to generate serialnumber for inventories -local gen_inv_serialnumber = (function () - local serialnumber = 0 - return function () - serialnumber = serialnumber + 1 - return serialnumber - 1 - end -end) () - -local main_invsize = 16 -local main_invname = "main" -local module_invsize = 1 -local module_invname = "module" - --- key = modulename, value = moduledef -maidroid.registered_modules = {} - -function maidroid.register_module(module_name, def) - maidroid.registered_modules[module_name] = def - minetest.register_craftitem(module_name, { - description = def.description, - stack_max = 1, - inventory_image = def.inventory_image, - }) -end - --- animation frame -maidroid.animations = { - stand = {x = 0, y = 79}, - lay = {x = 162, y = 166}, - walk = {x = 168, y = 187}, - mine = {x = 189, y = 198}, - walk_mine = {x = 200, y = 219}, - sit = {x = 81, y = 160}, -} - -function maidroid.register_maidroid(product_name, def) - minetest.register_entity(product_name, { - hp_max = def.hp_max or 1, - physical = true, - weight = def.weight or 5, - collistionbox = def.collistionbox or { -0.35, -0.5, -0.35, 0.35, 1.1, 0.35 }, - visual = "mesh", - visual_size = {x = 10, y = 10}, - mesh = def.mesh or "maidroid.b3d", - textures = def.textures or {"maidroid.png"}, - is_visible = true, - makes_footstep_sound = true, - module = nil, - invname = "", - - on_activate = function(self, staticdata) - self.invname = "maidroid"..tostring(gen_inv_serialnumber()) - local inv = minetest.create_detached_inventory(self.invname, { - on_put = function(inv, listname, index, stack, player) - if listname == module_invname then - local module_name = stack:get_name() - local module_def = maidroid.registered_modules[module_name] - self.module = module_def - module_def.initialize(self) - end - end, - allow_put = function(inv, listname, index, stack, player) - local item_name = stack:get_name() - local is_module = maidroid.registered_modules[item_name] - if listname == main_invname - or (listname == module_invname and is_module) then - return stack:get_count() - end - return 0 - end, - on_take = function(inv, listname, index, stack, player) - if listname == module_invname then - local module_name = stack:get_name() - local module_def = maidroid.registered_modules[module_name] - self.module = nil - module_def.finalize(self) - end - end, - }) - inv:set_size(main_invname, main_invsize) - inv:set_size(module_invname, module_invsize) - -- process staticdata - if staticdata ~= "" then - local data = minetest.deserialize(staticdata) - if data.inv.module ~= "" then - module_stack = ItemStack(data.inv.module) - module_stack:set_count(1) - inv:add_item(module_invname, module_stack) - self.module = maidroid.registered_modules[data.inv.module] - end - for _, item in ipairs(data.inv.main) do - local itemstack = ItemStack(item.name) - itemstack:set_count(item.count) - inv:add_item(main_invname, itemstack) - end - end - -- initialize module - if self.module then self.module.initialize(self) - else - self.object:setvelocity{x = 0, y = 0, z = 0} - self.object:setacceleration{x = 0, y = -10, z = 0} - end - end, - - on_step = function(self, dtime) - if self.module then self.module.on_step(self, dtime) end - end, - - on_punch = function(self, puncher, time_from_last_punch, tool_capabilities, dir) - end, - - on_rightclick = function(self, clicker) - local formspec = "size[8,9]" - .."list[detached:"..self.invname..";"..main_invname..";0,0;4,4;]" - .."label[5,0;MODULE]" - .."list[detached:"..self.invname..";"..module_invname..";6,0;1,1;]" - .."list[current_player;"..main_invname..";0,5;8,1;]" - .."list[current_player;"..main_invname..";0,6.2;8,3;8]" - minetest.show_formspec(clicker:get_player_name(), self.invname, formspec) - end, - - get_staticdata = function(self) - local inv = _aux.get_maidroid_inventory(self) - local staticdata = {} - staticdata.inv = {} - local module_name = inv:get_list(module_invname)[1]:get_name() - staticdata.inv.module = module_name or "" - staticdata.inv.main = {} - for _, item in ipairs(inv:get_list(main_invname)) do - local count = item:get_count() - local itemname = item:get_name() - if count ~= 0 then - local itemdata = { count = count, name = itemname } - table.insert(staticdata.inv.main, itemdata) - end - end - return minetest.serialize(staticdata) - end, - }) - - -- register spawn egg - minetest.register_craftitem(product_name.."_spawn_egg", { - description = def.description.." Spawn Egg", - inventory_image = def.inventory_image, - stack_max = 1, - on_use = function(itemstack, user, pointed_thing) - if pointed_thing.above ~= nil then - minetest.add_entity(pointed_thing.above, product_name) - return itemstack - end - return nil - end - }) -end diff --git a/textures/maidroid_maidroid.png b/maidroid/textures/maidroid_maidroid.png old mode 100755 new mode 100644 similarity index 100% rename from textures/maidroid_maidroid.png rename to maidroid/textures/maidroid_maidroid.png diff --git a/textures/maidroid_maidroid_mk2.png b/maidroid/textures/maidroid_maidroid_mk2.png similarity index 100% rename from textures/maidroid_maidroid_mk2.png rename to maidroid/textures/maidroid_maidroid_mk2.png diff --git a/textures/maidroid_maidroid_mk3.png b/maidroid/textures/maidroid_maidroid_mk3.png similarity index 100% rename from textures/maidroid_maidroid_mk3.png rename to maidroid/textures/maidroid_maidroid_mk3.png diff --git a/textures/maidroid_chasing_player_module.png b/textures/maidroid_chasing_player_module.png deleted file mode 100644 index 913ed35d565fba360a0268a58075cceb6d12aa65..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 379 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPN8zYYl-_xC|ZUTj5GeaUuobz*YQ}arITm}Z`qSVBa z)D(sC%#sWRcTeAd6une-p!j`H7sn8b(@Q7Y^0g`mw6F{HGku?U%=iuGwvAgBZhXpP zRx$sphRB{n9v_~s?3{d~AXqXweUtDl&<(H{H{ajeG zbMG)@=v}+>(89&F;m@gZmqvpLR!UpL8lvxQw*1> z+$hTnZhBjNV$&M-9G(;j19M-`AO^!@H9fbi!h0CFGWtH6OgrXYE59&rp`D8)+k)5E zS~Hv8{@xU3{&DZIWL=jn-9Nr4X9@=TPpD5543uJ6r%=8sKV{`d-6s`u>r=Namhkv} Q(ijv5p00i_>zopr0Oa$LCIA2c diff --git a/textures/maidroid_empty_module.png b/textures/maidroid_empty_module.png deleted file mode 100644 index 0a702fdacd35bd6514b806e6a17df2e7680eb86b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 385 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPN8zYaI(he>zA)t_KW=KSdbAE1aYF-JD%fR4Vl$uzQ znxasiS(2gP?&%wlqL<1J6o2aJ;uvCadgfO^Sr2hy694oRa>qdjpBCTV0>@OaL)4A=Q*2KoGDDY5u5W*IrkY$u1k0>6XX@-wPebKpht5KSNn53Oi-8- zr0ZB4>D6i2mN|>z#}6^J(;}kW`0k$=|37(-SOkg#I`w`D~x`!J)d)wp&+$rd7biYiF#AZ^`Gs( WSuU)oSXc2A6cV1UelF{r5}E)pyOfv! diff --git a/textures/maidroid_farming_module.png b/textures/maidroid_farming_module.png deleted file mode 100644 index 61570c26e45f290113ba59c0eb94f12d61fbffd8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 404 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPN8zYY#*M&zsPCy~q%#er@=ltB<)VvZPmw~~#C^fMp zHASI3vm`^o-P1Q9MK6^dDE`CK#WBR<^wP;23y&xWxXSkwwXb3b>Ye?;!Z!TD6s{GG zE}AQ~FD#Wae;BxHox?(D1HN|&8(Nmm-YKv5=luWO-Cmj#6W98lvt&r>X%S%fa4-0} zt4nHM-o)<@<{XZi{g300S6-(^@|m`n+vis#U-^E;qVHwL9`#FGPu#0ci~JFIfBKx4 zjR(IyT_YBFY{nyn{eNnzQa9Mnk7qitc;lH(AL{C~{kjgA_-5vQefcz`!$I)ZjB~Ri zW?5gnT2|CDr&6}jtz}(a$M<;xOwDiC`|i1t9=XoLT0u s$6ZWtDPxpU^@{ow$;WGzUcdjteQMSG?LPhOxuC%DboFyt=akR{06w0mJpcdz diff --git a/textures/maidroid_lumberjack_module.png b/textures/maidroid_lumberjack_module.png deleted file mode 100644 index f3cd2b210bd5fcbc80dd2d075c1a8d8ef55f87d0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 409 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPN8zYab_>7ar5kMi?%#er@=ltB<)VvZPmw~~#C^fMp zHASI3vm`^o-P1Q9MK6^dDE`;e#WBR<^wP?YIkhPY3b!By{rw+*_{7zTkDv|Btx~RY(@^n2YcBM zSi1j=bqV=olKo6KGTZRj5$*$9pP6=CiVA;bR2LMv_>ceBTKVs1q9>G{eKRL{THo>M z@eKRy-(O5Sm96TMxwg1z%jeGznRC_N&68uWsQ+u=ecV8{% z{V?Qe){ekjN%c^Vxzj}@R%&f|+Gz3o!@b34OA0$Smt+_>u2(PoEHPWasr2-zj%x9h wf`VJwf1cM-TE!UAoU^iKVr9>Dr)lSZ@=te~U!Rr!E*cazopr0G9irEdT%j diff --git a/util.lua b/util.lua deleted file mode 100644 index 46ad170..0000000 --- a/util.lua +++ /dev/null @@ -1,23 +0,0 @@ ------------------------------------------------------------- --- Copyright (c) 2016 tacigar --- https://github.com/tacigar/maidroid ------------------------------------------------------------- - -maidroid.util = {} - --- check that the table has the value -function maidroid.util.table_find_value(tbl, value) - for k, v in ipairs(tbl) do - if v == value then return true, k end - end - return false, nil -end - --- table shallow copy -function maidroid.util.table_shallow_copy(source) - local copy = {} - for key, value in pairs(source) do - copy[key] = value - end - return copy -end