From 09d3792df0d40e6979750d5ff71b11c6e2240c30 Mon Sep 17 00:00:00 2001 From: david Date: Fri, 8 Oct 2021 20:10:27 -0400 Subject: [PATCH] V1.2: MCL5 Improvements Fixed the detection of MCL5 or MCL2. Improved xray to include Deepslate and Darkstone and included into orehud Deepslate ores. (All of this is MCL5) --- orehud/init.lua | 10 +++++++++- orehud/mod.conf | 3 ++- xray/api.lua | 6 ++++++ xray/init.lua | 7 +++++-- xray/mod.conf | 2 +- xray/register.lua | 38 ++++++++++++++++++++++++++++---------- 6 files changed, 51 insertions(+), 15 deletions(-) diff --git a/orehud/init.lua b/orehud/init.lua index 9bdfb8d..12385b4 100644 --- a/orehud/init.lua +++ b/orehud/init.lua @@ -24,7 +24,7 @@ if not minetest.registered_nodes["default:stone"] then else orehud.gamemode = "MCL" -- Attempt to determine if it's MCL5 or MCL2 - if not minetest.registered_nodes["mcl_nether:ancient_debris"] then + if not minetest.registered_nodes["mcl_deepslate:deepslate"] then orehud.gamemode = "MCL2" else orehud.gamemode = "MCL5" @@ -59,6 +59,14 @@ if orehud.gamemode == "MCL5" then orehud.add_ore("mcl_copper:stone_with_copper") orehud.add_ore("mcl_nether:ancient_debris") orehud.add_ore("mcl_nether_gold:nether_gold_ore") + -- Deepslate ores now included + orehud.add_ore("mcl_deepslate:deepslate_with_iron") + orehud.add_ore("mcl_deepslate:deepslate_with_coal") + orehud.add_ore("mcl_deepslate:deepslate_with_gold") + orehud.add_ore("mcl_deepslate:deepslate_with_emerald") + orehud.add_ore("mcl_deepslate:deepslate_with_diamond") + orehud.add_ore("mcl_deepslate:deepslate_with_lapis") + orehud.add_ore("mcl_deepslate:deepslate_with_redstone") end if orehud.gamemode == "MTG" then diff --git a/orehud/mod.conf b/orehud/mod.conf index 7ff6ff1..7ce7925 100644 --- a/orehud/mod.conf +++ b/orehud/mod.conf @@ -1,4 +1,5 @@ name = orehud description = Displays ore positions via the HUD. author = ApolloX -optional_depends = default, mcl_core +optional_depends = default, mcl_core, mcl_deepslate, mcl_nether, mcl_nether_gold + diff --git a/xray/api.lua b/xray/api.lua index 393472a..85c2383 100644 --- a/xray/api.lua +++ b/xray/api.lua @@ -47,6 +47,8 @@ xray.add_pos = function(pname, pos) minetest.swap_node(pos, {name="xray:mcl_basalt"}) elseif current == "mcl_nether:netherrack" then minetest.swap_node(pos, {name="xray:mcl_netherrack"}) + elseif current == "mcl_deepslate:deepslate" then + minetest.swap_node(pos, {name="xray:mcl_deepslate"}) end -- Stone, Diorite, Anasite, Granite, etc. xray.store[pname] = nps @@ -92,6 +94,8 @@ xray.clear_pos = function(pname) minetest.swap_node(v, {name="mcl_blackstone:basalt"}) elseif node == "xray:mcl_netherrack" then minetest.swap_node(v, {name="mcl_nether:netherrack"}) + elseif node == "xray:mcl_deepslate" then + minetest.swap_node(v, {name="mcl_deepslate:deepslate"}) end end xray.store[pname] = {} @@ -132,5 +136,7 @@ xray.fix_pos = function (pos) minetest.swap_node(pos, {name="mcl_blackstone:basalt"}) elseif node == "xray:mcl_netherrack" then minetest.swap_node(pos, {name="mcl_nether:netherrack"}) + elseif node == "xray:mcl_deepslate" then + minetest.swap_node(pos, {name="mcl_deepslate:deepslate"}) end end \ No newline at end of file diff --git a/xray/init.lua b/xray/init.lua index b9b8b14..277f697 100644 --- a/xray/init.lua +++ b/xray/init.lua @@ -27,9 +27,8 @@ if not minetest.registered_nodes["default:stone"] then if not minetest.registered_nodes["mcl_core:stone"] then xray.gamemode = "N/A" else - xray.gamemode = "MCL" -- Attempt to determine if it's MCL5 or MCL2 - if not minetest.registered_nodes["mcl_nether:ancient_debris"] then + if not minetest.registered_nodes["mcl_deepslate:deepslate"] then xray.gamemode = "MCL2" else xray.gamemode = "MCL5" @@ -64,6 +63,8 @@ if xray.gamemode == "MCL5" then xray.add_node("mcl_blackstone:blackstone") -- xray:mcl_bstone xray.add_node("mcl_blackstone:basalt") -- xray:mcl_basalt xray.add_node("mcl_nether:netherrack") -- xray:mcl_netherrack + -- Deepslate now included + xray.add_node("mcl_deepslate:deepslate") -- xray:mcl_deepslate end if xray.gamemode == "MTG" then @@ -75,6 +76,7 @@ if xray.gamemode == "MTG" then end -- Include our nodes so we can cleanup after ourselves +-- Yeah there will be warnings in your logs about unknown nodes but who really checks that anyway. xray.add_node("xray:mtg_stone") xray.add_node("xray:mtg_dstone") xray.add_node("xray:mtg_sstone") @@ -89,6 +91,7 @@ xray.add_node("xray:mcl_rsstone") xray.add_node("xray:mcl_bstone") xray.add_node("xray:mcl_basalt") xray.add_node("xray:mcl_netherrack") +xray.add_node("xray:mcl_deepslate") local size = 0 local result = "Nodes: " diff --git a/xray/mod.conf b/xray/mod.conf index 792a977..ded5b88 100644 --- a/xray/mod.conf +++ b/xray/mod.conf @@ -1,4 +1,4 @@ name = xray description = Hides stone and stone varients from view. author = ApolloX -optional_depends = default, mcl_core, mcl_sounds +optional_depends = default, mcl_core, mcl_sounds, mcl_deepslate, mcl_blackstone, mcl_nether diff --git a/xray/register.lua b/xray/register.lua index 5697616..2afa6bf 100644 --- a/xray/register.lua +++ b/xray/register.lua @@ -65,7 +65,7 @@ if xray.gamemode == "MCL2" or xray.gamemode == "MCL5" then _doc_items_longdesc = xray.S("An Invisible block"), _doc_items_hidden = true, tiles = {"xray_stone.png"}, - is_ground_content = false, + is_ground_content = true, stack_max = 1, groups = {pickaxey=1, stone=1, building_block=1, material_stone=1}, drawtype = "glasslike", @@ -82,7 +82,7 @@ if xray.gamemode == "MCL2" or xray.gamemode == "MCL5" then _doc_items_longdesc = xray.S("An Invisible block"), _doc_items_hidden = true, tiles = {"xray_stone.png"}, - is_ground_content = false, + is_ground_content = true, stack_max = 1, groups = {pickaxey=1, stone=1, building_block=1, material_stone=1}, drawtype = "glasslike", @@ -99,7 +99,7 @@ if xray.gamemode == "MCL2" or xray.gamemode == "MCL5" then _doc_items_longdesc = xray.S("An Invisible block"), _doc_items_hidden = true, tiles = {"xray_stone.png"}, - is_ground_content = false, + is_ground_content = true, stack_max = 1, groups = {pickaxey=1, stone=1, building_block=1, material_stone=1}, drawtype = "glasslike", @@ -116,7 +116,7 @@ if xray.gamemode == "MCL2" or xray.gamemode == "MCL5" then _doc_items_longdesc = xray.S("An Invisible block"), _doc_items_hidden = true, tiles = {"xray_stone.png"}, - is_ground_content = false, + is_ground_content = true, light_source = xray.light_level, stack_max = 1, groups = {pickaxey=1, stone=1, building_block=1, material_stone=1}, @@ -133,7 +133,7 @@ if xray.gamemode == "MCL2" or xray.gamemode == "MCL5" then _doc_items_hidden = true, _doc_items_longdesc = xray.S("An Invisible block"), tiles = {"xray_stone.png"}, - is_ground_content = false, + is_ground_content = true, light_source = xray.light_level, stack_max = 1, groups = {pickaxey=1, sandstone=1, normal_sandstone=1, building_block=1, material_stone=1}, @@ -150,7 +150,7 @@ if xray.gamemode == "MCL2" or xray.gamemode == "MCL5" then _doc_items_hidden = true, _doc_items_longdesc = xray.S("An Invisible block"), tiles = {"xray_stone.png"}, - is_ground_content = false, + is_ground_content = true, light_source = xray.light_level, stack_max = 1, groups = {pickaxey=1, sandstone=1, normal_sandstone=1, building_block=1, material_stone=1}, @@ -172,7 +172,7 @@ if xray.gamemode == "MCL5" then tiles = {"xray_dark.png"}, light_source = xray.light_level, sounds = mcl_sounds.node_sound_stone_defaults(), - is_ground_content = false, + is_ground_content = true, stack_max = 1, groups = {cracky = 3, pickaxey=2, material_stone=1}, drawtype = "glasslike", @@ -190,7 +190,7 @@ if xray.gamemode == "MCL5" then sounds = mcl_sounds.node_sound_stone_defaults(), drawtype = "glasslike", sunlight_propagates = true, - is_ground_content = false, + is_ground_content = true, stack_max = 1, groups = {cracky = 3, pickaxey=2, material_stone=1}, drop = 'mcl_blackstone:basalt', @@ -205,7 +205,7 @@ if xray.gamemode == "MCL5" then _doc_items_longdesc = xray.S("An Invisible block"), stack_max = 1, tiles = {"xray_nether.png"}, - is_ground_content = false, + is_ground_content = true, groups = {pickaxey=1, building_block=1, material_stone=1}, drawtype = "glasslike", sunlight_propagates = true, @@ -215,4 +215,22 @@ if xray.gamemode == "MCL5" then _mcl_hardness = 0.4, _mcl_silk_touch_drop = false, }) -end \ No newline at end of file + minetest.register_node("xray:mcl_deepslate", { + description = xray.S("Xray Stone"), + _doc_items_longdesc = xray.S("An Invisible block"), + _doc_items_hidden = true, + light_source = xray.light_level, + tiles = { "xray_dark.png" }, + paramtype2 = "facedir", + is_ground_content = true, + drawtype = "glasslike", + sunlight_propagates = true, + stack_max = 1, + groups = { pickaxey = 1, stone = 1, building_block = 1, material_stone = 1 }, + drop = "mcl_deepslate:deepslate_cobbled", + sounds = mcl_sounds.node_sound_stone_defaults(), + _mcl_blast_resistance = 6, + _mcl_hardness = 3, + _mcl_silk_touch_drop = false, + }) +end