From f6dee42c6feb4afc2778348761159e3b34a9598c Mon Sep 17 00:00:00 2001 From: teknomunk Date: Sat, 23 Mar 2024 08:09:37 +0000 Subject: [PATCH] Limit top speed of furnace minecarts to 4 blocks/second, limit total fuel time to 27 minutes --- mods/ENTITIES/mcl_minecarts/init.lua | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/mods/ENTITIES/mcl_minecarts/init.lua b/mods/ENTITIES/mcl_minecarts/init.lua index c9961230f..b8b7caf39 100644 --- a/mods/ENTITIES/mcl_minecarts/init.lua +++ b/mods/ENTITIES/mcl_minecarts/init.lua @@ -180,7 +180,7 @@ local function calculate_acceleration(self, staticdata) acceleration = -1.5 elseif self._punched then acceleration = 2 - elseif (staticdata.fueltime or 0) > 0 then + elseif (staticdata.fueltime or 0) > 0 and staticdata.velocity <= 4 then acceleration = 0.6 elseif staticdata.velocity >= ( node_def._max_acceleration_velocity or max_vel ) then -- Standard friction @@ -815,6 +815,10 @@ local function register_entity(entity_id, def) self._staticdata = staticdata end + -- Cart specific behaviors + local hook = self._mcl_minecarts_on_step + if hook then hook(self,dtime) end + if (staticdata.hopper_delay or 0) > 0 then staticdata.hopper_delay = staticdata.hopper_delay - dtime end @@ -860,10 +864,6 @@ local function register_entity(entity_id, def) return end end - - -- Cart specific behaviors - local hook = self._mcl_minecarts_on_step - if hook then hook(self,dtime) end end function cart:get_staticdata() @@ -1126,6 +1126,11 @@ register_minecart({ if minetest.get_item_group(held:get_name(), "coal") == 1 then staticdata.fueltime = (staticdata.fueltime or 0) + 180 + -- Trucate to 27 minutes (9 uses) + if staticdata.fueltime > 27*60 then + staticdata.fuel_time = 27*60 + end + if not minetest.is_creative_enabled(clicker:get_player_name()) then held:take_item() local index = clicker:get_wield_index()