Fix rails in creative inventory, make minecart with tnt not crash server when exploding, make minecart with tnt slightly more powerful than regular tnt

This commit is contained in:
teknomunk 2024-04-06 06:24:31 +00:00
parent efe190e23c
commit 38ee22c3bd
2 changed files with 6 additions and 5 deletions

View File

@ -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)

View File

@ -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",
},