From f36811ec571dc1f52d101b60ac3c93a5211c2a1b Mon Sep 17 00:00:00 2001 From: mrkubax10 Date: Thu, 23 Feb 2023 12:09:46 +0100 Subject: [PATCH] Add tin to MCL compatibility --- compatibility.lua | 45 +++++++++++++++++++++++++++++++++++++++++++++ init.lua | 5 +++++ 2 files changed, 50 insertions(+) create mode 100644 compatibility.lua create mode 100644 init.lua diff --git a/compatibility.lua b/compatibility.lua new file mode 100644 index 0000000..31ef017 --- /dev/null +++ b/compatibility.lua @@ -0,0 +1,45 @@ +local S=minetest.get_translator("industrialtest") + +local mtgAvailable=minetest.get_modpath("default") +local mclAvaliable=minetest.get_modpath("mcl_core") + +-- compatibilty that adds not existing elements +if mclAvailable then + -- register required items that are not available in MCL + minetest.register_craftitem("industrialtest:raw_tin",{ + description=S("Raw Tin"), + inventory_image="industrialtest_mcl_raw_tin.png" + }) + minetest.register_craftitem("industrialtest:tin_ingot",{ + description=S("Tin Ingot"), + inventory_image="industrialtest_mcl_tin_ingot.png" + }) + + -- register crafts that are not available in MCL + minetest.register_craft({ + type="cooking", + output="industrialtest:tin_ingot", + recipe="industrialtest:raw_tin" + }) + + -- register required blocks that are not available in MCL + minetest.register_node("industrialtest:tin_ore",{ + description=S("Tin Ore"), + tiles={"default_stone.png^industrialtest_mcl_tin_ore.png"}, + sounds=mcl_sounds.node_sound_stone_defaults(), + drop="industrialtest:raw_tin" + }) + + -- register required ores that are not available in MCL + local stonelike={"mcl_core:stone","mcl_core:diorite","mcl_core:andesite","mcl_core:granite"} + minetest.register_ore({ + ore_type="scatter", + ore="industrialtest:tin_ore", + wherein="mcl_core:stone", + clust_scarity=10*10*10, + clust_num_ores=5, + clust_size=3, + y_max=mcl_worlds.layer_to_y(39), + y_min=mcl_vars.mg_overworld_min + }) +end \ No newline at end of file diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..ff9ef7b --- /dev/null +++ b/init.lua @@ -0,0 +1,5 @@ +MODNAME="industrialtest" +local modpath=minetest.get_modpath(MODNAME) + +-- load other lua files +dofile(modpath.."/compatibility.lua") \ No newline at end of file