From 63aa85bb989fe412c4f390faeddebcb0cf42ae4c Mon Sep 17 00:00:00 2001 From: IamPyu Date: Thu, 11 Jul 2024 18:49:25 -0600 Subject: [PATCH] develop smelting update --- CHANGELOG.md | 12 +++ mods/mobs_redo | 2 +- mods/pyutest_core/abms.lua | 13 +++ mods/pyutest_core/blocks.lua | 69 ++++++++++----- mods/pyutest_core/crafts.lua | 29 +++++++ mods/pyutest_core/furnace.lua | 79 ++++++++++++++++++ mods/pyutest_core/init.lua | 1 + mods/pyutest_core/items.lua | 1 + mods/pyutest_core/ores.lua | 14 ++++ mods/pyutest_core/overrides.lua | 6 ++ mods/pyutest_core/textures/brick.png | Bin 0 -> 185 bytes mods/pyutest_core/textures/furnace-front.png | Bin 0 -> 230 bytes mods/pyutest_core/textures/furnace-sides.png | Bin 0 -> 134 bytes .../textures/furnace-top-bottom.png | Bin 0 -> 110 bytes mods/unified_inventory | 2 +- 15 files changed, 206 insertions(+), 22 deletions(-) create mode 100644 mods/pyutest_core/furnace.lua create mode 100644 mods/pyutest_core/textures/brick.png create mode 100644 mods/pyutest_core/textures/furnace-front.png create mode 100644 mods/pyutest_core/textures/furnace-sides.png create mode 100644 mods/pyutest_core/textures/furnace-top-bottom.png diff --git a/CHANGELOG.md b/CHANGELOG.md index a9dd9bd..661e602 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## [Jun 11th - **STILL UNDER DEVELOPMENT** 2024] Update: Smithing Update + +- Updated Unified Inventory and Mobs Redo +- Added furnaces +- Implement the workbench from the "Adventure and Magic Update" +- Added bricks (Not the block, but the item) +- Clay now spawns in the world +- Fire now spreads instead of just sitting there and damaging entities. +- Add terracotta that I forgot to add in the "Adventure and Magic Update" + ## [Jun 10th 2024] Minor Update: Fence Update - Added fences @@ -161,6 +171,8 @@ Now that I think of it, this wasn't much of an "adventure" update.. **This update contains breaking changes!!** +- Game Exists Alpha and Enters Beta + - Added Diamonds and Emeralds - Added Block Variants of Ores - Added Wheat diff --git a/mods/mobs_redo b/mods/mobs_redo index e11f383..fc7269c 160000 --- a/mods/mobs_redo +++ b/mods/mobs_redo @@ -1 +1 @@ -Subproject commit e11f3835892ad9bd5e502fe5118be68d78371ec0 +Subproject commit fc7269cc8c0e50015e16c28569028be45787ebd8 diff --git a/mods/pyutest_core/abms.lua b/mods/pyutest_core/abms.lua index a3be994..fcb8787 100644 --- a/mods/pyutest_core/abms.lua +++ b/mods/pyutest_core/abms.lua @@ -36,3 +36,16 @@ minetest.register_abm({ }) end }) + +minetest.register_abm({ + label = "Fire Spread", + nodenames = {"group:flammable"}, + neighbors = {"pyutest_core:fire"}, + interval = 3, + chance = 3.1, + action = function (pos) + minetest.set_node(pos, { + name = "pyutest_core:fire" + }) + end +}) diff --git a/mods/pyutest_core/blocks.lua b/mods/pyutest_core/blocks.lua index 57d8846..9f8094d 100644 --- a/mods/pyutest_core/blocks.lua +++ b/mods/pyutest_core/blocks.lua @@ -204,6 +204,7 @@ PyuTestCore.make_building_blocks("pyutest_core:dirt", "Dirt", {"dirt.png"}, nil, PyuTestCore.make_building_blocks("pyutest_core:stone", "Stone", {"stone.png"}, nil, { ground = 1, + stone = 1, block = PyuTestCore.BLOCK_BREAKABLE_MIDDLE, }, {is_ground_content = false}) @@ -215,7 +216,8 @@ PyuTestCore.make_building_blocks("pyutest_core:wooden_log", "Oak Wooden Log", { }, nil, { block = PyuTestCore.BLOCK_BREAKABLE_CHOPPY, acid_vulnerable = 1, - wooden_log = 1 + wooden_log = 1, + flammable = 1 }, { is_ground_content = false, }) @@ -227,7 +229,8 @@ PyuTestCore.make_building_blocks("pyutest_core:savanna_wooden_log", "Savanna Woo }, nil, { block = PyuTestCore.BLOCK_BREAKABLE_CHOPPY, acid_vulnerable = 1, - wooden_log = 1 + wooden_log = 1, + flammable = 1 }, { is_ground_content = false, }) @@ -239,7 +242,8 @@ PyuTestCore.make_building_blocks("pyutest_core:birch_wooden_log", "Birch Wooden }, nil, { block = PyuTestCore.BLOCK_BREAKABLE_CHOPPY, acid_vulnerable = 1, - wooden_log = 1 + wooden_log = 1, + flammable = 1 }, { is_ground_content = false, }) @@ -251,14 +255,16 @@ PyuTestCore.make_building_blocks("pyutest_core:cherry_wooden_log", "Cherry Woode }, nil, { block = PyuTestCore.BLOCK_BREAKABLE_CHOPPY, acid_vulnerable = 1, - wooden_log = 1 + wooden_log = 1, + flammable = 1 }, { is_ground_content = false, }) PyuTestCore.make_building_blocks("pyutest_core:wooden", "Wooden", {"wood.png"}, nil, { block = PyuTestCore.BLOCK_BREAKABLE_CHOPPY, - acid_vulnerable = 1 + acid_vulnerable = 1, + flammable = 1 }, {is_ground_content = false}) PyuTestCore.make_building_blocks("pyutest_core:snow", "Snow", {"snow.png"}, nil, { @@ -283,23 +289,33 @@ PyuTestCore.make_building_blocks("pyutest_core:ice", "Ice", {"ice.png"}, nil, { slippery = 2 }) -PyuTestCore.make_building_blocks("pyutest_core:leaves", "Leaves", {"leaves.png"}, nil, {}, { +PyuTestCore.make_building_blocks("pyutest_core:leaves", "Leaves", {"leaves.png"}, nil, { + acid_vulnerable = 1, + flammable = 1 +}, { is_ground_content = false, - acid_vulnerable = 1 }) -PyuTestCore.make_building_blocks("pyutest_core:snowy_leaves", "Snowy Leaves", {"snowy-leaves.png"}, nil, {}, { +PyuTestCore.make_building_blocks("pyutest_core:snowy_leaves", "Snowy Leaves", {"snowy-leaves.png"}, nil, { + acid_vulnerable = 1, + flammable = 1 +}, { is_ground_content = false, - acid_vulnerable = 1 }) -PyuTestCore.make_building_blocks("pyutest_core:cherry_leaves", "Cherry Leaves", {"cherry-leaves.png"}, nil, {}, { +PyuTestCore.make_building_blocks("pyutest_core:cherry_leaves", "Cherry Leaves", {"cherry-leaves.png"}, nil, { + acid_vulnerable = 1, + flammable = 1 +}, { is_ground_content = false, - acid_vulnerable = 1 }) -PyuTestCore.make_building_blocks("pyutest_core:mushroom", "Mushroom", {"mushroom.png"}, nil, {}, {is_ground_content = false}) -PyuTestCore.make_building_blocks("pyutest_core:mushroom_stem", "Mushroom Stem", {"mushroom-stem.png"}, nil, {}, {is_ground_content = false}) +PyuTestCore.make_building_blocks("pyutest_core:mushroom", "Mushroom", {"mushroom.png"}, nil, { + flammable = 1 +}, {is_ground_content = false}) +PyuTestCore.make_building_blocks("pyutest_core:mushroom_stem", "Mushroom Stem", {"mushroom-stem.png"}, nil, { + flammable = 1 +}, {is_ground_content = false}) PyuTestCore.make_building_blocks("pyutest_core:mycelium", "Mycelium", {"mycelium.png"}, nil, {ground = 1}) PyuTestCore.make_building_blocks("pyutest_core:molten_rock", "Molten Rock", {"molten-rock.png"}, nil, { ground = 1, @@ -386,6 +402,7 @@ PyuTestCore.make_node("pyutest_core:glass", "Glass", { PyuTestCore.make_node("pyutest_core:flower", "Rose", { block = PyuTestCore.BLOCK_BREAKABLE_INSTANT, + flammable = 1 }, {"flower.png"}, { drawtype = "plantlike", walkable = false, @@ -398,6 +415,7 @@ PyuTestCore.make_node("pyutest_core:flower", "Rose", { PyuTestCore.make_node("pyutest_core:flower2", "Dandelion", { block = PyuTestCore.BLOCK_BREAKABLE_INSTANT, + flammable = 1 }, {"flower2.png"}, { drawtype = "plantlike", walkable = false, @@ -410,6 +428,7 @@ PyuTestCore.make_node("pyutest_core:flower2", "Dandelion", { PyuTestCore.make_node("pyutest_core:flower3", "Blue Daisy", { block = PyuTestCore.BLOCK_BREAKABLE_INSTANT, + flammable = 1 }, {"flower3.png"}, { drawtype = "plantlike", walkable = false, @@ -422,6 +441,7 @@ PyuTestCore.make_node("pyutest_core:flower3", "Blue Daisy", { PyuTestCore.make_node("pyutest_core:flower4", "Lavender", { block = PyuTestCore.BLOCK_BREAKABLE_INSTANT, + flammable = 1 }, {"flower4.png"}, { drawtype = "plantlike", walkable = false, @@ -433,7 +453,8 @@ PyuTestCore.make_node("pyutest_core:flower4", "Lavender", { }) PyuTestCore.make_node("pyutest_core:deadbush", "Deadbush", { - block = PyuTestCore.BLOCK_BREAKABLE_INSTANT + block = PyuTestCore.BLOCK_BREAKABLE_INSTANT, + flammable = 1 }, {"deadbush.png"}, { drawtype = "plantlike", walkable = false, @@ -445,7 +466,8 @@ PyuTestCore.make_node("pyutest_core:deadbush", "Deadbush", { }) PyuTestCore.make_node("pyutest_core:grass_plant", "Grass", { - block = PyuTestCore.BLOCK_BREAKABLE_INSTANT + block = PyuTestCore.BLOCK_BREAKABLE_INSTANT, + flammable = 1 }, {"grass-plant.png"}, { drawtype = "plantlike", walkable = false, @@ -457,7 +479,8 @@ PyuTestCore.make_node("pyutest_core:grass_plant", "Grass", { }) PyuTestCore.make_node("pyutest_core:tree_sapling", "Tree Sapling", { - block = PyuTestCore.BLOCK_BREAKABLE_INSTANT + block = PyuTestCore.BLOCK_BREAKABLE_INSTANT, + flammable = 1 }, {"sapling.png"}, { drawtype = "plantlike", walkable = false, @@ -495,7 +518,8 @@ PyuTestCore.make_node("pyutest_core:tree_sapling", "Tree Sapling", { }) PyuTestCore.make_node("pyutest_core:sugarcane", "Sugarcane", { - block = PyuTestCore.BLOCK_BREAKABLE_INSTANT + block = PyuTestCore.BLOCK_BREAKABLE_INSTANT, + flammable = 1 }, {"sugarcane.png"}, { drawtype = "plantlike", walkable = false, @@ -506,7 +530,8 @@ PyuTestCore.make_node("pyutest_core:sugarcane", "Sugarcane", { }) PyuTestCore.make_node("pyutest_core:trapdoor", "Trapdoor", { - block = PyuTestCore.BLOCK_BREAKABLE_CHOPPY + block = PyuTestCore.BLOCK_BREAKABLE_CHOPPY, + flammable = 1 }, {"trapdoor.png"}, { drawtype = "nodebox", paramtype = "light", @@ -601,8 +626,12 @@ PyuTestCore.make_node("pyutest_core:crate", "Crate", { PyuTestCore.make_node("pyutest_core:workbench", "Workbench", { block = PyuTestCore.BLOCK_BREAKABLE_CHOPPY }, {"workbench-top.png", "workbench-bottom.png", "workbench-sides.png"}, { - on_rightclick = function(pos, clicker) - + on_rightclick = function(pos, node, clicker) + minetest.show_formspec(clicker:get_player_name(), "pyutest_core:workbench", table.concat({ + "size[8,9]", + "list[current_player;craft;2.5,1;3,3;]", + "list[current_player;main;0,5;8,4;]" + })) end }) diff --git a/mods/pyutest_core/crafts.lua b/mods/pyutest_core/crafts.lua index ade04f7..5cd3719 100644 --- a/mods/pyutest_core/crafts.lua +++ b/mods/pyutest_core/crafts.lua @@ -183,3 +183,32 @@ minetest.register_craft({ }, type = "shapeless" }) + +minetest.register_craft({ + output = "pyutest_core:brick_block 4", + recipe = { + {"pyutest_core:brick", "pyutest_core:brick"}, + {"pyutest_core:brick", "pyutest_core:brick"} + } +}) + +minetest.register_craft({ + output = "pyutest_core:furnace", + recipe = { + {"pyutest_core:stone_block", "pyutest_core:stone_block", "pyutest_core:stone_block"}, + {"pyutest_core:stone_block", "", "pyutest_core:stone_block"}, + {"pyutest_core:stone_block", "pyutest_core:stone_block", "pyutest_core:stone_block"} + } +}) + +minetest.register_craft({ + type = "cooking", + output = "pyutest_core:glass", + recipe = "pyutest_core:sand_block 5" +}) + +minetest.register_craft({ + type = "cooking", + output = "pyutest_core:brick", + recipe = "pyutest_core:clay", +}) diff --git a/mods/pyutest_core/furnace.lua b/mods/pyutest_core/furnace.lua new file mode 100644 index 0000000..addc732 --- /dev/null +++ b/mods/pyutest_core/furnace.lua @@ -0,0 +1,79 @@ +local function furnace_formspec(pos) + local spos = string.format("%d,%d,%d", pos.x, pos.y, pos.z) + + local formspec = { + "size[8,9]", + "list[nodemeta:", spos, ";main;0,0;8,4;]", + "list[context;src;1,1;1,1;]", + "list[context;fuel;1,2.5;1,1;]", + "list[context;dst;5,1.25;2,2;]", + "button[0,3.5;4,2;smelt;Smelt]", + "button[4,3.5;4,2;smelt3;Smelt 3]", + "list[current_player;main;0,5;8,4;]" + } + + return table.concat(formspec) +end + +PyuTestCore.make_node("pyutest_core:furnace", "Furnace", { + block = PyuTestCore.BLOCK_BREAKABLE_MIDDLE +}, { + "furnace-top-bottom.png", + "furnace-top-bottom.png", + "furnace-sides.png", + "furnace-sides.png", + "furnace-sides.png", + "furnace-front.png", +}, { + is_ground_content = false, + paramtype2 = "facedir", + on_construct = function(pos, placer) + local meta = minetest.get_meta(pos) + local inventory = meta:get_inventory() + inventory:set_size("src", 1) + inventory:set_size("fuel", 1) + inventory:set_size("dst", 4) + meta:set_string("formspec", furnace_formspec(pos)) + end, + on_receive_fields = function(pos, formname, fields, player) + if fields.quit then + return + end + + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + + local function smelt() + local src = inv:get_stack("src", 1) + local fuel = inv:get_stack("fuel", 1) + + if minetest.get_item_group(fuel:get_name(), "fuel") == 0 then + return + end + + local output, decremented_input = minetest.get_craft_result({ + method = "cooking", + width = 1, + items = { + src + } + }) + + inv:add_item("dst", output.item) + src:set_count(src:get_count() - output.item:get_count()) + fuel:set_count(fuel:get_count() - 1) + inv:set_stack("src", 1, src) + inv:set_stack("fuel", 1, fuel) + end + + if fields.smelt then + smelt() + end + + if fields.smelt3 then + for i = 1, 3 do + smelt() + end + end + end, +}) diff --git a/mods/pyutest_core/init.lua b/mods/pyutest_core/init.lua index 68936c9..bcd9215 100644 --- a/mods/pyutest_core/init.lua +++ b/mods/pyutest_core/init.lua @@ -33,4 +33,5 @@ dofile(PyuTestCore_Path.."/combat.lua") dofile(PyuTestCore_Path.."/magic.lua") dofile(PyuTestCore_Path.."/crafts.lua") dofile(PyuTestCore_Path.."/furniture.lua") +dofile(PyuTestCore_Path.."/furnace.lua") dofile(PyuTestCore_Path.."/overrides.lua") diff --git a/mods/pyutest_core/items.lua b/mods/pyutest_core/items.lua index 2c72398..fbd2285 100644 --- a/mods/pyutest_core/items.lua +++ b/mods/pyutest_core/items.lua @@ -54,3 +54,4 @@ PyuTestCore.make_item("pyutest_core:clay", "Clay Ball", {}, "clay.png") PyuTestCore.make_item("pyutest_core:glass_bottle", "Glass Bottle", {}, "glass-bottle.png", { stack_max = 16 }) +PyuTestCore.make_item("pyutest_core:brick", "Brick", {}, "brick.png") diff --git a/mods/pyutest_core/ores.lua b/mods/pyutest_core/ores.lua index 20c88f3..5959144 100644 --- a/mods/pyutest_core/ores.lua +++ b/mods/pyutest_core/ores.lua @@ -1,10 +1,12 @@ PyuTestCore.make_building_blocks("pyutest_core:granite", "Granite", {"granite.png"}, nil, { ground = 1, + stone = 1, block = PyuTestCore.BLOCK_BREAKABLE_MIDDLE }) PyuTestCore.make_building_blocks("pyutest_core:andesite", "Andesite", {"andesite.png"}, nil, { ground = 1, + stone = 1, block = PyuTestCore.BLOCK_BREAKABLE_MIDDLE }) @@ -43,6 +45,18 @@ minetest.register_ore({ noise_params = PyuTestCore.SPECIALSTONE_NOISE_PARAMS }) +minetest.register_ore({ + ore_type = "blob", + ore = "pyutest_core:clay_block", + wherein = "pyutest_core:gravel_block", + clust_scarcity = 7 * 7 * 7, + clust_num_ores = 35, + clust_size = 5, + y_max = PyuTestCore_SurfaceBottom - 1, + y_min = PyuTestCore_DeepOceanMin, + noise_params = PyuTestCore.SPECIALSTONE_NOISE_PARAMS +}) + PyuTestCore.ORE_STONES = { "pyutest_core:stone_block", "pyutest_core:granite_block", diff --git a/mods/pyutest_core/overrides.lua b/mods/pyutest_core/overrides.lua index 8609efb..ef79de5 100644 --- a/mods/pyutest_core/overrides.lua +++ b/mods/pyutest_core/overrides.lua @@ -13,3 +13,9 @@ minetest.override_item("pyutest_core:leaves_block", { } } }) + +minetest.override_item("pyutest_core:coal_lump", { + groups = { + fuel = 1 + } +}) diff --git a/mods/pyutest_core/textures/brick.png b/mods/pyutest_core/textures/brick.png new file mode 100644 index 0000000000000000000000000000000000000000..ef40a343410a10d90e42162040702df7e44a392e GIT binary patch literal 185 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`4W2HJAr`$?Ct33~C>Lvm6Ve{W^WG7PkO_tWTn8+SIU-P9eUs?3#Z8O=@yQ{ zTAnNkRf_hv8uo}B&c1X=Z#}Ektiuzuza3&&{NExqZBp}-rFTMYf^SU!y85}Sb4q9e0L_F(%>V!Z literal 0 HcmV?d00001 diff --git a/mods/pyutest_core/textures/furnace-front.png b/mods/pyutest_core/textures/furnace-front.png new file mode 100644 index 0000000000000000000000000000000000000000..fab17a4c9b74e6db85d9a9c5b3d05b24736dc4d5 GIT binary patch literal 230 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ydu{YLo9leO^i){o_AnONK8mb zxNz-?g7@dEugw+M6q?Q7+da6dqNLLBk}2ivbiMdv*$wm7>2)dkEXha%s@+lY)2K_^ zaL)k{IDEJ{^z(H6c!MJ|F0dA49#d_9#AF*AJ7-oQ;||6b3%xfn-l>?=$6M3d#?HOz zS$qFHfu)gger)U5-!*|aqP-{D3=9%FS%Vn4&2DopWlq_uaj`?6SK+j>x`vzAW@CoU Xspch}^*!D|hckG(`njxgN@xNA*TPra literal 0 HcmV?d00001 diff --git a/mods/pyutest_core/textures/furnace-sides.png b/mods/pyutest_core/textures/furnace-sides.png new file mode 100644 index 0000000000000000000000000000000000000000..ebace488786c1828ca7981cbed8053d8d7aeeb8d GIT binary patch literal 134 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`zMd|QAr`&KCdQ^e&pR+CBqk&z zT)1{c!Ta;o*X9y4G&as{Y)rh;;F!q3-E;8lVdqK5*2nKth;dkzmSW2+&&Hh3z|G9e he0b&M^b=+b3?8evvLDMBqyi0Q@O1TaS?83{1OQV}D&znF literal 0 HcmV?d00001 diff --git a/mods/pyutest_core/textures/furnace-top-bottom.png b/mods/pyutest_core/textures/furnace-top-bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..dfe316cdaba303bfc626a366e82b42fa47e2d43d GIT binary patch literal 110 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`rk*a2Ar`&KCdQ^e&pR+CBqk&z zT)1{c!Ta;o*X9y4G&as{Y)rh;5XkJt+rT8o#^$k3Nt}VfHlN+?af5Cv&;SNcS3j3^ HP6