From e8c5f02c6402304a5b9302c25c9ba3647477862d Mon Sep 17 00:00:00 2001 From: Joachim Stolberg Date: Sun, 10 Mar 2019 11:36:00 +0100 Subject: [PATCH] code freeze for adding consumer model --- basic_machines/legacy_nodes.lua | 10 +++--- basic_machines/pusher.lua | 44 ++++++++++++------------- basis/command.lua | 6 +++- basis/node_states.lua | 11 +++++-- init.lua | 1 + textures/shrink.py | 2 +- textures/techage_appl_compressor4.png | Bin 478 -> 477 bytes textures/techage_electric_junction.png | Bin 613 -> 677 bytes textures/techage_flywheel8.png | Bin 3490 -> 2135 bytes 9 files changed, 43 insertions(+), 31 deletions(-) diff --git a/basic_machines/legacy_nodes.lua b/basic_machines/legacy_nodes.lua index 7281d9b..c6ace16 100644 --- a/basic_machines/legacy_nodes.lua +++ b/basic_machines/legacy_nodes.lua @@ -23,12 +23,12 @@ techage.register_node("default:chest", {"default:chest_open"}, { on_push_item = function(pos, in_dir, stack) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() - return techage.put_item(inv, "main", stack) + return techage.put_items(inv, "main", stack) end, on_unpull_item = function(pos, in_dir, stack) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() - return techage.put_item(inv, "main", stack) + return techage.put_items(inv, "main", stack) end, }) @@ -43,14 +43,14 @@ techage.register_node("default:furnace", {"default:furnace_active"}, { local inv = meta:get_inventory() minetest.get_node_timer(pos):start(1.0) if minetest.get_craft_result({method="fuel", width=1, items={stack}}).time ~= 0 then - return techage.put_item(inv, "fuel", stack) + return techage.put_items(inv, "fuel", stack) else - return techage.put_item(meta, "src", stack) + return techage.put_items(meta, "src", stack) end end, on_unpull_item = function(pos, side, stack) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() - return techage.put_item(meta, "dst", stack) + return techage.put_items(meta, "dst", stack) end, }) diff --git a/basic_machines/pusher.lua b/basic_machines/pusher.lua index 9a3e264..2ce7cfb 100644 --- a/basic_machines/pusher.lua +++ b/basic_machines/pusher.lua @@ -29,7 +29,6 @@ local M = minetest.get_meta -- Techage Related Data local TRD = function(pos) return (minetest.registered_nodes[minetest.get_node(pos).name] or {}).techage end local TRDN = function(node) return (minetest.registered_nodes[node.name] or {}).techage end - -- Load support for intllib. local MP = minetest.get_modpath("tubelib2") local I,_ = dofile(MP.."/intllib.lua") @@ -41,7 +40,7 @@ local CYCLE_TIME = 2 local function pushing(pos, trd, meta, mem) local pull_dir = meta:get_int("pull_dir") local push_dir = meta:get_int("push_dir") - local items = techage.pull_items(pos, pull_dir, TRD(pos).num_items) + local items = techage.pull_items(pos, pull_dir, trd.num_items) if items ~= nil then if techage.push_items(pos, push_dir, items) == false then -- place item back @@ -98,8 +97,8 @@ local function register_pusher(stage, num_items) "techage_filling_ta"..stage..".png^techage_frame_ta"..stage..".png", "techage_filling_ta"..stage..".png^techage_frame_ta"..stage..".png^techage_appl_outp.png", "techage_filling_ta"..stage..".png^techage_frame_ta"..stage..".png^techage_appl_inp.png", - "techage_pusher.png^[transformR180]^techage_frame_ta"..stage..".png", - "techage_pusher.png^techage_frame_ta"..stage..".png", + "techage_appl_pusher.png^[transformR180]^techage_frame_ta"..stage..".png", + "techage_appl_pusher.png^techage_frame_ta"..stage..".png", }, techage = { @@ -141,7 +140,7 @@ local function register_pusher(stage, num_items) "techage_filling_ta"..stage..".png^techage_frame_ta"..stage..".png^techage_appl_outp.png", "techage_filling_ta"..stage..".png^techage_frame_ta"..stage..".png^techage_appl_inp.png", { - image = "techage_pusher14.png^[transformR180]^techage_frame14_ta"..stage..".png", + image = "techage_appl_pusher14.png^[transformR180]^techage_frame14_ta"..stage..".png", backface_culling = false, animation = { type = "vertical_frames", @@ -151,7 +150,7 @@ local function register_pusher(stage, num_items) }, }, { - image = "techage_pusher14.png^techage_frame14_ta"..stage..".png", + image = "techage_appl_pusher14.png^techage_frame14_ta"..stage..".png", backface_culling = false, animation = { type = "vertical_frames", @@ -184,12 +183,12 @@ local function register_pusher(stage, num_items) description = "TA"..stage.." Pusher", tiles = { -- up, down, right, left, back, front - 'tubelib_pusher1.png', - 'tubelib_pusher1.png', - 'tubelib_outp.png^tubelib_defect.png', - 'tubelib_inp.png^tubelib_defect.png', - "tubelib_pusher1.png^[transformR180]^tubelib_defect.png", - "tubelib_pusher1.png^tubelib_defect.png", + "techage_filling_ta"..stage..".png^techage_frame_ta"..stage.."_top.png^techage_appl_arrow.png", + "techage_filling_ta"..stage..".png^techage_frame_ta"..stage..".png", + "techage_filling_ta"..stage..".png^techage_frame_ta"..stage..".png^techage_appl_outp.png^tubelib_defect.png", + "techage_filling_ta"..stage..".png^techage_frame_ta"..stage..".png^techage_appl_inp.png^tubelib_defect.png", + "techage_appl_pusher.png^[transformR180]^techage_frame_ta"..stage..".png^tubelib_defect.png", + "techage_appl_pusher.png^techage_frame_ta"..stage..".png^tubelib_defect.png", }, techage = { @@ -218,21 +217,14 @@ local function register_pusher(stage, num_items) sounds = default.node_sound_wood_defaults(), }) - - minetest.register_craft({ - output = "tubelib:pusher 2", - recipe = { - {"group:wood", "wool:dark_green", "group:wood"}, - {"tubelib:tubeS", "default:mese_crystal", "tubelib:tubeS"}, - {"group:wood", "wool:dark_green", "group:wood"}, - }, - }) - if stage == 2 then techage.register_node("techage:ta"..stage.."_pusher", {"techage:ta"..stage.."_pusher_active", "techage:ta"..stage.."_pusher_defect"}, { is_pusher = true, -- is a pulling/pushing node + on_recv_message = function(pos, topic, payload) + return "unsupported" + end, on_node_load = function(pos) TRD(pos).State:on_node_load(pos) end, @@ -267,3 +259,11 @@ register_pusher(2, 2) register_pusher(3, 6) register_pusher(4, 18) +minetest.register_craft({ + output = "techage:ta2_pusher 2", + recipe = { + {"group:wood", "wool:dark_green", "group:wood"}, + {"tubelib:tubeS", "default:mese_crystal", "tubelib:tubeS"}, + {"group:wood", "wool:dark_green", "group:wood"}, + }, +}) diff --git a/basis/command.lua b/basis/command.lua index 3f388d5..8963909 100644 --- a/basis/command.lua +++ b/basis/command.lua @@ -127,6 +127,10 @@ end techage.side_to_outdir = side_to_dir +function techage.side_to_indir(side, param2) + return tubelib2.Turn180Deg[side_to_dir(side, param2)] +end + local function get_dest_node(pos, out_dir) local spos, in_dir = Tube:get_connected_node_pos(pos, out_dir) local _,node = Tube:get_node(spos) @@ -372,7 +376,7 @@ end -- Put the given stack into the given ItemList. -- Function returns false if ItemList is full. -function techage.put_item(inv, listname, stack) +function techage.put_items(inv, listname, stack) if inv:room_for_item(listname, stack) then inv:add_item(listname, stack) return true diff --git a/basis/node_states.lua b/basis/node_states.lua index 1ade4d3..69fc134 100644 --- a/basis/node_states.lua +++ b/basis/node_states.lua @@ -211,9 +211,10 @@ function NodeStates:start(pos, mem, called_from_on_timer) if self.formspec_func then M(pos):set_string("formspec", self.formspec_func(self, pos, mem)) end - if not minetest.get_node_timer(pos):is_started() then - minetest.get_node_timer(pos):start(self.cycle_time) + if minetest.get_node_timer(pos):is_started() then + minetest.get_node_timer(pos):stop() end + minetest.get_node_timer(pos):start(self.cycle_time) return true end return false @@ -234,6 +235,9 @@ function NodeStates:standby(pos, mem) if self.formspec_func then M(pos):set_string("formspec", self.formspec_func(self, pos, mem)) end + if minetest.get_node_timer(pos):is_started() then + minetest.get_node_timer(pos):stop() + end minetest.get_node_timer(pos):start(self.cycle_time * self.standby_ticks) return true end @@ -256,6 +260,9 @@ function NodeStates:blocked(pos, mem) if self.formspec_func then M(pos):set_string("formspec", self.formspec_func(self, pos, mem)) end + if minetest.get_node_timer(pos):is_started() then + minetest.get_node_timer(pos):stop() + end minetest.get_node_timer(pos):start(self.cycle_time * self.standby_ticks) return true end diff --git a/init.lua b/init.lua index 8456aa3..e299c05 100644 --- a/init.lua +++ b/init.lua @@ -37,6 +37,7 @@ dofile(MP.."/electric/consumer.lua") dofile(MP.."/basic_machines/pusher.lua") dofile(MP.."/basic_machines/legacy_nodes.lua") +dofile(MP.."/basic_machines/grinder.lua") --dofile(MP.."/fermenter/biogas_pipe.lua") diff --git a/textures/shrink.py b/textures/shrink.py index f6c6300..96863b9 100644 --- a/textures/shrink.py +++ b/textures/shrink.py @@ -5,7 +5,7 @@ print ">>> Convert" for filename in os.listdir("./"): if fnmatch.fnmatch(filename, "*.png"): print(filename) - os.system("pngquant --skip-if-larger --quality=8-16 --output ./%s.new ./%s" % (filename, filename)) + os.system("pngquant --skip-if-larger --quality=8-32 --output ./%s.new ./%s" % (filename, filename)) print "\n>>> Copy" for filename in os.listdir("./"): diff --git a/textures/techage_appl_compressor4.png b/textures/techage_appl_compressor4.png index 3ed9fa9762f1f098acc369d89119051580cf4202..281c8aa887847e5c2024b897c54ed16512a38fd1 100644 GIT binary patch delta 393 zcmV;40e1f01Kk6VUVq==-mtZ=0001+prZf(|JlUCG%qh?Sy`Q~e*gdg00DGTPE!Ct z=GbNc00BNpL_t(Y$L*BAPQx$|hoii~Rh6=)r%JGAVI99cJ8n?}4ufn02LX)& zh8iT)z>ti`&EcFAkR_l@!2FkK$nDS1>_mq@=SR4eA5x(Gs0FN*A2k%Myf*6qPA=$g_$vCrAE@E#CHfJ7_5(wW@Y>@uy*N(`iJxXvVVL7rT(f>G`Vs^00000NkvXXt^-0~f_I0zqW}N^ diff --git a/textures/techage_electric_junction.png b/textures/techage_electric_junction.png index 78f859699977b2738ae98f98a9d3478f84d42796..5d9b5767051299ac147bd5c427cbdddc57ba9dd6 100644 GIT binary patch delta 646 zcmV;10(t%A1f>O#Du4d~{{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G` z2jc??7a<(yTMCZ=00J^eL_t(o!|hi+Z__{+e(obDpW;ML_Nrk+6c(gPtymafKrH+M z1_lQH3Ns9h{Q-!j>VSk;Dv&B6(ZYySgcvH28_BMm+Gig_Wq;RBo!B`y&cZvL@6ONr zym#-{5g5q#Z=dz_oag!2+I~P5#o}lnN+~F%5CjthL12W@hydptoO4)~WsE_a5OCeo zY%HbKJ^?9Z;WSz!kXqj9Tq>oMwnref+*D~}0;%PMTt;1zBt`@($G zcOgUvlv4co?G=7lTOZ;1(^B|?fVBnOWfNghS+ud5s z4-UQ*zBf1T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