From 9b4d4be94d0956ab07fbaadeb33f70dd4d31039e Mon Sep 17 00:00:00 2001 From: mrkubax10 Date: Fri, 29 Mar 2024 11:56:00 +0100 Subject: [PATCH] Add reinforced nodes: stone and glass Useful when building reactor explosion protection --- nodes.lua | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/nodes.lua b/nodes.lua index 78f683a..5543321 100644 --- a/nodes.lua +++ b/nodes.lua @@ -411,3 +411,85 @@ if not industrialtest.mods.mclRubber then }) end end + +definition={ + description=S("Reinforced Stone"), + tiles={"industrialtest_reinforced_stone.png"} +} +if industrialtest.mtgAvailable then + definition.groups={cracky=3} + definition.sounds=default.node_sound_stone_defaults() + definition.on_blast=function(pos,intensity) + if intensity>20 then + minetest.remove_node(pos) + minetest.add_item(pos,ItemStack("industrialtest:reinforced_stone")) + end + end +elseif industrialtest.mclAvailable then + definition.groups={ + pickaxey=1, + stone=1, + building_block=1, + material_stone=1 + } + definition.sounds=mcl_sounds.node_sound_stone_defaults() + definition._mcl_blast_resistance=1200 + definition._mcl_hardness=5 +end +minetest.register_node("industrialtest:reinforced_stone",definition) +minetest.register_craft({ + type="shaped", + output="industrialtest:reinforced_stone 8", + recipe={ + {industrialtest.elementKeys.stone,industrialtest.elementKeys.stone,industrialtest.elementKeys.stone}, + {industrialtest.elementKeys.stone,"industrialtest:advanced_alloy",industrialtest.elementKeys.stone}, + {industrialtest.elementKeys.stone,industrialtest.elementKeys.stone,industrialtest.elementKeys.stone} + } +}) + +definition={ + description=S("Reinforced Glass"), + drawtype="glasslike_framed_optional", + tiles={"industrialtest_reinforced_glass.png"}, + use_texture_alpha="clip", + paramtype="light", + sunlight_propagates=true +} +if industrialtest.mtgAvailable then + definition.groups={cracky=3} + definition.sounds=default.node_sound_glass_defaults() + definition.on_blast=function(pos,intensity) + if intensity>10 then + minetest.remove_node(pos) + minetest.add_item(pos,ItemStack("industrialtest:reinforced_glass")) + end + end +elseif industrialtest.mclAvailable then + definition.groups={ + glass=1, + building_block=1, + material_glass=1 + } + definition.sounds=mcl_sounds.node_sound_glass_defaults() + definition._mcl_blast_resistance=15 + definition._mcl_hardness=1.5 +end +minetest.register_node("industrialtest:reinforced_glass",definition) +minetest.register_craft({ + type="shaped", + output="industrialtest:reinforced_glass 7", + recipe={ + {industrialtest.elementKeys.glass,industrialtest.elementKeys.glass,industrialtest.elementKeys.glass}, + {"industrialtest:advanced_alloy",industrialtest.elementKeys.glass,"industrialtest:advanced_alloy"}, + {industrialtest.elementKeys.glass,industrialtest.elementKeys.glass,industrialtest.elementKeys.glass} + } +}) +minetest.register_craft({ + type="shaped", + output="industrialtest:reinforced_glass 7", + recipe={ + {industrialtest.elementKeys.glass,"industrialtest:advanced_alloy",industrialtest.elementKeys.glass}, + {industrialtest.elementKeys.glass,industrialtest.elementKeys.glass,industrialtest.elementKeys.glass}, + {industrialtest.elementKeys.glass,"industrialtest:advanced_alloy",industrialtest.elementKeys.glass} + } +})