From 063595ac3c59ac22933324a240cb3a3a0a9145b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20=C3=85str=C3=B6m?= Date: Wed, 15 Apr 2020 13:27:29 +0200 Subject: [PATCH 01/13] Change blast resistance of nodes in mcl_core The new blast resistance values are copied from the Minecraft wiki. https://minecraft.gamepedia.com/Explosion --- mods/ITEMS/mcl_core/nodes_base.lua | 106 +++++++++++------------ mods/ITEMS/mcl_core/nodes_cactuscane.lua | 2 +- mods/ITEMS/mcl_core/nodes_climb.lua | 4 +- mods/ITEMS/mcl_core/nodes_glass.lua | 4 +- mods/ITEMS/mcl_core/nodes_liquid.lua | 8 +- mods/ITEMS/mcl_core/nodes_misc.lua | 8 +- mods/ITEMS/mcl_core/nodes_trees.lua | 8 +- 7 files changed, 70 insertions(+), 70 deletions(-) diff --git a/mods/ITEMS/mcl_core/nodes_base.lua b/mods/ITEMS/mcl_core/nodes_base.lua index 6c47dd3f3..a8efc0cad 100644 --- a/mods/ITEMS/mcl_core/nodes_base.lua +++ b/mods/ITEMS/mcl_core/nodes_base.lua @@ -20,7 +20,7 @@ minetest.register_node("mcl_core:stone", { groups = {pickaxey=1, stone=1, building_block=1, material_stone=1}, drop = 'mcl_core:cobble', sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 30, + _mcl_blast_resistance = 6, _mcl_hardness = 1.5, }) @@ -34,7 +34,7 @@ minetest.register_node("mcl_core:stone_with_coal", { groups = {pickaxey=1, building_block=1, material_stone=1}, drop = 'mcl_core:coal_lump', sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 15, + _mcl_blast_resistance = 3, _mcl_hardness = 3, }) @@ -47,7 +47,7 @@ minetest.register_node("mcl_core:stone_with_iron", { groups = {pickaxey=3, building_block=1, material_stone=1}, drop = 'mcl_core:stone_with_iron', sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 15, + _mcl_blast_resistance = 3, _mcl_hardness = 3, }) @@ -61,7 +61,7 @@ minetest.register_node("mcl_core:stone_with_gold", { groups = {pickaxey=4, building_block=1, material_stone=1}, drop = "mcl_core:stone_with_gold", sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 15, + _mcl_blast_resistance = 3, _mcl_hardness = 3, }) @@ -93,7 +93,7 @@ minetest.register_node("mcl_core:stone_with_redstone", { sounds = mcl_sounds.node_sound_stone_defaults(), on_punch = redstone_ore_activate, on_walk_over = redstone_ore_activate, -- Uses walkover mod - _mcl_blast_resistance = 15, + _mcl_blast_resistance = 3, _mcl_hardness = 3, }) @@ -131,7 +131,7 @@ minetest.register_node("mcl_core:stone_with_redstone_lit", { on_timer = function(pos, elapsed) minetest.swap_node(pos, {name="mcl_core:stone_with_redstone"}) end, - _mcl_blast_resistance = 15, + _mcl_blast_resistance = 3, _mcl_hardness = 3, }) @@ -153,7 +153,7 @@ minetest.register_node("mcl_core:stone_with_lapis", { } }, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 15, + _mcl_blast_resistance = 3, _mcl_hardness = 3, }) @@ -166,7 +166,7 @@ minetest.register_node("mcl_core:stone_with_emerald", { groups = {pickaxey=4, building_block=1, material_stone=1}, drop = "mcl_core:emerald", sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 15, + _mcl_blast_resistance = 3, _mcl_hardness = 3, }) @@ -179,7 +179,7 @@ minetest.register_node("mcl_core:stone_with_diamond", { groups = {pickaxey=4, building_block=1, material_stone=1}, drop = "mcl_core:diamond", sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 15, + _mcl_blast_resistance = 3, _mcl_hardness = 3, }) @@ -191,7 +191,7 @@ minetest.register_node("mcl_core:stonebrick", { groups = {pickaxey=1, stone=1, stonebrick=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), is_ground_content = false, - _mcl_blast_resistance = 30, + _mcl_blast_resistance = 6, _mcl_hardness = 1.5, }) @@ -203,7 +203,7 @@ minetest.register_node("mcl_core:stonebrickcarved", { groups = {pickaxey=1, stone=1, stonebrick=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), is_ground_content = false, - _mcl_blast_resistance = 30, + _mcl_blast_resistance = 6, _mcl_hardness = 1.5, }) @@ -215,7 +215,7 @@ minetest.register_node("mcl_core:stonebrickcracked", { groups = {pickaxey=1, stone=1, stonebrick=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), is_ground_content = false, - _mcl_blast_resistance = 30, + _mcl_blast_resistance = 6, _mcl_hardness = 1.5, }) @@ -227,7 +227,7 @@ minetest.register_node("mcl_core:stonebrickmossy", { groups = {pickaxey=1, stone=1, stonebrick=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), is_ground_content = false, - _mcl_blast_resistance = 30, + _mcl_blast_resistance = 6, _mcl_hardness = 1.5, }) @@ -239,7 +239,7 @@ minetest.register_node("mcl_core:stone_smooth", { groups = {pickaxey=1, stone=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), is_ground_content = false, - _mcl_blast_resistance = 30, + _mcl_blast_resistance = 6, _mcl_hardness = 1.5, }) @@ -251,7 +251,7 @@ minetest.register_node("mcl_core:granite", { stack_max = 64, groups = {pickaxey=1, stone=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 30, + _mcl_blast_resistance = 6, _mcl_hardness = 1.5, }) @@ -263,7 +263,7 @@ minetest.register_node("mcl_core:granite_smooth", { is_ground_content = false, groups = {pickaxey=1, stone=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 30, + _mcl_blast_resistance = 6, _mcl_hardness = 1.5, }) @@ -275,7 +275,7 @@ minetest.register_node("mcl_core:andesite", { stack_max = 64, groups = {pickaxey=1, stone=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 30, + _mcl_blast_resistance = 6, _mcl_hardness = 1.5, }) @@ -299,7 +299,7 @@ minetest.register_node("mcl_core:diorite", { stack_max = 64, groups = {pickaxey=1, stone=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 30, + _mcl_blast_resistance = 6, _mcl_hardness = 1.5, }) @@ -311,7 +311,7 @@ minetest.register_node("mcl_core:diorite_smooth", { stack_max = 64, groups = {pickaxey=1, stone=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 30, + _mcl_blast_resistance = 6, _mcl_hardness = 1.5, }) @@ -344,7 +344,7 @@ minetest.register_node("mcl_core:dirt_with_grass", { return mcl_core.on_snowable_construct(pos) end, _mcl_snowed = "mcl_core:dirt_with_grass_snow", - _mcl_blast_resistance = 3, + _mcl_blast_resistance = 0.5, _mcl_hardness = 0.6, }) mcl_core.register_snowed_node("mcl_core:dirt_with_grass_snow", "mcl_core:dirt_with_grass", nil, nil, true) @@ -368,7 +368,7 @@ minetest.register_node("mcl_core:grass_path", { sounds = mcl_sounds.node_sound_dirt_defaults({ footstep = {name="default_grass_footstep", gain=0.4}, }), - _mcl_blast_resistance = 3.25, + _mcl_blast_resistance = 0.65, _mcl_hardness = 0.6, }) @@ -387,7 +387,7 @@ minetest.register_node("mcl_core:mycelium", { on_construct = mcl_core.on_snowable_construct, _mcl_snowed = "mcl_core:mycelium_snow", - _mcl_blast_resistance = 2.5, + _mcl_blast_resistance = 0.5, _mcl_hardness = 0.6, }) mcl_core.register_snowed_node("mcl_core:mycelium_snow", "mcl_core:mycelium") @@ -403,7 +403,7 @@ minetest.register_node("mcl_core:podzol", { sounds = mcl_sounds.node_sound_dirt_defaults(), on_construct = mcl_core.on_snowable_construct, _mcl_snowed = "mcl_core:podzol_snow", - _mcl_blast_resistance = 2.5, + _mcl_blast_resistance = 0.5, _mcl_hardness = 0.6, }) mcl_core.register_snowed_node("mcl_core:podzol_snow", "mcl_core:podzol") @@ -417,7 +417,7 @@ minetest.register_node("mcl_core:dirt", { stack_max = 64, groups = {handy=1,shovely=1, dirt=1,soil=1, soil_sapling=2, soil_sugarcane=1, cultivatable=2, enderman_takable=1, building_block=1}, sounds = mcl_sounds.node_sound_dirt_defaults(), - _mcl_blast_resistance = 3, + _mcl_blast_resistance = 0.5, _mcl_hardness = 0.5, }) @@ -429,7 +429,7 @@ minetest.register_node("mcl_core:coarse_dirt", { stack_max = 64, groups = {handy=1,shovely=1, dirt=3,soil=1, soil_sugarcane=1, cultivatable=1, enderman_takable=1, building_block=1}, sounds = mcl_sounds.node_sound_dirt_defaults(), - _mcl_blast_resistance = 3, + _mcl_blast_resistance = 0.5, _mcl_hardness = 0.5, }) @@ -450,7 +450,7 @@ minetest.register_node("mcl_core:gravel", { sounds = mcl_sounds.node_sound_dirt_defaults({ footstep = {name="default_gravel_footstep", gain=0.45}, }), - _mcl_blast_resistance = 3, + _mcl_blast_resistance = 0.6, _mcl_hardness = 0.6, }) @@ -464,7 +464,7 @@ minetest.register_node("mcl_core:sand", { stack_max = 64, groups = {handy=1,shovely=1, falling_node=1, sand=1, soil_sugarcane=1, enderman_takable=1, building_block=1, material_sand=1}, sounds = mcl_sounds.node_sound_sand_defaults(), - _mcl_blast_resistance = 2.5, + _mcl_blast_resistance = 0.5, _mcl_hardness = 0.5, }) @@ -477,7 +477,7 @@ minetest.register_node("mcl_core:sandstone", { stack_max = 64, groups = {pickaxey=1, sandstone=1, normal_sandstone=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 4, + _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, }) @@ -489,7 +489,7 @@ minetest.register_node("mcl_core:sandstonesmooth", { stack_max = 64, groups = {pickaxey=1, sandstone=1, normal_sandstone=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 4, + _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, }) @@ -501,7 +501,7 @@ minetest.register_node("mcl_core:sandstonecarved", { stack_max = 64, groups = {pickaxey=1, sandstone=1, normal_sandstone=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 4, + _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, }) @@ -514,7 +514,7 @@ minetest.register_node("mcl_core:sandstonesmooth2", { stack_max = 64, groups = {pickaxey=1, sandstone=1, normal_sandstone=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 4, + _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, }) @@ -528,7 +528,7 @@ minetest.register_node("mcl_core:redsand", { stack_max = 64, groups = {handy=1,shovely=1, falling_node=1, sand=1, soil_sugarcane=1, enderman_takable=1, building_block=1, material_sand=1}, sounds = mcl_sounds.node_sound_sand_defaults(), - _mcl_blast_resistance = 2.5, + _mcl_blast_resistance = 0.5, _mcl_hardness = 0.5, }) @@ -540,7 +540,7 @@ minetest.register_node("mcl_core:redsandstone", { stack_max = 64, groups = {pickaxey=1, sandstone=1, red_sandstone=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 4, + _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, }) @@ -552,7 +552,7 @@ minetest.register_node("mcl_core:redsandstonesmooth", { stack_max = 64, groups = {pickaxey=1, sandstone=1, red_sandstone=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 4, + _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, }) @@ -564,7 +564,7 @@ minetest.register_node("mcl_core:redsandstonecarved", { stack_max = 64, groups = {pickaxey=1, sandstone=1, red_sandstone=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 4, + _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, }) @@ -576,7 +576,7 @@ minetest.register_node("mcl_core:redsandstonesmooth2", { stack_max = 64, groups = {pickaxey=1, sandstone=1, red_sandstone=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 4, + _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, }) @@ -592,7 +592,7 @@ minetest.register_node("mcl_core:clay", { groups = {handy=1,shovely=1, enderman_takable=1, building_block=1}, drop = 'mcl_core:clay_lump 4', sounds = mcl_sounds.node_sound_dirt_defaults(), - _mcl_blast_resistance = 3, + _mcl_blast_resistance = 0.6, _mcl_hardness = 0.6, }) @@ -605,7 +605,7 @@ minetest.register_node("mcl_core:brick_block", { stack_max = 64, groups = {pickaxey=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 30, + _mcl_blast_resistance = 6, _mcl_hardness = 2, }) @@ -621,7 +621,7 @@ minetest.register_node("mcl_core:bedrock", { is_ground_content = false, on_blast = function() end, drop = '', - _mcl_blast_resistance = 18000000, + _mcl_blast_resistance = 3600000, _mcl_hardness = -1, -- Eternal fire on top of bedrock, if in the End dimension @@ -658,7 +658,7 @@ minetest.register_node("mcl_core:cobble", { stack_max = 64, groups = {pickaxey=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 30, + _mcl_blast_resistance = 6, _mcl_hardness = 2, }) @@ -670,7 +670,7 @@ minetest.register_node("mcl_core:mossycobble", { stack_max = 64, groups = {pickaxey=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 30, + _mcl_blast_resistance = 6, _mcl_hardness = 2, }) @@ -682,7 +682,7 @@ minetest.register_node("mcl_core:coalblock", { stack_max = 64, groups = {pickaxey=1, flammable=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 30, + _mcl_blast_resistance = 6, _mcl_hardness = 5, }) @@ -694,7 +694,7 @@ minetest.register_node("mcl_core:ironblock", { stack_max = 64, groups = {pickaxey=2, building_block=1}, sounds = mcl_sounds.node_sound_metal_defaults(), - _mcl_blast_resistance = 30, + _mcl_blast_resistance = 6, _mcl_hardness = 5, }) @@ -706,7 +706,7 @@ minetest.register_node("mcl_core:goldblock", { stack_max = 64, groups = {pickaxey=4, building_block=1}, sounds = mcl_sounds.node_sound_metal_defaults(), - _mcl_blast_resistance = 30, + _mcl_blast_resistance = 6, _mcl_hardness = 5, }) @@ -718,7 +718,7 @@ minetest.register_node("mcl_core:diamondblock", { stack_max = 64, groups = {pickaxey=4, building_block=1}, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 30, + _mcl_blast_resistance = 6, _mcl_hardness = 5, }) @@ -730,7 +730,7 @@ minetest.register_node("mcl_core:lapisblock", { stack_max = 64, groups = {pickaxey=3, building_block=1}, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 15, + _mcl_blast_resistance = 3, _mcl_hardness = 3, }) @@ -742,7 +742,7 @@ minetest.register_node("mcl_core:emeraldblock", { stack_max = 64, groups = {pickaxey=4, building_block=1}, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 30, + _mcl_blast_resistance = 6, _mcl_hardness = 5, }) @@ -754,7 +754,7 @@ minetest.register_node("mcl_core:obsidian", { sounds = mcl_sounds.node_sound_stone_defaults(), stack_max = 64, groups = {pickaxey=5, building_block=1, material_stone=1}, - _mcl_blast_resistance = 6000, + _mcl_blast_resistance = 1200, _mcl_hardness = 50, }) @@ -774,7 +774,7 @@ minetest.register_node("mcl_core:ice", { after_dig_node = function(pos, oldnode) mcl_core.melt_ice(pos) end, - _mcl_blast_resistance = 2.5, + _mcl_blast_resistance = 0.5, _mcl_hardness = 0.5, }) @@ -787,7 +787,7 @@ minetest.register_node("mcl_core:packed_ice", { groups = {handy=1,pickaxey=1, slippery=3, building_block=1}, drop = "", sounds = mcl_sounds.node_sound_glass_defaults(), - _mcl_blast_resistance = 2.5, + _mcl_blast_resistance = 0.5, _mcl_hardness = 0.5, }) @@ -851,7 +851,7 @@ for i=0,3 do local timer = minetest.get_node_timer(pos) timer:start(1.5) end, - _mcl_blast_resistance = 2.5, + _mcl_blast_resistance = 0.5, _mcl_hardness = 0.5, }) @@ -970,7 +970,7 @@ for i=1,8 do on_place = on_place, after_destruct = mcl_core.after_snow_destruct, drop = "mcl_throwing:snowball "..(i+1), - _mcl_blast_resistance = 0.5, + _mcl_blast_resistance = 0.1, _mcl_hardness = 0.1, }) end @@ -987,7 +987,7 @@ minetest.register_node("mcl_core:snowblock", { on_construct = mcl_core.on_snow_construct, after_destruct = mcl_core.after_snow_destruct, drop = "mcl_throwing:snowball 4", - _mcl_blast_resistance = 1, + _mcl_blast_resistance = 0.2, _mcl_hardness = 0.2, }) diff --git a/mods/ITEMS/mcl_core/nodes_cactuscane.lua b/mods/ITEMS/mcl_core/nodes_cactuscane.lua index e8555f148..277cc565f 100644 --- a/mods/ITEMS/mcl_core/nodes_cactuscane.lua +++ b/mods/ITEMS/mcl_core/nodes_cactuscane.lua @@ -42,7 +42,7 @@ minetest.register_node("mcl_core:cactus", { if not node_below then return false end return (node_below.name == "mcl_core:cactus" or minetest.get_item_group(node_below.name, "sand") == 1) end), - _mcl_blast_resistance = 2, + _mcl_blast_resistance = 0.4, _mcl_hardness = 0.4, }) diff --git a/mods/ITEMS/mcl_core/nodes_climb.lua b/mods/ITEMS/mcl_core/nodes_climb.lua index 5167d0828..8839b0120 100644 --- a/mods/ITEMS/mcl_core/nodes_climb.lua +++ b/mods/ITEMS/mcl_core/nodes_climb.lua @@ -81,7 +81,7 @@ minetest.register_node("mcl_core:ladder", { return itemstack end, - _mcl_blast_resistance = 2, + _mcl_blast_resistance = 0.4, _mcl_hardness = 0.4, on_rotate = rotate_climbable, }) @@ -164,7 +164,7 @@ minetest.register_node("mcl_core:vine", { end, - _mcl_blast_resistance = 1, + _mcl_blast_resistance = 0.2, _mcl_hardness = 0.2, on_rotate = false, }) diff --git a/mods/ITEMS/mcl_core/nodes_glass.lua b/mods/ITEMS/mcl_core/nodes_glass.lua index 3ac2cb394..87e9a7863 100644 --- a/mods/ITEMS/mcl_core/nodes_glass.lua +++ b/mods/ITEMS/mcl_core/nodes_glass.lua @@ -14,7 +14,7 @@ minetest.register_node("mcl_core:glass", { groups = {handy=1, glass=1, building_block=1, material_glass=1}, sounds = mcl_sounds.node_sound_glass_defaults(), drop = "", - _mcl_blast_resistance = 1.5, + _mcl_blast_resistance = 0.3, _mcl_hardness = 0.3, }) @@ -49,7 +49,7 @@ function mcl_core.add_stained_glass(desc, recipeitem, colorgroup, color) groups = {handy=1, glass=1, building_block=1, material_glass=1}, sounds = mcl_sounds.node_sound_glass_defaults(), drop = "", - _mcl_blast_resistance = 1.5, + _mcl_blast_resistance = 0.3, _mcl_hardness = 0.3, }) diff --git a/mods/ITEMS/mcl_core/nodes_liquid.lua b/mods/ITEMS/mcl_core/nodes_liquid.lua index 85ba4c9ef..ac938c80d 100644 --- a/mods/ITEMS/mcl_core/nodes_liquid.lua +++ b/mods/ITEMS/mcl_core/nodes_liquid.lua @@ -49,7 +49,7 @@ minetest.register_node("mcl_core:water_flowing", { liquid_range = 7, post_effect_color = {a=209, r=0x03, g=0x3C, b=0x5C}, groups = { water=3, liquid=3, puts_out_fire=1, not_in_creative_inventory=1, freezes=1, melt_around=1, dig_by_piston=1}, - _mcl_blast_resistance = 500, + _mcl_blast_resistance = 100, -- Hardness intentionally set to infinite instead of 100 (Minecraft value) to avoid problems in creative mode _mcl_hardness = -1, }) @@ -93,7 +93,7 @@ S("• When water is directly below lava, the water turns into stone."), post_effect_color = {a=209, r=0x03, g=0x3C, b=0x5C}, stack_max = 64, groups = { water=3, liquid=3, puts_out_fire=1, freezes=1, not_in_creative_inventory=1, dig_by_piston=1}, - _mcl_blast_resistance = 500, + _mcl_blast_resistance = 100, -- Hardness intentionally set to infinite instead of 100 (Minecraft value) to avoid problems in creative mode _mcl_hardness = -1, }) @@ -139,7 +139,7 @@ minetest.register_node("mcl_core:lava_flowing", { _mcl_node_death_message = lava_death_messages, post_effect_color = {a=255, r=208, g=73, b=10}, groups = { lava=3, liquid=2, destroys_items=1, not_in_creative_inventory=1, dig_by_piston=1}, - _mcl_blast_resistance = 500, + _mcl_blast_resistance = 100, -- Hardness intentionally set to infinite instead of 100 (Minecraft value) to avoid problems in creative mode _mcl_hardness = -1, }) @@ -194,7 +194,7 @@ S("• When lava is directly above water, the water turns into stone."), post_effect_color = {a=255, r=208, g=73, b=10}, stack_max = 64, groups = { lava=3, liquid=2, destroys_items=1, not_in_creative_inventory=1, dig_by_piston=1}, - _mcl_blast_resistance = 500, + _mcl_blast_resistance = 100, -- Hardness intentionally set to infinite instead of 100 (Minecraft value) to avoid problems in creative mode _mcl_hardness = -1, }) diff --git a/mods/ITEMS/mcl_core/nodes_misc.lua b/mods/ITEMS/mcl_core/nodes_misc.lua index 43161b446..a252bf931 100644 --- a/mods/ITEMS/mcl_core/nodes_misc.lua +++ b/mods/ITEMS/mcl_core/nodes_misc.lua @@ -17,7 +17,7 @@ minetest.register_node("mcl_core:bone_block", { groups = {pickaxey=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), on_rotate = on_rotate, - _mcl_blast_resistance = 10, + _mcl_blast_resistance = 2, _mcl_hardness = 2, }) @@ -76,7 +76,7 @@ minetest.register_node("mcl_core:cobweb", { drop = "mcl_mobitems:string", _mcl_shears_drop = true, sounds = mcl_sounds.node_sound_leaves_defaults(), - _mcl_blast_resistance = 20, + _mcl_blast_resistance = 4, _mcl_hardness = 4, }) @@ -135,7 +135,7 @@ minetest.register_node("mcl_core:barrier", { groups = {creative_breakable=1, not_in_creative_inventory = 1, not_solid = 1 }, on_blast = function() end, drop = "", - _mcl_blast_resistance = 18000003, + _mcl_blast_resistance = 36000008, _mcl_hardness = -1, after_place_node = function (pos, placer, itemstack, pointed_thing) if placer == nil then @@ -195,7 +195,7 @@ minetest.register_node("mcl_core:realm_barrier", { groups = {not_in_creative_inventory = 1, not_solid = 1 }, on_blast = function() end, drop = "", - _mcl_blast_resistance = 18000003, + _mcl_blast_resistance = 36000008, _mcl_hardness = -1, -- Prevent placement to protect player from screwing up the world, because the node is not pointable and hard to get rid of. node_placement_prediction = "", diff --git a/mods/ITEMS/mcl_core/nodes_trees.lua b/mods/ITEMS/mcl_core/nodes_trees.lua index ad162e5b6..ea18132e2 100644 --- a/mods/ITEMS/mcl_core/nodes_trees.lua +++ b/mods/ITEMS/mcl_core/nodes_trees.lua @@ -20,7 +20,7 @@ local register_tree_trunk = function(subname, description_trunk, description_bar groups = {handy=1,axey=1, tree=1, flammable=2, building_block=1, material_wood=1}, sounds = mcl_sounds.node_sound_wood_defaults(), on_rotate = on_rotate, - _mcl_blast_resistance = 10, + _mcl_blast_resistance = 2, _mcl_hardness = 2, }) @@ -35,7 +35,7 @@ local register_tree_trunk = function(subname, description_trunk, description_bar sounds = mcl_sounds.node_sound_wood_defaults(), is_ground_content = false, on_rotate = on_rotate, - _mcl_blast_resistance = 10, + _mcl_blast_resistance = 2, _mcl_hardness = 2, }) @@ -58,7 +58,7 @@ local register_wooden_planks = function(subname, description, tiles) is_ground_content = false, groups = {handy=1,axey=1, flammable=3,wood=1,building_block=1, material_wood=1}, sounds = mcl_sounds.node_sound_wood_defaults(), - _mcl_blast_resistance = 15, + _mcl_blast_resistance = 3, _mcl_hardness = 2, }) end @@ -108,7 +108,7 @@ local register_leaves = function(subname, description, longdesc, tiles, drop1, d drop = drop, _mcl_shears_drop = true, sounds = mcl_sounds.node_sound_leaves_defaults(), - _mcl_blast_resistance = 1, + _mcl_blast_resistance = 0.2, _mcl_hardness = 0.2, }) end From 1d5c11f68391caad31bffbe474b56160cd7af2f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20=C3=85str=C3=B6m?= Date: Wed, 15 Apr 2020 14:15:07 +0200 Subject: [PATCH 02/13] Add mcl_explosions for ray traced explosions Code has been adapted from the Minetest explosions API mod to have Minecraft-like explosion mechanics and work with MineClone 2. --- mods/CORE/mcl_explosions/description.txt | 1 + mods/CORE/mcl_explosions/init.lua | 266 +++++++++++++++++++++++ 2 files changed, 267 insertions(+) create mode 100644 mods/CORE/mcl_explosions/description.txt create mode 100644 mods/CORE/mcl_explosions/init.lua diff --git a/mods/CORE/mcl_explosions/description.txt b/mods/CORE/mcl_explosions/description.txt new file mode 100644 index 000000000..a9d5288b5 --- /dev/null +++ b/mods/CORE/mcl_explosions/description.txt @@ -0,0 +1 @@ +This mod adds a common API to create explosions. diff --git a/mods/CORE/mcl_explosions/init.lua b/mods/CORE/mcl_explosions/init.lua new file mode 100644 index 000000000..6909bdc6a --- /dev/null +++ b/mods/CORE/mcl_explosions/init.lua @@ -0,0 +1,266 @@ +--[[ .__ .__ + ____ ___ _________ | | ____ _____|__| ____ ____ ______ + _/ __ \\ \/ /\____ \| | / _ \/ ___/ |/ _ \ / \ / ___/ + \ ___/ > < | |_> > |_( <_> )___ \| ( <_> ) | \\___ \ + \___ >__/\_ \| __/|____/\____/____ >__|\____/|___| /____ > + \/ \/|__| \/ \/ \/ + + Explosion API mod for Minetest (adapted to MineClone 2) + + This mod is based on the Minetest explosion API mod, but has been changed + to have the same explosion mechanics as Minecraft and work with MineClone. + The computation-intensive parts of the mod has been optimized to allow for + larger explosions and faster world updating. + + This mod was created by Elias Astrom and is released + under the LGPLv2.1 license. +--]] + + +mcl_explosions = {} + +-- Saved sphere explosion shapes for various radiuses +local sphere_shapes = {} + +-- Saved node definitions in table using cid-keys for faster look-up. +local node_br = {} + +local AIR_CID = minetest.get_content_id('air') + +-- The step length for the rays (Minecraft uses 0.3) +local STEP_LENGTH = 0.3 + +minetest.after(0, function() + -- Store blast resistance values by content ids to improve performance. + for name, def in pairs(minetest.registered_nodes) do + node_br[minetest.get_content_id(name)] = def._mcl_blast_resistance or 0 + end +end) + +-- Compute the rays which make up a sphere with radius. Returns a list of rays +-- which can be used to trace explosions. This function is not efficient +-- (especially for larger radiuses), so the generated rays for various radiuses +-- should be cached and reused. +-- +-- Should be possible to improve by using a midpoint circle algorithm multiple +-- times to create the sphere, currently uses more of a brute-force approach. +local function compute_sphere_rays(radius) + local rays = {} + local sphere = {} + + for y = -radius, radius do + for z = -radius, radius do + for x = -radius, 0, 1 do + local d = x * x + y * y + z * z + if d <= radius * radius then + local pos = { x = x, y = y, z = z } + sphere[minetest.hash_node_position(pos)] = pos + break + end + end + end + end + + for y = -radius, radius do + for z = -radius, radius do + for x = radius, 0, -1 do + local d = x * x + y * y + z * z + if d <= radius * radius then + local pos = { x = x, y = y, z = z } + sphere[minetest.hash_node_position(pos)] = pos + break + end + end + end + end + + for x = -radius, radius do + for z = -radius, radius do + for y = -radius, 0, 1 do + local d = x * x + y * y + z * z + if d <= radius * radius then + local pos = { x = x, y = y, z = z } + sphere[minetest.hash_node_position(pos)] = pos + break + end + end + end + end + + for x = -radius, radius do + for z = -radius, radius do + for y = radius, 0, -1 do + local d = x * x + y * y + z * z + if d <= radius * radius then + local pos = { x = x, y = y, z = z } + sphere[minetest.hash_node_position(pos)] = pos + break + end + end + end + end + + for x = -radius, radius do + for y = -radius, radius do + for z = -radius, 0, 1 do + local d = x * x + y * y + z * z + if d <= radius * radius then + local pos = { x = x, y = y, z = z } + sphere[minetest.hash_node_position(pos)] = pos + break + end + end + end + end + + for x = -radius, radius do + for y = -radius, radius do + for z = radius, 0, -1 do + local d = x * x + y * y + z * z + if d <= radius * radius then + local pos = { x = x, y = y, z = z } + sphere[minetest.hash_node_position(pos)] = pos + break + end + end + end + end + + for _, pos in pairs(sphere) do + rays[#rays + 1] = vector.normalize(pos) + end + + return rays +end + +-- Get position from hash. This should be identical to +-- 'minetest.get_position_from_hash' but is used in case the hashing function +-- would change. +local function get_position_from_hash(hash) + local pos = {} + pos.x = (hash % 65536) - 32768 + hash = math.floor(hash / 65536) + pos.y = (hash % 65536) - 32768 + hash = math.floor(hash / 65536) + pos.z = (hash % 65536) - 32768 + return pos +end + +-- Traces the rays of an explosion, and updates the environment. +-- +-- Parameters: +-- pos - Where the rays in the explosion should start from +-- strength - The strength of each ray +-- raydirs - The directions for each ray +-- radius - The maximum distance each ray will go +-- drop_chance - Chance that destroy nodes drop their items +-- (becomes '1.0 / strength' if unspecified) +-- +-- Note that this function has been optimized, it contains code which has been +-- inlined to avoid function calls and unnecessary table creation. This was +-- measured to give a significant performance increase. +local function trace_explode(pos, strength, raydirs, radius, drop_chance) + local vm = minetest.get_voxel_manip() + + local emin, emax = vm:read_from_map(vector.subtract(pos, radius), + vector.add(pos, radius)) + local emin_x = emin.x + local emin_y = emin.y + local emin_z = emin.z + + local ystride = (emax.x - emin_x + 1) + local zstride = ystride * (emax.y - emin_y + 1) + local pos_x = pos.x + local pos_y = pos.y + local pos_z = pos.z + + local area = VoxelArea:new { + MinEdge = emin, + MaxEdge = emax + } + local data = vm:get_data() + local destroy = {} + + -- Trace rays + for i = 1, #raydirs do + local rpos_x = pos.x + local rpos_y = pos.y + local rpos_z = pos.z + local rdir_x = raydirs[i].x + local rdir_y = raydirs[i].y + local rdir_z = raydirs[i].z + local rstr = (0.7 + math.random() * 0.6) * strength + + for r = 0, math.ceil(radius * (1.0 / STEP_LENGTH)) do + local npos_x = math.floor(rpos_x + 0.5) + local npos_y = math.floor(rpos_y + 0.5) + local npos_z = math.floor(rpos_z + 0.5) + local idx = (npos_z - emin_z) * zstride + (npos_y - emin_y) * ystride + + npos_x - emin_x + 1 + + local cid = data[idx] + local br = node_br[cid] + local hash = (npos_z + 32768) * 65536 * 65536 + + (npos_y + 32768) * 65536 + + npos_x + 32768 + + rpos_x = rpos_x + STEP_LENGTH * rdir_x + rpos_y = rpos_y + STEP_LENGTH * rdir_y + rpos_z = rpos_z + STEP_LENGTH * rdir_z + + rstr = rstr - 0.75 * STEP_LENGTH - (br + 0.3) * STEP_LENGTH + + if rstr <= 0 then + break + end + + if cid ~= AIR_CID then + destroy[hash] = idx + end + end + end + + if drop_chance == nil then + drop_chance = 1 / strength + end + + -- Remove destroyed blocks and drop items + for hash, idx in pairs(destroy) do + if math.random() <= drop_chance then + local name = minetest.get_name_from_content_id(data[idx]) + local drop = minetest.get_node_drops(name, "") + for _, item in ipairs(drop) do + if type(item) == "string" then + minetest.add_item(get_position_from_hash(hash), item) + end + end + end + data[idx] = AIR_CID + end + + -- Log explosion + minetest.log('action', 'Explosion at ' .. minetest.pos_to_string(pos) .. + ' with strength ' .. strength .. ' and radius ' .. radius) + + -- Update environment + vm:set_data(data) + vm:write_to_map(data) + vm:update_liquids() +end + +-- Create an explosion with strength at pos. +-- +-- Parameters: +-- pos - The position where the explosion originates from +-- strength - The blast strength of the explosion (a TNT explosion uses 4) +function mcl_explosions.explode(pos, strength) + -- The maximum blast radius (in the air) + local radius = math.ceil(1.3 * strength / (0.3 * 0.75) * 0.3) + + if not sphere_shapes[radius] then + sphere_shapes[radius] = compute_sphere_rays(radius) + end + shape = sphere_shapes[radius] + + trace_explode(pos, strength, shape, radius) +end From 77c95fe8c31c2b71d0be439a81d6cc69e20bda36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20=C3=85str=C3=B6m?= Date: Wed, 15 Apr 2020 20:30:12 +0200 Subject: [PATCH 03/13] Add particles and sounds from explosions --- mods/CORE/mcl_explosions/init.lua | 51 ++++++++++++++++++++++++++----- 1 file changed, 43 insertions(+), 8 deletions(-) diff --git a/mods/CORE/mcl_explosions/init.lua b/mods/CORE/mcl_explosions/init.lua index 6909bdc6a..a18f56513 100644 --- a/mods/CORE/mcl_explosions/init.lua +++ b/mods/CORE/mcl_explosions/init.lua @@ -133,6 +133,29 @@ local function compute_sphere_rays(radius) return rays end +-- Add particles from explosion +-- +-- Parameters: +-- pos - The position of the explosion +-- radius - The radius of the explosion +local function add_particles(pos, radius) + minetest.add_particlespawner({ + amount = 64, + time = 0.125, + minpos = pos, + maxpos = pos, + minvel = {x = -radius, y = -radius, z = -radius}, + maxvel = {x = radius, y = radius, z = radius}, + minacc = vector.new(), + maxacc = vector.new(), + minexptime = 0.5, + maxexptime = 1.0, + minsize = radius * 0.5, + maxsize = radius * 1.0, + texture = "tnt_smoke.png", + }) +end + -- Get position from hash. This should be identical to -- 'minetest.get_position_from_hash' but is used in case the hashing function -- would change. @@ -153,8 +176,7 @@ end -- strength - The strength of each ray -- raydirs - The directions for each ray -- radius - The maximum distance each ray will go --- drop_chance - Chance that destroy nodes drop their items --- (becomes '1.0 / strength' if unspecified) +-- drop_chance - The chance that destroyed nodes will drop their items -- -- Note that this function has been optimized, it contains code which has been -- inlined to avoid function calls and unnecessary table creation. This was @@ -220,10 +242,6 @@ local function trace_explode(pos, strength, raydirs, radius, drop_chance) end end - if drop_chance == nil then - drop_chance = 1 / strength - end - -- Remove destroyed blocks and drop items for hash, idx in pairs(destroy) do if math.random() <= drop_chance then @@ -253,7 +271,14 @@ end -- Parameters: -- pos - The position where the explosion originates from -- strength - The blast strength of the explosion (a TNT explosion uses 4) -function mcl_explosions.explode(pos, strength) +-- info - Table containing information about explosion. +-- +-- Values in info: +-- drop_chance - If specified becomes the drop chance of all nodes in the +-- explosion (defaults to 1.0 / strength) +-- no_sound - If true then the explosion will not play a sound +-- no_particle - If true then the explosion will not create particles +function mcl_explosions.explode(pos, strength, info) -- The maximum blast radius (in the air) local radius = math.ceil(1.3 * strength / (0.3 * 0.75) * 0.3) @@ -262,5 +287,15 @@ function mcl_explosions.explode(pos, strength) end shape = sphere_shapes[radius] - trace_explode(pos, strength, shape, radius) + trace_explode(pos, strength, shape, radius, (info and info.drop_chance) or 1 / strength) + + if not (info and info.no_sound) then + add_particles(pos, radius) + end + if not (info and info.no_particle) then + minetest.sound_play("tnt_explode", { + pos = pos, gain = 1.0, + max_hear_distance = strength * 16 + }, true) + end end From ca7c8c23c79c0c892cdea53ade613fcaf44892e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20=C3=85str=C3=B6m?= Date: Thu, 16 Apr 2020 23:05:50 +0200 Subject: [PATCH 04/13] Add entity damage and player knockback Could not find a way to add knockback to entities. After adding a velocity to them they will just slide around indefinitely. Because of this, knockback is only enabled on players for now. --- mods/CORE/mcl_explosions/init.lua | 128 +++++++++++++++++++++++++++--- mods/ITEMS/mcl_tnt/init.lua | 5 ++ 2 files changed, 123 insertions(+), 10 deletions(-) diff --git a/mods/CORE/mcl_explosions/init.lua b/mods/CORE/mcl_explosions/init.lua index a18f56513..225c2e770 100644 --- a/mods/CORE/mcl_explosions/init.lua +++ b/mods/CORE/mcl_explosions/init.lua @@ -24,16 +24,21 @@ local sphere_shapes = {} -- Saved node definitions in table using cid-keys for faster look-up. local node_br = {} +local node_on_blast = {} local AIR_CID = minetest.get_content_id('air') -- The step length for the rays (Minecraft uses 0.3) local STEP_LENGTH = 0.3 +-- How many rays to compute entity exposure to explosion +local N_EXPOSURE_RAYS = 16 + minetest.after(0, function() -- Store blast resistance values by content ids to improve performance. for name, def in pairs(minetest.registered_nodes) do node_br[minetest.get_content_id(name)] = def._mcl_blast_resistance or 0 + node_on_blast[minetest.get_content_id(name)] = def.on_blast end end) @@ -203,7 +208,7 @@ local function trace_explode(pos, strength, raydirs, radius, drop_chance) local data = vm:get_data() local destroy = {} - -- Trace rays + -- Trace rays for environment destruction for i = 1, #raydirs do local rpos_x = pos.x local rpos_y = pos.y @@ -237,23 +242,126 @@ local function trace_explode(pos, strength, raydirs, radius, drop_chance) end if cid ~= AIR_CID then - destroy[hash] = idx + destroy[hash] = idx + end + end + end + + -- Entities in radius of explosion + local punch_radius = 2 * strength + local objs = minetest.get_objects_inside_radius(pos, punch_radius) + + -- Trace rays for entity damage + for _, obj in pairs(objs) do + -- Object position and direction to explosion center + local opos = obj:get_pos() + + if obj:get_luaentity() ~= nil or obj:is_player() then + local collisionbox = nil + + if obj:is_player() then + collisionbox = { -0.3, 0.0, -0.3, 0.3, 1.77, 0.3 } + elseif obj:get_luaentity().name then + local def = minetest.registered_entities[obj:get_luaentity().name] + collisionbox = def.collisionbox + end + + if collisionbox then + -- Create rays from random points in the collision box + local x1 = collisionbox[1] * 2 + local y1 = collisionbox[2] * 2 + local z1 = collisionbox[3] * 2 + local x2 = collisionbox[4] * 2 + local y2 = collisionbox[5] * 2 + local z2 = collisionbox[6] * 2 + local x_len = math.abs(x2 - x1) + local y_len = math.abs(y2 - y1) + local z_len = math.abs(z2 - z1) + + -- Move object position to the center of its bounding box + opos.x = opos.x + x1 + x2 + opos.y = opos.y + y1 + y2 + opos.z = opos.z + z1 + z2 + + -- Count number of rays from collision box which are unobstructed + local count = N_EXPOSURE_RAYS + + for i = 1, N_EXPOSURE_RAYS do + local rpos_x = opos.x + math.random() * x_len - x_len / 2 + local rpos_y = opos.y + math.random() * y_len - y_len / 2 + local rpos_z = opos.z + math.random() * z_len - z_len / 2 + local rdir_x = pos.x - rpos_x + local rdir_y = pos.y - rpos_y + local rdir_z = pos.z - rpos_z + local rdir_len = math.hypot(rdir_x, math.hypot(rdir_y, rdir_z)) + rdir_x = rdir_x / rdir_len + rdir_y = rdir_y / rdir_len + rdir_z = rdir_z / rdir_len + + for i=0, rdir_len / STEP_LENGTH do + rpos_x = rpos_x + rdir_x * STEP_LENGTH + rpos_y = rpos_y + rdir_y * STEP_LENGTH + rpos_z = rpos_z + rdir_z * STEP_LENGTH + local npos_x = math.floor(rpos_x + 0.5) + local npos_y = math.floor(rpos_y + 0.5) + local npos_z = math.floor(rpos_z + 0.5) + local idx = (npos_z - emin_z) * zstride + (npos_y - emin_y) * ystride + + npos_x - emin_x + 1 + + + local cid = data[idx] + local br = node_br[cid] + + if br ~= 0 then + count = count - 1 + break + end + end + end + + -- Punch entity with damage depending on explosion exposure and + -- distance to explosion + local exposure = count / N_EXPOSURE_RAYS + local punch_vec = vector.subtract(pos, opos) + local punch_dir = vector.normalize(punch_vec) + local impact = (1 - vector.length(punch_vec) / punch_radius) * exposure + if impact < 0 then + impact = 0 + end + local damage = math.floor((impact * impact + impact) * 7 * strength + 1) + obj:punch(obj, nil, { damage_groups = { fleshy = damage } }, punch_dir) + + if obj:is_player() then + obj:add_player_velocity(vector.multiply(punch_dir, -exposure * 20)) + end end end end -- Remove destroyed blocks and drop items for hash, idx in pairs(destroy) do - if math.random() <= drop_chance then - local name = minetest.get_name_from_content_id(data[idx]) - local drop = minetest.get_node_drops(name, "") - for _, item in ipairs(drop) do - if type(item) == "string" then - minetest.add_item(get_position_from_hash(hash), item) - end + local do_drop = math.random() <= drop_chance + local on_blast = node_on_blast[data[idx]] + local remove = true + + if do_drop or on_blast ~= nil then + local npos = get_position_from_hash(hash) + if on_blast ~= nil then + remove = on_blast(npos, 1.0) + else + local name = minetest.get_name_from_content_id(data[idx]) + local drop = minetest.get_node_drops(name, "") + + for _, item in ipairs(drop) do + if type(item) == "string" then + minetest.add_item(npos, item) + end + end end end - data[idx] = AIR_CID + if remove then + data[idx] = AIR_CID + end end -- Log explosion diff --git a/mods/ITEMS/mcl_tnt/init.lua b/mods/ITEMS/mcl_tnt/init.lua index c63d118bd..ed47f6973 100644 --- a/mods/ITEMS/mcl_tnt/init.lua +++ b/mods/ITEMS/mcl_tnt/init.lua @@ -103,6 +103,11 @@ minetest.register_node("mcl_tnt:tnt", { _doc_items_usagehelp = S("Place the TNT and ignite it with one of the methods above. Quickly get in safe distance. The TNT will start to be affected by gravity and explodes in 4 seconds."), groups = { dig_immediate = 3, tnt = 1, enderman_takable=1 }, mesecons = tnt_mesecons, + on_blast = function(pos) + minetest.chat_send_all("on_blast " .. minetest.pos_to_string(pos)) + spawn_tnt(pos, "mcl_tnt:tnt") + return true + end, _on_ignite = function(player, pointed_thing) tnt.ignite(pointed_thing.under) return true From fd05259202250dceb547a1f9bf11d391d7daafab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20=C3=85str=C3=B6m?= Date: Fri, 17 Apr 2020 20:36:39 +0200 Subject: [PATCH 05/13] Make TNT and TNT Minecart use the explosions API The old api from mcl_tnt is still left in the code, and used by the mobs. --- mods/ENTITIES/mcl_minecarts/depends.txt | 1 + mods/ENTITIES/mcl_minecarts/init.lua | 4 ++-- mods/ITEMS/mcl_tnt/depends.txt | 1 + mods/ITEMS/mcl_tnt/init.lua | 3 +-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/mods/ENTITIES/mcl_minecarts/depends.txt b/mods/ENTITIES/mcl_minecarts/depends.txt index 51e65fb89..cdf7feb54 100644 --- a/mods/ENTITIES/mcl_minecarts/depends.txt +++ b/mods/ENTITIES/mcl_minecarts/depends.txt @@ -1,3 +1,4 @@ +mcl_explosions mcl_core mcl_sounds mcl_player diff --git a/mods/ENTITIES/mcl_minecarts/init.lua b/mods/ENTITIES/mcl_minecarts/init.lua index 14f70d246..3aa1ec4ca 100644 --- a/mods/ENTITIES/mcl_minecarts/init.lua +++ b/mods/ENTITIES/mcl_minecarts/init.lua @@ -206,7 +206,7 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o -- Explode if already ignited if self._boomtimer then self.object:remove() - tnt.boom(pos) + mcl_explosions.explode(pos, 4, { drop_chance = 1.0 }) return end @@ -249,7 +249,7 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o local pos = self.object:get_pos() if self._boomtimer <= 0 then self.object:remove() - tnt.boom(pos) + mcl_explosions.explode(pos, 4, { drop_chance = 1.0 }) return else tnt.smoke_step(pos) diff --git a/mods/ITEMS/mcl_tnt/depends.txt b/mods/ITEMS/mcl_tnt/depends.txt index 548dace5d..e4c208ea6 100644 --- a/mods/ITEMS/mcl_tnt/depends.txt +++ b/mods/ITEMS/mcl_tnt/depends.txt @@ -1,3 +1,4 @@ +mcl_explosions mcl_sounds? mcl_mobitems? mcl_death_messages? diff --git a/mods/ITEMS/mcl_tnt/init.lua b/mods/ITEMS/mcl_tnt/init.lua index ed47f6973..5f53afaf8 100644 --- a/mods/ITEMS/mcl_tnt/init.lua +++ b/mods/ITEMS/mcl_tnt/init.lua @@ -104,7 +104,6 @@ minetest.register_node("mcl_tnt:tnt", { groups = { dig_immediate = 3, tnt = 1, enderman_takable=1 }, mesecons = tnt_mesecons, on_blast = function(pos) - minetest.chat_send_all("on_blast " .. minetest.pos_to_string(pos)) spawn_tnt(pos, "mcl_tnt:tnt") return true end, @@ -209,7 +208,7 @@ function TNT:on_step(dtime) self.blinkstatus = not self.blinkstatus end if self.timer > tnt.BOOMTIMER then - tnt.boom(self.object:get_pos(), nil, self.object) + mcl_explosions.explode(self.object:get_pos(), 4, { drop_chance = 1.0 }) self.object:remove() end end From 8d67824e42debea5da23326c976b3139d480983c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20=C3=85str=C3=B6m?= Date: Fri, 17 Apr 2020 21:02:46 +0200 Subject: [PATCH 06/13] Add to list of contributors in README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 303d0f5bd..1e8a73c63 100644 --- a/README.md +++ b/README.md @@ -200,6 +200,7 @@ There are so many people to list (sorry). Check out the respective mod directori * [ex-bart](https://github.com/ex-bart): Redstone comparators * [Rootyjr](https://github.com/Rootyjr): Fishing rod and bugfixes * [aligator](https://github.com/aligator): Improvement of doors +* [ryvnf](https://github.com/ryvnf): Explosion mechanics * Lots of other people: TO BE WRITTEN (see mod directories for details) ### Textures From 6315490b14ec1c125fe963613ddfcfdcbbd77504 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20=C3=85str=C3=B6m?= Date: Fri, 17 Apr 2020 21:40:13 +0200 Subject: [PATCH 07/13] Update the rest of the blast resistance values The values have been updated according to this list: https://minecraft.gamepedia.com/Module:Blast_resistance_values --- mods/ITEMS/REDSTONE/mcl_dispensers/init.lua | 2 +- mods/ITEMS/REDSTONE/mcl_droppers/init.lua | 2 +- mods/ITEMS/REDSTONE/mcl_droppers/init_new.lua | 2 +- mods/ITEMS/REDSTONE/mcl_observers/init.lua | 6 ++-- mods/ITEMS/REDSTONE/mesecons_button/init.lua | 4 +-- .../REDSTONE/mesecons_commandblock/init.lua | 4 +-- .../REDSTONE/mesecons_lightstone/init.lua | 4 +-- .../REDSTONE/mesecons_noteblock/init.lua | 2 +- mods/ITEMS/REDSTONE/mesecons_pistons/init.lua | 36 +++++++++---------- .../REDSTONE/mesecons_pressureplates/init.lua | 2 +- .../REDSTONE/mesecons_solarpanel/init.lua | 8 ++--- mods/ITEMS/REDSTONE/mesecons_torch/init.lua | 2 +- .../REDSTONE/mesecons_walllever/init.lua | 4 +-- mods/ITEMS/mcl_anvils/init.lua | 2 +- mods/ITEMS/mcl_banners/init.lua | 4 +-- mods/ITEMS/mcl_books/init.lua | 2 +- mods/ITEMS/mcl_cake/init.lua | 4 +-- mods/ITEMS/mcl_cauldrons/init.lua | 4 +-- mods/ITEMS/mcl_cocoas/init.lua | 2 +- mods/ITEMS/mcl_colorblocks/init.lua | 10 +++--- mods/ITEMS/mcl_crafting_table/init.lua | 2 +- mods/ITEMS/mcl_doors/register.lua | 18 +++++----- mods/ITEMS/mcl_end/building.lua | 10 +++--- mods/ITEMS/mcl_end/chorus_plant.lua | 2 +- mods/ITEMS/mcl_farming/melon.lua | 2 +- mods/ITEMS/mcl_farming/pumpkin.lua | 4 +-- mods/ITEMS/mcl_farming/soil.lua | 4 +-- mods/ITEMS/mcl_farming/wheat.lua | 2 +- mods/ITEMS/mcl_furnaces/init.lua | 4 +-- mods/ITEMS/mcl_heads/init.lua | 4 +-- mods/ITEMS/mcl_hoppers/init.lua | 4 +-- mods/ITEMS/mcl_jukebox/init.lua | 2 +- mods/ITEMS/mcl_mobspawners/init.lua | 2 +- mods/ITEMS/mcl_monster_eggs/init.lua | 2 +- mods/ITEMS/mcl_mushrooms/huge.lua | 2 +- mods/ITEMS/mcl_nether/init.lua | 24 ++++++------- mods/ITEMS/mcl_ocean/corals.lua | 4 +-- mods/ITEMS/mcl_ocean/prismarine.lua | 8 ++--- mods/ITEMS/mcl_portals/portal_end.lua | 6 ++-- mods/ITEMS/mcl_signs/init.lua | 4 +-- mods/ITEMS/mcl_sponges/init.lua | 6 ++-- mods/ITEMS/mcl_walls/init.lua | 8 ++--- mods/ITEMS/mcl_wool/init.lua | 4 +-- mods/ITEMS/xpanes/init.lua | 4 +-- 44 files changed, 119 insertions(+), 119 deletions(-) diff --git a/mods/ITEMS/REDSTONE/mcl_dispensers/init.lua b/mods/ITEMS/REDSTONE/mcl_dispensers/init.lua index 464bc4bd8..b6d0d2ef6 100644 --- a/mods/ITEMS/REDSTONE/mcl_dispensers/init.lua +++ b/mods/ITEMS/REDSTONE/mcl_dispensers/init.lua @@ -94,7 +94,7 @@ local dispenserdef = { end meta:from_table(meta2:to_table()) end, - _mcl_blast_resistance = 17.5, + _mcl_blast_resistance = 3.5, _mcl_hardness = 3.5, mesecons = {effector = { -- Dispense random item when triggered diff --git a/mods/ITEMS/REDSTONE/mcl_droppers/init.lua b/mods/ITEMS/REDSTONE/mcl_droppers/init.lua index 6ca92b335..715a85f3d 100644 --- a/mods/ITEMS/REDSTONE/mcl_droppers/init.lua +++ b/mods/ITEMS/REDSTONE/mcl_droppers/init.lua @@ -94,7 +94,7 @@ local dropperdef = { return stack:get_count() end end, - _mcl_blast_resistance = 17.5, + _mcl_blast_resistance = 3.5, _mcl_hardness = 3.5, mesecons = {effector = { -- Drop random item when triggered diff --git a/mods/ITEMS/REDSTONE/mcl_droppers/init_new.lua b/mods/ITEMS/REDSTONE/mcl_droppers/init_new.lua index fc7238c47..1bf968a82 100644 --- a/mods/ITEMS/REDSTONE/mcl_droppers/init_new.lua +++ b/mods/ITEMS/REDSTONE/mcl_droppers/init_new.lua @@ -92,7 +92,7 @@ local dropperdef = { return stack:get_count() end end, - _mcl_blast_resistance = 17.5, + _mcl_blast_resistance = 3.5, _mcl_hardness = 3.5, mesecons = {effector = { -- Drop random item when triggered diff --git a/mods/ITEMS/REDSTONE/mcl_observers/init.lua b/mods/ITEMS/REDSTONE/mcl_observers/init.lua index 7c0eb3a2f..885e8599e 100644 --- a/mods/ITEMS/REDSTONE/mcl_observers/init.lua +++ b/mods/ITEMS/REDSTONE/mcl_observers/init.lua @@ -82,7 +82,7 @@ mesecon.register_node("mcl_observers:observer", sounds = mcl_sounds.node_sound_stone_defaults(), paramtype2 = "facedir", on_rotate = false, - _mcl_blast_resistance = 17.5, + _mcl_blast_resistance = 3.5, _mcl_hardness = 3.5, }, { @@ -139,7 +139,7 @@ mesecon.register_node("mcl_observers:observer_down", sounds = mcl_sounds.node_sound_stone_defaults(), groups = {pickaxey=1, material_stone=1, not_opaque=1, not_in_creative_inventory=1 }, on_rotate = false, - _mcl_blast_resistance = 17.5, + _mcl_blast_resistance = 3.5, _mcl_hardness = 3.5, drop = "mcl_observers:observer_off", }, @@ -188,7 +188,7 @@ mesecon.register_node("mcl_observers:observer_up", sounds = mcl_sounds.node_sound_stone_defaults(), groups = {pickaxey=1, material_stone=1, not_opaque=1, not_in_creative_inventory=1 }, on_rotate = false, - _mcl_blast_resistance = 17.5, + _mcl_blast_resistance = 3.5, _mcl_hardness = 3.5, drop = "mcl_observers:observer_off", }, diff --git a/mods/ITEMS/REDSTONE/mesecons_button/init.lua b/mods/ITEMS/REDSTONE/mesecons_button/init.lua index e1a5c5980..5ff15eccb 100644 --- a/mods/ITEMS/REDSTONE/mesecons_button/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_button/init.lua @@ -133,7 +133,7 @@ mesecon.register_button = function(basename, description, texture, recipeitem, s _mcl_button_basename = basename, _mcl_button_timer = button_timer, - _mcl_blast_resistance = 2.5, + _mcl_blast_resistance = 0.5, _mcl_hardness = 0.5, }) @@ -184,7 +184,7 @@ mesecon.register_button = function(basename, description, texture, recipeitem, s end end, - _mcl_blast_resistance = 2.5, + _mcl_blast_resistance = 0.5, _mcl_hardness = 0.5, }) diff --git a/mods/ITEMS/REDSTONE/mesecons_commandblock/init.lua b/mods/ITEMS/REDSTONE/mesecons_commandblock/init.lua index 8a36210ad..44db17a4a 100644 --- a/mods/ITEMS/REDSTONE/mesecons_commandblock/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_commandblock/init.lua @@ -242,7 +242,7 @@ S("Example 2:\n give @@n mcl_core:apple 5\nGives the nearest player 5 apples" action_on = commandblock_action_on, rules = mesecon.rules.alldirs, }}, - _mcl_blast_resistance = 18000000, + _mcl_blast_resistance = 3600000, _mcl_hardness = -1, }) @@ -261,7 +261,7 @@ minetest.register_node("mesecons_commandblock:commandblock_on", { action_off = commandblock_action_off, rules = mesecon.rules.alldirs, }}, - _mcl_blast_resistance = 18000000, + _mcl_blast_resistance = 3600000, _mcl_hardness = -1, }) diff --git a/mods/ITEMS/REDSTONE/mesecons_lightstone/init.lua b/mods/ITEMS/REDSTONE/mesecons_lightstone/init.lua index 0e01d52b9..c09bcf592 100644 --- a/mods/ITEMS/REDSTONE/mesecons_lightstone/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_lightstone/init.lua @@ -16,7 +16,7 @@ minetest.register_node("mesecons_lightstone:lightstone_off", { end, rules = mesecon.rules.alldirs, }}, - _mcl_blast_resistance = 1.5, + _mcl_blast_resistance = 0.3, _mcl_hardness = 0.3, }) @@ -34,7 +34,7 @@ minetest.register_node("mesecons_lightstone:lightstone_on", { end, rules = mesecon.rules.alldirs, }}, - _mcl_blast_resistance = 1.5, + _mcl_blast_resistance = 0.3, _mcl_hardness = 0.3, }) diff --git a/mods/ITEMS/REDSTONE/mesecons_noteblock/init.lua b/mods/ITEMS/REDSTONE/mesecons_noteblock/init.lua index 5ac18ea42..439342d34 100644 --- a/mods/ITEMS/REDSTONE/mesecons_noteblock/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_noteblock/init.lua @@ -48,7 +48,7 @@ S("The note block will only play a note when it is below air, otherwise, it stay end, rules = mesecon.rules.alldirs, }}, - _mcl_blast_resistance = 4, + _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, }) diff --git a/mods/ITEMS/REDSTONE/mesecons_pistons/init.lua b/mods/ITEMS/REDSTONE/mesecons_pistons/init.lua index 8536cff9a..eb69d3380 100644 --- a/mods/ITEMS/REDSTONE/mesecons_pistons/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_pistons/init.lua @@ -200,7 +200,7 @@ minetest.register_node("mesecons_pistons:piston_normal_off", { action_on = piston_on, rules = piston_get_rules }}, - _mcl_blast_resistance = 2.5, + _mcl_blast_resistance = 0.5, _mcl_hardness = 0.5, on_rotate = function(pos, node, user, mode) if mode == screwdriver.ROTATE_AXIS then @@ -235,7 +235,7 @@ minetest.register_node("mesecons_pistons:piston_normal_on", { action_off = piston_off, rules = piston_get_rules }}, - _mcl_blast_resistance = 2.5, + _mcl_blast_resistance = 0.5, _mcl_hardness = 0.5, on_rotate = false, }) @@ -262,7 +262,7 @@ minetest.register_node("mesecons_pistons:piston_pusher_normal", { selection_box = piston_pusher_box, node_box = piston_pusher_box, sounds = mcl_sounds.node_sound_wood_defaults(), - _mcl_blast_resistance = 2.5, + _mcl_blast_resistance = 0.5, on_rotate = false, }) @@ -304,7 +304,7 @@ minetest.register_node("mesecons_pistons:piston_sticky_off", { action_on = piston_on, rules = piston_get_rules }}, - _mcl_blast_resistance = 2.5, + _mcl_blast_resistance = 0.5, _mcl_hardness = 0.5, on_rotate = function(pos, node, user, mode) if mode == screwdriver.ROTATE_AXIS then @@ -339,7 +339,7 @@ minetest.register_node("mesecons_pistons:piston_sticky_on", { action_off = piston_off, rules = piston_get_rules }}, - _mcl_blast_resistance = 2.5, + _mcl_blast_resistance = 0.5, _mcl_hardness = 0.5, on_rotate = false, }) @@ -366,7 +366,7 @@ minetest.register_node("mesecons_pistons:piston_pusher_sticky", { selection_box = piston_pusher_box, node_box = piston_pusher_box, sounds = mcl_sounds.node_sound_wood_defaults(), - _mcl_blast_resistance = 2.5, + _mcl_blast_resistance = 0.5, on_rotate = false, }) @@ -423,7 +423,7 @@ minetest.register_node("mesecons_pistons:piston_up_normal_off", { sounds = mcl_sounds.node_sound_stone_defaults({ footstep = mcl_sounds.node_sound_wood_defaults().footstep }), - _mcl_blast_resistance = 2.5, + _mcl_blast_resistance = 0.5, _mcl_hardness = 0.5, on_rotate = function(pos, node, user, mode) if mode == screwdriver.ROTATE_AXIS then @@ -459,7 +459,7 @@ minetest.register_node("mesecons_pistons:piston_up_normal_on", { action_off = piston_off, rules = piston_up_rules, }}, - _mcl_blast_resistance = 2.5, + _mcl_blast_resistance = 0.5, _mcl_hardness = 0.5, on_rotate = false, }) @@ -486,7 +486,7 @@ minetest.register_node("mesecons_pistons:piston_up_pusher_normal", { selection_box = piston_up_pusher_box, node_box = piston_up_pusher_box, sounds = mcl_sounds.node_sound_wood_defaults(), - _mcl_blast_resistance = 2.5, + _mcl_blast_resistance = 0.5, on_rotate = false, }) @@ -526,7 +526,7 @@ minetest.register_node("mesecons_pistons:piston_up_sticky_off", { action_on = piston_on, rules = piston_up_rules, }}, - _mcl_blast_resistance = 2.5, + _mcl_blast_resistance = 0.5, _mcl_hardness = 0.5, on_rotate = function(pos, node, user, mode) if mode == screwdriver.ROTATE_AXIS then @@ -562,7 +562,7 @@ minetest.register_node("mesecons_pistons:piston_up_sticky_on", { action_off = piston_off, rules = piston_up_rules, }}, - _mcl_blast_resistance = 2.5, + _mcl_blast_resistance = 0.5, _mcl_hardness = 0.5, on_rotate = false, }) @@ -589,7 +589,7 @@ minetest.register_node("mesecons_pistons:piston_up_pusher_sticky", { selection_box = piston_up_pusher_box, node_box = piston_up_pusher_box, sounds = mcl_sounds.node_sound_wood_defaults(), - _mcl_blast_resistance = 2.5, + _mcl_blast_resistance = 0.5, on_rotate = false, }) @@ -646,7 +646,7 @@ minetest.register_node("mesecons_pistons:piston_down_normal_off", { action_on = piston_on, rules = piston_down_rules, }}, - _mcl_blast_resistance = 2.5, + _mcl_blast_resistance = 0.5, _mcl_hardness = 0.5, on_rotate = function(pos, node, user, mode) if mode == screwdriver.ROTATE_AXIS then @@ -682,7 +682,7 @@ minetest.register_node("mesecons_pistons:piston_down_normal_on", { action_off = piston_off, rules = piston_down_rules, }}, - _mcl_blast_resistance = 2.5, + _mcl_blast_resistance = 0.5, _mcl_hardness = 0.5, on_rotate = false, }) @@ -709,7 +709,7 @@ minetest.register_node("mesecons_pistons:piston_down_pusher_normal", { selection_box = piston_down_pusher_box, node_box = piston_down_pusher_box, sounds = mcl_sounds.node_sound_wood_defaults(), - _mcl_blast_resistance = 2.5, + _mcl_blast_resistance = 0.5, on_rotate = false, }) @@ -744,7 +744,7 @@ minetest.register_node("mesecons_pistons:piston_down_sticky_off", { action_on = piston_on, rules = piston_down_rules, }}, - _mcl_blast_resistance = 2.5, + _mcl_blast_resistance = 0.5, _mcl_hardness = 0.5, on_rotate = function(pos, node, user, mode) if mode == screwdriver.ROTATE_AXIS then @@ -780,7 +780,7 @@ minetest.register_node("mesecons_pistons:piston_down_sticky_on", { action_off = piston_off, rules = piston_down_rules, }}, - _mcl_blast_resistance = 2.5, + _mcl_blast_resistance = 0.5, _mcl_hardness = 0.5, on_rotate = false, }) @@ -807,7 +807,7 @@ minetest.register_node("mesecons_pistons:piston_down_pusher_sticky", { selection_box = piston_down_pusher_box, node_box = piston_down_pusher_box, sounds = mcl_sounds.node_sound_wood_defaults(), - _mcl_blast_resistance = 2.5, + _mcl_blast_resistance = 0.5, on_rotate = false, }) diff --git a/mods/ITEMS/REDSTONE/mesecons_pressureplates/init.lua b/mods/ITEMS/REDSTONE/mesecons_pressureplates/init.lua index 2c8c20bf5..2e161ae4d 100644 --- a/mods/ITEMS/REDSTONE/mesecons_pressureplates/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_pressureplates/init.lua @@ -125,7 +125,7 @@ function mesecon.register_pressure_plate(basename, description, textures_off, te is_ground_content = false, pressureplate_basename = basename, pressureplate_activated_by = activated_by, - _mcl_blast_resistance = 2.5, + _mcl_blast_resistance = 0.5, _mcl_hardness = 0.5, },{ node_box = pp_box_off, diff --git a/mods/ITEMS/REDSTONE/mesecons_solarpanel/init.lua b/mods/ITEMS/REDSTONE/mesecons_solarpanel/init.lua index eb5eafdbc..c9d051574 100644 --- a/mods/ITEMS/REDSTONE/mesecons_solarpanel/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_solarpanel/init.lua @@ -36,7 +36,7 @@ minetest.register_node("mesecons_solarpanel:solar_panel_on", { minetest.swap_node(pos, {name = "mesecons_solarpanel:solar_panel_inverted_off"}) mesecon.receptor_off(pos, mesecon.rules.pplate) end, - _mcl_blast_resistance = 1, + _mcl_blast_resistance = 0.2, _mcl_hardness = 0.2, }) @@ -76,7 +76,7 @@ minetest.register_node("mesecons_solarpanel:solar_panel_off", { minetest.swap_node(pos, {name = "mesecons_solarpanel:solar_panel_inverted_on"}) mesecon.receptor_on(pos, mesecon.rules.pplate) end, - _mcl_blast_resistance = 1, + _mcl_blast_resistance = 0.2, _mcl_hardness = 0.2, }) @@ -154,7 +154,7 @@ minetest.register_node("mesecons_solarpanel:solar_panel_inverted_on", { minetest.swap_node(pos, {name = "mesecons_solarpanel:solar_panel_off"}) mesecon.receptor_off(pos, mesecon.rules.pplate) end, - _mcl_blast_resistance = 1, + _mcl_blast_resistance = 0.2, _mcl_hardness = 0.2, }) @@ -192,7 +192,7 @@ minetest.register_node("mesecons_solarpanel:solar_panel_inverted_off", { minetest.swap_node(pos, {name = "mesecons_solarpanel:solar_panel_on"}) mesecon.receptor_on(pos, mesecon.rules.pplate) end, - _mcl_blast_resistance = 1, + _mcl_blast_resistance = 0.2, _mcl_hardness = 0.2, }) diff --git a/mods/ITEMS/REDSTONE/mesecons_torch/init.lua b/mods/ITEMS/REDSTONE/mesecons_torch/init.lua index fda96121f..20a1ca6d4 100644 --- a/mods/ITEMS/REDSTONE/mesecons_torch/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_torch/init.lua @@ -204,7 +204,7 @@ minetest.register_node("mesecons_torch:redstoneblock", { state = mesecon.state.on, rules = mesecon.rules.alldirs, }}, - _mcl_blast_resistance = 30, + _mcl_blast_resistance = 6, _mcl_hardness = 5, }) diff --git a/mods/ITEMS/REDSTONE/mesecons_walllever/init.lua b/mods/ITEMS/REDSTONE/mesecons_walllever/init.lua index 8894f4ad1..053990ed4 100644 --- a/mods/ITEMS/REDSTONE/mesecons_walllever/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_walllever/init.lua @@ -128,7 +128,7 @@ minetest.register_node("mesecons_walllever:wall_lever_off", { state = mesecon.state.off }}, on_rotate = on_rotate, - _mcl_blast_resistance = 2.5, + _mcl_blast_resistance = 0.5, _mcl_hardness = 0.5, }) minetest.register_node("mesecons_walllever:wall_lever_on", { @@ -160,7 +160,7 @@ minetest.register_node("mesecons_walllever:wall_lever_on", { state = mesecon.state.on }}, on_rotate = on_rotate, - _mcl_blast_resistance = 2.5, + _mcl_blast_resistance = 0.5, _mcl_hardness = 0.5, }) diff --git a/mods/ITEMS/mcl_anvils/init.lua b/mods/ITEMS/mcl_anvils/init.lua index 76cd0f3ee..bfeed83ff 100644 --- a/mods/ITEMS/mcl_anvils/init.lua +++ b/mods/ITEMS/mcl_anvils/init.lua @@ -275,7 +275,7 @@ local anvildef = { } }, sounds = mcl_sounds.node_sound_metal_defaults(), - _mcl_blast_resistance = 6000, + _mcl_blast_resistance = 1200, _mcl_hardness = 5, _mcl_after_falling = damage_anvil_by_falling, diff --git a/mods/ITEMS/mcl_banners/init.lua b/mods/ITEMS/mcl_banners/init.lua index 8c8869d60..31853b11d 100644 --- a/mods/ITEMS/mcl_banners/init.lua +++ b/mods/ITEMS/mcl_banners/init.lua @@ -230,7 +230,7 @@ S("You can copy the pattern of a banner by placing two banners of the same color respawn_banner_entity(pos, node) end, _mcl_hardness = 1, - _mcl_blast_resistance = 5, + _mcl_blast_resistance = 1, on_rotate = function(pos, node, user, mode, param2) if mode == screwdriver.ROTATE_FACE then local meta = minetest.get_meta(pos) @@ -274,7 +274,7 @@ minetest.register_node("mcl_banners:hanging_banner", { respawn_banner_entity(pos, node) end, _mcl_hardness = 1, - _mcl_blast_resistance = 5, + _mcl_blast_resistance = 1, on_rotate = function(pos, node, user, mode, param2) if mode == screwdriver.ROTATE_FACE then local r = screwdriver.rotate.wallmounted(pos, node, mode) diff --git a/mods/ITEMS/mcl_books/init.lua b/mods/ITEMS/mcl_books/init.lua index 50eadec6d..82ec64d71 100644 --- a/mods/ITEMS/mcl_books/init.lua +++ b/mods/ITEMS/mcl_books/init.lua @@ -342,7 +342,7 @@ minetest.register_node("mcl_books:bookshelf", { groups = {handy=1,axey=1, flammable=3,building_block=1, material_wood=1}, drop = "mcl_books:book 3", sounds = wood_sound, - _mcl_blast_resistance = 7.5, + _mcl_blast_resistance = 1.5, _mcl_hardness = 1.5, }) diff --git a/mods/ITEMS/mcl_cake/init.lua b/mods/ITEMS/mcl_cake/init.lua index 33cad6195..9f9dd2049 100644 --- a/mods/ITEMS/mcl_cake/init.lua +++ b/mods/ITEMS/mcl_cake/init.lua @@ -70,7 +70,7 @@ minetest.register_node("mcl_cake:cake", { _food_particles = false, _mcl_saturation = 0.4, - _mcl_blast_resistance = 2.5, + _mcl_blast_resistance = 0.5, _mcl_hardness = 0.5, }) @@ -130,7 +130,7 @@ local register_slice = function(level, nodebox, desc) _food_particles = false, _mcl_saturation = 0.4, - _mcl_blast_resistance = 2.5, + _mcl_blast_resistance = 0.5, _mcl_hardness = 0.5, }) diff --git a/mods/ITEMS/mcl_cauldrons/init.lua b/mods/ITEMS/mcl_cauldrons/init.lua index bc65e9662..7f0592b2a 100644 --- a/mods/ITEMS/mcl_cauldrons/init.lua +++ b/mods/ITEMS/mcl_cauldrons/init.lua @@ -63,7 +63,7 @@ minetest.register_node("mcl_cauldrons:cauldron", { }, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_hardness = 2, - _mcl_blast_resistance = 10, + _mcl_blast_resistance = 2, }) -- Template function for cauldrons with water @@ -94,7 +94,7 @@ local register_filled_cauldron = function(water_level, description, river_water) sounds = mcl_sounds.node_sound_metal_defaults(), drop = "mcl_cauldrons:cauldron", _mcl_hardness = 2, - _mcl_blast_resistance = 10, + _mcl_blast_resistance = 2, }) -- Add entry aliases for the Help diff --git a/mods/ITEMS/mcl_cocoas/init.lua b/mods/ITEMS/mcl_cocoas/init.lua index 7f809fc06..8b70c1ad6 100644 --- a/mods/ITEMS/mcl_cocoas/init.lua +++ b/mods/ITEMS/mcl_cocoas/init.lua @@ -111,7 +111,7 @@ local crop_def = { }, sounds = mcl_sounds.node_sound_wood_defaults(), on_rotate = false, - _mcl_blast_resistance = 15, + _mcl_blast_resistance = 3, _mcl_hardness = 0.2, } diff --git a/mods/ITEMS/mcl_colorblocks/init.lua b/mods/ITEMS/mcl_colorblocks/init.lua index f55003e02..1965c9024 100644 --- a/mods/ITEMS/mcl_colorblocks/init.lua +++ b/mods/ITEMS/mcl_colorblocks/init.lua @@ -37,7 +37,7 @@ minetest.register_node("mcl_colorblocks:hardened_clay", { stack_max = 64, groups = {pickaxey=1, hardened_clay=1,building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 21, + _mcl_blast_resistance = 4.2, _mcl_hardness = 1.25, }) @@ -87,7 +87,7 @@ for _, row in ipairs(block.dyes) do groups = {pickaxey=1, hardened_clay=1,building_block=1, material_stone=1}, stack_max = 64, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 21, + _mcl_blast_resistance = 4.2, _mcl_hardness = 1.25, }) @@ -128,7 +128,7 @@ for _, row in ipairs(block.dyes) do -- Specify the node to which this node will convert after getting in contact with water _mcl_colorblocks_harden_to = "mcl_colorblocks:concrete_"..name, - _mcl_blast_resistance = 2.5, + _mcl_blast_resistance = 0.5, _mcl_hardness = 0.5, }) @@ -142,7 +142,7 @@ for _, row in ipairs(block.dyes) do stack_max = 64, is_ground_content = false, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 9, + _mcl_blast_resistance = 1.8, _mcl_hardness = 1.8, }) @@ -159,7 +159,7 @@ for _, row in ipairs(block.dyes) do stack_max = 64, is_ground_content = false, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 7, + _mcl_blast_resistance = 4.2, _mcl_hardness = 1.4, on_rotate = on_rotate, }) diff --git a/mods/ITEMS/mcl_crafting_table/init.lua b/mods/ITEMS/mcl_crafting_table/init.lua index 3c19e2882..2339f2c60 100644 --- a/mods/ITEMS/mcl_crafting_table/init.lua +++ b/mods/ITEMS/mcl_crafting_table/init.lua @@ -35,7 +35,7 @@ minetest.register_node("mcl_crafting_table:crafting_table", { minetest.show_formspec(player:get_player_name(), "main", form) end, sounds = mcl_sounds.node_sound_wood_defaults(), - _mcl_blast_resistance = 12.5, + _mcl_blast_resistance = 2.5, _mcl_hardness = 2.5, }) diff --git a/mods/ITEMS/mcl_doors/register.lua b/mods/ITEMS/mcl_doors/register.lua index e8f990f9b..aca60e8ff 100644 --- a/mods/ITEMS/mcl_doors/register.lua +++ b/mods/ITEMS/mcl_doors/register.lua @@ -13,7 +13,7 @@ mcl_doors:register_door("mcl_doors:wooden_door", { inventory_image = "doors_item_wood.png", groups = {handy=1,axey=1, material_wood=1}, _mcl_hardness = 3, - _mcl_blast_resistance = 15, + _mcl_blast_resistance = 3, tiles_bottom = {"mcl_doors_door_wood_lower.png", "mcl_doors_door_wood_side_lower.png"}, tiles_top = {"mcl_doors_door_wood_upper.png", "mcl_doors_door_wood_side_upper.png"}, sounds = mcl_sounds.node_sound_wood_defaults(), @@ -36,7 +36,7 @@ mcl_doors:register_door("mcl_doors:acacia_door", { inventory_image = "mcl_doors_door_acacia.png", groups = {handy=1,axey=1, material_wood=1}, _mcl_hardness = 3, - _mcl_blast_resistance = 15, + _mcl_blast_resistance = 3, tiles_bottom = {"mcl_doors_door_acacia_lower.png", "mcl_doors_door_acacia_side_lower.png"}, tiles_top = {"mcl_doors_door_acacia_upper.png", "mcl_doors_door_acacia_side_upper.png"}, sounds = mcl_sounds.node_sound_wood_defaults(), @@ -59,7 +59,7 @@ mcl_doors:register_door("mcl_doors:birch_door", { inventory_image = "mcl_doors_door_birch.png", groups = {handy=1,axey=1, material_wood=1}, _mcl_hardness = 3, - _mcl_blast_resistance = 15, + _mcl_blast_resistance = 3, tiles_bottom = {"mcl_doors_door_birch_lower.png", "mcl_doors_door_birch_side_lower.png"}, tiles_top = {"mcl_doors_door_birch_upper.png", "mcl_doors_door_birch_side_upper.png"}, sounds = mcl_sounds.node_sound_wood_defaults(), @@ -82,7 +82,7 @@ mcl_doors:register_door("mcl_doors:dark_oak_door", { inventory_image = "mcl_doors_door_dark_oak.png", groups = {handy=1,axey=1, material_wood=1}, _mcl_hardness = 3, - _mcl_blast_resistance = 15, + _mcl_blast_resistance = 3, tiles_bottom = {"mcl_doors_door_dark_oak_lower.png", "mcl_doors_door_dark_oak_side_lower.png"}, tiles_top = {"mcl_doors_door_dark_oak_upper.png", "mcl_doors_door_dark_oak_side_upper.png"}, sounds = mcl_sounds.node_sound_wood_defaults(), @@ -105,7 +105,7 @@ mcl_doors:register_door("mcl_doors:jungle_door", { inventory_image = "mcl_doors_door_jungle.png", groups = {handy=1,axey=1, material_wood=1}, _mcl_hardness = 3, - _mcl_blast_resistance = 15, + _mcl_blast_resistance = 3, tiles_bottom = {"mcl_doors_door_jungle_lower.png", "mcl_doors_door_jungle_side_lower.png"}, tiles_top = {"mcl_doors_door_jungle_upper.png", "mcl_doors_door_jungle_side_upper.png"}, sounds = mcl_sounds.node_sound_wood_defaults(), @@ -128,7 +128,7 @@ mcl_doors:register_door("mcl_doors:spruce_door", { inventory_image = "mcl_doors_door_spruce.png", groups = {handy=1,axey=1, material_wood=1}, _mcl_hardness = 3, - _mcl_blast_resistance = 15, + _mcl_blast_resistance = 3, tiles_bottom = {"mcl_doors_door_spruce_lower.png", "mcl_doors_door_spruce_side_lower.png"}, tiles_top = {"mcl_doors_door_spruce_upper.png", "mcl_doors_door_spruce_side_upper.png"}, sounds = mcl_sounds.node_sound_wood_defaults(), @@ -182,7 +182,7 @@ mcl_doors:register_door("mcl_doors:iron_door", { inventory_image = "doors_item_steel.png", groups = {pickaxey=1, mesecon_effector_on=1}, _mcl_hardness = 5, - _mcl_blast_resistance = 25, + _mcl_blast_resistance = 5, tiles_bottom = {"mcl_doors_door_iron_lower.png^[transformFX", "mcl_doors_door_iron_side_lower.png"}, tiles_top = {"mcl_doors_door_iron_upper.png^[transformFX", "mcl_doors_door_iron_side_upper.png"}, sounds = mcl_sounds.node_sound_metal_defaults(), @@ -224,7 +224,7 @@ for w=1, #woods do wield_image = woods[w][3], groups = {handy=1,axey=1, mesecon_effector_on=1, material_wood=1}, _mcl_hardness = 3, - _mcl_blast_resistance = 15, + _mcl_blast_resistance = 3, sounds = mcl_sounds.node_sound_wood_defaults(), }) @@ -251,7 +251,7 @@ mcl_doors:register_trapdoor("mcl_doors:iron_trapdoor", { wield_image = "doors_trapdoor_steel.png", groups = {pickaxey=1, mesecon_effector_on=1}, _mcl_hardness = 5, - _mcl_blast_resistance = 25, + _mcl_blast_resistance = 5, sounds = mcl_sounds.node_sound_metal_defaults(), sound_open = "doors_steel_door_open", sound_close = "doors_steel_door_close", diff --git a/mods/ITEMS/mcl_end/building.lua b/mods/ITEMS/mcl_end/building.lua index 9b0022e9f..3dcf0671e 100644 --- a/mods/ITEMS/mcl_end/building.lua +++ b/mods/ITEMS/mcl_end/building.lua @@ -15,7 +15,7 @@ minetest.register_node("mcl_end:end_stone", { groups = {pickaxey=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), after_dig_node = mcl_end.check_detach_chorus_plant, - _mcl_blast_resistance = 45, + _mcl_blast_resistance = 9, _mcl_hardness = 3, }) @@ -27,7 +27,7 @@ minetest.register_node("mcl_end:end_bricks", { stack_max = 64, groups = {pickaxey=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 4, + _mcl_blast_resistance = 9, _mcl_hardness = 0.8, }) @@ -39,7 +39,7 @@ minetest.register_node("mcl_end:purpur_block", { stack_max = 64, groups = {pickaxey=1, building_block=1, material_stone=1, purpur_block=1}, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 30, + _mcl_blast_resistance = 6, _mcl_hardness = 1.5, }) @@ -54,7 +54,7 @@ minetest.register_node("mcl_end:purpur_pillar", { groups = {pickaxey=1, building_block=1, material_stone=1, purpur_block=1}, sounds = mcl_sounds.node_sound_stone_defaults(), on_rotate = on_rotate, - _mcl_blast_resistance = 30, + _mcl_blast_resistance = 6, _mcl_hardness = 1.5, }) @@ -167,7 +167,7 @@ minetest.register_node("mcl_end:dragon_egg", { }, groups = {handy=1, falling_node = 1, deco_block = 1, not_in_creative_inventory = 1, dig_by_piston = 1 }, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 45, + _mcl_blast_resistance = 9, _mcl_hardness = 3, -- TODO: Make dragon egg teleport on punching }) diff --git a/mods/ITEMS/mcl_end/chorus_plant.lua b/mods/ITEMS/mcl_end/chorus_plant.lua index e29a6fecd..171ff37b6 100644 --- a/mods/ITEMS/mcl_end/chorus_plant.lua +++ b/mods/ITEMS/mcl_end/chorus_plant.lua @@ -200,7 +200,7 @@ minetest.register_node("mcl_end:chorus_flower", { end, after_dig_node = mcl_end.check_detach_chorus_plant, on_blast = mcl_end.check_blast_chorus_plant, - _mcl_blast_resistance = 2, + _mcl_blast_resistance = 0.4, _mcl_hardness = 0.4, }) diff --git a/mods/ITEMS/mcl_farming/melon.lua b/mods/ITEMS/mcl_farming/melon.lua index 0734b35d2..43ff7b0f8 100644 --- a/mods/ITEMS/mcl_farming/melon.lua +++ b/mods/ITEMS/mcl_farming/melon.lua @@ -33,7 +33,7 @@ local melon_base_def = { } }, sounds = mcl_sounds.node_sound_wood_defaults(), - _mcl_blast_resistance = 5, + _mcl_blast_resistance = 1, _mcl_hardness = 1, } diff --git a/mods/ITEMS/mcl_farming/pumpkin.lua b/mods/ITEMS/mcl_farming/pumpkin.lua index f77d6f0d6..72b4e5412 100644 --- a/mods/ITEMS/mcl_farming/pumpkin.lua +++ b/mods/ITEMS/mcl_farming/pumpkin.lua @@ -101,7 +101,7 @@ local pumpkin_base_def = { groups = {handy=1,axey=1, plant=1,building_block=1, dig_by_piston=1, enderman_takable=1}, sounds = mcl_sounds.node_sound_wood_defaults(), on_rotate = on_rotate, - _mcl_blast_resistance = 5, + _mcl_blast_resistance = 1, _mcl_hardness = 1, } minetest.register_node("mcl_farming:pumpkin", pumpkin_base_def) @@ -148,7 +148,7 @@ minetest.register_node("mcl_farming:pumpkin_face_light", { mobs_mc.tools.check_snow_golem_summon(pos) end, on_rotate = on_rotate, - _mcl_blast_resistance = 5, + _mcl_blast_resistance = 1, _mcl_hardness = 1, }) diff --git a/mods/ITEMS/mcl_farming/soil.lua b/mods/ITEMS/mcl_farming/soil.lua index 87dcbe22b..0c0e3b832 100644 --- a/mods/ITEMS/mcl_farming/soil.lua +++ b/mods/ITEMS/mcl_farming/soil.lua @@ -21,7 +21,7 @@ minetest.register_node("mcl_farming:soil", { end, groups = {handy=1,shovely=1, dirtifies_below_solid=1, dirtifier=1, soil=2, soil_sapling=1, deco_block=1 }, sounds = mcl_sounds.node_sound_dirt_defaults(), - _mcl_blast_resistance = 3, + _mcl_blast_resistance = 0.5, _mcl_hardness = 0.6, }) @@ -44,7 +44,7 @@ minetest.register_node("mcl_farming:soil_wet", { end, groups = {handy=1,shovely=1, not_in_creative_inventory=1, dirtifies_below_solid=1, dirtifier=1, soil=3, soil_sapling=1 }, sounds = mcl_sounds.node_sound_dirt_defaults(), - _mcl_blast_resistance = 3, + _mcl_blast_resistance = 0.5, _mcl_hardness = 0.6, }) diff --git a/mods/ITEMS/mcl_farming/wheat.lua b/mods/ITEMS/mcl_farming/wheat.lua index 0bf8724e4..850838b2b 100644 --- a/mods/ITEMS/mcl_farming/wheat.lua +++ b/mods/ITEMS/mcl_farming/wheat.lua @@ -149,7 +149,7 @@ minetest.register_node("mcl_farming:hay_block", { groups = {handy=1, flammable=2, building_block=1, fall_damage_add_percent=-80}, sounds = mcl_sounds.node_sound_leaves_defaults(), on_rotate = on_rotate, - _mcl_blast_resistance = 2.5, + _mcl_blast_resistance = 0.5, _mcl_hardness = 0.5, }) diff --git a/mods/ITEMS/mcl_furnaces/init.lua b/mods/ITEMS/mcl_furnaces/init.lua index 17c404dd4..c76b379e6 100644 --- a/mods/ITEMS/mcl_furnaces/init.lua +++ b/mods/ITEMS/mcl_furnaces/init.lua @@ -359,7 +359,7 @@ minetest.register_node("mcl_furnaces:furnace", { allow_metadata_inventory_take = allow_metadata_inventory_take, on_metadata_inventory_take = on_metadata_inventory_take, on_receive_fields = receive_fields, - _mcl_blast_resistance = 17.5, + _mcl_blast_resistance = 3.5, _mcl_hardness = 3.5, on_rotate = on_rotate, }) @@ -402,7 +402,7 @@ minetest.register_node("mcl_furnaces:furnace_active", { allow_metadata_inventory_take = allow_metadata_inventory_take, on_metadata_inventory_take = on_metadata_inventory_take, on_receive_fields = receive_fields, - _mcl_blast_resistance = 17.5, + _mcl_blast_resistance = 3.5, _mcl_hardness = 3.5, on_rotate = on_rotate, }) diff --git a/mods/ITEMS/mcl_heads/init.lua b/mods/ITEMS/mcl_heads/init.lua index b20d696aa..cb83ed1fa 100644 --- a/mods/ITEMS/mcl_heads/init.lua +++ b/mods/ITEMS/mcl_heads/init.lua @@ -112,7 +112,7 @@ local function addhead(name, texture, desc, longdesc, rangemob, rangefactor) _mcl_armor_mob_range_mob = rangemob, _mcl_armor_mob_range_factor = rangefactor, - _mcl_blast_resistance = 5, + _mcl_blast_resistance = 1, _mcl_hardness = 1, }) @@ -146,7 +146,7 @@ local function addhead(name, texture, desc, longdesc, rangemob, rangefactor) }), drop = "mcl_heads:"..name, on_rotate = on_rotate_wall, - _mcl_blast_resistance = 5, + _mcl_blast_resistance = 1, _mcl_hardness = 1, }) diff --git a/mods/ITEMS/mcl_hoppers/init.lua b/mods/ITEMS/mcl_hoppers/init.lua index e53052e70..52cb60874 100644 --- a/mods/ITEMS/mcl_hoppers/init.lua +++ b/mods/ITEMS/mcl_hoppers/init.lua @@ -114,7 +114,7 @@ local def_hopper = { end, sounds = mcl_sounds.node_sound_metal_defaults(), - _mcl_blast_resistance = 24, + _mcl_blast_resistance = 4.8, _mcl_hardness = 3, } @@ -303,7 +303,7 @@ local def_hopper_side = { on_rotate = on_rotate, sounds = mcl_sounds.node_sound_metal_defaults(), - _mcl_blast_resistance = 24, + _mcl_blast_resistance = 4.8, _mcl_hardness = 3, } diff --git a/mods/ITEMS/mcl_jukebox/init.lua b/mods/ITEMS/mcl_jukebox/init.lua index 0328c7072..3cfc3b760 100644 --- a/mods/ITEMS/mcl_jukebox/init.lua +++ b/mods/ITEMS/mcl_jukebox/init.lua @@ -227,7 +227,7 @@ minetest.register_node("mcl_jukebox:jukebox", { end meta:from_table(meta2:to_table()) end, - _mcl_blast_resistance = 30, + _mcl_blast_resistance = 6, _mcl_hardness = 2, }) diff --git a/mods/ITEMS/mcl_mobspawners/init.lua b/mods/ITEMS/mcl_mobspawners/init.lua index 8b9732c11..39abd7227 100644 --- a/mods/ITEMS/mcl_mobspawners/init.lua +++ b/mods/ITEMS/mcl_mobspawners/init.lua @@ -323,7 +323,7 @@ minetest.register_node("mcl_mobspawners:spawner", { sounds = mcl_sounds.node_sound_metal_defaults(), - _mcl_blast_resistance = 25, + _mcl_blast_resistance = 5, _mcl_hardness = 5, }) diff --git a/mods/ITEMS/mcl_monster_eggs/init.lua b/mods/ITEMS/mcl_monster_eggs/init.lua index 7823b360c..a4c0144d4 100644 --- a/mods/ITEMS/mcl_monster_eggs/init.lua +++ b/mods/ITEMS/mcl_monster_eggs/init.lua @@ -26,7 +26,7 @@ local register_block = function(subname, description, tiles, is_ground_content) _tt_help = S("Hides a silverfish"), _doc_items_longdesc = S("An infested block is a block from which a silverfish will pop out when it is broken. It looks identical to its normal counterpart."), _mcl_hardness = 0, - _mcl_blast_resistance = 3.75, + _mcl_blast_resistance = 0.5, }) end diff --git a/mods/ITEMS/mcl_mushrooms/huge.lua b/mods/ITEMS/mcl_mushrooms/huge.lua index 54e719a5d..6061f8688 100644 --- a/mods/ITEMS/mcl_mushrooms/huge.lua +++ b/mods/ITEMS/mcl_mushrooms/huge.lua @@ -4,7 +4,7 @@ local template = { groups = {handy=1,axey=1, building_block = 1, material_wood = 1 }, sounds = mcl_sounds.node_sound_wood_defaults(), is_ground_content = true, - _mcl_blast_resistance = 1, + _mcl_blast_resistance = 0.2, _mcl_hardness = 0.2, } diff --git a/mods/ITEMS/mcl_nether/init.lua b/mods/ITEMS/mcl_nether/init.lua index 07c575f04..e7612c906 100644 --- a/mods/ITEMS/mcl_nether/init.lua +++ b/mods/ITEMS/mcl_nether/init.lua @@ -25,7 +25,7 @@ minetest.register_node("mcl_nether:glowstone", { paramtype = "light", light_source = minetest.LIGHT_MAX, sounds = mcl_sounds.node_sound_glass_defaults(), - _mcl_blast_resistance = 1.5, + _mcl_blast_resistance = 0.3, _mcl_hardness = 0.3, }) @@ -38,7 +38,7 @@ minetest.register_node("mcl_nether:quartz_ore", { groups = {pickaxey=1, building_block=1, material_stone=1}, drop = 'mcl_nether:quartz', sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 15, + _mcl_blast_resistance = 3, _mcl_hardness = 3, }) @@ -75,7 +75,7 @@ minetest.register_node("mcl_nether:netherrack", { is_ground_content = true, groups = {pickaxey=1, building_block=1, material_stone=1, enderman_takable=1}, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 2, + _mcl_blast_resistance = 0.4, _mcl_hardness = 0.4, -- Eternal fire on top @@ -104,7 +104,7 @@ minetest.register_node("mcl_nether:magma", { player:set_hp(player:get_hp() - 1, { type = "punch", from = "mod" }) end end, - _mcl_blast_resistance = 2.5, + _mcl_blast_resistance = 0.5, _mcl_hardness = 0.5, -- Eternal fire on top @@ -125,7 +125,7 @@ minetest.register_node("mcl_nether:soul_sand", { fixed = { -0.5, -0.5, -0.5, 0.5, 0.5 - 2/16, 0.5 }, }, sounds = mcl_sounds.node_sound_sand_defaults(), - _mcl_blast_resistance = 2.5, + _mcl_blast_resistance = 0.5, _mcl_hardness = 0.5, -- Movement handling is done in mcl_playerplus mod }) @@ -139,7 +139,7 @@ minetest.register_node("mcl_nether:nether_brick", { is_ground_content = false, groups = {pickaxey=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 30, + _mcl_blast_resistance = 6, _mcl_hardness = 2, }) @@ -152,7 +152,7 @@ minetest.register_node("mcl_nether:red_nether_brick", { is_ground_content = false, groups = {pickaxey=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 30, + _mcl_blast_resistance = 6, _mcl_hardness = 2, }) @@ -170,7 +170,7 @@ minetest.register_node("mcl_nether:nether_wart_block", { dug={name="default_dirt_footstep", gain=1.5}, } ), - _mcl_blast_resistance = 5, + _mcl_blast_resistance = 1, _mcl_hardness = 1, }) @@ -182,7 +182,7 @@ minetest.register_node("mcl_nether:quartz_block", { tiles = {"mcl_nether_quartz_block_top.png", "mcl_nether_quartz_block_bottom.png", "mcl_nether_quartz_block_side.png"}, groups = {pickaxey=1, quartz_block=1,building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 4, + _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, }) @@ -194,7 +194,7 @@ minetest.register_node("mcl_nether:quartz_chiseled", { tiles = {"mcl_nether_quartz_chiseled_top.png", "mcl_nether_quartz_chiseled_top.png", "mcl_nether_quartz_chiseled_side.png"}, groups = {pickaxey=1, quartz_block=1,building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 4, + _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, }) @@ -209,7 +209,7 @@ minetest.register_node("mcl_nether:quartz_pillar", { groups = {pickaxey=1, quartz_block=1,building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), on_rotate = on_rotate, - _mcl_blast_resistance = 4, + _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, }) minetest.register_node("mcl_nether:quartz_smooth", { @@ -220,7 +220,7 @@ minetest.register_node("mcl_nether:quartz_smooth", { tiles = {"mcl_nether_quartz_block_bottom.png"}, groups = {pickaxey=1, quartz_block=1,building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 4, + _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, }) diff --git a/mods/ITEMS/mcl_ocean/corals.lua b/mods/ITEMS/mcl_ocean/corals.lua index 2a9015ec7..7b076c3e4 100644 --- a/mods/ITEMS/mcl_ocean/corals.lua +++ b/mods/ITEMS/mcl_ocean/corals.lua @@ -90,7 +90,7 @@ for c=1, #corals do sounds = mcl_sounds.node_sound_dirt_defaults(), drop = "mcl_ocean:dead_"..id.."_coral_block", _mcl_hardness = 1.5, - _mcl_blast_resistance = 30, + _mcl_blast_resistance = 6, }) minetest.register_node("mcl_ocean:dead_"..id.."_coral_block", { description = corals[c][3], @@ -99,7 +99,7 @@ for c=1, #corals do groups = { pickaxey = 1, building_block = 1, coral=2, coral_block=2, coral_species=c, }, sounds = mcl_sounds.node_sound_dirt_defaults(), _mcl_hardness = 1.5, - _mcl_blast_resistance = 30, + _mcl_blast_resistance = 6, }) -- Coral diff --git a/mods/ITEMS/mcl_ocean/prismarine.lua b/mods/ITEMS/mcl_ocean/prismarine.lua index 90626cfa9..5840d59ce 100644 --- a/mods/ITEMS/mcl_ocean/prismarine.lua +++ b/mods/ITEMS/mcl_ocean/prismarine.lua @@ -19,7 +19,7 @@ minetest.register_node("mcl_ocean:sea_lantern", { tiles = {{name="mcl_ocean_sea_lantern.png", animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=1.25}}}, groups = {handy=1, building_block=1, material_glass=1}, sounds = mcl_sounds.node_sound_glass_defaults(), - _mcl_blast_resistance = 1.5, + _mcl_blast_resistance = 0.3, _mcl_hardness = 0.3, }) @@ -32,7 +32,7 @@ minetest.register_node("mcl_ocean:prismarine", { tiles = {{name="mcl_ocean_prismarine_anim.png", animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=45.0}}}, groups = {pickaxey=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 30, + _mcl_blast_resistance = 1.5, _mcl_hardness = 1.5, }) @@ -44,7 +44,7 @@ minetest.register_node("mcl_ocean:prismarine_brick", { tiles = {"mcl_ocean_prismarine_bricks.png"}, groups = {pickaxey=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 30, + _mcl_blast_resistance = 1.5, _mcl_hardness = 1.5, }) @@ -56,7 +56,7 @@ minetest.register_node("mcl_ocean:prismarine_dark", { tiles = {"mcl_ocean_prismarine_dark.png"}, groups = {pickaxey=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 30, + _mcl_blast_resistance = 1.5, _mcl_hardness = 1.5, }) diff --git a/mods/ITEMS/mcl_portals/portal_end.lua b/mods/ITEMS/mcl_portals/portal_end.lua index c7e8cf8d6..8506dd271 100644 --- a/mods/ITEMS/mcl_portals/portal_end.lua +++ b/mods/ITEMS/mcl_portals/portal_end.lua @@ -79,7 +79,7 @@ minetest.register_node("mcl_portals:portal_end", { groups = {portal=1, not_in_creative_inventory = 1, disable_jump = 1}, _mcl_hardness = -1, - _mcl_blast_resistance = 18000000, + _mcl_blast_resistance = 36000000, }) -- Obsidian platform at the End portal destination in the End @@ -329,7 +329,7 @@ minetest.register_node("mcl_portals:end_portal_frame", { on_rotate = rotate_frame, - _mcl_blast_resistance = 18000000, + _mcl_blast_resistance = 36000000, _mcl_hardness = -1, }) @@ -368,7 +368,7 @@ minetest.register_node("mcl_portals:end_portal_frame_eye", { on_rotate = rotate_frame_eye, - _mcl_blast_resistance = 18000000, + _mcl_blast_resistance = 36000000, _mcl_hardness = -1, }) diff --git a/mods/ITEMS/mcl_signs/init.lua b/mods/ITEMS/mcl_signs/init.lua index 442458a91..afb8423ed 100644 --- a/mods/ITEMS/mcl_signs/init.lua +++ b/mods/ITEMS/mcl_signs/init.lua @@ -412,7 +412,7 @@ minetest.register_node("mcl_signs:wall_sign", { end end, _mcl_hardness = 1, - _mcl_blast_resistance = 5, + _mcl_blast_resistance = 1, }) -- Standing sign nodes. @@ -452,7 +452,7 @@ local ssign = { end, _mcl_hardness = 1, - _mcl_blast_resistance = 5, + _mcl_blast_resistance = 1, } minetest.register_node("mcl_signs:standing_sign", ssign) diff --git a/mods/ITEMS/mcl_sponges/init.lua b/mods/ITEMS/mcl_sponges/init.lua index 28edb4f76..db68b2815 100644 --- a/mods/ITEMS/mcl_sponges/init.lua +++ b/mods/ITEMS/mcl_sponges/init.lua @@ -90,7 +90,7 @@ minetest.register_node("mcl_sponges:sponge", { end return minetest.item_place_node(itemstack, placer, pointed_thing) end, - _mcl_blast_resistance = 3, + _mcl_blast_resistance = 0.6, _mcl_hardness = 0.6, }) @@ -108,7 +108,7 @@ minetest.register_node("mcl_sponges:sponge_wet", { stack_max = 64, sounds = mcl_sounds.node_sound_dirt_defaults(), groups = {handy=1, building_block=1}, - _mcl_blast_resistance = 3, + _mcl_blast_resistance = 0.6, _mcl_hardness = 0.6, }) @@ -127,7 +127,7 @@ if minetest.get_modpath("mclx_core") then stack_max = 64, sounds = mcl_sounds.node_sound_dirt_defaults(), groups = {handy=1, building_block=1}, - _mcl_blast_resistance = 3, + _mcl_blast_resistance = 0.6, _mcl_hardness = 0.6, }) diff --git a/mods/ITEMS/mcl_walls/init.lua b/mods/ITEMS/mcl_walls/init.lua index be07d5490..5704309db 100644 --- a/mods/ITEMS/mcl_walls/init.lua +++ b/mods/ITEMS/mcl_walls/init.lua @@ -166,7 +166,7 @@ function mcl_walls.register_wall(nodename, description, source, tiles, inventory fixed = take }, sounds = sounds, - _mcl_blast_resistance = 30, + _mcl_blast_resistance = 6, _mcl_hardness = 2, }) @@ -193,7 +193,7 @@ function mcl_walls.register_wall(nodename, description, source, tiles, inventory fixed = {pillar, full_blocks[1]} }, sounds = sounds, - _mcl_blast_resistance = 30, + _mcl_blast_resistance = 6, _mcl_hardness = 2, }) -- Add entry alias for the Help @@ -218,7 +218,7 @@ function mcl_walls.register_wall(nodename, description, source, tiles, inventory fixed = {pillar, full_blocks[2]} }, sounds = sounds, - _mcl_blast_resistance = 30, + _mcl_blast_resistance = 6, _mcl_hardness = 2, }) -- Add entry alias for the Help @@ -249,7 +249,7 @@ function mcl_walls.register_wall(nodename, description, source, tiles, inventory collisionbox = {-0.2, 0, -0.2, 0.2, 1.4, 0.2}, on_construct = update_wall, sounds = sounds, - _mcl_blast_resistance = 30, + _mcl_blast_resistance = 6, _mcl_hardness = 2, }) if source then diff --git a/mods/ITEMS/mcl_wool/init.lua b/mods/ITEMS/mcl_wool/init.lua index 9e3785b3e..31649d70b 100644 --- a/mods/ITEMS/mcl_wool/init.lua +++ b/mods/ITEMS/mcl_wool/init.lua @@ -63,7 +63,7 @@ for _, row in ipairs(wool.dyes) do groups = {handy=1,shearsy_wool=1, flammable=1,wool=1,building_block=1,[color_group]=1}, sounds = mcl_sounds.node_sound_wool_defaults(), _mcl_hardness = 0.8, - _mcl_blast_resistance = 4, + _mcl_blast_resistance = 0.8, }) minetest.register_node("mcl_wool:"..name.."_carpet", { description = desc_carpet, @@ -89,7 +89,7 @@ for _, row in ipairs(wool.dyes) do }, }, _mcl_hardness = 0.1, - _mcl_blast_resistance = 0.5, + _mcl_blast_resistance = 0.1, }) if mod_doc and not is_canonical then doc.add_entry_alias("nodes", "mcl_wool:"..canonical_color, "nodes", "mcl_wool:"..name) diff --git a/mods/ITEMS/xpanes/init.lua b/mods/ITEMS/xpanes/init.lua index 6f8ff22b4..b98d65e38 100644 --- a/mods/ITEMS/xpanes/init.lua +++ b/mods/ITEMS/xpanes/init.lua @@ -202,7 +202,7 @@ local pane = function(description, node, append) {node, node, node}, }, drop = "", - _mcl_blast_resistance = 1.5, + _mcl_blast_resistance = 0.3, _mcl_hardness = 0.3, }) @@ -225,7 +225,7 @@ xpanes.register_pane("bar", { {"mcl_core:iron_ingot", "mcl_core:iron_ingot", "mcl_core:iron_ingot"}, {"mcl_core:iron_ingot", "mcl_core:iron_ingot", "mcl_core:iron_ingot"}, }, - _mcl_blast_resistance = 30, + _mcl_blast_resistance = 6, _mcl_hardness = 5, }) From 92ab90fd1b028d76735443201b374ee6b961bc2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20=C3=85str=C3=B6m?= Date: Sat, 18 Apr 2020 12:19:18 +0200 Subject: [PATCH 08/13] Add knockback for mobs --- mods/CORE/mcl_explosions/init.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mods/CORE/mcl_explosions/init.lua b/mods/CORE/mcl_explosions/init.lua index 225c2e770..e0a71bf6d 100644 --- a/mods/CORE/mcl_explosions/init.lua +++ b/mods/CORE/mcl_explosions/init.lua @@ -322,17 +322,18 @@ local function trace_explode(pos, strength, raydirs, radius, drop_chance) -- Punch entity with damage depending on explosion exposure and -- distance to explosion local exposure = count / N_EXPOSURE_RAYS - local punch_vec = vector.subtract(pos, opos) + local punch_vec = vector.subtract(opos, pos) local punch_dir = vector.normalize(punch_vec) local impact = (1 - vector.length(punch_vec) / punch_radius) * exposure if impact < 0 then impact = 0 end local damage = math.floor((impact * impact + impact) * 7 * strength + 1) - obj:punch(obj, nil, { damage_groups = { fleshy = damage } }, punch_dir) + obj:punch(obj, 10, { damage_groups = { full_punch_interval = 1, + fleshy = damage, knockback = impact * 20.0 } }, punch_dir) if obj:is_player() then - obj:add_player_velocity(vector.multiply(punch_dir, -exposure * 20)) + obj:add_player_velocity(vector.multiply(punch_dir, impact * 20)) end end end From cdea2eeabf570a22ca2a79710a019093e63b6f47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20=C3=85str=C3=B6m?= Date: Sat, 18 Apr 2020 12:22:28 +0200 Subject: [PATCH 09/13] Change mcl_mobs to enable knockback in y direction --- mods/ENTITIES/mcl_mobs/api.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index 86ec7ee31..69657cea0 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -2730,7 +2730,7 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir) self.object:set_velocity({ x = dir.x * kb, - y = up, + y = dir.y * kb + up, z = dir.z * kb }) From b4ea2afe77ecae00140e602fc459ce94120a3d50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20=C3=85str=C3=B6m?= Date: Sat, 18 Apr 2020 14:16:32 +0200 Subject: [PATCH 10/13] Add tnt_knockback flag for entities When set to true, entities will be knocked back when affected by TNT explosions. Also ignore '__builtin:item' entities to reduce lag, and replace tabs with spaces in 'mcl_explosions/init.lua'. --- mods/CORE/mcl_explosions/init.lua | 181 +++++++++++++++--------------- 1 file changed, 92 insertions(+), 89 deletions(-) diff --git a/mods/CORE/mcl_explosions/init.lua b/mods/CORE/mcl_explosions/init.lua index e0a71bf6d..b8358acd5 100644 --- a/mods/CORE/mcl_explosions/init.lua +++ b/mods/CORE/mcl_explosions/init.lua @@ -144,21 +144,21 @@ end -- pos - The position of the explosion -- radius - The radius of the explosion local function add_particles(pos, radius) - minetest.add_particlespawner({ - amount = 64, - time = 0.125, - minpos = pos, - maxpos = pos, - minvel = {x = -radius, y = -radius, z = -radius}, - maxvel = {x = radius, y = radius, z = radius}, - minacc = vector.new(), - maxacc = vector.new(), - minexptime = 0.5, - maxexptime = 1.0, - minsize = radius * 0.5, - maxsize = radius * 1.0, - texture = "tnt_smoke.png", - }) + minetest.add_particlespawner({ + amount = 64, + time = 0.125, + minpos = pos, + maxpos = pos, + minvel = {x = -radius, y = -radius, z = -radius}, + maxvel = {x = radius, y = radius, z = radius}, + minacc = vector.new(), + maxacc = vector.new(), + minexptime = 0.5, + maxexptime = 1.0, + minsize = radius * 0.5, + maxsize = radius * 1.0, + texture = "tnt_smoke.png", + }) end -- Get position from hash. This should be identical to @@ -242,7 +242,7 @@ local function trace_explode(pos, strength, raydirs, radius, drop_chance) end if cid ~= AIR_CID then - destroy[hash] = idx + destroy[hash] = idx end end end @@ -253,88 +253,91 @@ local function trace_explode(pos, strength, raydirs, radius, drop_chance) -- Trace rays for entity damage for _, obj in pairs(objs) do - -- Object position and direction to explosion center - local opos = obj:get_pos() + local ent = obj:get_luaentity() - if obj:get_luaentity() ~= nil or obj:is_player() then + -- Ignore items to lower lag + if obj:is_player() or (ent and ent.name ~= '__builtin.item') then + local opos = obj:get_pos() local collisionbox = nil if obj:is_player() then - collisionbox = { -0.3, 0.0, -0.3, 0.3, 1.77, 0.3 } - elseif obj:get_luaentity().name then - local def = minetest.registered_entities[obj:get_luaentity().name] - collisionbox = def.collisionbox + collisionbox = { -0.3, 0.0, -0.3, 0.3, 1.77, 0.3 } + elseif ent.name then + local def = minetest.registered_entities[ent.name] + collisionbox = def.collisionbox end if collisionbox then - -- Create rays from random points in the collision box - local x1 = collisionbox[1] * 2 - local y1 = collisionbox[2] * 2 - local z1 = collisionbox[3] * 2 - local x2 = collisionbox[4] * 2 - local y2 = collisionbox[5] * 2 - local z2 = collisionbox[6] * 2 - local x_len = math.abs(x2 - x1) - local y_len = math.abs(y2 - y1) - local z_len = math.abs(z2 - z1) + -- Create rays from random points in the collision box + local x1 = collisionbox[1] * 2 + local y1 = collisionbox[2] * 2 + local z1 = collisionbox[3] * 2 + local x2 = collisionbox[4] * 2 + local y2 = collisionbox[5] * 2 + local z2 = collisionbox[6] * 2 + local x_len = math.abs(x2 - x1) + local y_len = math.abs(y2 - y1) + local z_len = math.abs(z2 - z1) - -- Move object position to the center of its bounding box - opos.x = opos.x + x1 + x2 - opos.y = opos.y + y1 + y2 - opos.z = opos.z + z1 + z2 + -- Move object position to the center of its bounding box + opos.x = opos.x + x1 + x2 + opos.y = opos.y + y1 + y2 + opos.z = opos.z + z1 + z2 - -- Count number of rays from collision box which are unobstructed - local count = N_EXPOSURE_RAYS + -- Count number of rays from collision box which are unobstructed + local count = N_EXPOSURE_RAYS - for i = 1, N_EXPOSURE_RAYS do - local rpos_x = opos.x + math.random() * x_len - x_len / 2 - local rpos_y = opos.y + math.random() * y_len - y_len / 2 - local rpos_z = opos.z + math.random() * z_len - z_len / 2 - local rdir_x = pos.x - rpos_x - local rdir_y = pos.y - rpos_y - local rdir_z = pos.z - rpos_z - local rdir_len = math.hypot(rdir_x, math.hypot(rdir_y, rdir_z)) - rdir_x = rdir_x / rdir_len - rdir_y = rdir_y / rdir_len - rdir_z = rdir_z / rdir_len + for i = 1, N_EXPOSURE_RAYS do + local rpos_x = opos.x + math.random() * x_len - x_len / 2 + local rpos_y = opos.y + math.random() * y_len - y_len / 2 + local rpos_z = opos.z + math.random() * z_len - z_len / 2 + local rdir_x = pos.x - rpos_x + local rdir_y = pos.y - rpos_y + local rdir_z = pos.z - rpos_z + local rdir_len = math.hypot(rdir_x, math.hypot(rdir_y, rdir_z)) + rdir_x = rdir_x / rdir_len + rdir_y = rdir_y / rdir_len + rdir_z = rdir_z / rdir_len - for i=0, rdir_len / STEP_LENGTH do - rpos_x = rpos_x + rdir_x * STEP_LENGTH - rpos_y = rpos_y + rdir_y * STEP_LENGTH - rpos_z = rpos_z + rdir_z * STEP_LENGTH - local npos_x = math.floor(rpos_x + 0.5) - local npos_y = math.floor(rpos_y + 0.5) - local npos_z = math.floor(rpos_z + 0.5) - local idx = (npos_z - emin_z) * zstride + (npos_y - emin_y) * ystride + - npos_x - emin_x + 1 + for i=0, rdir_len / STEP_LENGTH do + rpos_x = rpos_x + rdir_x * STEP_LENGTH + rpos_y = rpos_y + rdir_y * STEP_LENGTH + rpos_z = rpos_z + rdir_z * STEP_LENGTH + local npos_x = math.floor(rpos_x + 0.5) + local npos_y = math.floor(rpos_y + 0.5) + local npos_z = math.floor(rpos_z + 0.5) + local idx = (npos_z - emin_z) * zstride + (npos_y - emin_y) * ystride + + npos_x - emin_x + 1 - local cid = data[idx] - local br = node_br[cid] + local cid = data[idx] + local br = node_br[cid] - if br ~= 0 then - count = count - 1 - break - end - end - end + if br ~= 0 then + count = count - 1 + break + end + end + end - -- Punch entity with damage depending on explosion exposure and - -- distance to explosion - local exposure = count / N_EXPOSURE_RAYS - local punch_vec = vector.subtract(opos, pos) - local punch_dir = vector.normalize(punch_vec) - local impact = (1 - vector.length(punch_vec) / punch_radius) * exposure - if impact < 0 then - impact = 0 - end - local damage = math.floor((impact * impact + impact) * 7 * strength + 1) + -- Punch entity with damage depending on explosion exposure and + -- distance to explosion + local exposure = count / N_EXPOSURE_RAYS + local punch_vec = vector.subtract(opos, pos) + local punch_dir = vector.normalize(punch_vec) + local impact = (1 - vector.length(punch_vec) / punch_radius) * exposure + if impact < 0 then + impact = 0 + end + local damage = math.floor((impact * impact + impact) * 7 * strength + 1) obj:punch(obj, 10, { damage_groups = { full_punch_interval = 1, - fleshy = damage, knockback = impact * 20.0 } }, punch_dir) + fleshy = damage, knockback = impact * 20.0 } }, punch_dir) - if obj:is_player() then - obj:add_player_velocity(vector.multiply(punch_dir, impact * 20)) - end + if obj:is_player() then + obj:add_player_velocity(vector.multiply(punch_dir, impact * 20)) + elseif ent.tnt_knockback then + obj:add_velocity(vector.multiply(punch_dir, impact * 20)) + end end end end @@ -348,16 +351,16 @@ local function trace_explode(pos, strength, raydirs, radius, drop_chance) if do_drop or on_blast ~= nil then local npos = get_position_from_hash(hash) if on_blast ~= nil then - remove = on_blast(npos, 1.0) + remove = on_blast(npos, 1.0) else - local name = minetest.get_name_from_content_id(data[idx]) - local drop = minetest.get_node_drops(name, "") + local name = minetest.get_name_from_content_id(data[idx]) + local drop = minetest.get_node_drops(name, "") - for _, item in ipairs(drop) do - if type(item) == "string" then - minetest.add_item(npos, item) - end - end + for _, item in ipairs(drop) do + if type(item) == "string" then + minetest.add_item(npos, item) + end + end end end if remove then From 64c767ad8c8e9137b2793e5f3b93f1632184dfaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20=C3=85str=C3=B6m?= Date: Sat, 18 Apr 2020 14:18:23 +0200 Subject: [PATCH 11/13] Make TNT behave like Minecraft TNT entities are now knocked back by explosions. When a TNT block becomes triggered by an explosion, its fuse time is set to a random value between 0.5 and 1.5 seconds. --- mods/ITEMS/mcl_tnt/init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_tnt/init.lua b/mods/ITEMS/mcl_tnt/init.lua index 5f53afaf8..0ec2679b8 100644 --- a/mods/ITEMS/mcl_tnt/init.lua +++ b/mods/ITEMS/mcl_tnt/init.lua @@ -104,7 +104,8 @@ minetest.register_node("mcl_tnt:tnt", { groups = { dig_immediate = 3, tnt = 1, enderman_takable=1 }, mesecons = tnt_mesecons, on_blast = function(pos) - spawn_tnt(pos, "mcl_tnt:tnt") + local e = spawn_tnt(pos, "mcl_tnt:tnt") + e:get_luaentity().timer = tnt.BOOMTIMER - (0.5 + math.random()) return true end, _on_ignite = function(player, pointed_thing) @@ -133,6 +134,7 @@ local TNT = { -- Initial value for our timer timer = 0, blinktimer = 0, + tnt_knockback = true, blinkstatus = true,} function TNT:on_activate(staticdata) From a62a75c79986ba37089e17f1c287c61adf8c42ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20=C3=85str=C3=B6m?= Date: Sat, 18 Apr 2020 22:16:29 +0200 Subject: [PATCH 12/13] Do not drop items in creative mode It works like this in Minecraft. This will also reduce lag when playing with TNT in creative. --- mods/CORE/mcl_explosions/init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mods/CORE/mcl_explosions/init.lua b/mods/CORE/mcl_explosions/init.lua index b8358acd5..22dae608f 100644 --- a/mods/CORE/mcl_explosions/init.lua +++ b/mods/CORE/mcl_explosions/init.lua @@ -19,6 +19,8 @@ mcl_explosions = {} +local creative_mode = minetest.settings:get_bool("creative_mode") + -- Saved sphere explosion shapes for various radiuses local sphere_shapes = {} @@ -344,7 +346,7 @@ local function trace_explode(pos, strength, raydirs, radius, drop_chance) -- Remove destroyed blocks and drop items for hash, idx in pairs(destroy) do - local do_drop = math.random() <= drop_chance + local do_drop = not creative_mode and math.random() <= drop_chance local on_blast = node_on_blast[data[idx]] local remove = true From a10dff84214c89b6768f5d3ce0cdaed3bb9bb5f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20=C3=85str=C3=B6m?= Date: Sat, 18 Apr 2020 23:06:08 +0200 Subject: [PATCH 13/13] Use walkable for entity exposure This makes TNT do full damage under water. --- mods/CORE/mcl_explosions/init.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/mods/CORE/mcl_explosions/init.lua b/mods/CORE/mcl_explosions/init.lua index 22dae608f..1c016c080 100644 --- a/mods/CORE/mcl_explosions/init.lua +++ b/mods/CORE/mcl_explosions/init.lua @@ -25,8 +25,9 @@ local creative_mode = minetest.settings:get_bool("creative_mode") local sphere_shapes = {} -- Saved node definitions in table using cid-keys for faster look-up. -local node_br = {} +local node_blastres = {} local node_on_blast = {} +local node_walkable = {} local AIR_CID = minetest.get_content_id('air') @@ -39,8 +40,9 @@ local N_EXPOSURE_RAYS = 16 minetest.after(0, function() -- Store blast resistance values by content ids to improve performance. for name, def in pairs(minetest.registered_nodes) do - node_br[minetest.get_content_id(name)] = def._mcl_blast_resistance or 0 + node_blastres[minetest.get_content_id(name)] = def._mcl_blast_resistance or 0 node_on_blast[minetest.get_content_id(name)] = def.on_blast + node_walkable[minetest.get_content_id(name)] = def.walkable end end) @@ -228,7 +230,7 @@ local function trace_explode(pos, strength, raydirs, radius, drop_chance) npos_x - emin_x + 1 local cid = data[idx] - local br = node_br[cid] + local br = node_blastres[cid] local hash = (npos_z + 32768) * 65536 * 65536 + (npos_y + 32768) * 65536 + npos_x + 32768 @@ -313,9 +315,9 @@ local function trace_explode(pos, strength, raydirs, radius, drop_chance) local cid = data[idx] - local br = node_br[cid] + local walkable = node_walkable[cid] - if br ~= 0 then + if walkable then count = count - 1 break end