From 442d3a42b11e00d798b8e6a384cc8788779ed418 Mon Sep 17 00:00:00 2001 From: mrkubax10 Date: Thu, 24 Oct 2024 16:30:20 +0200 Subject: [PATCH] Change Activated{Electric}Machine.before{Activation|Deactivation} to Activated{Electric}Machine.after{Activation|Deactivation} --- machines/activated_electric_machine.lua | 4 ++-- machines/activated_machine.lua | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/machines/activated_electric_machine.lua b/machines/activated_electric_machine.lua index 6e5bfa2..60d4daa 100644 --- a/machines/activated_electric_machine.lua +++ b/machines/activated_electric_machine.lua @@ -29,9 +29,9 @@ industrialtest.ActivatedElectricMachine.shouldActivate=industrialtest.ActivatedM industrialtest.ActivatedElectricMachine.shouldDeactivate=industrialtest.ActivatedMachine.shouldDeactivate -industrialtest.ActivatedElectricMachine.beforeActivation=industrialtest.ActivatedMachine.beforeActivation +industrialtest.ActivatedElectricMachine.afterActivation=industrialtest.ActivatedMachine.afterActivation -industrialtest.ActivatedElectricMachine.beforeDeactivation=industrialtest.ActivatedMachine.beforeDeactivation +industrialtest.ActivatedElectricMachine.afterDeactivation=industrialtest.ActivatedMachine.afterDeactivation function industrialtest.ActivatedElectricMachine.activeOnTimer(self,pos,elapsed) industrialtest.ElectricMachine.requestPower(self,pos) diff --git a/machines/activated_machine.lua b/machines/activated_machine.lua index 13ae731..dff2841 100644 --- a/machines/activated_machine.lua +++ b/machines/activated_machine.lua @@ -20,11 +20,11 @@ function industrialtest.ActivatedMachine.onTimer(self,pos,elapsed) local result=industrialtest.Machine.onTimer(self,pos,elapsed) if self:shouldActivate(pos) then - self:beforeActivation(pos) minetest.swap_node(pos,{ name=self.name.."_active", param2=minetest.get_node(pos).param2 }) + self:afterActivation(pos) minetest.get_node_timer(pos):start(industrialtest.updateDelay) return false end @@ -61,10 +61,10 @@ function industrialtest.ActivatedMachine.shouldDeactivate(self,pos) return false end -function industrialtest.ActivatedMachine.beforeActivation(self,pos) +function industrialtest.ActivatedMachine.afterActivation(self,pos) end -function industrialtest.ActivatedMachine.beforeDeactivation(self,pos) +function industrialtest.ActivatedMachine.afterDeactivation(self,pos) end function industrialtest.ActivatedMachine.activeOnTimer(self,pos,elapsed) @@ -82,11 +82,11 @@ function industrialtest.ActivatedMachine.activeOnTimer(self,pos,elapsed) end if self:shouldDeactivate(pos) then - self:beforeDeactivation(pos) minetest.swap_node(pos,{ name=self.name, param2=minetest.get_node(pos).param2 }) + self:afterDeactivation(pos) minetest.get_node_timer(pos):start(industrialtest.updateDelay) return false end