From 491f0b4dc1b42ee01e7968ef160547fda44a867a Mon Sep 17 00:00:00 2001 From: JoeEnderman <76822001+JoeEnderman@users.noreply.github.com> Date: Fri, 21 Apr 2023 01:31:55 -0500 Subject: [PATCH] Add some early functionality to new features --- depends.txt | 3 +- mapgen_decorations.lua | 79 +++++++++++++++++++++++++- mod.conf | 2 +- nodes.lua | 83 +++++++++++++++++++++++++++ tools.lua | 125 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 289 insertions(+), 3 deletions(-) diff --git a/depends.txt b/depends.txt index 93b4329..b5bfacb 100644 --- a/depends.txt +++ b/depends.txt @@ -7,4 +7,5 @@ loot? mesecons? moreblocks? climate_api? -xpanes? \ No newline at end of file +xpanes? +farming? diff --git a/mapgen_decorations.lua b/mapgen_decorations.lua index 5ceb5a6..519412b 100644 --- a/mapgen_decorations.lua +++ b/mapgen_decorations.lua @@ -47,6 +47,9 @@ local S1 = {name = "stairs:stair_netherrack", prob = 255, force_place = true, pa local S2 = {name = "stairs:stair_netherrack", prob = 255, force_place = true, param2 = 7} local S3 = {name = "stairs:stair_netherrack", prob = 255, force_place = true, param2 = 12} local S4 = {name = "stairs:stair_netherrack", prob = 255, force_place = true, param2 = 16} +local M1 = {name = "nether:hinge", prob = 255} +local M2 = {name = "nether:hinge_growing", prob = 255} +local M3 = {name = "nether:hinge_glow", prob = 255} -- ================= @@ -589,4 +592,78 @@ minetest.register_decoration({ flags = "place_center_x,place_center_z,all_floors", place_offset_y = -2, rotation = "random" -}) \ No newline at end of file +}) + + minetest.register_decoration({ + name = "Hades Hinge", + deco_type = "schematic", + place_on = "nether:rack", + sidelen = 80, + fill_ratio = 0.002, + biomes = {"nether_caverns"}, + y_max = decoration_ceiling, + y_min = decoration_floor, + schematic = { + size = {x = 12, y = 7, z = 7}, + data = { -- note that data is upside down + _, _, _, _, _, _, _, H1, H1, _, _, _, --1 + _, _, _, _, _, _, _, _, _, _, _, _, + _, _, _, _, _, _, _, _, _, _, _, _, + _, _, _, _, _, _, _, _, _, _, _, _, + _, _, _, _, _, _, _, _, _, _, _, _, + _, _, _, _, _, _, _, _, _, _, _, _, + _, _, _, _, _, _, _, _, _, _, _, _, + + _, _, _, _, _, H1, H1, H1, H1, _, _, _, --2 + _, _, _, _, _, _, _, H1, H1, H1, _, _, + _, _, _, _, _, _, _, _, _, _, _, _, + _, _, _, _, _, _, _, _, _, _, _, _, + _, _, _, _, _, _, _, _, _, _, _, _, + _, _, _, _, _, _, _, _, _, _, _, _, + _, _, _, _, _, _, _, _, _, _, _, _, + + _, _, _, H1, H1, H1, H1, _, _, _, _, _, --3 + _, _, _, _, _, H1, H1, H1, H1, _, _, _, + _, _, _, _, _, _, _, H1, H3, H1, _, _, + _, _, _, _, _, _, _, _, _, H1, _, _, + _, _, _, _, _, _, _, _, _, _, H1, _, + _, _, _, _, _, _, _, _, _, _, _, H2, + _, _, _, _, _, _, _, _, _, _, _, _, + + _, H1, H1, H1, H1, _, _, _, _, _, _, _, --4 + _, _, H1, H1, H1, H1, H1, _, _, _, _, _, + _, _, _, _, H1, H1, H1, H1, H1, _, _, _, + _, _, _, _, _, _, H1, H1, _, _, _, _, + _, _, _, _, _, _, _, _, _, _, _, _, + _, _, _, _, _, _, _, _, _, _, _, _, + _, _, _, _, _, _, _, _, _, _, _, _, + + H1, H1, H1, _, _, _, _, _, _, _, _, _, --5 + H1, H1, H1, H1, H1, _, _, _, _, _, _, _, + _, _, H1, H1, H1, H1, _, _, _, _, _, _, + _, _, _, _, H1, H1, H3, H1, _, _, _, _, + _, _, _, _, _, _, _, H1, _, _, _, _, + _, _, _, _, _, _, _, H1, _, _, _, _, + _, _, _, _, _, _, _, H2, _, _, _, _, + + H1, H1, _, _, _, _, _, _, _, _, _, _, --6 + H1, H1, H1, H1, _, _, _, _, _, _, _, _, + _, H1, H1, H3, H1, _, _, _, _, _, _, _, + _, _, _, _, H1, _, _, _, _, _, _, _, + _, _, _, _, H1, _, _, _, _, _, _, _, + _, _, _, _, H1, _, _, _, _, _, _, _, + _, _, _, _, H2, _, _, _, _, _, _, _, + + _, _, _, _, _, _, _, _, _, _, _, _, --7 + _, H1, _, _, _, _, _, _, _, _, _, _, + H1, _, _, _, _, _, _, _, _, _, _, _, + H2, _, _, _, _, _, _, _, _, _, _, _, + _, _, _, _, _, _, _, _, _, _, _, _, + _, _, _, _, _, _, _, _, _, _, _, _, + _, _, _, _, _, _, _, _, _, _, _, _ + } + }, + flags = "place_center_x,place_center_z,all_floors", + place_offset_y = -2, + rotation = "random" +}) diff --git a/mod.conf b/mod.conf index 50426d2..5907c6e 100644 --- a/mod.conf +++ b/mod.conf @@ -1,4 +1,4 @@ name = nether description = Adds a deep underground realm with different mapgen that you can reach with obsidian portals. depends = stairs, default -optional_depends = moreblocks, mesecons, loot, dungeon_loot, doc_basics, fire, climate_api, ethereal, xpanes, walls +optional_depends = moreblocks, mesecons, loot, dungeon_loot, doc_basics, fire, climate_api, ethereal, xpanes, walls, farming diff --git a/nodes.lua b/nodes.lua index 753858b..0de6d1e 100644 --- a/nodes.lua +++ b/nodes.lua @@ -269,6 +269,89 @@ minetest.register_node("nether:glowstone", { can_dig = transmogrified_can_dig, -- to ensure glowstone temporarily created by the lightstaff can't be kept }) +-- Murexium, like iron, but faster + +minetest.register_node("nether:rack_with_murexium", { + description = S("Murexium Ore"), + tiles = {"nether_rack.png^nether_mineral_murexium.png"}, + groups = {cracky = 2}, + drop = "nether:murexium_lump", + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("nether:murexium_block", { + description = S("Murexium Block"), + tiles = {"nether_murexium_block.png"}, + is_ground_content = false, + groups = {cracky = 1, level = 2}, + sounds = default.node_sound_metal_defaults(), +}) + +-- Hades Hinge, the only source of wood down here + +minetest.register_node("nether:hinge", { + description = S("Hades Hinge"), + tiles = {"nether_hinge_top.png", "nether_hinge_top.png", "nether_hinge.png"}, + paramtype2 = "facedir", + place_param2 = 0, + is_ground_content = false, + groups = {choppy = 3, oddly_breakable_by_hand = 1}, + sounds = default.node_sound_wood_defaults(), +}) + +minetest.register_node("nether:hinge_growing", { + description = S("Growing Hades Hinge Tip"), + drop = "nether:hinge_spawn", + drawtype = "plantlike", + tiles = {"nether_hinge_growing.png"}, + inventory_image = "nether_hinge_growing.png", + wield_image = "nether_hinge_growing.png", + sunlight_propagates = true, + is_ground_content = false, + groups = {dig_immediate = 2, oddly_breakable_by_hand = 3, attached_node = 1}, + sounds = default.node_sound_wood_defaults(), +}) + +minetest.register_node("nether:hinge_spawn", { + description = S("Hades Hinge Spawn"), + drawtype = "plantlike", + tiles = {"nether_hinge_spawn.png"}, + inventory_image = "nether_hinge_spawn.png", + wield_image = "nether_hinge_spawn.png", + sunlight_propagates = true, + is_ground_content = false, + on_timer = grow_sapling, + groups = {dig_immediate = 2, oddly_breakable_by_hand = 3, attached_node = 1, sapling = 1}, + sounds = default.node_sound_wood_defaults(), + + on_construct = function(pos) + minetest.get_node_timer(pos):start(math.random(300, 1500)) + end, + + on_place = function(itemstack, placer, pointed_thing) + itemstack = default.sapling_on_place(itemstack, placer, pointed_thing, + "nether:hinge_spawn", + -- minp, maxp to be checked, relative to sapling pos + -- minp_relative.y = 1 because sapling pos has been checked + {x = -3, y = 1, z = -3}, + {x = 3, y = 6, z = 3}, + -- maximum interval of interior volume check + 4) + + return itemstack + end, +}) + +minetest.register_node("nether:hinge_glowing", { + description = S("Glowing Hades Hinge"), + tiles = {"nether_hinge_glowing.png"}, + is_ground_content = false, + paramtype = "light", + light_source = 10, + groups = {choppy = 3, oddly_breakable_by_hand = 3}, + sounds = default.node_sound_wood_defaults(), +}) + -- Deep glowstone, found in the mantle / central magma layers minetest.register_node("nether:glowstone_deep", { description = S("Deep Glowstone"), diff --git a/tools.lua b/tools.lua index 1591e47..caa3946 100644 --- a/tools.lua +++ b/tools.lua @@ -151,7 +151,132 @@ minetest.register_craft({ {"group:stick"} } }) +-- Murexium +minetest.register_tool("nether:pick_murexium", { + description = S("Murexium Pickaxe"), + inventory_image = "nether_tool_murexium_pick.png", + tool_capabilities = { + full_punch_interval = 1.0, + max_drop_level=1, + groupcaps={ + cracky = {times={[1]=1.00, [2]=0.50, [3]=0.10}, uses=20, maxlevel=2}, + }, + damage_groups = {fleshy=4}, + }, + sound = {breaks = "default_tool_breaks"}, + groups = {pickaxe = 1} +}) +minetest.register_tool("nether:shovel_murexium", { + description = S("Murexium Shovel"), + inventory_image = "nether_tool_murexium_shovel.png", + wield_image = "nether_tool_murexium_shovel.png^[transformR90", + tool_capabilities = { + full_punch_interval = 1.1, + max_drop_level=1, + groupcaps={ + crumbly = {times={[1]=0.80, [2]=0.40, [3]=0.10}, uses=30, maxlevel=2}, + }, + damage_groups = {fleshy=3}, + }, + sound = {breaks = "default_tool_breaks"}, + groups = {shovel = 1} +}) + +minetest.register_tool("nether:axe_murexium", { + description = S("Murexium Axe"), + inventory_image = "nether_tool_murexium_axe.png", + tool_capabilities = { + full_punch_interval = 1.0, + max_drop_level=1, + groupcaps={ + choppy={times={[1]=0.80, [2]=0.40, [3]=0.10}, uses=20, maxlevel=2}, + }, + damage_groups = {fleshy=4}, + }, + sound = {breaks = "default_tool_breaks"}, + groups = {axe = 1} +}) + +minetest.register_tool("nether:sword_nether", { + description = S("Nether Sword"), + inventory_image = "nether_tool_nethersword.png", + tool_capabilities = { + full_punch_interval = 0.7, + max_drop_level=1, + groupcaps={ + snappy={times={[1]=1.0, [2]=0.6, [3]=0.1}, uses=45, maxlevel=3}, + }, + damage_groups = {fleshy=10}, + }, + sound = {breaks = "default_tool_breaks"}, + groups = {sword = 1} +}) + +if minetest.get_modpath("farming") ~= nil then +farming.register_hoe(":nether:hoe_murexium", { + description = S("Murexium Hoe"), + inventory_image = "nether_tool_murexium_hoe.png", + max_uses = 500, + material = "nether:murexium_ingot", + groups = {hoe = 1} +}) +end +minetest.register_craftitem("nether:murexium_ingot", { + description = S("Murexium Ingot"), + inventory_image = "nether_murexium_ingot.png" +}) +minetest.register_craftitem("nether:murexium_lump", { + description = S("Murexium Lump"), + inventory_image = "nether_murexium_lump.png", +}) + +minetest.register_craft({ + type = "cooking", + output = "nether:murexium_ingot", + recipe = "nether:murexium_lump", + cooktime = 30, +}) +minetest.register_craft({ + output = "nether:pick_murexium", + recipe = { + {"nether:murexium_ingot","nether:murexium_ingot","nether:murexium_ingot"}, + {"", "group:stick", ""}, + {"", "group:stick", ""} + } +}) +minetest.register_craft({ + output = "nether:shovel_murexium", + recipe = { + {"nether:murexium_ingot"}, + {"group:stick"}, + {"group:stick"} + } +}) +minetest.register_craft({ + output = "nether:axe_murexium", + recipe = { + {"nether:murexium_ingot","nether:murexium_ingot"}, + {"nether:murexium_ingot","group:stick"}, + {"","group:stick"} + } +}) +minetest.register_craft({ + output = "nether:sword_murexium", + recipe = { + {"nether:murexium_ingot"}, + {"nether:murexium_ingot"}, + {"group:stick"} + } +}) +minetest.register_craft({ + output = "nether:hoe_murexium", + recipe = { + {"nether:murexium_ingot","nether:murexium_ingot"}, + {"","group:stick"}, + {"","group:stick"} + } +})