From 932f8b2c84179e7665f454767ebede039c6d0872 Mon Sep 17 00:00:00 2001 From: Evert Prants Date: Mon, 2 Jul 2018 17:37:00 +0300 Subject: [PATCH] Add Zinc, Add a spawner node that works with mobs_redo mobs --- elepower_dynamics/crafting.lua | 36 ++++ elepower_dynamics/craftitems.lua | 12 ++ elepower_dynamics/dusts.lua | 1 + elepower_dynamics/nodes.lua | 54 ++++++ .../textures/elepower_invar_block.png | Bin 0 -> 2354 bytes .../textures/elepower_lead_block.png | Bin 0 -> 1387 bytes .../textures/elepower_mineral_zinc.png | Bin 0 -> 1609 bytes .../textures/elepower_nickel_block.png | Bin 0 -> 2094 bytes .../textures/elepower_viridisium_block.png | Bin 0 -> 1881 bytes .../textures/elepower_zinc_block.png | Bin 0 -> 2043 bytes .../textures/elepower_zinc_ingot.png | Bin 0 -> 1587 bytes .../textures/elepower_zinc_lump.png | Bin 0 -> 1499 bytes elepower_dynamics/worldgen.lua | 35 ++++ elepower_farming/formspec.lua | 17 ++ elepower_farming/mod.conf | 1 + elepower_farming/nodes/init.lua | 5 + elepower_farming/nodes/spawner.lua | 174 ++++++++++++++++++ .../textures/elefarming_egg_silhouette.png | Bin 0 -> 213 bytes .../elefarming_machine_spawner_top.png | Bin 0 -> 1835 bytes elepower_machines/machines/grindstone.lua | 2 +- elepower_papi/machine.lua | 23 +-- 21 files changed, 348 insertions(+), 12 deletions(-) create mode 100644 elepower_dynamics/textures/elepower_invar_block.png create mode 100644 elepower_dynamics/textures/elepower_lead_block.png create mode 100644 elepower_dynamics/textures/elepower_mineral_zinc.png create mode 100644 elepower_dynamics/textures/elepower_nickel_block.png create mode 100644 elepower_dynamics/textures/elepower_viridisium_block.png create mode 100644 elepower_dynamics/textures/elepower_zinc_block.png create mode 100644 elepower_dynamics/textures/elepower_zinc_ingot.png create mode 100644 elepower_dynamics/textures/elepower_zinc_lump.png create mode 100644 elepower_farming/nodes/spawner.lua create mode 100644 elepower_farming/textures/elefarming_egg_silhouette.png create mode 100644 elepower_farming/textures/elefarming_machine_spawner_top.png diff --git a/elepower_dynamics/crafting.lua b/elepower_dynamics/crafting.lua index 68177cd..5a37989 100644 --- a/elepower_dynamics/crafting.lua +++ b/elepower_dynamics/crafting.lua @@ -266,6 +266,12 @@ minetest.register_craft({ recipe = "elepower_dynamics:nickel_lump" }) +minetest.register_craft({ + type = "cooking", + output = "elepower_dynamics:zinc_ingot", + recipe = "elepower_dynamics:zinc_lump" +}) + minetest.register_craft({ type = "cooking", output = "elepower_dynamics:viridisium_ingot", @@ -303,3 +309,33 @@ for mat, data in pairs(elepd.registered_gears) do end end end + +----------- +-- Nodes -- +----------- + +local function blockcraft(mat) + local ingot = "elepower_dynamics:" .. mat .. "_ingot" + local block = "elepower_dynamics:" .. mat .. "_block" + minetest.register_craft({ + type = "shapeless", + output = block, + recipe = { + ingot, ingot, ingot, + ingot, ingot, ingot, + ingot, ingot, ingot, + } + }) + + minetest.register_craft({ + type = "shapeless", + output = ingot .. " 9", + recipe = { block }, + }) +end + +blockcraft("viridisium") +blockcraft("nickel") +blockcraft("invar") +blockcraft("lead") +blockcraft("zinc") diff --git a/elepower_dynamics/craftitems.lua b/elepower_dynamics/craftitems.lua index 989e424..56a48af 100644 --- a/elepower_dynamics/craftitems.lua +++ b/elepower_dynamics/craftitems.lua @@ -41,6 +41,12 @@ minetest.register_craftitem("elepower_dynamics:viridisium_ingot", { groups = {viridisium = 1, ingot = 1} }) +minetest.register_craftitem("elepower_dynamics:zinc_ingot", { + description = "Zinc Ingot", + inventory_image = "elepower_zinc_ingot.png", + groups = {zinc = 1, ingot = 1} +}) + -- Lumps minetest.register_craftitem("elepower_dynamics:lead_lump", { @@ -61,6 +67,12 @@ minetest.register_craftitem("elepower_dynamics:viridisium_lump", { groups = {viridisium = 1, lump = 1} }) +minetest.register_craftitem("elepower_dynamics:zinc_lump", { + description = "Zinc Lump", + inventory_image = "elepower_zinc_lump.png", + groups = {zinc = 1, lump = 1} +}) + -- Special minetest.register_craftitem("elepower_dynamics:carbon_fiber", { diff --git a/elepower_dynamics/dusts.lua b/elepower_dynamics/dusts.lua index aafb057..a380278 100644 --- a/elepower_dynamics/dusts.lua +++ b/elepower_dynamics/dusts.lua @@ -45,6 +45,7 @@ local dusts = { {"invar", "Invar", "#9fa5b2"}, {"electrum", "Electrum", "#ebeb90"}, {"viridisium", "Viridisium", "#5b9751"}, + {"zinc", "Zinc", "#598a9e"}, {"wood", "Sawdust", "#847454", true} } diff --git a/elepower_dynamics/nodes.lua b/elepower_dynamics/nodes.lua index df7521b..6b54a4d 100644 --- a/elepower_dynamics/nodes.lua +++ b/elepower_dynamics/nodes.lua @@ -7,6 +7,8 @@ -- Nodes -- ----------- +-- Ores + minetest.register_node("elepower_dynamics:stone_with_lead", { description = "Lead Ore", tiles = {"default_stone.png^elepower_mineral_lead.png"}, @@ -31,6 +33,16 @@ minetest.register_node("elepower_dynamics:stone_with_viridisium", { sounds = default.node_sound_stone_defaults(), }) +minetest.register_node("elepower_dynamics:stone_with_zinc", { + description = "Zinc Ore", + tiles = {"default_stone.png^elepower_mineral_zinc.png"}, + groups = {cracky = 3}, + drop = 'elepower_dynamics:zinc_lump', + sounds = default.node_sound_stone_defaults(), +}) + +-- Other + minetest.register_node("elepower_dynamics:particle_board", { description = "Particle Board", tiles = {"elepower_particle_board.png"}, @@ -38,3 +50,45 @@ minetest.register_node("elepower_dynamics:particle_board", { drop = 'elepower_dynamics:wood_dust 4', sounds = default.node_sound_wood_defaults(), }) + +-- Blocks + +minetest.register_node("elepower_dynamics:viridisium_block", { + description = "Viridisium Block", + tiles = {"elepower_viridisium_block.png"}, + is_ground_content = false, + groups = {cracky = 1, level = 2}, + sounds = default.node_sound_metal_defaults(), +}) + +minetest.register_node("elepower_dynamics:lead_block", { + description = "Lead Block", + tiles = {"elepower_lead_block.png"}, + is_ground_content = false, + groups = {cracky = 1, level = 2}, + sounds = default.node_sound_metal_defaults(), +}) + +minetest.register_node("elepower_dynamics:invar_block", { + description = "Invar Block", + tiles = {"elepower_invar_block.png"}, + is_ground_content = false, + groups = {cracky = 1, level = 3}, + sounds = default.node_sound_metal_defaults(), +}) + +minetest.register_node("elepower_dynamics:nickel_block", { + description = "Nickel Block", + tiles = {"elepower_nickel_block.png"}, + is_ground_content = false, + groups = {cracky = 1, level = 3}, + sounds = default.node_sound_metal_defaults(), +}) + +minetest.register_node("elepower_dynamics:zinc_block", { + description = "Zinc Block", + tiles = {"elepower_zinc_block.png"}, + is_ground_content = false, + groups = {cracky = 1, level = 3}, + sounds = default.node_sound_metal_defaults(), +}) diff --git a/elepower_dynamics/textures/elepower_invar_block.png b/elepower_dynamics/textures/elepower_invar_block.png new file mode 100644 index 0000000000000000000000000000000000000000..aeab678f2bd86bf0a71447f7bc1f57f85d23359f GIT binary patch literal 2354 zcmV-23C;G2P) zaB^>EX>4U6ba`-PAZ2)IW&i+q+O1b>lJq7F{Ld+J1SH5N9!<7R8XGW5CM7rpiK&#j-!Y+i}arlGCRP zUFJVBzG=YMteba%Guqp>My9PGw-?>Bw2!c_DOw z@3O0SrhR8#JppZYe&5AqsKv%6w2Sik_n*H*ZWOvm{zcN;qQB_>P}*!lb-;a7DBkBU z`zgHr=2OzG+lS>CujMcOt}Q}7KC0UKKF`R{Gmm%GN4OltDRpJHFt07P_FEBG!Z+Bw z$X-{$m5~x1aWoKQ4Ogc^3>hEtG^o-;b3Z$EK=eF0;mO?DQ8(z!5TkJ4a{G1B!^ssl zAU?Z}aB%45i-oq?vdwkMFgz$5LtFiHX>sv zl1 zB%cvOHMrnI2r;CPLkTsyxH2rp6jw#9$t9mciYcX>N~$Ki>~qL5r<`-iwQzB$xS=2) zOD?6<3ZoS(SG-*@q1MLDHQz#uEw$WAtDQ}E-S^OAPd)e2>)_!A@_59NMjmCa zf?ym0cFSkWdkoq>dlgSUx-$z5M0vqFs5bY^VT(&=!Je^+9gD*k7p1pXrVS5^M`^fP z58~3z$nhBO9x@*k@iclozO0D72TeL#KfQV$U;;gTUQ2ABCix2W6+vV{dj> z@@P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z;;sEqPT?*$k4P7{2g@D0$~RwVnN7=FC57QeYLFcSWrSCL>oi{(G{!6_BCEGp!7rYb1}`Q#B4Y`| zK!nB#YFGij&gWxtbs!j4m=zPuwoDDcUjp5e%Pr6j0|VM!z$EP`K#1T$fHUMkz(!OF zMY6(dgb0CD0LpNko#z596aqIm$=W;QXZA~2i`6HcQ^3rj2ehs>HeC2V*BfA+K1{MUf5w%=DIDbEgtuGE9p<*|~Xp4u8BsY}j3 z_RG9xV(%3Rm+hZW$41);tS-(88p6v(2X-Qr@v*O0Dd0R+b#^ zzV04ss|&W6?Q7AGgD8JEdXniH|>|BlGfzY`M}m z%UL6k?BzSPV!{iG?e&VNo^oqZEa?Uua|D4C1)J`3Zy(OxJaM=8Wz?rO+Lr@nerFXr zxtXz!v+?aXjRol`+xXp5IL=Iw)#GWQH!oSR|CplNmenfu{NT?fJHJ@sw)2(lX)0WbYH0q`r-mu`l|H_<y{D4^000SaNLh0L04^f{04^f|c%?sf00007bV*G`2jT|;3?UE~ zL-_CX>@2HM@dakSAh-}0003nNkl|36g@XHj6MYu#BGXLS-68>VHwcMLJR!^D?7FHC&Va67K)f4A;IL7_i*o7xN>@y$A1v19qeZd+)X=d^nf(tAa!42r)eS)S5nKF z^%nOs4()+{tWFLI0Hm&8sVoaUT?#XU9a81MEqC+c_5pVhbv_*Jg*MDF-`ghn8hQDTT7uDEj`FqG4e3 zmq2SG0Kj3^VeunCr4nL$X|6qwl*~9(N})Fv!^&8nv?RhO*2aQ(oYEsU00000NkvXX Hu0mjf?TYGB literal 0 HcmV?d00001 diff --git a/elepower_dynamics/textures/elepower_nickel_block.png b/elepower_dynamics/textures/elepower_nickel_block.png new file mode 100644 index 0000000000000000000000000000000000000000..03fd2baa77ffdaf824643c2e09c88d044dfccca6 GIT binary patch literal 2094 zcmV+}2+{Y6P) zaB^>EX>4U6ba`-PAZ2)IW&i+q+O1bsk0klGG&{Cj9u*xFHuxPgH_qE*8KE?3qLXq`d z=4Tl2r^d&cz}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_eSC#f+p9BPn;uvO4FPTXJyVr&V(!yrIL zF%M>1$XXuc1~VNQRpA&;x&f!sAO?cA5xY)@-Hn`6#{V8}3LyA*kW&NQ56FGx_KI3f z^F?PSp;3k-sM?_VaX)=8~C*SZ!7XR(b0D~o_PA^rU+^JQ+4W7 z`<~o3Ynmh$5U(wRa_2+_dB=1>uj%9o)ZPBY%y&D*9;Y&wg>t;{1N&2#h zPmYI<8ee32xos{DUK_tv(Q;MK4Oz^+CXcu45?!s@9n2AT&1opSy{t|Vj+nlUrD?-z zzUGt_7A3c6q)QQA#BX>hn%t zSXLjKe$%RV120_rcIWEX{PrLAgZYzSRx~;* z8ts||x4`p>O*r=kmVaS#*(HU=M2^u#3<8gf{2pkg#x5LG{GeZ zF!c$}S*$gvz)lrWVY~gNuGhRw5pbDzcim+O(0f@qgr_q>Jgg73O z_LFKZU6}TVJEm;E;!pk z+wN#va4sNlmMH2|mKD9;^HuQJAoZci@`VD#@$e`*L_|8lvu8XEev1Z!0aaCA1v~HH lQgjc#dPw)6|Nl(4@&f?vph-^4jMe}E002ovPDHLkV1hEJ)mZ=l literal 0 HcmV?d00001 diff --git a/elepower_dynamics/textures/elepower_zinc_lump.png b/elepower_dynamics/textures/elepower_zinc_lump.png new file mode 100644 index 0000000000000000000000000000000000000000..36c9de51159c8df0473dd1385945072c904913cd GIT binary patch literal 1499 zcmV<11tj{3P) zaB^>EX>4U6ba`-PAZ2)IW&i+q+U-|amgFc5{O1&N1SAlM;>=tln55E}oT!C?<16#uAo+ z5gG?nSpZ+-`Ix*qFenRV#Rju2(*o!(LT}0C7SRq11@kUoitQKxM2J8T3^_1h11g3B z*~n}n5r9+>lo2{R&jqxQ2sZ@D-njsBPzCUfXCkeoEWFidgdjp(Fepd`Lm6awFUX(h z6*-i}i5HO|QB;!T;KHo15Mr1eHAfeHlo(=+8dJ)E1T-7uTn#eRcorbadQoI+(L^@TWYyeM=EvSrH3B7 z_SEx0stq^%kP${4I+7XrX6?}WVf+MZbXeoX)La;E)}W2?GC{MQ$m9%+u_q87Cj;aR z^W@AbdC!x%$(c=zst`tyGRbK)83Tj96U(5RyEo>Koo>R{Yr?&F0mGpN2jS{Y^tIZON2U2UqP=iv-uagut}cWi*w1 zZuPbob?fl`@@&`qav;2x;?WJJ;5G2lpvCpeMv2>o+994# zyyg;KozVmK2D_`3$_fC5p3Ii!SLZtcy|nHK2p_Op&?_bi8$ahtIKg={#QuCx`3|Za z(8y?75%42CM@5O{;IpGkY7cVg>c?t45E^P*l*(wLbT;^-Inr2CjMPONY??<-S+-+) z!;(%2)gSWIo|FsoC(yR)rpByImyKR0wCdM0=>T2)K;D>d0D88rc>k>BSrhwh{N zX;O1WHb6dR|0+Nq0K>aW%tS1t9&NkQraYwKC&1 zSLV4jOSSJ5XgQ`#m;WoB4u=m})K8PZhjZi8Mt;AgeH!{747q{tm}I^HSwGN_S8($+ z00006VoOIv0RI600RN!9r;`8x010qNS#tmYE+YT{E+YYWr9XB6000McNliru;s*i@ zA`m=otC9c!02y>eSad^gZEa<4bO1wgWnpw>WFU8GbZ8()Nlj2!fese{008qzL_t(I z%iWSOPD4QqM4!F8`5XA64-(=6oFNSbXW)d076kPdX9!i4mQ;vzko;YnBGBr ztVp}STB&XbPMaH2 zP~JB^QK7Gfs-mjHA?79_-%i*%S(i!*kvxJJ0+(m444!axej+&~QV66NsphmfbJQfp zO@pfJe&h6XEKkc1-%<2S@!P15czLb`4jCzRU~aQeRu!>002ovPDHLkV1lA2 BvjhMD literal 0 HcmV?d00001 diff --git a/elepower_dynamics/worldgen.lua b/elepower_dynamics/worldgen.lua index 0f6dd41..77a97b0 100644 --- a/elepower_dynamics/worldgen.lua +++ b/elepower_dynamics/worldgen.lua @@ -96,3 +96,38 @@ minetest.register_ore({ y_max = -12000, y_min = -31000, }) + +-- Zinc + +minetest.register_ore({ + ore_type = "scatter", + ore = "elepower_dynamics:stone_with_zinc", + wherein = "default:stone", + clust_scarcity = 25 * 25 * 25, + clust_num_ores = 2, + clust_size = 3, + y_max = 31000, + y_min = -31000, +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "elepower_dynamics:stone_with_zinc", + wherein = "default:stone", + clust_scarcity = 20 * 20 * 20, + clust_num_ores = 5, + clust_size = 3, + y_max = 0, + y_min = -31000, +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "elepower_dynamics:stone_with_zinc", + wherein = "default:stone", + clust_scarcity = 12 * 12 * 12, + clust_num_ores = 5, + clust_size = 3, + y_max = -256, + y_min = -31000, +}) diff --git a/elepower_farming/formspec.lua b/elepower_farming/formspec.lua index 68fc86d..b242069 100644 --- a/elepower_farming/formspec.lua +++ b/elepower_farming/formspec.lua @@ -56,3 +56,20 @@ function elefarm.formspec.tree_processor(timer, power, fluid_buffer, water_buffe "listring[current_player;main]".. default.get_hotbar_bg(0, 4.25) end + +function elefarm.formspec.spawner_formspec(timer, power) + return "size[8,8.5]".. + default.gui_bg.. + default.gui_bg_img.. + default.gui_slots.. + ele.formspec.power_meter(power).. + bar(1, 0, 100-timer).. + "list[context;src;3.5,1.5;1,1;]".. + "image[3.5,1.5;1,1;elefarming_egg_silhouette.png]".. + "list[current_player;main;0,4.25;8,1;]".. + "list[current_player;main;0,5.5;8,3;8]".. + "listring[current_player;main]".. + "listring[context;src]".. + "listring[current_player;main]".. + default.get_hotbar_bg(0, 4.25) +end diff --git a/elepower_farming/mod.conf b/elepower_farming/mod.conf index 65cc031..78aa549 100644 --- a/elepower_farming/mod.conf +++ b/elepower_farming/mod.conf @@ -1,3 +1,4 @@ name = elepower_farming description = Electric Farming Automation! depends = elepower_papi, elepower_tools, elepower_fapi, bucket, farming, fluid_tanks +optional_depends = mobs, mobs_animal, mobs_monster diff --git a/elepower_farming/nodes/init.lua b/elepower_farming/nodes/init.lua index e638016..8a5b4f9 100644 --- a/elepower_farming/nodes/init.lua +++ b/elepower_farming/nodes/init.lua @@ -13,3 +13,8 @@ dofile(elefarm.modpath.."/nodes/planter.lua") dofile(elefarm.modpath.."/nodes/harvester.lua") dofile(elefarm.modpath.."/nodes/tree_extractor.lua") dofile(elefarm.modpath.."/nodes/tree_processor.lua") + +-- Mobs redo support +if minetest.get_modpath("mobs") ~= nil and mobs.mod and mobs.mod == "redo" then + dofile(elefarm.modpath.."/nodes/spawner.lua") +end diff --git a/elepower_farming/nodes/spawner.lua b/elepower_farming/nodes/spawner.lua new file mode 100644 index 0000000..df09dc3 --- /dev/null +++ b/elepower_farming/nodes/spawner.lua @@ -0,0 +1,174 @@ + +-- How many seconds there are between runs +local SPAWNER_TICK = 10 + +local function can_dig(pos, player) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + return inv:is_empty("src") +end + +local function spawn(pos, mob) + -- get meta and command + local meta = minetest.get_meta(pos) + + -- TODO: ways to configure + local mlig = 0 -- min light + local xlig = 15 -- max light + local num = 4 -- max number + local pla = 24 -- player radius + local yof = 0 -- Y offset to spawn mob + + -- if amount is 0 then do nothing + if num == 0 then + return + end + + -- are we spawning a registered mob? + if not mobs.spawning_mobs[mob] then + return + end + + -- check objects inside 9x9 area around spawner + local objs = minetest.get_objects_inside_radius(pos, 9) + local count = 0 + local ent = nil + + -- count mob objects of same type in area + for k, obj in ipairs(objs) do + ent = obj:get_luaentity() + + if ent and ent.name and ent.name == mob then + count = count + 1 + end + end + + -- is there too many of same type? + if count >= num then + return + end + + -- spawn mob if player detected and in range + if pla > 0 then + local in_range = 0 + local objs = minetest.get_objects_inside_radius(pos, pla) + + for _,oir in pairs(objs) do + if oir:is_player() then + in_range = 1 + break + end + end + + -- player not found + if in_range == 0 then + return + end + end + + -- find air blocks within 5 nodes of spawner + local air = minetest.find_nodes_in_area( + {x = pos.x - 5, y = pos.y + yof, z = pos.z - 5}, + {x = pos.x + 5, y = pos.y + yof, z = pos.z + 5}, + {"air"}) + + -- spawn in random air block + if air and #air > 0 then + local pos2 = air[math.random(#air)] + local lig = minetest.get_node_light(pos2) or 0 + + pos2.y = pos2.y + 0.5 + + -- only if light levels are within range + if lig >= mlig and lig <= xlig and minetest.registered_entities[mob] then + minetest.add_entity(pos2, mob) + return true + end + end + + return +end + +local function on_timer(pos, elapsed) + local refresh = false + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + + local capacity = ele.helpers.get_node_property(meta, pos, "capacity") + local usage = ele.helpers.get_node_property(meta, pos, "usage") + local storage = ele.helpers.get_node_property(meta, pos, "storage") + + local work = meta:get_int("src_time") + + local egg_slot = inv:get_stack("src", 1) + local egg_name = egg_slot:get_name() + local mob_desc = "None" + local active = "Active" + if storage > usage and not egg_slot:is_empty() and ele.helpers.get_item_group(egg_name, "spawn_egg") then + local mob_name = egg_name:gsub("_set", "") + + if work == SPAWNER_TICK then + local spawned = 0 + + -- Spawn + if spawn(pos, mob_name) then + spawned = spawned + 1 + end + + work = 0 + if spawned > 0 then + storage = storage - usage + end + else + work = work + 1 + end + + refresh = true + mob_desc = minetest.registered_items[mob_name].description + else + work = 0 + active = "Inactive" + end + + meta:set_string("infotext", ("Powered Mob Spawner %s\nMob: %s\n%s"):format( + active, mob_desc, ele.capacity_text(capacity, storage))) + + local power_percent = math.floor((storage / capacity)*100) + local work_percent = math.floor((work / SPAWNER_TICK)*100) + + meta:set_string("formspec", elefarm.formspec.spawner_formspec(work_percent, power_percent)) + meta:set_int("storage", storage) + meta:set_int("src_time", work) + + return refresh +end + +ele.register_machine("elepower_farming:spawner", { + description = "Powered Mob Spawner", + ele_capacity = 64000, + ele_inrush = 800, + ele_usage = 800, + ele_no_automatic_ports = true, + tiles = { + "elefarming_machine_spawner_top.png", "elefarming_machine_base.png", "elefarming_machine_side.png", + "elefarming_machine_side.png", "elefarming_machine_side.png", "elefarming_machine_side.png", + }, + groups = { + oddly_breakable_by_hand = 1, + ele_machine = 1, + ele_user = 1, + cracky = 1, + tubedevice = 1, + tubedevice_receiver = 1, + }, + on_construct = function (pos) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + inv:set_size("src", 1) + + meta:set_int("src_time", 0) + meta:set_string("formspec", elefarm.formspec.spawner_formspec(0,0)) + end, + can_dig = can_dig, + on_timer = on_timer, +}) diff --git a/elepower_farming/textures/elefarming_egg_silhouette.png b/elepower_farming/textures/elefarming_egg_silhouette.png new file mode 100644 index 0000000000000000000000000000000000000000..6b62daa1328e55cb78aef6d757ebf52d91c8c830 GIT binary patch literal 213 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=De8Ak0{?)V>TT$X?><>&pI!or%{{_LX*76HrL9#5JPCIX^cyHLrxhxhOTUBsE2$ zJhLQ2!QIn0AiR-J9H_|F)5S5w;&gI?#65?=z>oVEEqYYnWjZNEz^?VilNl@Cr3YO# zxOlZJCrh*JU;&ql(@MVS7Rnp__SXNm3){+Y%}nOQ1gro4K!X@OUHx3vIVCg!035nR AdjJ3c literal 0 HcmV?d00001 diff --git a/elepower_farming/textures/elefarming_machine_spawner_top.png b/elepower_farming/textures/elefarming_machine_spawner_top.png new file mode 100644 index 0000000000000000000000000000000000000000..76dab96b96dd250a90d542e7fa8df2f2b45abaeb GIT binary patch literal 1835 zcmV+`2h{k9P) zaB^>EX>4U6ba`-PAZ2)IW&i+q+O1Y=k~1d^{Ld+Jgpoi9j>GV%$_;Y-G_M)kYwx$I ztfxF+AtR|<5}5kW-_87m5A)%T6AeCkf8gVyi<~eC$NZ%6ro)Z*`f=>ZliXYj43WiX z=g;7myh6^<=Oxc;p9Hx)Y!vHSIG-2N+K9t4uq`e_mZpJYZEVuo$nvu6=I?Wcb@&+c zF@(JI+gcwm;A{HJS!FMt)Zy*;Q1ub>z=u=dR=T5BhyBaY>u2o_kw+4$Y0}I zImsiOLw$;Qv(~?@mC#z9(Iw{*vR^^%P{s^;XGd%N%i~de

?@ z{zNmKh#)3Z~^&j zGt$9A%9k%R%*J6ZQ-I+@!5}*bn-Tu#@uCtWO7hnC3iDol@2E+wIu-S*8Z>G$!3Gy3_@E(#7*gbD(QzfB9%G0xrUau2 zJ16`*K_R7+Pk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