From 7e194e982dbe3a08b534e5f8beebd64a2405e2a4 Mon Sep 17 00:00:00 2001 From: rnd1 Date: Thu, 7 Apr 2016 11:54:10 +0200 Subject: [PATCH] battery: notifies of recharge problems, will activate furnace if not already active when adding fuel clock generator: texture update --- mover.lua | 6 +++--- technic_power.lua | 9 +++++++-- textures/basic_machine_clock_generator.png | Bin 579 -> 805 bytes 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/mover.lua b/mover.lua index 9fc1e68..a9a24cf 100644 --- a/mover.lua +++ b/mover.lua @@ -45,18 +45,18 @@ basic_machines.plant_table = {["farming:seed_barley"]="farming:barley_1",["farm --DEPRECATED: fuels used to power mover, now battery is used basic_machines.fuels = {["default:coal_lump"]=30,["default:cactus"]=5,["default:tree"]=10,["default:jungletree"]=12,["default:pinetree"]=12,["default:acacia_tree"]=10,["default:coalblock"]=500,["default:lava_source"]=5000,["basic_machines:charcoal"]=20} - -- *** END OF SETTINGS *** -- + local punchset = {}; minetest.register_on_joinplayer(function(player) local name = player:get_player_name(); if name == nil then return end punchset[name] = {}; punchset[name].state = 0; -end -) +end) + -- MOVER -- minetest.register_node("basic_machines:mover", { diff --git a/technic_power.lua b/technic_power.lua index 076d3e8..c8b4da7 100644 --- a/technic_power.lua +++ b/technic_power.lua @@ -43,6 +43,8 @@ battery_recharge = function(pos) if energy+add_energy<=capacity then stack:take_item(1); inv:set_stack("fuel", 1, stack) + else + meta:set_string("infotext", "recharge problem: capacity " .. capacity .. ", needed " .. energy+add_energy) end else -- try do determine caloric value local fuellist = inv:get_list("fuel");if not fuellist then return energy end @@ -95,6 +97,8 @@ battery_upgrade = function(pos) meta:set_string("infotext", "energy: " .. math.ceil(energy*10)/10 .. " / ".. capacity); end +local machines_activate_furnace = minetest.registered_nodes["default:furnace"].on_metadata_inventory_put; -- this function will activate furnace + minetest.register_node("basic_machines:battery", { description = "battery - stores energy, generates energy from fuel, can power nearby machines, or accelerate/run furnace above it. Its upgradeable.", tiles = {"basic_machine_outlet.png","basic_machine_side.png","basic_machine_battery.png"}, @@ -142,6 +146,8 @@ minetest.register_node("basic_machines:battery", { fmeta:set_float("fuel_totaltime",60);fmeta:set_float("fuel_time",0) -- add 60 second burn time to furnace energy=energy-1; -- use up one energy meta:set_float("energy",energy); + -- make furnace start if not already started + if node~="default:furnace_active" then machines_activate_furnace(pos) end -- update energy display meta:set_string("infotext", "energy: " .. math.ceil(energy*10)/10 .. " / ".. capacity); end @@ -230,7 +236,6 @@ minetest.register_node("basic_machines:battery", { - -- GENERATOR local generator_update_meta = function(pos) @@ -435,7 +440,7 @@ minetest.register_craftitem("basic_machines:power_cell", { }) minetest.register_craftitem("basic_machines:power_block", { - description = "Power block - provides 10 power", + description = "Power block - provides 11 power", inventory_image = "power_block.png", stack_max = 25 }) diff --git a/textures/basic_machine_clock_generator.png b/textures/basic_machine_clock_generator.png index 14561b3a824edb6b843cacd4269bfe7e80d2f7f8..67383188dfe24aa3d4577d467279f33933180e6e 100644 GIT binary patch delta 747 zcmVR$Dh2>lOhFO6huXpiUv{eACS^Ume^1r#fk#h zS=qZgUlg9qe%T2*R~pTod+zys&pYA!rdDZGqNMOf8ia-SMTrUnTQ+S=Y^r}nXL3}6 zAas{5o?+>Fz*ugkFp)k)vTNJl8a+|7@jh;Jhxa&KG(ls-2(+7Vl9JsFUo+Hn_@W9B_ZO4w?HZ}6V3(p<7r|-H01i5SC zK(0n6VcO=pgQzbE`XYAPvQCj?sO;&B13O*O&OLN!D0j$>kO2>^tso8}Mnsa}t{a=Zw#HO=X zUWvX{IF+gvtBv?3qnD1CB6*wVV=p_mvF>tv>{M!p>FSl7daP&%trq76eCDR7X75-} z-Sn)R%1T-c`@|hlhJ>nXZ;+uxwNT^+QCuxtt&n-*k$pwG_C4}MrdaAxK#;Oa%9Qy? z-$u9JFtp<`%_L@*l1G1~USNery#Ti5j>Pz0;915b;Ua=;EwE)K3=3c9(nBUvtr@tS z(wa3lCE}TrwWDwagjWroIFrVg9F;2`n}x57S|=vbc}t-0FF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