From 996fc3f2037d6ba515c907b91db770b78b66fa3f Mon Sep 17 00:00:00 2001 From: teknomunk Date: Sat, 6 Apr 2024 06:24:31 +0000 Subject: [PATCH] Fix rails in creative inventory, make minecart with tnt not crash server when exploding, make minecart with tnt slightly more powerful than regular tnt --- mods/ENTITIES/mcl_minecarts/carts.lua | 7 +++++-- mods/ENTITIES/mcl_minecarts/rails.lua | 4 +--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/mods/ENTITIES/mcl_minecarts/carts.lua b/mods/ENTITIES/mcl_minecarts/carts.lua index 4a3068edd..6e1de023f 100644 --- a/mods/ENTITIES/mcl_minecarts/carts.lua +++ b/mods/ENTITIES/mcl_minecarts/carts.lua @@ -414,12 +414,15 @@ end local function do_detached_movement(self, dtime) local staticdata = self._staticdata + -- Make sure the object is still valid before trying to move it + if not self.object or not self.object:get_pos() then return end + -- Apply physics if mcl_physics then mcl_physics.apply_entity_environmental_physics(self) else -- Simple physics - local friction = self.object:get_velocity() + local friction = self.object:get_velocity() or vector.new(0,0,0) friction.y = 0 local accel = vector.new(0,-9.81,0) -- gravity @@ -1322,7 +1325,7 @@ register_minecart({ local pos = self.object:get_pos() if self._boomtimer <= 0 then self.object:remove() - mcl_explosions.explode(pos, 4, { drop_chance = 1.0 }) + mcl_explosions.explode(pos, 6, { drop_chance = 1.0 }) return else tnt.smoke_step(pos) diff --git a/mods/ENTITIES/mcl_minecarts/rails.lua b/mods/ENTITIES/mcl_minecarts/rails.lua index 45498c89c..17dc19e67 100644 --- a/mods/ENTITIES/mcl_minecarts/rails.lua +++ b/mods/ENTITIES/mcl_minecarts/rails.lua @@ -156,6 +156,7 @@ table_merge(SLOPED_RAIL_DEF,{ mesh = "sloped_track.obj", groups = { rail_slope = 1, + not_in_creative_inventory = 1, }, collision_box = { type = "fixed", @@ -217,9 +218,6 @@ local function register_straight_rail(base_name, tiles, def) mod.register_rail(base_name, base_def) base_def.craft = nil; sloped_def.craft = nil table_merge(base_def,{ - groups = { - not_in_creative_inventory = 1, - }, _mcl_minecarts = { railtype = "straight", },