diff --git a/mods/CORE/mcl_explosions/init.lua b/mods/CORE/mcl_explosions/init.lua index 0132d1669a..cb9af5c796 100644 --- a/mods/CORE/mcl_explosions/init.lua +++ b/mods/CORE/mcl_explosions/init.lua @@ -337,7 +337,6 @@ local function trace_explode(pos, strength, raydirs, radius, info, direct, sourc if not obj:is_player() then return end - mcl_util.deal_damage(obj, damage, {type = "explosion", direct = direct, source = source}) obj:add_velocity(vector.multiply(punch_dir, impact * 20)) diff --git a/mods/ENTITIES/mcl_boats/init.lua b/mods/ENTITIES/mcl_boats/init.lua index 1f1d85274f..f750e80eb8 100644 --- a/mods/ENTITIES/mcl_boats/init.lua +++ b/mods/ENTITIES/mcl_boats/init.lua @@ -206,6 +206,8 @@ end function boat.on_step(self, dtime, moveresult) mcl_burning.tick(self.object, dtime, self) + -- mcl_burning.tick may remove object immediately + if not self.object:get_pos() then return end self._v = get_v(self.object:get_velocity()) * get_sign(self._v) local v_factor = 1 diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index 8945c6e200..8cbe9b8ca1 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -3618,6 +3618,8 @@ local mob_step = function(self, dtime) check_aggro(self,dtime) if not self.fire_resistant then mcl_burning.tick(self.object, dtime, self) + -- mcl_burning.tick may remove object immediately + if not self.object:get_pos() then return end end local pos = self.object:get_pos() diff --git a/mods/ENVIRONMENT/lightning/init.lua b/mods/ENVIRONMENT/lightning/init.lua index 14d8f5176f..32ff721b2b 100644 --- a/mods/ENVIRONMENT/lightning/init.lua +++ b/mods/ENVIRONMENT/lightning/init.lua @@ -120,9 +120,10 @@ function lightning.strike(pos) if not pos then return false end - local objects = get_objects_inside_radius(pos2, 3.5) if lightning.on_strike_functions then for _, func in pairs(lightning.on_strike_functions) do + -- allow on_strike callbacks to destroy entities by re-obtaining objects for each callback + local objects = get_objects_inside_radius(pos2, 3.5) func(pos, pos2, objects) end end @@ -174,6 +175,7 @@ lightning.register_on_strike(function(pos, pos2, objects) elseif lua and lua.name == "mobs_mc:creeper" then mcl_util.replace_mob(obj, "mobs_mc:creeper_charged") else + -- WARNING: unsafe entity handling. object may be removed immediately mcl_util.deal_damage(obj, 5, { type = "lightning_bolt" }) end end @@ -182,8 +184,9 @@ lightning.register_on_strike(function(pos, pos2, objects) for i = 1, #playerlist do local player = playerlist[i] local sky = {} + local sky_table = player:get_sky(true) - sky.bgcolor, sky.type, sky.textures = player:get_sky() + sky.bgcolor, sky.type, sky.textures = sky_table.base_color, sky_table.type, sky_table.textures local name = player:get_player_name() if ps[name] == nil then diff --git a/mods/ITEMS/mcl_armor/damage.lua b/mods/ITEMS/mcl_armor/damage.lua index ed616397db..012c323076 100644 --- a/mods/ITEMS/mcl_armor/damage.lua +++ b/mods/ITEMS/mcl_armor/damage.lua @@ -90,6 +90,8 @@ mcl_damage.register_modifier(function(obj, damage, reason) if thorns_damage > 0 and reason.type ~= "thorns" and reason.source ~= obj then mcl_util.deal_damage(reason.source, thorns_damage, {type = "thorns", direct = obj}) + -- mcl_util.deal_damage may remove object immediately + if not reason.source:get_pos() then return end local thorns_item = thorns_pieces[math.random(#thorns_pieces)] diff --git a/mods/ITEMS/mcl_beacons/init.lua b/mods/ITEMS/mcl_beacons/init.lua index 08586bcef4..c484c949da 100644 --- a/mods/ITEMS/mcl_beacons/init.lua +++ b/mods/ITEMS/mcl_beacons/init.lua @@ -98,7 +98,7 @@ minetest.register_node("mcl_beacons:beacon_beam", { } }, pointable= false, - light_source = 15, + light_source = 14, walkable = false, groups = {not_in_creative_inventory=1}, _mcl_blast_resistance = 1200, @@ -226,6 +226,7 @@ minetest.register_node("mcl_beacons:beacon", { collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, mesh = "mcl_beacon.b3d", tiles = {"beacon_UV.png"}, + use_texture_alpha = "clip", on_construct = function(pos) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() @@ -333,7 +334,7 @@ minetest.register_node("mcl_beacons:beacon", { end end end, - light_source = 15, + light_source = 14, groups = {handy=1}, drop = "mcl_beacons:beacon", sounds = mcl_sounds.node_sound_glass_defaults(), diff --git a/mods/ITEMS/mcl_bows/arrow.lua b/mods/ITEMS/mcl_bows/arrow.lua index a03b875cbe..ad4a3f30e4 100644 --- a/mods/ITEMS/mcl_bows/arrow.lua +++ b/mods/ITEMS/mcl_bows/arrow.lua @@ -115,6 +115,8 @@ end function ARROW_ENTITY.on_step(self, dtime) mcl_burning.tick(self.object, dtime, self) + -- mcl_burning.tick may remove object immediately + if not self.object:get_pos() then return end self._time_in_air = self._time_in_air + .001 diff --git a/mods/ITEMS/mcl_bows/rocket.lua b/mods/ITEMS/mcl_bows/rocket.lua index d25c526473..e846937d0a 100644 --- a/mods/ITEMS/mcl_bows/rocket.lua +++ b/mods/ITEMS/mcl_bows/rocket.lua @@ -313,6 +313,8 @@ end function ARROW_ENTITY.on_step(self, dtime) mcl_burning.tick(self.object, dtime, self) + -- mcl_burning.tick may remove object immediately + if not self.object:get_pos() then return end self._time_in_air = self._time_in_air + .001 diff --git a/mods/ITEMS/mcl_campfires/init.lua b/mods/ITEMS/mcl_campfires/init.lua index e51ec9f54f..195612533e 100644 --- a/mods/ITEMS/mcl_campfires/init.lua +++ b/mods/ITEMS/mcl_campfires/init.lua @@ -11,7 +11,7 @@ local S = minetest.get_translator(minetest.get_current_modname()) local campfires = { - { name = "Campfire", lightlevel = 15, techname = "campfire", damage = 1, drops = "mcl_core:charcoal_lump 2" }, + { name = "Campfire", lightlevel = 14, techname = "campfire", damage = 1, drops = "mcl_core:charcoal_lump 2" }, { name = "Soul Campfire", lightlevel = 10, techname = "soul_campfire", damage = 2, drops = "mcl_blackstone:soul_soil" }, } @@ -25,6 +25,7 @@ for _, campfire in pairs(campfires) do drawtype = "mesh", mesh = "mcl_campfires_campfire.obj", tiles = {{name="mcl_campfires_log.png"},}, + use_texture_alpha = "clip", groups = { handy=1, axey=1, material_wood=1, not_in_creative_inventory=1, campfire=1, }, paramtype = "light", paramtype2 = "facedir", @@ -73,6 +74,7 @@ for _, campfire in pairs(campfires) do length=2.0 }} }, + use_texture_alpha = "clip", groups = { handy=1, axey=1, material_wood=1, campfire=1, lit_campfire=1 }, paramtype = "light", paramtype2 = "facedir", diff --git a/mods/ITEMS/mcl_core/nodes_base.lua b/mods/ITEMS/mcl_core/nodes_base.lua index 773aa92a9c..2f464a2fcb 100644 --- a/mods/ITEMS/mcl_core/nodes_base.lua +++ b/mods/ITEMS/mcl_core/nodes_base.lua @@ -1053,7 +1053,7 @@ for i=1,8 do mcl_core.clear_snow_dirt(npos, node) end, node_box = node_box, - groups = {shovely=1, attached_node=1,deco_block=1, dig_by_piston=1, snow_cover=1, top_snow=i}, + groups = {shovely=2, attached_node=1,deco_block=1, dig_by_piston=1, snow_cover=1, top_snow=i}, sounds = mcl_sounds.node_sound_snow_defaults(), on_construct = mcl_core.on_snow_construct, on_place = on_place, @@ -1072,7 +1072,7 @@ minetest.register_node("mcl_core:snowblock", { tiles = {"default_snow.png"}, is_ground_content = true, stack_max = 64, - groups = {shovely=1, building_block=1, snow_cover=1}, + groups = {shovely=2, building_block=1, snow_cover=1}, sounds = mcl_sounds.node_sound_snow_defaults(), on_construct = mcl_core.on_snow_construct, after_destruct = mcl_core.after_snow_destruct, diff --git a/mods/ITEMS/mcl_stonecutter/init.lua b/mods/ITEMS/mcl_stonecutter/init.lua index 145bc77035..e758849906 100644 --- a/mods/ITEMS/mcl_stonecutter/init.lua +++ b/mods/ITEMS/mcl_stonecutter/init.lua @@ -31,6 +31,7 @@ minetest.register_node("mcl_stonecutter:stonecutter", { length=1 }} }, + use_texture_alpha = "clip", drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", diff --git a/mods/ITEMS/mcl_tools/init.lua b/mods/ITEMS/mcl_tools/init.lua index 6111d7b91d..118020f0bb 100644 --- a/mods/ITEMS/mcl_tools/init.lua +++ b/mods/ITEMS/mcl_tools/init.lua @@ -288,7 +288,7 @@ minetest.register_tool("mcl_tools:shovel_wood", { _repair_material = "group:wood", _mcl_toollike_wield = true, _mcl_diggroups = { - shovely = { speed = 2, level = 1, uses = 60 } + shovely = { speed = 2, level = 2, uses = 60 } }, }) minetest.register_tool("mcl_tools:shovel_stone", {