diff --git a/CHANGELOG.md b/CHANGELOG.md index 500fa71..cfdb509 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +# [Aug 3rd 2024] Unnamed Update + +- Added new node/block types + - Added purple mushroom + - Added vyn wood +- Debuff some lootboxes +- Add more loot to the "Trash" lootbox +- Add PyuTestCore.registered_* +- Saplings now take a random value between 18 and 35 seconds to grow instead of 6 seconds +- Updated saplings to new schematic names +- Black roses no longer spawn normally +- The `/replacenear` command now interprets anynode as anyblock +- New torch texture +- Indent code + # [Jul 26th 2024] Unnamed Minor Update - Vines are now flammable diff --git a/mods/pyutest/pyutest_cmds/fun.lua b/mods/pyutest/pyutest_cmds/fun.lua index a51e1d7..30df0f3 100644 --- a/mods/pyutest/pyutest_cmds/fun.lua +++ b/mods/pyutest/pyutest_cmds/fun.lua @@ -1,36 +1,36 @@ minetest.register_privilege("fun", { - description = "Access to \"powerful\" fun commands", - give_to_singeplayer = true + description = "Access to \"powerful\" fun commands", + give_to_singeplayer = true }) minetest.register_chatcommand("explode", { - params = "", - description = "Create an explosion of size RANGE.", - privs = { - fun = true - }, - func = function(name, param) - local player = minetest.get_player_by_name(name) - local range = tonumber(param) + params = "", + description = "Create an explosion of size RANGE.", + privs = { + fun = true + }, + func = function(name, param) + local player = minetest.get_player_by_name(name) + local range = tonumber(param) - if range == nil then - return false, "Please use a number for the range." - end + if range == nil then + return false, "Please use a number for the range." + end - PyuTestCore.create_explosion(player:get_pos(), range, false, range, player, true) - end + PyuTestCore.create_explosion(player:get_pos(), range, false, range, player, true) + end }) minetest.register_chatcommand("rtp", { description = [[Teleport to a random location in the world. This command may or may not kill you.]], - func = function(name) - local player = minetest.get_player_by_name(name) +func = function(name) + local player = minetest.get_player_by_name(name) - local player_pos = player:get_pos() + local player_pos = player:get_pos() - math.randomseed(os.time()) - local pos = vector.new(math.random(-31000, 31000), player_pos.y, math.random(-31000, 31000)) - player:set_pos(pos) - end + math.randomseed(os.time()) + local pos = vector.new(math.random(-31000, 31000), player_pos.y, math.random(-31000, 31000)) + player:set_pos(pos) +end }) diff --git a/mods/pyutest/pyutest_cmds/gameplay.lua b/mods/pyutest/pyutest_cmds/gameplay.lua index 7229b05..60ad442 100644 --- a/mods/pyutest/pyutest_cmds/gameplay.lua +++ b/mods/pyutest/pyutest_cmds/gameplay.lua @@ -2,72 +2,72 @@ Format: user = { - name = { - pos = {x = 128, y = 50, z = 256}, - idx = 439 - } + name = { + pos = {x = 128, y = 50, z = 256}, + idx = 439 + } } ]] local waypoints = {} minetest.register_chatcommand("waypoint", { - params = "", - description = [[Creates a waypoint at your position called + params = "", + description = [[Creates a waypoint at your position called If the waypoint is already set, move the waypoint.]], - func = function (name, param) - if waypoints[name] == nil then - waypoints[name] = {} - end +func = function (name, param) + if waypoints[name] == nil then + waypoints[name] = {} + end - local player = minetest.get_player_by_name(name) - if player == nil then return end + local player = minetest.get_player_by_name(name) + if player == nil then return end - if waypoints[name][param] ~= nil then - player:hud_remove(waypoints[name][param].idx) - end + if waypoints[name][param] ~= nil then + player:hud_remove(waypoints[name][param].idx) + end - local pos = player:get_pos() + local pos = player:get_pos() - waypoints[name][param] = {} - waypoints[name][param].pos = pos + waypoints[name][param] = {} + waypoints[name][param].pos = pos - local idx = player:hud_add({ + local idx = player:hud_add({ hud_elem_type = "waypoint", name = param, text = "m", world_pos = pos, number = 0xFFFFFFFF, - }) - waypoints[name][param].idx = idx - end + }) + waypoints[name][param].idx = idx +end }) minetest.register_chatcommand("teleportwaypoint", { - params = "", - description = "Teleport to waypoint NAME", - func = function (name, param) - if waypoints[name] == nil then - waypoints[name] = {} - end - if waypoints[name][param] == nil then return end + params = "", + description = "Teleport to waypoint NAME", + func = function (name, param) + if waypoints[name] == nil then + waypoints[name] = {} + end + if waypoints[name][param] == nil then return end - local player = minetest.get_player_by_name(name) - if player == nil then return end + local player = minetest.get_player_by_name(name) + if player == nil then return end - player:set_pos(waypoints[name][param].pos) - end + player:set_pos(waypoints[name][param].pos) + end }) minetest.register_chatcommand("biome", { - description = "Return the current biome name", - func = function (name) - local player = minetest.get_player_by_name(name) - if player == nil then return end + description = "Return the current biome name", + func = function (name) + local player = minetest.get_player_by_name(name) + if player == nil then return end - local pos = player:get_pos() + local pos = player:get_pos() - local name = minetest.get_biome_name(minetest.get_biome_data(pos).biome) - return true, string.format("Current biome name: %s", name) - end + local name = minetest.get_biome_name(minetest.get_biome_data(pos).biome) + return true, string.format("Current biome name: %s", name) + end }) diff --git a/mods/pyutest/pyutest_cmds/worldedit.lua b/mods/pyutest/pyutest_cmds/worldedit.lua index 6d9b335..0bc6b6e 100644 --- a/mods/pyutest/pyutest_cmds/worldedit.lua +++ b/mods/pyutest/pyutest_cmds/worldedit.lua @@ -1,63 +1,63 @@ minetest.register_privilege("builder", { - description = "Builder/World Edit Privilege", - give_to_singeplayer = true + description = "Builder/World Edit Privilege", + give_to_singeplayer = true }) minetest.register_chatcommand("replacenear", { - params = " ", - description = [[Replace blocks around RANGE from FROM to TO. + params = " ", + description = [[Replace blocks around RANGE from FROM to TO. FROM can be comma seperated, or it can be `any` which replaces any node. Or it can be `anyblock` which replaces any node other than air and ignore. ]], - privs = { - builder = true - }, - func = function (name, param) - local parts = param:split(" ") - if #parts == 3 then - local player = minetest.get_player_by_name(name) - local pos = player:get_pos() - local range = tonumber(parts[1]) or 5 - local from = parts[2]:split(",") - local to = parts[3] - local replaced = 0 +privs = { + builder = true +}, +func = function (name, param) + local parts = param:split(" ") + if #parts == 3 then + local player = minetest.get_player_by_name(name) + local pos = player:get_pos() + local range = tonumber(parts[1]) or 5 + local from = parts[2]:split(",") + local to = parts[3] + local replaced = 0 - local function replace(p) - for _, v in pairs(from) do - local name = minetest.get_node(p).name - local anyblock_match = (v == "anyblock" and name ~= "air" and name ~= "ignore") + local function replace(p) + for _, v in pairs(from) do + local name = minetest.get_node(p).name + local anyblock_match = (v == "anyblock" or v == "anynode" and name ~= "air" and name ~= "ignore") - if name == v or v == "any" or anyblock_match then - minetest.set_node(p, {name = to}) - replaced = replaced + 1 - end - end - end + if name == v or v == "any" or anyblock_match then + minetest.set_node(p, {name = to}) + replaced = replaced + 1 + end + end + end - PyuTestCore.dorange(pos, range, function(p) + PyuTestCore.dorange(pos, range, function(p) replace(p) - end) + end) - return true, string.format("Replaced %d blocks", replaced) - end - return false, "Requires 3 arguments" - end + return true, string.format("Replaced %d blocks", replaced) + end + return false, "Requires 3 arguments" +end }) minetest.register_chatcommand("place", { - params = "", - description = "Place SCHEMATIC at player position", - privs = { - builder = true - }, - func = function(name, param) - local player = minetest.get_player_by_name(name) - minetest.place_schematic(player:get_pos(), - PyuTestCore.get_schem_path(param), - "random", - nil, - false, - "place_center_x, place_center_z" - ) - end + params = "", + description = "Place SCHEMATIC at player position", + privs = { + builder = true + }, + func = function(name, param) + local player = minetest.get_player_by_name(name) + minetest.place_schematic(player:get_pos(), + PyuTestCore.get_schem_path(param), + "random", + nil, + false, + "place_center_x, place_center_z" + ) + end }) diff --git a/mods/pyutest/pyutest_core/abms.lua b/mods/pyutest/pyutest_core/abms.lua index fcb8787..520533b 100644 --- a/mods/pyutest/pyutest_core/abms.lua +++ b/mods/pyutest/pyutest_core/abms.lua @@ -1,51 +1,51 @@ minetest.register_abm({ - label = "Sponge Loop", - nodenames = {"pyutest_core:sponge"}, - neighbors = {"group:liquid"}, - interval = 0, - chance = 1, - action = function (pos) - local range = 4 + label = "Sponge Loop", + nodenames = {"pyutest_core:sponge"}, + neighbors = {"group:liquid"}, + interval = 0, + chance = 1, + action = function (pos) + local range = 4 - local function replace(npos) - local node = minetest.get_node(npos) - if node.name == "air" then return end - local def = minetest.registered_nodes[node.name] + local function replace(npos) + local node = minetest.get_node(npos) + if node.name == "air" then return end + local def = minetest.registered_nodes[node.name] - if def.groups["liquid"] == 1 then - minetest.remove_node(npos) - end - end + if def.groups["liquid"] == 1 then + minetest.remove_node(npos) + end + end - PyuTestCore.dorange(pos, range, function(p) - replace(p) - end) - end + PyuTestCore.dorange(pos, range, function(p) + replace(p) + end) + end }) minetest.register_abm({ - label = "Contagious Acid Spread", - nodenames = {"group:acid_vulnerable"}, - neighbors = {"pyutest_core:contagious_acid"}, - interval = 3.4, - chance = 3.7, - catchup = true, - action = function (pos) - minetest.set_node(pos, { - name = "pyutest_core:contagious_acid" - }) - end + label = "Contagious Acid Spread", + nodenames = {"group:acid_vulnerable"}, + neighbors = {"pyutest_core:contagious_acid"}, + interval = 3.4, + chance = 3.7, + catchup = true, + action = function (pos) + minetest.set_node(pos, { + name = "pyutest_core:contagious_acid" + }) + 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 + label = "Fire Spread", + nodenames = {"group:flammable"}, + neighbors = {"pyutest_core:fire"}, + interval = 1, + chance = 4, + action = function (pos) + minetest.set_node(pos, { + name = "pyutest_core:fire" + }) + end }) diff --git a/mods/pyutest/pyutest_core/blocks.lua b/mods/pyutest/pyutest_core/blocks.lua index 372d782..1d2ddaf 100644 --- a/mods/pyutest/pyutest_core/blocks.lua +++ b/mods/pyutest/pyutest_core/blocks.lua @@ -65,216 +65,239 @@ PyuTestCore.make_building_blocks = function (name, desc, tex, colortint, cgroups local id_fence = name.."_fence" table.insert(PyuTestCore.building_blocks, { - name = name, - desc = desc, - tiles = tex, - groups = groups, - econf = econf + name = name, + desc = desc, + tiles = tex, + groups = groups, + econf = econf }) minetest.register_node(id_block, PyuTestCore.util.tableconcat({ - description = Translate(desc.." Block"), - tiles = tex, - groups = PyuTestCore.util.tableconcat(groups, { - solid = 1 - }), - sounds = PyuTestCore.make_node_sounds(), + description = Translate(desc.." Block"), + tiles = tex, + groups = PyuTestCore.util.tableconcat(groups, { + solid = 1 + }), + sounds = PyuTestCore.make_node_sounds(), }, econf)) minetest.register_node(id_carpet, PyuTestCore.util.tableconcat({ - description = Translate(desc .. " Carpet"), - tiles = tex, - groups = PyuTestCore.util.tableconcat(PyuTestCore.util.tablecopy(groups), { - attached_node = 3 - }), - drawtype = "nodebox", - paramtype = "light", - paramtype2 = "facedir", - node_box = PyuTestCore.node_boxes.CARPET, - sounds = PyuTestCore.make_node_sounds(), + description = Translate(desc .. " Carpet"), + tiles = tex, + groups = PyuTestCore.util.tableconcat(PyuTestCore.util.tablecopy(groups), { + attached_node = 3 + }), + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + node_box = PyuTestCore.node_boxes.CARPET, + sounds = PyuTestCore.make_node_sounds(), }, econf)) minetest.register_node(id_slab, PyuTestCore.util.tableconcat({ - description = Translate(desc.." Slab"), - tiles = tex, - groups = groups, - drawtype = "nodebox", - paramtype = "light", - node_box = PyuTestCore.node_boxes.SLAB, - sounds = PyuTestCore.make_node_sounds(), + description = Translate(desc.." Slab"), + tiles = tex, + groups = groups, + drawtype = "nodebox", + paramtype = "light", + node_box = PyuTestCore.node_boxes.SLAB, + sounds = PyuTestCore.make_node_sounds(), }, econf)) minetest.register_node(id_pillar, PyuTestCore.util.tableconcat({ - description = Translate(desc.." Pillar"), - tiles = tex, - groups = groups, - drawtype = "nodebox", - paramtype = "light", - node_box = PyuTestCore.node_boxes.PILLAR, - sounds = PyuTestCore.make_node_sounds(), + description = Translate(desc.." Pillar"), + tiles = tex, + groups = groups, + drawtype = "nodebox", + paramtype = "light", + node_box = PyuTestCore.node_boxes.PILLAR, + sounds = PyuTestCore.make_node_sounds(), }, econf)) minetest.register_node(id_stairs, PyuTestCore.util.tableconcat({ - description = Translate(desc.." Stairs"), - tiles = tex, - groups = groups, - drawtype = "nodebox", - paramtype = "light", - paramtype2 = "facedir", - node_box = PyuTestCore.node_boxes.STAIRS, - sounds = PyuTestCore.make_node_sounds(), + description = Translate(desc.." Stairs"), + tiles = tex, + groups = groups, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + node_box = PyuTestCore.node_boxes.STAIRS, + sounds = PyuTestCore.make_node_sounds(), }, econf)) minetest.register_node(id_fence, PyuTestCore.util.tableconcat({ - description = Translate(desc.." Fence"), - tiles = tex, - groups = groups, - drawtype = "fencelike", - paramtype = "light", - collision_box = { - type = "fixed", - fixed = {-0.25, -0.5, -0.25, 0.25, 0.5, 0.25} - }, - sounds = PyuTestCore.make_node_sounds(), + description = Translate(desc.." Fence"), + tiles = tex, + groups = groups, + drawtype = "fencelike", + paramtype = "light", + collision_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.5, 0.25} + }, + sounds = PyuTestCore.make_node_sounds(), }, econf)) minetest.register_craft({ - output = id_carpet .. " 2", - recipe = { - {id_block, id_block} - } + output = id_carpet .. " 2", + recipe = { + {id_block, id_block} + } }) minetest.register_craft({ - output = id_slab .. " 3", - recipe = { - {id_block, id_block, id_block} - } + output = id_slab .. " 3", + recipe = { + {id_block, id_block, id_block} + } }) minetest.register_craft({ - output = id_pillar .. " 3", - recipe = { - {id_block}, - {id_block}, - {id_block} - } + output = id_pillar .. " 3", + recipe = { + {id_block}, + {id_block}, + {id_block} + } }) minetest.register_craft({ - output = id_stairs .. " 4", - recipe = { - {id_block, "", ""}, - {id_block, id_block, ""}, - {id_block, id_block, id_block} - } + output = id_stairs .. " 4", + recipe = { + {id_block, "", ""}, + {id_block, id_block, ""}, + {id_block, id_block, id_block} + } }) - minetest.register_craft({ - output = id_fence .. " 4", - recipe = { - {id_block, "pyutest_core:stick", id_block}, - {id_block, "pyutest_core:stick", id_block} - } + minetest.register_craft({ + output = id_fence .. " 4", + recipe = { + {id_block, "pyutest_core:stick", id_block}, + {id_block, "pyutest_core:stick", id_block} + } }) end -PyuTestCore.make_building_blocks("pyutest_core:grass", "Grass", {"pyutest-grass.png"}, nil, { - ground = 1, - acid_vulnerable = 1, - grass = 1 +PyuTestCore.make_building_blocks("pyutest_core:grass", "Grass", { + "pyutest-grass.png" +}, nil, { + ground = 1, + acid_vulnerable = 1, + grass = 1 }) -PyuTestCore.make_building_blocks("pyutest_core:dark_grass", "Dark Grass", {"pyutest-dark-grass.png"}, nil, { - ground = 1, - acid_vulnerable = 1, - grass = 1 +PyuTestCore.make_building_blocks("pyutest_core:dark_grass", "Dark Grass", { + "pyutest-dark-grass.png" +}, nil, { + ground = 1, + acid_vulnerable = 1, + grass = 1 }) -PyuTestCore.make_building_blocks("pyutest_core:swampy_grass", "Swampy Grass", {"pyutest-swampy-grass.png"}, nil, { - ground = 1, - acid_vulnerable = 1, - sugarcane_spawn_on = 1, - grass = 1 +PyuTestCore.make_building_blocks("pyutest_core:swampy_grass", "Swampy Grass", { + "pyutest-swampy-grass.png" +}, nil, { + ground = 1, + acid_vulnerable = 1, + sugarcane_spawn_on = 1, + grass = 1 }) -PyuTestCore.make_building_blocks("pyutest_core:savanna_grass", "Savanna Grass", {"pyutest-savanna-grass.png"}, nil, { - ground = 1, - acid_vulnerable = 1, - sugarcane_spawn_on = 1, - grass = 1 +PyuTestCore.make_building_blocks("pyutest_core:savanna_grass", "Savanna Grass", { + "pyutest-savanna-grass.png" +}, nil, { + ground = 1, + acid_vulnerable = 1, + sugarcane_spawn_on = 1, + grass = 1 }) -PyuTestCore.make_building_blocks("pyutest_core:aspen_grass", "Aspen Grass", {"pyutest-aspen-grass.png"}, nil, { - ground = 1, - acid_vulnerable = 1, - grass = 1 +PyuTestCore.make_building_blocks("pyutest_core:aspen_grass", "Aspen Grass", { + "pyutest-aspen-grass.png" +}, nil, { + ground = 1, + acid_vulnerable = 1, + grass = 1 }) -PyuTestCore.make_building_blocks("pyutest_core:jungle_grass", "Jungle Grass", {"pyutest-jungle-grass.png"}, nil, { - ground = 1, - acid_vulnerable = 1, - grass = 1 +PyuTestCore.make_building_blocks("pyutest_core:jungle_grass", "Jungle Grass", { + "pyutest-jungle-grass.png" +}, nil, { + ground = 1, + acid_vulnerable = 1, + grass = 1 }) PyuTestCore.make_building_blocks("pyutest_core:dirt", "Dirt", {"pyutest-dirt.png"}, nil, { - ground = 1, - acid_vulnerable = 1 + ground = 1, + acid_vulnerable = 1 }) PyuTestCore.make_building_blocks("pyutest_core:podzol", "Podzol", {"pyutest-podzol.png"}, nil, { - ground = 1, - acid_vulnerable = 1 + ground = 1, + acid_vulnerable = 1 }) PyuTestCore.make_building_blocks("pyutest_core:stone", "Stone", {"pyutest-stone.png"}, nil, { - ground = 1, - stone = 1, - block = PyuTestCore.BLOCK_BREAKABLE_MIDDLE, + ground = 1, + stone = 1, + block = PyuTestCore.BLOCK_BREAKABLE_MIDDLE, }, {is_ground_content = false}) PyuTestCore.make_building_blocks("pyutest_core:snow", "Snow", {"pyutest-snow.png"}, nil, { - ground = 1, - acid_vulnerable = 1 + ground = 1, + acid_vulnerable = 1 }) PyuTestCore.make_building_blocks("pyutest_core:sand", "Sand", {"pyutest-sand.png"}, nil, { - ground = 1, - acid_vulnerable = 1, - falling_node = 1, - sugarcane_spawn_on = 1 + ground = 1, + acid_vulnerable = 1, + falling_node = 1, + sugarcane_spawn_on = 1 }) PyuTestCore.make_building_blocks("pyutest_core:sandstone", "Sandstone", {"pyutest-sandstone.png"}, nil, { - ground = 1, - acid_vulnerable = 1 + ground = 1, + acid_vulnerable = 1 }, {is_ground_content = false}) PyuTestCore.make_building_blocks("pyutest_core:ice", "Ice", {"pyutest-ice.png"}, nil, { - ground = 1, - acid_vulnerable = 1, - slippery = 4 + ground = 1, + acid_vulnerable = 1, + slippery = 4 }) PyuTestCore.make_building_blocks("pyutest_core:mushroom", "Mushroom", {"pyutest-mushroom.png"}, nil, { - flammable = 1 + flammable = 1 }, {is_ground_content = false}) + PyuTestCore.make_building_blocks("pyutest_core:mushroom_stem", "Mushroom Stem", {"pyutest-mushroom-stem.png"}, nil, { - flammable = 1 + flammable = 1 }, {is_ground_content = false}) -PyuTestCore.make_building_blocks("pyutest_core:mycelium", "Mycelium", {"pyutest-mycelium.png"}, nil, {ground = 1}) + +PyuTestCore.make_building_blocks("pyutest_core:purple_mushroom", "Purple Mushroom", { + "pyutest-purple-mushroom.png" +}, nil, { + flammable = 1 +}, {is_ground_content = false}) + +PyuTestCore.make_building_blocks("pyutest_core:mycelium", "Mycelium", { + "pyutest-mycelium.png" +}, nil, {ground = 1}) + PyuTestCore.make_building_blocks("pyutest_core:molten_rock", "Molten Rock", {"pyutest-molten-rock.png"}, nil, { - ground = 1, - block = PyuTestCore.BLOCK_BREAKABLE_MIDDLE + ground = 1, + block = PyuTestCore.BLOCK_BREAKABLE_MIDDLE }, {is_ground_content = false}) PyuTestCore.make_building_blocks("pyutest_core:basalt", "Basalt", {"pyutest-basalt.png"}, nil, { - ground = 1, - block = PyuTestCore.BLOCK_BREAKABLE_MIDDLE + ground = 1, + block = PyuTestCore.BLOCK_BREAKABLE_MIDDLE }, {is_ground_content = false}) PyuTestCore.make_building_blocks("pyutest_core:obsidian", "Obsidian", {"pyutest-obsidian.png"}, nil, { - block = PyuTestCore.BLOCK_BREAKABLE_VERYLONG + block = PyuTestCore.BLOCK_BREAKABLE_VERYLONG }, {is_ground_content = false}) PyuTestCore.make_building_blocks("pyutest_core:haybale", "Haybale", { @@ -283,7 +306,7 @@ PyuTestCore.make_building_blocks("pyutest_core:haybale", "Haybale", { "pyutest-haybale.png" }, nil) - -- keeping old ID for backwards compatibility +-- keeping old ID for backwards compatibility PyuTestCore.make_building_blocks("pyutest_core:crying_obsidian", "Enchanted Obsidian", { "pyutest-enchanted-obsidian.png" }, nil, { @@ -307,18 +330,18 @@ PyuTestCore.make_building_blocks("pyutest_core:stone_bricks", "Stone Bricks", {" PyuTestCore.make_building_blocks("pyutest_core:slime", "Slime", {"pyutest-slime.png"}, nil, {bouncy = 85}) PyuTestCore.make_building_blocks("pyutest_core:clay", "Clay", {"pyutest-clay-block.png"}, nil, { - acid_vulnerable = 1 + acid_vulnerable = 1 }) PyuTestCore.make_building_blocks("pyutest_core:gravel", "Gravel", {"pyutest-gravel.png"}, nil, { - falling_node = 1, - acid_vulnerable = 1 + falling_node = 1, + acid_vulnerable = 1 }) PyuTestCore.make_building_blocks("pyutest_core:crystal_lantern", "Crystal Lantern", {"pyutest-crystal-lantern.png"}, nil, { - block = PyuTestCore.BLOCK_BREAKABLE_MIDDLE + block = PyuTestCore.BLOCK_BREAKABLE_MIDDLE }, { - light_source = minetest.LIGHT_MAX + light_source = minetest.LIGHT_MAX }) PyuTestCore.make_building_blocks("pyutest_core:bone", "Bone", { @@ -326,217 +349,226 @@ PyuTestCore.make_building_blocks("pyutest_core:bone", "Bone", { "pyutest-bone-block-top-bottom.png", "pyutest-bone-block.png" }, nil, { - block = PyuTestCore.BLOCK_BREAKABLE_MIDDLE + block = PyuTestCore.BLOCK_BREAKABLE_MIDDLE }) PyuTestCore.make_node("pyutest_core:light", "Light", { - block = PyuTestCore.BLOCK_BREAKABLE_INSTANT, - light = 1 + block = PyuTestCore.BLOCK_BREAKABLE_INSTANT, + light = 1 }, { - "pyutest-light.png" + "pyutest-light.png" }, { - drawtype = "torchlike", - walkable = false, - paramtype = "light", - sunlight_propagates = true, - light_source = minetest.LIGHT_MAX + drawtype = "torchlike", + walkable = false, + paramtype = "light", + sunlight_propagates = true, + light_source = minetest.LIGHT_MAX }) PyuTestCore.make_node("pyutest_core:torch", "Torch", { - block = PyuTestCore.BLOCK_BREAKABLE_INSTANT, - light = 1, - attached_node = 1 + block = PyuTestCore.BLOCK_BREAKABLE_INSTANT, + light = 1, + attached_node = 1 }, { - "pyutest-torch.png", - "pyutest-torch.png^[transform6", - "pyutest-torch.png^[transform1" + "pyutest-torch.png", + "pyutest-torch.png^[transform6", + "pyutest-torch.png^[transform1" }, { - light_source = minetest.LIGHT_MAX, - walkable = false, - drawtype = "torchlike", - paramtype = "light", - inventory_image = "pyutest-torch.png", - paramtype2 = "wallmounted", + light_source = minetest.LIGHT_MAX, + walkable = false, + drawtype = "torchlike", + paramtype = "light", + inventory_image = "pyutest-torch.png", + paramtype2 = "wallmounted", }) PyuTestCore.make_node("pyutest_core:sponge", "Sponge", { - block = PyuTestCore.BLOCK_BREAKABLE_INSTANT + block = PyuTestCore.BLOCK_BREAKABLE_INSTANT }, {"pyutest-sponge.png"}) PyuTestCore.make_node("pyutest_core:glass", "Glass", { - block = PyuTestCore.BLOCK_BREAKABLE_INSTANT + block = PyuTestCore.BLOCK_BREAKABLE_INSTANT }, {"pyutest-glass.png"}, { - drawtype = "glasslike_framed", - paramtype = "light", - sunlight_propagates = true + drawtype = "glasslike_framed", + paramtype = "light", + sunlight_propagates = true }) PyuTestCore.make_node("pyutest_core:tree_sapling", "Tree Sapling", { - block = PyuTestCore.BLOCK_BREAKABLE_INSTANT, - flammable = 1 + block = PyuTestCore.BLOCK_BREAKABLE_INSTANT, + flammable = 1 }, { "pyutest-sapling.png" }, { - drawtype = "plantlike", - walkable = false, - waving = 1, - buildable_to = true, - paramtype = "light", - sunlight_propagates = true, - inventory_image = "pyutest-sapling.png", + drawtype = "plantlike", + walkable = false, + waving = 1, + buildable_to = true, + paramtype = "light", + sunlight_propagates = true, + inventory_image = "pyutest-sapling.png", - on_timer = function (pos) + on_timer = function (pos) + local trees = { + "Tree", + "Tree2", + "BirchTree", + "TallBirchTree", + "VeryTallBirchTree", + "SwampTree", + "SavannaTree", + "RedwoodTree", + "AspenTree1", + "AspenTree2", + "SmallJungleTree", + "JungleTree", + "LargeJungleTree", + "SnowyTree1", + "SnowyTree2", + "CherryTree", + "OldGrowthTree", + "TaigaTree" + } - -- FIXME: Update to new tree schematic names - local trees = { - "tree", - "tree2", - "tree3", - "tree4", - "tree5", - "tree6", - "tree7", - "tree8", - "stree" - } + math.randomseed(os.time()) + local selected_tree = trees[math.random(#trees)] - math.randomseed(os.time()) - local selected_tree = trees[math.random(#trees)] + minetest.remove_node(pos) + pos.y = pos.y - 1 + minetest.place_schematic(pos, PyuTestCore.get_schem_path(selected_tree), "random", nil, false, "place_center_x, place_center_z") + end, - minetest.remove_node(pos) - pos.y = pos.y - 1 - minetest.place_schematic(pos, PyuTestCore.get_schem_path(selected_tree), "random", nil, false, "place_center_x, place_center_z") - end, - - on_rightclick = function (pos) - local timer = minetest.get_node_timer(pos) - timer:start(6) - end + on_rightclick = function (pos) + local timer = minetest.get_node_timer(pos) + math.randomseed(os.time()) + timer:start(math.random(18, 35)) + end }) -- FIXME: This has been in the game for a month, implement it already! PyuTestCore.make_node("pyutest_core:trapdoor", "Trapdoor", { - block = PyuTestCore.BLOCK_BREAKABLE_CHOPPY, - flammable = 1 + block = PyuTestCore.BLOCK_BREAKABLE_CHOPPY, + flammable = 1 }, {"pyutest-trapdoor.png"}, { - drawtype = "nodebox", - paramtype = "light", - sunlight_propagates = true, - node_box = { - type = "fixed", - fixed = {-0.5, -0.5, -0.5, 0.5, -0.15, 0.5} - } + drawtype = "nodebox", + paramtype = "light", + sunlight_propagates = true, + node_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, -0.15, 0.5} + } }) PyuTestCore.make_node("pyutest_core:contagious_acid", "Contagious Acid", { - block = PyuTestCore.BLOCK_BREAKABLE_MIDDLE, + block = PyuTestCore.BLOCK_BREAKABLE_MIDDLE, + solid_node = 1 }, {"pyutest-acid.png"}, {}) PyuTestCore.make_node("pyutest_core:barrier", "Barrier", { - block = PyuTestCore.BLOCK_BREAKABLE_FOREVER + block = PyuTestCore.BLOCK_BREAKABLE_FOREVER }, {}, { - drawtype = "airlike", - walkable = true, - paramtype = "light", - sunlight_propagates = true, - inventory_image = "pyutest-barrier.png", - wield_image = "pyutest-barrier.png" + drawtype = "airlike", + walkable = true, + paramtype = "light", + sunlight_propagates = true, + inventory_image = "pyutest-barrier.png", + wield_image = "pyutest-barrier.png" }) PyuTestCore.make_node("pyutest_core:fire", "Fire", { - block = PyuTestCore.BLOCK_BREAKABLE_INSTANT + block = PyuTestCore.BLOCK_BREAKABLE_INSTANT }, {"pyutest-fire.png"}, { - drawtype = "firelike", - walkable = false, - buildable_to = true, - paramtype = "light", - sunlight_propagates = true, - damage_per_second = 2, - light_source = 8, - drop = "pyutest_core:ash 4" + drawtype = "firelike", + walkable = false, + buildable_to = true, + paramtype = "light", + sunlight_propagates = true, + damage_per_second = 2, + light_source = 8, + drop = "pyutest_core:ash 4" }) PyuTestCore.make_node("pyutest_core:tnt", "TNT", { - block = PyuTestCore.BLOCK_BREAKABLE_INSTANT + block = PyuTestCore.BLOCK_BREAKABLE_INSTANT }, { - "pyutest-tnt-top-bottom.png", - "pyutest-tnt-top-bottom.png", - "pyutest-tnt-side.png" -- Affects all other sides + "pyutest-tnt-top-bottom.png", + "pyutest-tnt-top-bottom.png", + "pyutest-tnt-side.png" -- Affects all other sides }, { - on_rightclick = function (pos, _, clicker) - local timer = minetest.get_node_timer(pos) - minetest.after(3, function() - PyuTestCore.create_explosion(pos, 3, true, 3, clicker, true) - end) - end, + on_rightclick = function (pos, _, clicker) + local timer = minetest.get_node_timer(pos) + minetest.after(3, function() + PyuTestCore.create_explosion(pos, 3, true, 3, clicker, true) + end) + end, - on_timer = function (pos) - PyuTestCore.create_explosion(pos, 3, true, 3) - end + on_timer = function (pos) + PyuTestCore.create_explosion(pos, 3, true, 3) + end }) PyuTestCore.make_node("pyutest_core:crate", "Crate", { - block = PyuTestCore.BLOCK_BREAKABLE_CHOPPY + block = PyuTestCore.BLOCK_BREAKABLE_CHOPPY }, {"pyutest-crate.png"}, { - on_construct = function (pos) - local meta = minetest.get_meta(pos) - local inventory = meta:get_inventory() - inventory:set_size("main", 8 * 4) - end, + on_construct = function (pos) + local meta = minetest.get_meta(pos) + local inventory = meta:get_inventory() + inventory:set_size("main", 8 * 4) + end, - can_dig = function (pos, player) - local meta = minetest.get_meta(pos) - local inventory = meta:get_inventory() - local empty = inventory:is_empty("main") + can_dig = function (pos, player) + local meta = minetest.get_meta(pos) + local inventory = meta:get_inventory() + local empty = inventory:is_empty("main") - if not empty then - minetest.chat_send_player(player:get_player_name(), "Cannot destroy crate, it's not empty!") - end + if not empty then + minetest.chat_send_player(player:get_player_name(), "Cannot destroy crate, it's not empty!") + end - return empty - end, + return empty + end, - on_rightclick = function (pos, node, clicker) - 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[current_player;main;0,5;8,4;]" .. - "listring[nodemeta:"..spos..";main]" .. - "listring[current_player;main]" - minetest.show_formspec(clicker:get_player_name(), string.format("pyutest_core:crate_%d_%d_%d", pos.x, pos.y, pos.z), formspec) - minetest.sound_play({name = "crate_open", gain = 1}, {pos = pos}) - end + on_rightclick = function (pos, node, clicker) + 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[current_player;main;0,5;8,4;]" .. + "listring[nodemeta:"..spos..";main]" .. + "listring[current_player;main]" + minetest.show_formspec(clicker:get_player_name(), string.format("pyutest_core:crate_%d_%d_%d", pos.x, pos.y, pos.z), formspec) + minetest.sound_play({name = "crate_open", gain = 1}, {pos = pos}) + end }) PyuTestCore.make_node("pyutest_core:workbench", "Workbench", { - block = PyuTestCore.BLOCK_BREAKABLE_CHOPPY + block = PyuTestCore.BLOCK_BREAKABLE_CHOPPY }, { "pyutest-workbench-top.png", "pyutest-workbench-bottom.png", "pyutest-workbench-sides.png" }, { - 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 + 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 }) PyuTestCore.make_node("pyutest_core:ladder", "Ladder", { - block = PyuTestCore.BLOCK_BREAKABLE_CHOPPY + block = PyuTestCore.BLOCK_BREAKABLE_CHOPPY }, {"pyutest-ladder.png"}, { - drawtype = "signlike", - paramtype = "light", - walkable = false, - climbable = true, - buildable_to = true, - sunlight_propagates = true, - paramtype2 = "wallmounted", - selection_box = { - type = "wallmounted" - }, - inventory_image = "pyutest-ladder.png" + drawtype = "signlike", + paramtype = "light", + walkable = false, + climbable = true, + buildable_to = true, + sunlight_propagates = true, + paramtype2 = "wallmounted", + selection_box = { + type = "wallmounted" + }, + inventory_image = "pyutest-ladder.png" }) diff --git a/mods/pyutest/pyutest_core/combat.lua b/mods/pyutest/pyutest_core/combat.lua index 4a38955..fd15b7b 100644 --- a/mods/pyutest/pyutest_core/combat.lua +++ b/mods/pyutest/pyutest_core/combat.lua @@ -1,20 +1,20 @@ PyuTestCore.make_sword = function (nsname, desc, texture, damage, durability, atkspeed) PyuTestCore.make_tool(nsname, desc, {}, texture, { - stack_max = 1, - tool_capabilities = { - groupcaps = { - block = { - uses = durability / 2 - } - }, - punch_attack_uses = durability, - damage_groups = {fleshy = damage}, - full_punch_interval = atkspeed or 1 - } + stack_max = 1, + tool_capabilities = { + groupcaps = { + block = { + uses = durability / 2 + } + }, + punch_attack_uses = durability, + damage_groups = {fleshy = damage}, + full_punch_interval = atkspeed or 1 + } }) end PyuTestCore.make_sword("pyutest_core:wooden_sword", "Wooden Sword", "pyutest-wooden-sword.png", 4, 200, 1.8) PyuTestCore.make_sword("pyutest_core:stone_sword", "Stone Sword", "pyutest-stone-sword.png", 5, 450, 1.5) -PyuTestCore.make_sword("pyutest_core:iron_sword", "Iron Sword", "pyutest-iron-sword.png", 7, 750, 1.2) -PyuTestCore.make_sword("pyutest_core:diamond_sword", "Diamond Sword", "pyutest-diamond-sword.png", 12, 1200, 0.8) +PyuTestCore.make_sword("pyutest_core:iron_sword", "Iron Sword", "pyutest-iron-sword.png", 6, 750, 1.2) +PyuTestCore.make_sword("pyutest_core:diamond_sword", "Diamond Sword", "pyutest-diamond-sword.png", 7, 1200, 0.8) diff --git a/mods/pyutest/pyutest_core/crafts.lua b/mods/pyutest/pyutest_core/crafts.lua index c3ac663..fad2186 100644 --- a/mods/pyutest/pyutest_core/crafts.lua +++ b/mods/pyutest/pyutest_core/crafts.lua @@ -1,225 +1,225 @@ minetest.register_craft({ - output = "pyutest_core:stick 4", - recipe = { - {"group:wooden_planks"}, - {"group:wooden_planks"} - } + output = "pyutest_core:stick 4", + recipe = { + {"group:wooden_planks"}, + {"group:wooden_planks"} + } }) minetest.register_craft({ - output = "pyutest_core:wooden_pickaxe 1", - recipe = { - {"group:wooden_planks", "group:wooden_planks", "group:wooden_planks"}, - {"", "pyutest_core:stick", ""}, - {"", "pyutest_core:stick", ""} - } + output = "pyutest_core:wooden_pickaxe 1", + recipe = { + {"group:wooden_planks", "group:wooden_planks", "group:wooden_planks"}, + {"", "pyutest_core:stick", ""}, + {"", "pyutest_core:stick", ""} + } }) minetest.register_craft({ - output = "pyutest_core:wooden_sword 1", - recipe = { - {"", "group:wooden_planks", ""}, - {"", "group:wooden_planks", ""}, - {"", "pyutest_core:stick", ""} - } + output = "pyutest_core:wooden_sword 1", + recipe = { + {"", "group:wooden_planks", ""}, + {"", "group:wooden_planks", ""}, + {"", "pyutest_core:stick", ""} + } }) -- this recipe makes no sense, but who cares? minetest.register_craft({ - output = "pyutest_core:contagious_acid 3", - recipe = { - "pyutest_core:mushroom_block", - "pyutest_core:mushroom_stem_block", - "pyutest_core:dirt_block", - "pyutest_core:swampy_grass_block" - }, - type = "shapeless" + output = "pyutest_core:contagious_acid 3", + recipe = { + "pyutest_core:mushroom_block", + "pyutest_core:mushroom_stem_block", + "pyutest_core:dirt_block", + "pyutest_core:swampy_grass_block" + }, + type = "shapeless" }) minetest.register_craft({ - output = "pyutest_core:light 4", - recipe = { - {"pyutest_core:torch", "pyutest_core:torch"}, - {"pyutest_core:torch", "pyutest_core:torch"} - } + output = "pyutest_core:light 4", + recipe = { + {"pyutest_core:torch", "pyutest_core:torch"}, + {"pyutest_core:torch", "pyutest_core:torch"} + } }) minetest.register_craft({ - output = "pyutest_core:tnt 3", - recipe = { - {"pyutest_core:sand_block", "pyutest_core:gunpowder"}, - {"pyutest_core:gunpowder", "pyutest_core:sand_block"} - } + output = "pyutest_core:tnt 3", + recipe = { + {"pyutest_core:sand_block", "pyutest_core:gunpowder"}, + {"pyutest_core:gunpowder", "pyutest_core:sand_block"} + } }) minetest.register_craft({ - output = "pyutest_core:torch 4", - recipe = { - {"pyutest_core:coal_lump"}, - {"pyutest_core:stick"} - } + output = "pyutest_core:torch 4", + recipe = { + {"pyutest_core:coal_lump"}, + {"pyutest_core:stick"} + } }) minetest.register_craft({ - output = "pyutest_core:coin 4", - recipe = { - {"pyutest_core:gold_ingot", "pyutest_core:gold_ingot", "pyutest_core:gold_ingot"}, - {"pyutest_core:gold_ingot", "pyutest_core:gold_ingot", "pyutest_core:gold_ingot"}, - {"pyutest_core:gold_ingot", "pyutest_core:gold_ingot", "pyutest_core:gold_ingot"} - } + output = "pyutest_core:coin 4", + recipe = { + {"pyutest_core:gold_ingot", "pyutest_core:gold_ingot", "pyutest_core:gold_ingot"}, + {"pyutest_core:gold_ingot", "pyutest_core:gold_ingot", "pyutest_core:gold_ingot"}, + {"pyutest_core:gold_ingot", "pyutest_core:gold_ingot", "pyutest_core:gold_ingot"} + } }) minetest.register_craft({ - output = "pyutest_core:gold_ingot 9", - recipe = { - {"pyutest_core:coin"} - } + output = "pyutest_core:gold_ingot 9", + recipe = { + {"pyutest_core:coin"} + } }) minetest.register_craft({ - output = "pyutest_core:wheat 4", - recipe = { - "pyutest_core:haybale_block" - }, - type = "shapeless" + output = "pyutest_core:wheat 4", + recipe = { + "pyutest_core:haybale_block" + }, + type = "shapeless" }) minetest.register_craft({ - output = "pyutest_core:haybale_block", - recipe = { - {"pyutest_core:wheat", "pyutest_core:wheat"}, - {"pyutest_core:wheat", "pyutest_core:wheat"} - } + output = "pyutest_core:haybale_block", + recipe = { + {"pyutest_core:wheat", "pyutest_core:wheat"}, + {"pyutest_core:wheat", "pyutest_core:wheat"} + } }) minetest.register_craft({ - output = "pyutest_core:bread 3", - recipe = { - {"pyutest_core:wheat", "pyutest_core:wheat", "pyutest_core:wheat"} - } + output = "pyutest_core:bread 3", + recipe = { + {"pyutest_core:wheat", "pyutest_core:wheat", "pyutest_core:wheat"} + } }) minetest.register_craft({ - output = "pyutest_core:iron_pickaxe", - recipe = { - {"pyutest_core:iron_ingot", "pyutest_core:iron_ingot", "pyutest_core:iron_ingot"}, - {"", "pyutest_core:stick", ""}, - {"", "pyutest_core:stick", ""} - } + output = "pyutest_core:iron_pickaxe", + recipe = { + {"pyutest_core:iron_ingot", "pyutest_core:iron_ingot", "pyutest_core:iron_ingot"}, + {"", "pyutest_core:stick", ""}, + {"", "pyutest_core:stick", ""} + } }) minetest.register_craft({ - output = "pyutest_core:iron_sword", - recipe = { - {"pyutest_core:iron_ingot"}, - {"pyutest_core:iron_ingot"}, - {"pyutest_core:stick"} - } + output = "pyutest_core:iron_sword", + recipe = { + {"pyutest_core:iron_ingot"}, + {"pyutest_core:iron_ingot"}, + {"pyutest_core:stick"} + } }) minetest.register_craft({ - output = "pyutest_core:diamond_pickaxe", - recipe = { - {"pyutest_core:diamond_shard", "pyutest_core:diamond_shard", "pyutest_core:diamond_shard"}, - {"", "pyutest_core:stick", ""}, - {"", "pyutest_core:stick", ""} - } + output = "pyutest_core:diamond_pickaxe", + recipe = { + {"pyutest_core:diamond_shard", "pyutest_core:diamond_shard", "pyutest_core:diamond_shard"}, + {"", "pyutest_core:stick", ""}, + {"", "pyutest_core:stick", ""} + } }) minetest.register_craft({ - output = "pyutest_core:diamond_sword", - recipe = { - {"pyutest_core:diamond_shard"}, - {"pyutest_core:diamond_shard"}, - {"pyutest_core:stick"} - } + output = "pyutest_core:diamond_sword", + recipe = { + {"pyutest_core:diamond_shard"}, + {"pyutest_core:diamond_shard"}, + {"pyutest_core:stick"} + } }) minetest.register_craft({ - output = "pyutest_core:crate 2", - recipe = { - {"group:wooden_planks", "group:wooden_planks", "group:wooden_planks"}, - {"group:wooden_planks", "", "group:wooden_planks"}, - {"group:wooden_planks", "group:wooden_planks", "group:wooden_planks"} - } + output = "pyutest_core:crate 2", + recipe = { + {"group:wooden_planks", "group:wooden_planks", "group:wooden_planks"}, + {"group:wooden_planks", "", "group:wooden_planks"}, + {"group:wooden_planks", "group:wooden_planks", "group:wooden_planks"} + } }) minetest.register_craft({ - output = "pyutest_core:stone_pickaxe", - recipe = { - {"pyutest_core:stone_block", "pyutest_core:stone_block", "pyutest_core:stone_block"}, - {"", "pyutest_core:stick", ""}, - {"", "pyutest_core:stick", ""} - } + output = "pyutest_core:stone_pickaxe", + recipe = { + {"pyutest_core:stone_block", "pyutest_core:stone_block", "pyutest_core:stone_block"}, + {"", "pyutest_core:stick", ""}, + {"", "pyutest_core:stick", ""} + } }) minetest.register_craft({ - output = "pyutest_core:stone_sword", - recipe = { - {"", "pyutest_core:stone_block", ""}, - {"", "pyutest_core:stone_block", ""}, - {"", "pyutest_core:stick", ""} - } + output = "pyutest_core:stone_sword", + recipe = { + {"", "pyutest_core:stone_block", ""}, + {"", "pyutest_core:stone_block", ""}, + {"", "pyutest_core:stick", ""} + } }) minetest.register_craft({ - output = "pyutest_core:brick_block 4", - recipe = { - {"pyutest_core:brick", "pyutest_core:brick"}, - {"pyutest_core:brick", "pyutest_core:brick"} - } + 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"} - } + 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({ - output = "pyutest_core:slime_block", - type = "shapeless", - recipe = { - "pyutest_core:clay_block", - "pyutest_core:swampy_grass_block" - } + output = "pyutest_core:slime_block", + type = "shapeless", + recipe = { + "pyutest_core:clay_block", + "pyutest_core:swampy_grass_block" + } }) minetest.register_craft({ - output = "pyutest_core:sugar 3", - type = "shapeless", - recipe = { - "pyutest_core:sugarcane" - } + output = "pyutest_core:sugar 3", + type = "shapeless", + recipe = { + "pyutest_core:sugarcane" + } }) minetest.register_craft({ - output = "pyutest_core:clay_block 4", - recipe = { - {"pyutest_core:clay", "pyutest_core:clay"}, - {"pyutest_core:clay", "pyutest_core:clay"} - } + output = "pyutest_core:clay_block 4", + recipe = { + {"pyutest_core:clay", "pyutest_core:clay"}, + {"pyutest_core:clay", "pyutest_core:clay"} + } }) minetest.register_craft({ - output = "pyutest_core:bone_block 4", - recipe = { - {"pyutest_core:bone", "pyutest_core:bone"}, - {"pyutest_core:bone", "pyutest_core:bone"} - } + output = "pyutest_core:bone_block 4", + recipe = { + {"pyutest_core:bone", "pyutest_core:bone"}, + {"pyutest_core:bone", "pyutest_core:bone"} + } }) minetest.register_craft({ - type = "cooking", - output = "pyutest_core:glass", - recipe = "pyutest_core:sand_block 5" + 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", + type = "cooking", + output = "pyutest_core:brick", + recipe = "pyutest_core:clay", }) diff --git a/mods/pyutest/pyutest_core/electricity.lua b/mods/pyutest/pyutest_core/electricity.lua index f48b47b..dad2afe 100644 --- a/mods/pyutest/pyutest_core/electricity.lua +++ b/mods/pyutest/pyutest_core/electricity.lua @@ -82,172 +82,172 @@ end PyuTestCore.make_node("pyutest_core:copper_wire", "Copper Wire", { - block = PyuTestCore.BLOCK_BREAKABLE_INSTANT + block = PyuTestCore.BLOCK_BREAKABLE_INSTANT }, {"wire.png"}, { - drawtype = "signlike", - paramtype = "light", - sunlight_propagates = true, - color = "darkgoldenrod", - walkable = false, - inventory_image = "wire.png", - paramtype2 = "wallmounted", - selection_box = { - type = "wallmounted" - }, + drawtype = "signlike", + paramtype = "light", + sunlight_propagates = true, + color = "darkgoldenrod", + walkable = false, + inventory_image = "wire.png", + paramtype2 = "wallmounted", + selection_box = { + type = "wallmounted" + }, - on_construct = function (pos) - set_powered(pos, false) - local timer = minetest.get_node_timer(pos) - timer:start(PyuTestCore.ELECTRICITY_UPDATE_TIME) - end, + on_construct = function (pos) + set_powered(pos, false) + local timer = minetest.get_node_timer(pos) + timer:start(PyuTestCore.ELECTRICITY_UPDATE_TIME) + end, - on_timer = function (pos) - if is_electrified(pos) then - set_electrified(pos, true) - else - set_electrified(pos, false) - end + on_timer = function (pos) + if is_electrified(pos) then + set_electrified(pos, true) + else + set_electrified(pos, false) + end - local timer = minetest.get_node_timer(pos) - timer:start(PyuTestCore.ELECTRICITY_UPDATE_TIME) - end + local timer = minetest.get_node_timer(pos) + timer:start(PyuTestCore.ELECTRICITY_UPDATE_TIME) + end }) minetest.register_craft({ - output = "pyutest_core:copper_wire 16", - recipe = { - "pyutest_core:copper_ingot" - }, - type = "shapeless" + output = "pyutest_core:copper_wire 16", + recipe = { + "pyutest_core:copper_ingot" + }, + type = "shapeless" }) PyuTestCore.make_node("pyutest_core:negator", "Negated Copper Wire", { - block = PyuTestCore.BLOCK_BREAKABLE_INSTANT + block = PyuTestCore.BLOCK_BREAKABLE_INSTANT }, {"wire.png"}, { - drawtype = "signlike", - paramtype = "light", - sunlight_propagates = true, - color = "yellowgreen", - walkable = false, - inventory_image = "wire.png", - paramtype2 = "wallmounted", - selection_box = { - type = "wallmounted" - }, + drawtype = "signlike", + paramtype = "light", + sunlight_propagates = true, + color = "yellowgreen", + walkable = false, + inventory_image = "wire.png", + paramtype2 = "wallmounted", + selection_box = { + type = "wallmounted" + }, - on_construct = function (pos) - set_negated(pos, true) - set_powered(pos, false) - local timer = minetest.get_node_timer(pos) - timer:start(PyuTestCore.ELECTRICITY_UPDATE_TIME) - end, + on_construct = function (pos) + set_negated(pos, true) + set_powered(pos, false) + local timer = minetest.get_node_timer(pos) + timer:start(PyuTestCore.ELECTRICITY_UPDATE_TIME) + end, - on_timer = function (pos) - if is_electrified(pos) then - set_electrified(pos, true) - else - set_electrified(pos, false) - end + on_timer = function (pos) + if is_electrified(pos) then + set_electrified(pos, true) + else + set_electrified(pos, false) + end - local timer = minetest.get_node_timer(pos) - timer:start(PyuTestCore.ELECTRICITY_UPDATE_TIME) - end + local timer = minetest.get_node_timer(pos) + timer:start(PyuTestCore.ELECTRICITY_UPDATE_TIME) + end }) PyuTestCore.make_node("pyutest_core:switch", "Switch", { - block = PyuTestCore.BLOCK_BREAKABLE_NORMAL + block = PyuTestCore.BLOCK_BREAKABLE_NORMAL }, {"device.png"}, { - color = "dimgray", - on_construct = function(pos) - set_powered(pos, false) - end, + color = "dimgray", + on_construct = function(pos) + set_powered(pos, false) + end, - on_rightclick = function(pos) - set_powered(pos, not get_powered(pos)) - end + on_rightclick = function(pos) + set_powered(pos, not get_powered(pos)) + end }) PyuTestCore.make_device = function (name, desc, color, craftitem, action, setup, extra_conf) PyuTestCore.make_node(name.."_device", desc, { - block = PyuTestCore.BLOCK_BREAKABLE_NORMAL + block = PyuTestCore.BLOCK_BREAKABLE_NORMAL }, {"device.png"}, PyuTestCore.util.tableconcat({ - color = color, - on_construct = function (pos) - local s = setup or function (_) end - s(pos) + color = color, + on_construct = function (pos) + local s = setup or function (_) end + s(pos) - local timer = minetest.get_node_timer(pos) - timer:start(PyuTestCore.ELECTRICITY_UPDATE_TIME) - end, - on_timer = function (pos) - if is_electrified(pos, true) then - action(true, pos) - else - action(false, pos) - end + local timer = minetest.get_node_timer(pos) + timer:start(PyuTestCore.ELECTRICITY_UPDATE_TIME) + end, + on_timer = function (pos) + if is_electrified(pos, true) then + action(true, pos) + else + action(false, pos) + end - local timer = minetest.get_node_timer(pos) - timer:start(PyuTestCore.ELECTRICITY_UPDATE_TIME) - end + local timer = minetest.get_node_timer(pos) + timer:start(PyuTestCore.ELECTRICITY_UPDATE_TIME) + end }, extra_conf or {})) minetest.register_craft({ - output = name.."_device 4", - recipe = { - {"pyutest_core:copper_ingot", "pyutest_core:copper_ingot", "pyutest_core:copper_ingot"}, - {"pyutest_core:copper_ingot", craftitem, "pyutest_core:copper_ingot"}, - {"pyutest_core:copper_ingot", "pyutest_core:copper_ingot", "pyutest_core:copper_ingot"} - } + output = name.."_device 4", + recipe = { + {"pyutest_core:copper_ingot", "pyutest_core:copper_ingot", "pyutest_core:copper_ingot"}, + {"pyutest_core:copper_ingot", craftitem, "pyutest_core:copper_ingot"}, + {"pyutest_core:copper_ingot", "pyutest_core:copper_ingot", "pyutest_core:copper_ingot"} + } }) end PyuTestCore.make_device("pyutest_core:time", "Time Device", "orange", "pyutest_core:light", function (e) - if not e then - minetest.chat_send_all("Not electrified!") - return - end - minetest.chat_send_all(string.format("Time: " .. os.date("%I:%M:%S", os.time()))) + if not e then + minetest.chat_send_all("Not electrified!") + return + end + minetest.chat_send_all(string.format("Time: " .. os.date("%I:%M:%S", os.time()))) end) PyuTestCore.make_device("pyutest_core:block_setter", "Block Setter Device", "blue", "pyutest_core:stone_block", function (e, pos) - if not e then return end - local blocks = {} - for k, _ in pairs(minetest.registered_nodes) do - local no_disallowed_blocks_match = (k ~= "ignore" and k ~= "pyutest_core:contagious_acid") + if not e then return end + local blocks = {} + for k, _ in pairs(minetest.registered_nodes) do + local no_disallowed_blocks_match = (k ~= "ignore" and k ~= "pyutest_core:contagious_acid") - if no_disallowed_blocks_match then - table.insert(blocks, k) - end - end - local pos = vector.new(pos.x, pos.y + 1, pos.z) - minetest.remove_node(pos) - minetest.place_node(pos, {name = blocks[math.random(#blocks)]}) + if no_disallowed_blocks_match then + table.insert(blocks, k) + end + end + local pos = vector.new(pos.x, pos.y + 1, pos.z) + minetest.remove_node(pos) + minetest.place_node(pos, {name = blocks[math.random(#blocks)]}) end) PyuTestCore.make_device("pyutest_core:freezer", "Freezer Device", "skyblue", "pyutest_core:ice_block", function(e, pos) - if not e then return end + if not e then return end - PyuTestCore.dorange(pos, 3, function(p) - local node = minetest.get_node_or_nil(p) - if node == nil then return end + PyuTestCore.dorange(pos, 3, function(p) + local node = minetest.get_node_or_nil(p) + if node == nil then return end - if minetest.get_item_group(node.name, "water") ~= 0 then - minetest.set_node(p, {name = "pyutest_core:ice_block"}) - elseif minetest.get_item_group(node.name, "lava") ~= 0 then - minetest.set_node(p, {name = "pyutest_core:hellstone_block"}) - end - end) + if minetest.get_item_group(node.name, "water") ~= 0 then + minetest.set_node(p, {name = "pyutest_core:ice_block"}) + elseif minetest.get_item_group(node.name, "lava") ~= 0 then + minetest.set_node(p, {name = "pyutest_core:hellstone_block"}) + end + end) end) PyuTestCore.make_device("pyutest_core:heater", "Heater Device", "maroon", "pyutest_core:ash", function(e, pos) - if not e then return end + if not e then return end - PyuTestCore.dorange(pos, 3, function(p) - local node = minetest.get_node_or_nil(p) - if node == nil then return end + PyuTestCore.dorange(pos, 3, function(p) + local node = minetest.get_node_or_nil(p) + if node == nil then return end - if minetest.get_item_group(node.name, "ice") ~= 0 then - minetest.set_node(p, {name = "pyutest_core:water_source"}) - end - end) + if minetest.get_item_group(node.name, "ice") ~= 0 then + minetest.set_node(p, {name = "pyutest_core:water_source"}) + end + end) end) diff --git a/mods/pyutest/pyutest_core/flowers.lua b/mods/pyutest/pyutest_core/flowers.lua index 2e80d0e..41a593e 100644 --- a/mods/pyutest/pyutest_core/flowers.lua +++ b/mods/pyutest/pyutest_core/flowers.lua @@ -62,7 +62,7 @@ PyuTestCore.make_node("pyutest_core:lilypad", "Lily Pad", { -- Plants after the floral update PyuTestCore.make_flower("pyutest_core:maybell", "Maybell", "pyutest-maybell.png", "pyutest_core:white_dye", true) PyuTestCore.make_flower("pyutest_core:orange_tulip", "Orange Tulip", "pyutest-orange-tulip.png", "pyutest_core:orange_dye", true) -PyuTestCore.make_flower("pyutest_core:black_rose", "Black Rose", "pyutest-black-rose.png", "pyutest_core:black_dye", true) +PyuTestCore.make_flower("pyutest_core:black_rose", "Black Rose", "pyutest-black-rose.png", "pyutest_core:black_dye", false) PyuTestCore.make_node("pyutest_core:vines", "Vines", { block = PyuTestCore.BLOCK_BREAKABLE_INSTANT, diff --git a/mods/pyutest/pyutest_core/furnace.lua b/mods/pyutest/pyutest_core/furnace.lua index 902bf7c..d9afadc 100644 --- a/mods/pyutest/pyutest_core/furnace.lua +++ b/mods/pyutest/pyutest_core/furnace.lua @@ -16,64 +16,64 @@ local function furnace_formspec(pos) end PyuTestCore.make_node("pyutest_core:furnace", "Furnace", { - block = PyuTestCore.BLOCK_BREAKABLE_MIDDLE + block = PyuTestCore.BLOCK_BREAKABLE_MIDDLE }, { - "pyutest-furnace-top-bottom.png", - "pyutest-furnace-top-bottom.png", - "pyutest-furnace-sides.png", - "pyutest-furnace-sides.png", - "pyutest-furnace-sides.png", - "pyutest-furnace-front.png", + "pyutest-furnace-top-bottom.png", + "pyutest-furnace-top-bottom.png", + "pyutest-furnace-sides.png", + "pyutest-furnace-sides.png", + "pyutest-furnace-sides.png", + "pyutest-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 + 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 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) + 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 + 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 - } - }) + 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 + 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.smelt then + smelt() + end - if fields.smelt3 then - for i = 1, 3 do - smelt() - end - end - end, + if fields.smelt3 then + for i = 1, 3 do + smelt() + end + end + end, }) diff --git a/mods/pyutest/pyutest_core/furniture.lua b/mods/pyutest/pyutest_core/furniture.lua index 3a190f8..8b4cdbb 100644 --- a/mods/pyutest/pyutest_core/furniture.lua +++ b/mods/pyutest/pyutest_core/furniture.lua @@ -8,6 +8,7 @@ PyuTestCore.FURNITURE_NODEBOXES = { } } +PyuTestCore.registered_furniture = {} PyuTestCore.make_furniture = function(name, desc, craft, tiles, cgroups, extra_conf) local econf = extra_conf or {} local groups = PyuTestCore.util.tablecopy(cgroups) or { @@ -21,91 +22,98 @@ PyuTestCore.make_furniture = function(name, desc, craft, tiles, cgroups, extra_c local id_mtable = name.."_mtable" minetest.register_node(id_table, PyuTestCore.util.tableconcat({ - description = Translate(desc.." Table"), - tiles = tiles, - groups = PyuTestCore.util.tableconcat(groups, { - table = 1 - }), - sounds = PyuTestCore.make_node_sounds(), - drawtype = "nodebox", - paramtype = "light", - node_box = PyuTestCore.FURNITURE_NODEBOXES.TABLE, - connects_to = {"group:table"} + description = Translate(desc.." Table"), + tiles = tiles, + groups = PyuTestCore.util.tableconcat(groups, { + table = 1 + }), + sounds = PyuTestCore.make_node_sounds(), + drawtype = "nodebox", + paramtype = "light", + node_box = PyuTestCore.FURNITURE_NODEBOXES.TABLE, + connects_to = {"group:table"} }, econf)) minetest.register_node(id_chair, PyuTestCore.util.tableconcat({ - description = Translate(desc.." Chair"), - tiles = tiles, - groups = PyuTestCore.util.tableconcat(groups, { - chair = 1, - attached_node = 3, - }), - sounds = PyuTestCore.make_node_sounds(), - paramtype = "light", - paramtype2 = "4dir", - drawtype = "mesh", - mesh = "chair.obj", - selection_box = { - type = "fixed", - fixed = {-0.5, -0.5, -0.5, 0.5, 1.1, 0.5} - }, - collision_box = { - type = "fixed", - fixed = { - {-0.5, -0.5, -0.5, 0.5, 0.10, 0.5} - } - } + description = Translate(desc.." Chair"), + tiles = tiles, + groups = PyuTestCore.util.tableconcat(groups, { + chair = 1, + attached_node = 3, + }), + sounds = PyuTestCore.make_node_sounds(), + paramtype = "light", + paramtype2 = "4dir", + drawtype = "mesh", + mesh = "chair.obj", + selection_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, 1.1, 0.5} + }, + collision_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0.10, 0.5} + } + } }, econf)) minetest.register_node(id_mtable, PyuTestCore.util.tableconcat({ - description = Translate(desc.." Mini Table"), - tiles = tiles, - groups = PyuTestCore.util.tableconcat(groups, { - mtable = 1, - attached_node = 3, - }), - sounds = PyuTestCore.make_node_sounds(), - paramtype = "light", - paramtype2 = "4dir", - drawtype = "mesh", - mesh = "mtable.obj", - selection_box = { - type = "fixed", - fixed = {-0.5, -0.5, -0.5, 0.5, 0.25, 0.5} - }, - collision_box = { - type = "fixed", - fixed = { - {-0.5, -0.5, -0.5, 0.5, 0.25, 0.5} - } - } + description = Translate(desc.." Mini Table"), + tiles = tiles, + groups = PyuTestCore.util.tableconcat(groups, { + mtable = 1, + attached_node = 3, + }), + sounds = PyuTestCore.make_node_sounds(), + paramtype = "light", + paramtype2 = "4dir", + drawtype = "mesh", + mesh = "mtable.obj", + selection_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, 0.25, 0.5} + }, + collision_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0.25, 0.5} + } + } }, econf)) minetest.register_craft({ - output = id_table .. " 4", - recipe = { - {craft, craft, craft}, - {"", craft, ""}, - {"", craft, ""} - } + output = id_table .. " 4", + recipe = { + {craft, craft, craft}, + {"", craft, ""}, + {"", craft, ""} + } }) minetest.register_craft({ - output = id_chair .. " 4", - recipe = { - {craft, "", ""}, - {craft, craft, craft}, - {craft, "", craft} - } + output = id_chair .. " 4", + recipe = { + {craft, "", ""}, + {craft, craft, craft}, + {craft, "", craft} + } }) minetest.register_craft({ - output = id_mtable .. " 4", - recipe = { - {craft, craft, craft}, - {craft, craft, craft} - } + output = id_mtable .. " 4", + recipe = { + {craft, craft, craft}, + {craft, craft, craft} + } }) + + PyuTestCore.registered_furniture[name] = { + craft = craft, + groups = groups, + tiles = tiles, + econf = econf + } end for _, v in pairs(PyuTestCore.building_blocks) do diff --git a/mods/pyutest/pyutest_core/items.lua b/mods/pyutest/pyutest_core/items.lua index ad3bd73..67a5d2f 100644 --- a/mods/pyutest/pyutest_core/items.lua +++ b/mods/pyutest/pyutest_core/items.lua @@ -18,37 +18,37 @@ end PyuTestCore.make_item("pyutest_core:stick", "Stick", {}, "pyutest-stick.png") PyuTestCore.make_item("pyutest_core:bone", "Bone", {}, "pyutest-bone.png", { - stack_max = 99 + stack_max = 99 }) PyuTestCore.make_item("pyutest_core:gunpowder", "Gunpowder", {}, "pyutest-powder.png", { - color = "dimgray", + color = "dimgray", }) PyuTestCore.make_item("pyutest_core:ash", "Ash", {}, "pyutest-powder.png", { - color = "gray", + color = "gray", }) PyuTestCore.make_item("pyutest_core:sugar", "Sugar", {}, "pyutest-powder.png") PyuTestCore.make_item("pyutest_core:coin", "Coin", {}, "pyutest-coin.png", { - on_secondary_use = function (_, user) - local pos = user:get_pos() - minetest.sound_play({name = "coin", gain = 1}, { - pos = pos - }) - return nil - end + on_secondary_use = function (_, user) + local pos = user:get_pos() + minetest.sound_play({name = "coin", gain = 1}, { + pos = pos + }) + return nil + end }) PyuTestCore.make_item("pyutest_core:wheat", "Wheat", {}, "pyutest-wheat.png") PyuTestCore.make_item("pyutest_core:string", "String", {}, "pyutest-string.png") PyuTestCore.make_item("pyutest_core:egg", "Egg", {}, "pyutest-egg.png", { - color = "peachpuff" + color = "peachpuff" }) PyuTestCore.make_item("pyutest_core:clay", "Clay Ball", {}, "pyutest-clay.png") PyuTestCore.make_item("pyutest_core:glass_bottle", "Glass Bottle", {}, "pyutest-glass-bottle.png", { - stack_max = 16 + stack_max = 16 }) PyuTestCore.make_item("pyutest_core:brick", "Brick", {}, "pyutest-brick.png") PyuTestCore.make_item("pyutest_core:snowball", "Snowball", {}, "pyutest-snowball.png") diff --git a/mods/pyutest/pyutest_core/leaves.lua b/mods/pyutest/pyutest_core/leaves.lua index bbcf542..50ddb0d 100644 --- a/mods/pyutest/pyutest_core/leaves.lua +++ b/mods/pyutest/pyutest_core/leaves.lua @@ -1,30 +1,35 @@ +PyuTestCore.registered_leaves = {} PyuTestCore.make_leaves = function (id, desc, tiles) local _id = id ~= nil and id.."_leaves" or "pyutest_core:leaves" -- backwards compatability with original leaves local _desc = desc ~= nil and desc .. " Leaves" or "Leaves" PyuTestCore.make_building_blocks(_id, _desc, tiles, nil, { - acid_vulnerable = 1, - flammable = 1, + acid_vulnerable = 1, + flammable = 1, }, { - is_ground_content = false + is_ground_content = false }) local leaves_id = _id.."_block" minetest.override_item(leaves_id, { - drop = { - max_items = 1, - items = { - { - rarity = 3.5, - items = {"pyutest_core:apple 1"} - }, + drop = { + max_items = 1, + items = { + { + rarity = 3.5, + items = {"pyutest_core:apple 1"} + }, - { - items = {leaves_id} - } - } - } + { + items = {leaves_id} + } + } + } }) + + PyuTestCore.registered_leaves[_id] = { + tiles = tiles + } end PyuTestCore.make_leaves(nil, nil, {"pyutest-leaves.png"}) diff --git a/mods/pyutest/pyutest_core/liquid.lua b/mods/pyutest/pyutest_core/liquid.lua index e507200..9a7f59b 100644 --- a/mods/pyutest/pyutest_core/liquid.lua +++ b/mods/pyutest/pyutest_core/liquid.lua @@ -1,3 +1,4 @@ +PyuTestCore.registered_liquids = {} PyuTestCore.make_liquid = function (name, desc, groups, texture, speed, extra_conf) local function make_liquid_flags(liquidtype) local drawtype = "" @@ -9,32 +10,32 @@ PyuTestCore.make_liquid = function (name, desc, groups, texture, speed, extra_co end local t = PyuTestCore.util.tableconcat({ - drawtype = drawtype, - waving = 3, - walkable = false, - pointable = false, - buildable_to = true, - is_ground_content = false, - use_texture_alpha = "blend", - paramtype = "light", - drop = "", - drowning = 1, - liquidtype = liquidtype, - liquid_renewable = true, - liquid_viscosity = speed or 1, - liquid_alternative_flowing = name.."_flowing", - liquid_alternative_source = name.."_source", - paramtype2 = liquidtype == "flowing" and "flowingliquid" or nil, - special_tiles = liquidtype == "flowing" and { - { - name = texture, - backface_culling = false - }, - { - name = texture, - backface_culling = true - } - } or nil + drawtype = drawtype, + waving = 3, + walkable = false, + pointable = false, + buildable_to = true, + is_ground_content = false, + use_texture_alpha = "blend", + paramtype = "light", + drop = "", + drowning = 1, + liquidtype = liquidtype, + liquid_renewable = true, + liquid_viscosity = speed or 1, + liquid_alternative_flowing = name.."_flowing", + liquid_alternative_source = name.."_source", + paramtype2 = liquidtype == "flowing" and "flowingliquid" or nil, + special_tiles = liquidtype == "flowing" and { + { + name = texture, + backface_culling = false + }, + { + name = texture, + backface_culling = true + } + } or nil }, extra_conf or {}) return t end @@ -44,22 +45,29 @@ PyuTestCore.make_liquid = function (name, desc, groups, texture, speed, extra_co PyuTestCore.make_node(name.."_source", desc .. " Source", g, {texture}, make_liquid_flags("source")) PyuTestCore.make_node(name.."_flowing", "Flowing " .. desc, g, {texture}, make_liquid_flags("flowing")) + + PyuTestCore.registered_liquids[name] = { + source = name.."_source", + flowing = name.."_flowing", + texture = texture, + groups = g + } end PyuTestCore.make_liquid("pyutest_core:water", "Water", { - water = 1 + water = 1 }, "pyutest-water.png", 1, { - post_effect_color = {a=60, r=24.7, g=46.3, b=89.4}, - paramtype2 = "color", + post_effect_color = {a=60, r=24.7, g=46.3, b=89.4}, + paramtype2 = "color", }) PyuTestCore.make_liquid("pyutest_core:lava", "Lava", { - lava = 1 + lava = 1 }, "pyutest-lava.png", 5, { - damage_per_second = 2, - light_source = 8 + damage_per_second = 4, + light_source = 8 }) PyuTestCore.make_liquid("pyutest_core:oil", "Oil", {}, "pyutest-oil.png", 3) PyuTestCore.make_liquid("pyutest_core:liquid_acid", "Acid", {}, "pyutest-acid.png", 7, { - damage_per_second = 2 + damage_per_second = 4 }) diff --git a/mods/pyutest/pyutest_core/lootboxes.lua b/mods/pyutest/pyutest_core/lootboxes.lua index 8ac3666..49080ed 100644 --- a/mods/pyutest/pyutest_core/lootboxes.lua +++ b/mods/pyutest/pyutest_core/lootboxes.lua @@ -1,58 +1,63 @@ +PyuTestCore.registered_lootboxes = {} PyuTestCore.make_lootbox = function (name, dname, items) local id = name.."_lootbox" minetest.register_node(id, { - description = Translate(dname .. " Lootbox"), - groups = { - block = PyuTestCore.BLOCK_BREAKABLE_CHOPPY, - not_in_creative_inventory = 1 - }, - tiles = {"pyutest-crate.png"}, - sounds = PyuTestCore.make_node_sounds(), - on_rightclick = function (pos, _, clicker) - if clicker == nil then return end + description = Translate(dname .. " Lootbox"), + groups = { + block = PyuTestCore.BLOCK_BREAKABLE_CHOPPY, + not_in_creative_inventory = 1 + }, + tiles = {"pyutest-crate.png"}, + sounds = PyuTestCore.make_node_sounds(), + on_rightclick = function (pos, _, clicker) + if clicker == nil then return end - for _, v in pairs(items) do - minetest.add_item(pos, v) - end + for _, v in pairs(items) do + minetest.add_item(pos, v) + end - minetest.sound_play("lootbox_unlock", { - pos = pos, - gain = 1 - }) - minetest.remove_node(pos) - end, - color = "lime" + minetest.sound_play("lootbox_unlock", { + pos = pos, + gain = 1 + }) + minetest.remove_node(pos) + end }) + PyuTestCore.registered_lootboxes[name] = { + id = id, + items = items + } end PyuTestCore.make_lootbox("pyutest_core:trash", "Trash", { - ItemStack("pyutest_core:deadbush 19"), - ItemStack("pyutest_core:") + ItemStack("pyutest_core:deadbush 6"), + ItemStack("pyutest_core:bone 3"), + ItemStack("pyutest_core:ash 2") }) PyuTestCore.make_lootbox("pyutest_core:resource", "Resource", { - ItemStack("pyutest_core:gunpowder 3"), - ItemStack("pyutest_core:stick 4"), - ItemStack("pyutest_core:sugar 2"), - ItemStack("pyutest_core:tree_sapling 3"), - ItemStack("pyutest_core:apple 3"), - ItemStack("pyutest_core:string 5") + ItemStack("pyutest_core:gunpowder 3"), + ItemStack("pyutest_core:stick 4"), + ItemStack("pyutest_core:sugar 2"), + ItemStack("pyutest_core:tree_sapling 3"), + ItemStack("pyutest_core:apple 3"), + ItemStack("pyutest_core:string 5") }) PyuTestCore.make_lootbox("pyutest_core:griefer", "Griefer's Dream", { - ItemStack("pyutest_core:tnt 3"), - ItemStack("pyutest_core:bomb 2") + ItemStack("pyutest_core:tnt 3"), + ItemStack("pyutest_core:bomb 2") }) PyuTestCore.make_lootbox("pyutest_core:lighting", "Lighting", { - ItemStack("pyutest_core:light 2"), - ItemStack("pyutest_core:torch 13") + ItemStack("pyutest_core:light 2"), + ItemStack("pyutest_core:torch 5") }) PyuTestCore.make_lootbox("pyutest_core:color", "Color", { - ItemStack("pyutest_core:green_dye 2"), - ItemStack("pyutest_core:pink_dye 3"), - ItemStack("pyutest_core:white_dye 1"), - ItemStack("pyutest_core:black_dye 3"), - ItemStack("pyutest_core:brown_dye 2") + ItemStack("pyutest_core:green_dye 2"), + ItemStack("pyutest_core:pink_dye 3"), + ItemStack("pyutest_core:white_dye 1"), + ItemStack("pyutest_core:black_dye 3"), + ItemStack("pyutest_core:brown_dye 2") }) diff --git a/mods/pyutest/pyutest_core/magic.lua b/mods/pyutest/pyutest_core/magic.lua index 8d74f45..b1033f2 100644 --- a/mods/pyutest/pyutest_core/magic.lua +++ b/mods/pyutest/pyutest_core/magic.lua @@ -1,125 +1,132 @@ PyuTestCore.make_item("pyutest_core:magic_shards", "Magic Shards", {}, "pyutest-magic-shards.png") minetest.override_item("pyutest_core:crying_obsidian_block", { - drop = { - max_items = 1, - items = { - { - rarity = 3.2, - items = {"pyutest_core:magic_shards 3"} - }, + drop = { + max_items = 1, + items = { + { + rarity = 3.2, + items = {"pyutest_core:magic_shards 3"} + }, - { - items = {"pyutest_core:crying_obsidian_block"} - } - } - } + { + items = {"pyutest_core:crying_obsidian_block"} + } + } + } }) +PyuTestCore.registered_spellbooks = {} PyuTestCore.make_spellbook = function (nsname, desc, color, craftitem, action) if action == nil then action = function(_, _, _)end end PyuTestCore.make_item(nsname, desc, {}, "pyutest-spellbook.png", { - stack_max = 1, - color = color, - on_use = function (itemstack, user, pointed_thing) - local pos = user:get_pos() - minetest.sound_play({name = "spellbook_action", gain = 0.75}, {pos = pos}) - action(itemstack, user, pointed_thing) - end + stack_max = 1, + color = color, + on_use = function (itemstack, user, pointed_thing) + local pos = user:get_pos() + minetest.sound_play({name = "spellbook_action", gain = 0.75}, {pos = pos}) + action(itemstack, user, pointed_thing) + end }) minetest.register_craft({ - output = nsname, - recipe = { - {"", "pyutest_core:magic_shards", ""}, - {"pyutest_core:magic_shards", craftitem, "pyutest_core:magic_shards"}, - {"", "pyutest_core:magic_shards", ""} - } + output = nsname, + recipe = { + {"", "pyutest_core:magic_shards", ""}, + {"pyutest_core:magic_shards", craftitem, "pyutest_core:magic_shards"}, + {"", "pyutest_core:magic_shards", ""} + } }) + + PyuTestCore.registered_spellbooks[nsname] = { + color = color, + craftitem = craftitem, + action = action + } end PyuTestCore.make_spellbook("pyutest_core:explosions_spellbook", "Spellbook of Explosions", "gray", "pyutest_core:bomb", function (itemstack, user) - PyuTestCore.create_explosion(user:get_pos(), 3, false, 7, user) + PyuTestCore.create_explosion(user:get_pos(), 3, false, 7, user) end) PyuTestCore.make_spellbook("pyutest_core:fire_spellbook", "Spellbook of Fire", "crimson", "pyutest_core:hellstone_block", function (itemstack, user) - local range = 2 + local range = 2 - local function replace(pos) - local node = minetest.get_node_or_nil(pos) - if node == nil then return end - if node.name ~= "air" then return end - local pos2 = vector.new(pos.x, pos.y - 1, pos.z) - node = minetest.get_node_or_nil(pos) - if node == nil then return end - if node.name ~= "air" then return end + local function replace(pos) + local node = minetest.get_node_or_nil(pos) + if node == nil then return end + if node.name ~= "air" then return end + local pos2 = vector.new(pos.x, pos.y - 1, pos.z) + node = minetest.get_node_or_nil(pos) + if node == nil then return end + if node.name ~= "air" then return end - minetest.set_node(pos, {name = "pyutest_core:fire"}) - end + minetest.set_node(pos, {name = "pyutest_core:fire"}) + end - for dx = -range, range do - for dz = -range, range do - local pos = user:get_pos() - replace({x = pos.x + dx, y = pos.y, z = pos.z + dz}) - end - end + for dx = -range, range do + for dz = -range, range do + local pos = user:get_pos() + replace({x = pos.x + dx, y = pos.y, z = pos.z + dz}) + end + end end) PyuTestCore.make_item("pyutest_core:enchanted_shard", "Enchanted Shard", {}, "pyutest-shard.png", { - color = "indigo", + color = "indigo", }) minetest.register_craft({ - output = "pyutest_core:enchanted_shard 2", - recipe = { - {"pyutest_core:magic_shards", "pyutest_core:diamond_shard", "pyutest_core:magic_shards"}, - {"pyutest_core:emerald_shard", "pyutest_core:magic_shards", "pyutest_core:emerald_shard"}, - {"pyutest_core:magic_shards", "pyutest_core:diamond_shard", "pyutest_core:magic_shards"} - } + output = "pyutest_core:enchanted_shard 2", + recipe = { + {"pyutest_core:magic_shards", "pyutest_core:diamond_shard", "pyutest_core:magic_shards"}, + {"pyutest_core:emerald_shard", "pyutest_core:magic_shards", "pyutest_core:emerald_shard"}, + {"pyutest_core:magic_shards", "pyutest_core:diamond_shard", "pyutest_core:magic_shards"} + } }) PyuTestCore.make_tool("pyutest_core:enchanted_pickaxe", "Enchanted Pickaxe", {}, "pyutest-enchanted-pickaxe.png", { - stack_max = 1, - tool_capabilities = { - groupcaps = { - block = { - times = { - [PyuTestCore.BLOCK_BREAKABLE_INSTANT] = 0.035, - [PyuTestCore.BLOCK_BREAKABLE_NORMAL] = 0.35, - [PyuTestCore.BLOCK_BREAKABLE_CHOPPY] = 0.45, - [PyuTestCore.BLOCK_BREAKABLE_MIDDLE] = 0.45, - [PyuTestCore.BLOCK_BREAKABLE_LONG] = 0.8, - [PyuTestCore.BLOCK_BREAKABLE_VERYLONG] = 3, - [PyuTestCore.BLOCK_BREAKABLE_FOREVER] = 7 - }, - uses = 3600, - } - }, - punch_attack_uses = 1200, - damage_groups = {fleshy = 4} - } + stack_max = 1, + tool_capabilities = { + groupcaps = { + block = { + times = { + [PyuTestCore.BLOCK_BREAKABLE_INSTANT] = 0.035, + [PyuTestCore.BLOCK_BREAKABLE_NORMAL] = 0.35, + [PyuTestCore.BLOCK_BREAKABLE_CHOPPY] = 0.45, + [PyuTestCore.BLOCK_BREAKABLE_MIDDLE] = 0.45, + [PyuTestCore.BLOCK_BREAKABLE_LONG] = 0.8, + [PyuTestCore.BLOCK_BREAKABLE_VERYLONG] = 3, + [PyuTestCore.BLOCK_BREAKABLE_FOREVER] = 7 + }, + uses = 3600, + } + }, + punch_attack_uses = 1200, + damage_groups = {fleshy = 4} + } }) minetest.register_craft({ - output = "pyutest_core:enchanted_pickaxe", - recipe = { - {"pyutest_core:enchanted_shard", "pyutest_core:enchanted_shard", "pyutest_core:enchanted_shard"}, - {"", "pyutest_core:stick", ""}, - {"", "pyutest_core:stick", ""} - } + output = "pyutest_core:enchanted_pickaxe", + recipe = { + {"pyutest_core:enchanted_shard", "pyutest_core:enchanted_shard", "pyutest_core:enchanted_shard"}, + {"", "pyutest_core:stick", ""}, + {"", "pyutest_core:stick", ""} + } }) -PyuTestCore.make_sword("pyutest_core:enchanted_sword", "Enchanted Sword", "pyutest-enchanted-sword.png", 15, 3600, 0.6) +PyuTestCore.make_sword("pyutest_core:enchanted_sword", "Enchanted Sword", "pyutest-enchanted-sword.png", 9, 3600, 0.6) minetest.register_craft({ - output = "pyutest_core:enchanted_sword", - recipe = { - {"pyutest_core:enchanted_shard"}, - {"pyutest_core:enchanted_shard"}, - {"pyutest_core:stick"} - } + output = "pyutest_core:enchanted_sword", + recipe = { + {"pyutest_core:enchanted_shard"}, + {"pyutest_core:enchanted_shard"}, + {"pyutest_core:stick"} + } }) diff --git a/mods/pyutest/pyutest_core/ores.lua b/mods/pyutest/pyutest_core/ores.lua index 6199fd7..9921c6a 100644 --- a/mods/pyutest/pyutest_core/ores.lua +++ b/mods/pyutest/pyutest_core/ores.lua @@ -1,13 +1,13 @@ PyuTestCore.make_building_blocks("pyutest_core:granite", "Granite", {"pyutest-granite.png"}, nil, { - ground = 1, - stone = 1, - block = PyuTestCore.BLOCK_BREAKABLE_MIDDLE + ground = 1, + stone = 1, + block = PyuTestCore.BLOCK_BREAKABLE_MIDDLE }) PyuTestCore.make_building_blocks("pyutest_core:andesite", "Andesite", {"pyutest-andesite.png"}, nil, { - ground = 1, - stone = 1, - block = PyuTestCore.BLOCK_BREAKABLE_MIDDLE + ground = 1, + stone = 1, + block = PyuTestCore.BLOCK_BREAKABLE_MIDDLE }) PyuTestCore.SPECIALSTONE_NOISE_PARAMS = { @@ -22,39 +22,39 @@ PyuTestCore.SPECIALSTONE_NOISE_PARAMS = { } minetest.register_ore({ - ore_type = "blob", - ore = "pyutest_core:granite_block", - wherein = "pyutest_core:stone_block", - clust_scarcity = 9 * 9 * 9, - clust_num_ores = 35, - clust_size = 5, - y_max = PyuTestCore_SurfaceBottom - 1, - y_min = PyuTestCore_WorldBottom, - noise_params = PyuTestCore.SPECIALSTONE_NOISE_PARAMS + ore_type = "blob", + ore = "pyutest_core:granite_block", + wherein = "pyutest_core:stone_block", + clust_scarcity = 9 * 9 * 9, + clust_num_ores = 35, + clust_size = 5, + y_max = PyuTestCore_SurfaceBottom - 1, + y_min = PyuTestCore_WorldBottom, + noise_params = PyuTestCore.SPECIALSTONE_NOISE_PARAMS }) minetest.register_ore({ - ore_type = "blob", - ore = "pyutest_core:andesite_block", - wherein = "pyutest_core:stone_block", - clust_scarcity = 9 * 9 * 9, - clust_num_ores = 35, - clust_size = 5, - y_max = PyuTestCore_SurfaceBottom - 1, - y_min = PyuTestCore_WorldBottom, - noise_params = PyuTestCore.SPECIALSTONE_NOISE_PARAMS + ore_type = "blob", + ore = "pyutest_core:andesite_block", + wherein = "pyutest_core:stone_block", + clust_scarcity = 9 * 9 * 9, + clust_num_ores = 35, + clust_size = 5, + y_max = PyuTestCore_SurfaceBottom - 1, + y_min = PyuTestCore_WorldBottom, + 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 + 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 = { @@ -63,84 +63,91 @@ PyuTestCore.ORE_STONES = { "pyutest_core:andesite_block", } +-- TODO: The code here is very messy, and this function takes to much arguments. Squash the arguments into a table and clean the code. +PyuTestCore.registered_ores = {} PyuTestCore.make_ore = function (id, desc, ifix, idfix, btxt, itxt, color, y_max, scarcity, count, btype, oconf, bconf) local oid = id.."_ore" local iid = id.."_"..ifix local block_type = btype ~= nil and btype or PyuTestCore.BLOCK_BREAKABLE_LONG minetest.register_node(oid, PyuTestCore.util.tableconcat({ - description = Translate(desc .. " Ore"), - groups = { - block = block_type, - mineral = 1 - }, - tiles = {btxt}, - drop = iid .. " " .. tostring(count or 1), - sounds = PyuTestCore.make_node_sounds(), - light_source = 3.9, -- Make ores emit little light + description = Translate(desc .. " Ore"), + groups = { + block = block_type, + mineral = 1 + }, + tiles = {btxt}, + drop = iid .. " " .. tostring(count or 1), + sounds = PyuTestCore.make_node_sounds(), + light_source = 3.9, -- Make ores emit little light }, oconf or {})) minetest.register_craftitem(iid, { - description = Translate(desc .. " " .. idfix), - inventory_image = itxt, - wield_image = itxt, - color = color, - groups = { - mineral = 1 - } + description = Translate(desc .. " " .. idfix), + inventory_image = itxt, + wield_image = itxt, + color = color, + groups = { + mineral = 1 + } }) minetest.register_ore({ - ore_type = "scatter", - ore = oid, - wherein = PyuTestCore.ORE_STONES, - clust_scarcity = scarcity * scarcity * scarcity, - clust_num_ores = 4, - clust_size = 3, - y_max = y_max, - y_min = PyuTestCore_WorldBottom, + ore_type = "scatter", + ore = oid, + wherein = PyuTestCore.ORE_STONES, + clust_scarcity = scarcity * scarcity * scarcity, + clust_num_ores = 4, + clust_size = 3, + y_max = y_max, + y_min = PyuTestCore_WorldBottom, }) minetest.register_ore({ - ore_type = "scatter", - ore = oid, - wherein = PyuTestCore.ORE_STONES, - clust_scarcity = scarcity * scarcity * scarcity * 2.2, - clust_num_ores = 9, - clust_size = 3, - y_max = y_max, - y_min = PyuTestCore_WorldBottom, + ore_type = "scatter", + ore = oid, + wherein = PyuTestCore.ORE_STONES, + clust_scarcity = scarcity * scarcity * scarcity * 2.2, + clust_num_ores = 9, + clust_size = 3, + y_max = y_max, + y_min = PyuTestCore_WorldBottom, }) minetest.register_ore({ - ore_type = "scatter", - ore = oid, - wherein = PyuTestCore.ORE_STONES, - clust_scarcity = (scarcity * scarcity * scarcity) * 3, - clust_num_ores = 18, - clust_size = 6, - y_max = y_max, - y_min = PyuTestCore_WorldBottom, + ore_type = "scatter", + ore = oid, + wherein = PyuTestCore.ORE_STONES, + clust_scarcity = (scarcity * scarcity * scarcity) * 3, + clust_num_ores = 18, + clust_size = 6, + y_max = y_max, + y_min = PyuTestCore_WorldBottom, }) PyuTestCore.make_building_blocks(id, desc, {"pyutest-metal.png"}, color, {block = block_type}, bconf or {}) local bid = id.."_block" minetest.register_craft({ - output = bid, - recipe = { - {iid, iid}, - {iid, iid} - } + output = bid, + recipe = { + {iid, iid}, + {iid, iid} + } }) minetest.register_craft({ - output = iid .. " 4", - recipe = { - bid - }, - type = "shapeless" + output = iid .. " 4", + recipe = { + bid + }, + type = "shapeless" }) + + PyuTestCore.registered_ores[id] = { + ore = oid, + item = iid + } end -- Useful Ores diff --git a/mods/pyutest/pyutest_core/overrides.lua b/mods/pyutest/pyutest_core/overrides.lua index 97ff6f3..01ccbe9 100644 --- a/mods/pyutest/pyutest_core/overrides.lua +++ b/mods/pyutest/pyutest_core/overrides.lua @@ -1,11 +1,11 @@ minetest.override_item("pyutest_core:clay_block", { - drop = "pyutest_core:clay 3" + drop = "pyutest_core:clay 3" }) minetest.override_item("pyutest_core:coal_lump", { - groups = { - fuel = 1 - } + groups = { + fuel = 1 + } }) minetest.override_item("pyutest_core:bone_block", { diff --git a/mods/pyutest/pyutest_core/player.lua b/mods/pyutest/pyutest_core/player.lua index eb80644..368282c 100644 --- a/mods/pyutest/pyutest_core/player.lua +++ b/mods/pyutest/pyutest_core/player.lua @@ -1,106 +1,126 @@ -- player setup minetest.register_on_joinplayer(function (player) - if player == nil then return end - local name = player:get_player_name() - player:set_properties({ - hp_max = 30 - }) + if player == nil then return end + local name = player:get_player_name() + player:set_properties({ + hp_max = 25 + }) - player:get_inventory():set_width("main", 8) - player:get_inventory():set_size("main", 8 * 4) - player:hud_set_hotbar_itemcount(8) + player:get_inventory():set_width("main", 8) + player:get_inventory():set_size("main", 8 * 4) + player:hud_set_hotbar_itemcount(8) - -- creative mode privs - if minetest.is_creative_enabled(name) then - minetest.set_player_privs(name, PyuTestCore.util.tableconcat({ - fly = true, - fast = true, - noclip = true, - builder = true, - settime = true, - creative = true, - peaceful_player = true, -- from mobs_redo - teleport = true, - }, minetest.get_player_privs(name))) - end + -- creative mode privs + if minetest.is_creative_enabled(name) then + minetest.set_player_privs(name, PyuTestCore.util.tableconcat({ + fly = true, + fast = true, + noclip = true, + builder = true, + settime = true, + creative = true, + peaceful_player = true, -- from mobs_redo + teleport = true, + }, minetest.get_player_privs(name))) + end end) -- player physics local function set_player_speed(player, speed) player:set_physics_override({ - speed = speed, + speed = speed, }) end minetest.register_globalstep(function(dtime) - local players = minetest.get_connected_players() - for p=1, #players do + local players = minetest.get_connected_players() + for p=1, #players do local ctrl = players[p]:get_player_control() if ctrl.aux1 then set_player_speed(players[p], 1.60) else set_player_speed(players[p], 1) end - end + end end) -- player hand minetest.register_item(":", { - type = "none", - wield_image = "pyutest-hand.png" + type = "none", + wield_image = "pyutest-hand.png" }) if minetest.is_creative_enabled("") then local break_speed = 0.2 minetest.override_item("", { - range = 9, - tool_capabilities = { - groupcaps = { - block = { - times = { - [PyuTestCore.BLOCK_BREAKABLE_INSTANT] = break_speed, - [PyuTestCore.BLOCK_BREAKABLE_NORMAL] = break_speed, - [PyuTestCore.BLOCK_BREAKABLE_CHOPPY] = break_speed, - [PyuTestCore.BLOCK_BREAKABLE_MIDDLE] = break_speed, - [PyuTestCore.BLOCK_BREAKABLE_LONG] = break_speed, - [PyuTestCore.BLOCK_BREAKABLE_VERYLONG] = break_speed, - [PyuTestCore.BLOCK_BREAKABLE_FOREVER] = break_speed - }, - uses = 0 - } - }, - punch_attack_uses = 0, - damage_groups = {fleshy = 10000} - } + range = 9, + tool_capabilities = { + groupcaps = { + block = { + times = { + [PyuTestCore.BLOCK_BREAKABLE_INSTANT] = break_speed, + [PyuTestCore.BLOCK_BREAKABLE_NORMAL] = break_speed, + [PyuTestCore.BLOCK_BREAKABLE_CHOPPY] = break_speed, + [PyuTestCore.BLOCK_BREAKABLE_MIDDLE] = break_speed, + [PyuTestCore.BLOCK_BREAKABLE_LONG] = break_speed, + [PyuTestCore.BLOCK_BREAKABLE_VERYLONG] = break_speed, + [PyuTestCore.BLOCK_BREAKABLE_FOREVER] = break_speed + }, + uses = 0 + } + }, + punch_attack_uses = 0, + damage_groups = {fleshy = 10000} + } }) else minetest.override_item("", { - range = 6, - tool_capabilities = { - groupcaps = { - block = { - times = { - [PyuTestCore.BLOCK_BREAKABLE_INSTANT] = 0.35, - [PyuTestCore.BLOCK_BREAKABLE_NORMAL] = 0.85, - [PyuTestCore.BLOCK_BREAKABLE_CHOPPY] = 3, - [PyuTestCore.BLOCK_BREAKABLE_MIDDLE] = 5.5, - [PyuTestCore.BLOCK_BREAKABLE_LONG] = 9, - [PyuTestCore.BLOCK_BREAKABLE_VERYLONG] = 12, - [PyuTestCore.BLOCK_BREAKABLE_FOREVER] = 18 - }, - uses = 0 - } - }, - punch_attack_uses = 0, - damage_groups = {fleshy = 1} - } + range = 5, + tool_capabilities = { + groupcaps = { + block = { + times = { + [PyuTestCore.BLOCK_BREAKABLE_INSTANT] = 0.35, + [PyuTestCore.BLOCK_BREAKABLE_NORMAL] = 0.85, + [PyuTestCore.BLOCK_BREAKABLE_CHOPPY] = 3, + [PyuTestCore.BLOCK_BREAKABLE_MIDDLE] = 5.5, + [PyuTestCore.BLOCK_BREAKABLE_LONG] = 9, + [PyuTestCore.BLOCK_BREAKABLE_VERYLONG] = 12, + [PyuTestCore.BLOCK_BREAKABLE_FOREVER] = 18 + }, + uses = 0 + } + }, + punch_attack_uses = 0, + damage_groups = {fleshy = 1} + } }) end -- unlimited blocks in creative mode minetest.register_on_placenode(function(_, _, placer) - if placer and placer:is_player() then - return minetest.is_creative_enabled(placer:get_player_name()) - end + if placer and placer:is_player() then + return minetest.is_creative_enabled(placer:get_player_name()) + end +end) + +-- player death message +minetest.register_on_dieplayer(function(player, reason) + local playername = player:get_player_name() + + if reason.object ~= nil then + local le = reason.object:get_luaentity() + + if le == nil then + minetest.chat_send_all(string.format("%s was slain by %s", + playername, reason.object:get_player_name())) + else + local split = string.split(le.name, ":") + local name = split[#split] + name = name:gsub("_", " ") + name = string.upper(name:sub(1, 1))..name:sub(2, name:len()) + minetest.chat_send_all(string.format("%s was slain by %s", playername, name)) + end + end end) diff --git a/mods/pyutest/pyutest_core/tools.lua b/mods/pyutest/pyutest_core/tools.lua index 0573568..ffb974c 100644 --- a/mods/pyutest/pyutest_core/tools.lua +++ b/mods/pyutest/pyutest_core/tools.lua @@ -4,7 +4,7 @@ PyuTestCore.make_tool = function (nsname, desc, groups, wield_image, extra_conf) wield_image = wield_image, inventory_image = wield_image, groups = PyuTestCore.util.tableconcat(groups, { - tool = 1 + tool = 1 }) } @@ -21,141 +21,140 @@ PyuTestCore.make_food = function (nsname, desc, wield_image, health_fill, extra_ local code = extra_code or function()end PyuTestCore.make_item(nsname, desc, {}, wield_image, { - on_use = function (itemstack, user, pt) - if user == nil then return end - minetest.sound_play({name = "eat", gain = 1}, {pos = user:get_pos(), start_time = 1.2}) - minetest.do_item_eat(health_fill, "", itemstack, user, pt) - code() - end + on_use = function (itemstack, user, pt) + if user == nil then return end + minetest.sound_play({name = "eat", gain = 1}, {pos = user:get_pos(), start_time = 1.2}) + minetest.do_item_eat(health_fill, "", itemstack, user, pt) + code() + end }) end PyuTestCore.make_tool("pyutest_core:wooden_pickaxe", "Wooden Pickaxe", {}, "pyutest-wooden-pickaxe.png", { - stack_max = 1, - tool_capabilities = { - groupcaps = { - block = { - times = { - [PyuTestCore.BLOCK_BREAKABLE_INSTANT] = 0.085, - [PyuTestCore.BLOCK_BREAKABLE_NORMAL] = 0.75, - [PyuTestCore.BLOCK_BREAKABLE_CHOPPY] = 1.3, - [PyuTestCore.BLOCK_BREAKABLE_MIDDLE] = 2.4, - }, - uses = 200, - } - }, - punch_attack_uses = 100, - damage_groups = {fleshy = 3} - } + stack_max = 1, + tool_capabilities = { + groupcaps = { + block = { + times = { + [PyuTestCore.BLOCK_BREAKABLE_INSTANT] = 0.085, + [PyuTestCore.BLOCK_BREAKABLE_NORMAL] = 0.75, + [PyuTestCore.BLOCK_BREAKABLE_CHOPPY] = 1.3, + [PyuTestCore.BLOCK_BREAKABLE_MIDDLE] = 2.4, + }, + uses = 200, + } + }, + punch_attack_uses = 100, + damage_groups = {fleshy = 3} + } }) PyuTestCore.make_tool("pyutest_core:stone_pickaxe", "Stone Pickaxe", {}, "pyutest-stone-pickaxe.png", { - stack_max = 1, - tool_capabilities = { - groupcaps = { - block = { - times = { - [PyuTestCore.BLOCK_BREAKABLE_INSTANT] = 0.065, - [PyuTestCore.BLOCK_BREAKABLE_NORMAL] = 0.55, - [PyuTestCore.BLOCK_BREAKABLE_CHOPPY] = 0.9, - [PyuTestCore.BLOCK_BREAKABLE_MIDDLE] = 1.1, - [PyuTestCore.BLOCK_BREAKABLE_LONG] = 2.1, - [PyuTestCore.BLOCK_BREAKABLE_VERYLONG] = 9, - [PyuTestCore.BLOCK_BREAKABLE_FOREVER] = 15 - }, - uses = 450, - } - }, - punch_attack_uses = 225, - damage_groups = {fleshy = 3} - } + stack_max = 1, + tool_capabilities = { + groupcaps = { + block = { + times = { + [PyuTestCore.BLOCK_BREAKABLE_INSTANT] = 0.065, + [PyuTestCore.BLOCK_BREAKABLE_NORMAL] = 0.55, + [PyuTestCore.BLOCK_BREAKABLE_CHOPPY] = 0.9, + [PyuTestCore.BLOCK_BREAKABLE_MIDDLE] = 1.1, + [PyuTestCore.BLOCK_BREAKABLE_LONG] = 2.1, + [PyuTestCore.BLOCK_BREAKABLE_VERYLONG] = 9, + [PyuTestCore.BLOCK_BREAKABLE_FOREVER] = 15 + }, + uses = 450, + } + }, + punch_attack_uses = 225, + damage_groups = {fleshy = 3} + } }) PyuTestCore.make_tool("pyutest_core:iron_pickaxe", "Iron Pickaxe", {}, "pyutest-iron-pickaxe.png", { - stack_max = 1, - tool_capabilities = { - groupcaps = { - block = { - times = { - [PyuTestCore.BLOCK_BREAKABLE_INSTANT] = 0.035, - [PyuTestCore.BLOCK_BREAKABLE_NORMAL] = 0.35, - [PyuTestCore.BLOCK_BREAKABLE_CHOPPY] = 0.8, - [PyuTestCore.BLOCK_BREAKABLE_MIDDLE] = 0.8, - [PyuTestCore.BLOCK_BREAKABLE_LONG] = 1.7, - [PyuTestCore.BLOCK_BREAKABLE_VERYLONG] = 7, - [PyuTestCore.BLOCK_BREAKABLE_FOREVER] = 11 - }, - uses = 750, - } - }, - punch_attack_uses = 375, - damage_groups = {fleshy = 4} - } + stack_max = 1, + tool_capabilities = { + groupcaps = { + block = { + times = { + [PyuTestCore.BLOCK_BREAKABLE_INSTANT] = 0.035, + [PyuTestCore.BLOCK_BREAKABLE_NORMAL] = 0.35, + [PyuTestCore.BLOCK_BREAKABLE_CHOPPY] = 0.8, + [PyuTestCore.BLOCK_BREAKABLE_MIDDLE] = 0.8, + [PyuTestCore.BLOCK_BREAKABLE_LONG] = 1.7, + [PyuTestCore.BLOCK_BREAKABLE_VERYLONG] = 7, + [PyuTestCore.BLOCK_BREAKABLE_FOREVER] = 11 + }, + uses = 750, + } + }, + punch_attack_uses = 375, + damage_groups = {fleshy = 4} + } }) PyuTestCore.make_tool("pyutest_core:diamond_pickaxe", "Diamond Pickaxe", {}, "pyutest-diamond-pickaxe.png", { - stack_max = 1, - tool_capabilities = { - groupcaps = { - block = { - times = { - [PyuTestCore.BLOCK_BREAKABLE_INSTANT] = 0.035, - [PyuTestCore.BLOCK_BREAKABLE_NORMAL] = 0.35, - [PyuTestCore.BLOCK_BREAKABLE_CHOPPY] = 0.6, - [PyuTestCore.BLOCK_BREAKABLE_MIDDLE] = 0.6, - [PyuTestCore.BLOCK_BREAKABLE_LONG] = 1.3, - [PyuTestCore.BLOCK_BREAKABLE_VERYLONG] = 5, - [PyuTestCore.BLOCK_BREAKABLE_FOREVER] = 8 - }, - uses = 1200, - } - }, - punch_attack_uses = 600, - damage_groups = {fleshy = 4} - } + stack_max = 1, + tool_capabilities = { + groupcaps = { + block = { + times = { + [PyuTestCore.BLOCK_BREAKABLE_INSTANT] = 0.035, + [PyuTestCore.BLOCK_BREAKABLE_NORMAL] = 0.35, + [PyuTestCore.BLOCK_BREAKABLE_CHOPPY] = 0.6, + [PyuTestCore.BLOCK_BREAKABLE_MIDDLE] = 0.6, + [PyuTestCore.BLOCK_BREAKABLE_LONG] = 1.3, + [PyuTestCore.BLOCK_BREAKABLE_VERYLONG] = 5, + [PyuTestCore.BLOCK_BREAKABLE_FOREVER] = 8 + }, + uses = 1200, + } + }, + punch_attack_uses = 600, + damage_groups = {fleshy = 4} + } }) PyuTestCore.make_item("pyutest_core:bomb", "Bomb", {}, "pyutest-bomb.png", { - stack_max = 16, - on_use = function (_, user) - if user == nil then - return - end - local pos = user:get_pos() - PyuTestCore.create_explosion(pos, 2, false, 3, user) - local stack = user:get_wielded_item() - stack:set_count(stack:get_count() - 1) + stack_max = 16, + on_use = function (_, user) + if user == nil then + return + end + local pos = user:get_pos() + PyuTestCore.create_explosion(pos, 2, false, 3, user) + local stack = user:get_wielded_item() + stack:set_count(stack:get_count() - 1) - user:set_wielded_item(stack) - end + user:set_wielded_item(stack) + end }) PyuTestCore.make_item("pyutest_core:windball", "Windball", {}, "pyutest-windball.png", { - stack_max = 16, - on_use = function (_, user) - if user == nil then - return - end + stack_max = 16, + on_use = function (_, user) + if user == nil then + return + end + + local pos = user:get_pos() + minetest.sound_play({name = "spellbook_action", gain = 0.75}, {pos = pos}) + math.randomseed(os.time()) + user:add_velocity({ + x = 0, + z = 0, + y = math.random(12, 22) + }) - local pos = user:get_pos() - minetest.sound_play({name = "spellbook_action", gain = 0.75}, {pos = pos}) - math.randomseed(os.time()) - user:add_velocity({ - x = 0, - z = 0, - y = math.random(12, 22) - }) + local stack = user:get_wielded_item() + stack:set_count(stack:get_count() - 1) - - local stack = user:get_wielded_item() - stack:set_count(stack:get_count() - 1) - - user:set_wielded_item(stack) - end + user:set_wielded_item(stack) + end }) -PyuTestCore.make_food("pyutest_core:apple", "Apple", "pyutest-apple.png", 5) -PyuTestCore.make_food("pyutest_core:bread", "Bread", "pyutest-bread.png", 3) -PyuTestCore.make_food("pyutest_core:water_bottle", "Water Bottle", "pyutest-water-bottle.png", 2) +PyuTestCore.make_food("pyutest_core:apple", "Apple", "pyutest-apple.png", 6) +PyuTestCore.make_food("pyutest_core:bread", "Bread", "pyutest-bread.png", 4) +PyuTestCore.make_food("pyutest_core:water_bottle", "Water Bottle", "pyutest-water-bottle.png", 0) diff --git a/mods/pyutest/pyutest_core/utils.lua b/mods/pyutest/pyutest_core/utils.lua index cb728f0..ee7c06f 100644 --- a/mods/pyutest/pyutest_core/utils.lua +++ b/mods/pyutest/pyutest_core/utils.lua @@ -45,24 +45,25 @@ PyuTestCore.create_explosion = function (pos, range, rm_pos, dmg, creator, dmg_c end PyuTestCore.dorange(pos, range, function(p) - if minetest.get_node(p).name == "pyutest_core:tnt" then - minetest.get_node_timer(p):start(0.2) - else - minetest.dig_node(p) - end + if minetest.get_node(p).name == "pyutest_core:tnt" then + minetest.remove_node(p) + PyuTestCore.create_explosion(p, range, rm_pos, dmg, creator, dmg_creator) + else + minetest.dig_node(p) + end end) for _, v in pairs(minetest.get_objects_inside_radius(pos, range)) do if creator ~= nil then if v ~= creator then v:punch(creator, nil, { - damage_groups = {fleshy = dmg} + damage_groups = {fleshy = dmg} }, nil) end if dmg_creator and v == creator then v:punch(creator, nil, { - damage_groups = {fleshy = dmg} + damage_groups = {fleshy = dmg} }, nil) end end @@ -73,22 +74,22 @@ PyuTestCore.create_explosion = function (pos, range, rm_pos, dmg, creator, dmg_c local maxpos = {x = pos.x + r, y = pos.y + r, z = pos.z + r} minetest.add_particlespawner({ - amount = range * 3, - time = 0.1, - minexptime = 0.4, - maxexptime = 1.4, - minsize = 32, - maxsize = 64, + amount = range * 3, + time = 0.1, + minexptime = 0.4, + maxexptime = 1.4, + minsize = 32, + maxsize = 64, - collisiondetection = false, - texture = "pyutest-blast.png", + collisiondetection = false, + texture = "pyutest-blast.png", - minpos = minpos, - maxpos = maxpos, + minpos = minpos, + maxpos = maxpos, }) minetest.sound_play("block_break", { - pos = pos, - gain = 2.5 + pos = pos, + gain = 2.5 }) end diff --git a/mods/pyutest/pyutest_core/wood.lua b/mods/pyutest/pyutest_core/wood.lua index 7c4bf3f..c706364 100644 --- a/mods/pyutest/pyutest_core/wood.lua +++ b/mods/pyutest/pyutest_core/wood.lua @@ -1,90 +1,104 @@ +PyuTestCore.registered_wood = {} PyuTestCore.make_wood = function (id, desc, ltiles, btiles) PyuTestCore.make_building_blocks(id.."_log", desc .. " Log", ltiles, nil, { - block = PyuTestCore.BLOCK_BREAKABLE_CHOPPY, - acid_vulnerable = 1, - flammable = 1, - fuel = 1 + block = PyuTestCore.BLOCK_BREAKABLE_CHOPPY, + acid_vulnerable = 1, + flammable = 1, }, { - is_ground_content = false + is_ground_content = false }) PyuTestCore.make_building_blocks(id.."_wood", desc .. " Wood", btiles, nil, { - block = PyuTestCore.BLOCK_BREAKABLE_CHOPPY, - acid_vulnerable = 1, - flammable = 1, - fuel = 1 + block = PyuTestCore.BLOCK_BREAKABLE_CHOPPY, + acid_vulnerable = 1, + flammable = 1, }, { - is_ground_content = false + is_ground_content = false }) local log_id = id.."_log_block" local wood_id = id.."_wood_block" minetest.override_item(log_id, { - groups = PyuTestCore.util.tableconcat(minetest.registered_nodes[log_id].groups, { - wooden_log = 1 - }), - paramtype2 = "facedir", - on_place = minetest.rotate_node + groups = PyuTestCore.util.tableconcat(minetest.registered_nodes[log_id].groups, { + wooden_log = 1, + fuel = 1 + }), + paramtype2 = "facedir", + on_place = minetest.rotate_node }) minetest.override_item(wood_id, { - groups = PyuTestCore.util.tableconcat(minetest.registered_nodes[wood_id].groups, { - wooden_planks = 1 - }) + groups = PyuTestCore.util.tableconcat(minetest.registered_nodes[wood_id].groups, { + wooden_planks = 1, + fuel = 1 + }) }) minetest.register_craft({ - output = id.."_wood_block 4", - recipe = {id.."_log_block"}, - type = "shapeless" + output = id.."_wood_block 4", + recipe = {id.."_log_block"}, + type = "shapeless" }) + + PyuTestCore.registered_wood[id] = { + log = log_id, + wood = wood_id + } end PyuTestCore.make_wood("pyutest_core:wooden", "Oak", { - "pyutest-log-top-bottom.png", - "pyutest-log-top-bottom.png", - "pyutest-log.png" + "pyutest-log-top-bottom.png", + "pyutest-log-top-bottom.png", + "pyutest-log.png" }, { - "pyutest-wood.png" + "pyutest-wood.png" }) PyuTestCore.make_wood("pyutest_core:savanna", "Savanna", { - "pyutest-savanna-log-top-bottom.png", - "pyutest-savanna-log-top-bottom.png", - "pyutest-savanna-log.png" + "pyutest-savanna-log-top-bottom.png", + "pyutest-savanna-log-top-bottom.png", + "pyutest-savanna-log.png" }, { - "pyutest-savanna-wood.png" + "pyutest-savanna-wood.png" }) PyuTestCore.make_wood("pyutest_core:birch", "Birch", { - "pyutest-birch-log-top-bottom.png", - "pyutest-birch-log-top-bottom.png", - "pyutest-birch-log.png" + "pyutest-birch-log-top-bottom.png", + "pyutest-birch-log-top-bottom.png", + "pyutest-birch-log.png" }, { - "pyutest-birch-wood.png" + "pyutest-birch-wood.png" }) PyuTestCore.make_wood("pyutest_core:cherry", "Cherry", { - "pyutest-cherry-log-top-bottom.png", - "pyutest-cherry-log-top-bottom.png", - "pyutest-cherry-log.png" + "pyutest-cherry-log-top-bottom.png", + "pyutest-cherry-log-top-bottom.png", + "pyutest-cherry-log.png" }, { - "pyutest-cherry-wood.png" + "pyutest-cherry-wood.png" }) PyuTestCore.make_wood("pyutest_core:redwood", "Redwood", { - "pyutest-redwood-log-top-bottom.png", - "pyutest-redwood-log-top-bottom.png", - "pyutest-redwood-log.png" + "pyutest-redwood-log-top-bottom.png", + "pyutest-redwood-log-top-bottom.png", + "pyutest-redwood-log.png" }, { - "pyutest-redwood.png" + "pyutest-redwood.png" }) PyuTestCore.make_wood("pyutest_core:jungle", "Jungle", { - "pyutest-jungle-log-top-bottom.png", - "pyutest-jungle-log-top-bottom.png", - "pyutest-jungle-log.png" + "pyutest-jungle-log-top-bottom.png", + "pyutest-jungle-log-top-bottom.png", + "pyutest-jungle-log.png" }, { - "pyutest-jungle-wood.png" + "pyutest-jungle-wood.png" +}) + +PyuTestCore.make_wood("pyutest_core:vyn", "Vyn", { + "pyutest-vyn-log-top-bottom.png", + "pyutest-vyn-log-top-bottom.png", + "pyutest-vyn-log.png" +}, { + "pyutest-vyn-wood.png" }) diff --git a/mods/pyutest/pyutest_core/wool.lua b/mods/pyutest/pyutest_core/wool.lua index 41efdac..c66467b 100644 --- a/mods/pyutest/pyutest_core/wool.lua +++ b/mods/pyutest/pyutest_core/wool.lua @@ -1,54 +1,61 @@ +PyuTestCore.registered_colored_blocks = {} PyuTestCore.make_colored_blocks = function(name, desc, color) PyuTestCore.make_building_blocks(name.."_wool", desc.." Wool", { - "pyutest-wool.png" + "pyutest-wool.png" }, color or "white", { - colored = 1 + colored = 1 }) PyuTestCore.make_building_blocks(name.."_terracotta", desc .. " Terracotta", { - "pyutest-terracotta.png" + "pyutest-terracotta.png" }, color or "white", { block = PyuTestCore.BLOCK_BREAKABLE_MIDDLE, colored = 1 }) PyuTestCore.make_item(name.."_dye", desc.." Dye", {}, "pyutest-dye.png", { - color = color or "white" + color = color or "white" }) minetest.register_craft({ - output = name.."_wool_block", - type = "shapeless", - recipe = { - "pyutest_core:white_wool_block", - name.."_dye" - } + output = name.."_wool_block", + type = "shapeless", + recipe = { + "pyutest_core:white_wool_block", + name.."_dye" + } }) minetest.register_craft({ - output = name.."_terracotta_block", - type = "shapeless", - recipe = { - "pyutest_core:white_terracotta_block", - name.."_dye" - } + output = name.."_terracotta_block", + type = "shapeless", + recipe = { + "pyutest_core:white_terracotta_block", + name.."_dye" + } }) + + PyuTestCore.registered_colored_blocks[name] = { + wool = name.."_wool", + terracotta = name.."_terracotta", + dye = name.."_dye" + } end PyuTestCore.make_colored_blocks("pyutest_core:white", "White", "white") minetest.register_craft({ - output = "pyutest_core:white_wool_block 4", - recipe = { - {"pyutest_core:string", "pyutest_core:string"}, - {"pyutest_core:string", "pyutest_core:string"} - } + output = "pyutest_core:white_wool_block 4", + recipe = { + {"pyutest_core:string", "pyutest_core:string"}, + {"pyutest_core:string", "pyutest_core:string"} + } }) minetest.register_craft({ - type = "cooking", - output = "pyutest_core:white_terracotta_block", - recipe = "pyutest_core:clay_block" + type = "cooking", + output = "pyutest_core:white_terracotta_block", + recipe = "pyutest_core:clay_block" }) local colors = { @@ -71,11 +78,11 @@ end PyuTestCore.make_dye_mixing_recipe = function(c1, c2, out) minetest.register_craft({ - type = "shapeless", - output = out .. " 2", - recipe = { - c1, c2 - } + type = "shapeless", + output = out .. " 2", + recipe = { + c1, c2 + } }) end diff --git a/mods/pyutest/pyutest_inventory/init.lua b/mods/pyutest/pyutest_inventory/init.lua index b63abdb..692e91e 100644 --- a/mods/pyutest/pyutest_inventory/init.lua +++ b/mods/pyutest/pyutest_inventory/init.lua @@ -14,58 +14,58 @@ for k, v in pairs(unified_inventory.registered_categories) do end unified_inventory.register_category("pyutest_inventory:blocks", { - symbol = "pyutest_core:stone_block", - label = "Blocks", - index = 3, - items = get_items_from_group("block") + symbol = "pyutest_core:stone_block", + label = "Blocks", + index = 3, + items = get_items_from_group("block") }) unified_inventory.register_category("pyutest_inventory:tools", { - symbol = "pyutest_core:iron_pickaxe", - label = "Tools", - index = 4, - items = get_items_from_group("tool") + symbol = "pyutest_core:iron_pickaxe", + label = "Tools", + index = 4, + items = get_items_from_group("tool") }) unified_inventory.register_category("pyutest_inventory:furniture", { - symbol = "pyutest_core:wooden_wood_chair", - label = "Furniture", - index = 5, - items = get_items_from_group("furniture") + symbol = "pyutest_core:wooden_wood_chair", + label = "Furniture", + index = 5, + items = get_items_from_group("furniture") }) unified_inventory.register_category("pyutest_inventory:minerals", { - symbol = "pyutest_core:diamond_ore", - label = "Minerals", - index = 6, - items = get_items_from_group("mineral") + symbol = "pyutest_core:diamond_ore", + label = "Minerals", + index = 6, + items = get_items_from_group("mineral") }) unified_inventory.register_category("pyutest_inventory:colored", { - symbol = "pyutest_core:yellow_wool_block", - label = "Colored Blocks", - index = 7, - items = get_items_from_group("colored") + symbol = "pyutest_core:yellow_wool_block", + label = "Colored Blocks", + index = 7, + items = get_items_from_group("colored") }) unified_inventory.register_category("pyutest_inventory:flowers", { - symbol = "pyutest_core:rose", - label = "Flora", - index = 8, - items = get_items_from_group("flower") + symbol = "pyutest_core:rose", + label = "Flora", + index = 8, + items = get_items_from_group("flower") }) unified_inventory.register_category("pyutest_inventory:fuel", { - symbol = "pyutest_core:coal_lump", - label = "Fuel", - index = 9, - items = get_items_from_group("fuel") + symbol = "pyutest_core:coal_lump", + label = "Fuel", + index = 9, + items = get_items_from_group("fuel") }) unified_inventory.register_category("pyutest_inventory:solid_nodes", { - symbol = "pyutest_core:stone_block", - label = "Solid Nodes", - index = 10, - items = get_items_from_group("solid") + symbol = "pyutest_core:stone_block", + label = "Solid Nodes", + index = 10, + items = get_items_from_group("solid") }) diff --git a/mods/pyutest/pyutest_mapgen/api.lua b/mods/pyutest/pyutest_mapgen/api.lua index 1b78a43..6d0f402 100644 --- a/mods/pyutest/pyutest_mapgen/api.lua +++ b/mods/pyutest/pyutest_mapgen/api.lua @@ -3,46 +3,46 @@ PyuTestMapgen = {} PyuTestMapgen.register_structure = function (name, schematic, def) local id = "pyutest_mapgen:structure_block_"..name minetest.register_node(id, { - description = string.format("Structure Block (%s)", name), - groups = { - not_in_creative_inventory = 1 - }, - tiles = { - "pyutest-stick.png" - }, - walkable = false, - pointable = false, + description = string.format("Structure Block (%s)", name), + groups = { + not_in_creative_inventory = 1 + }, + tiles = { + "pyutest-stick.png" + }, + walkable = false, + pointable = false, }) minetest.register_decoration({ - sidelen = 80, - decoration = id, - deco_type = "simple", - place_on = def.place_on, - spawn_by = def.spawn_by, - num_spawn_by = def.num_spawn_by, - fill_ratio = def.fill_ratio, - noise_params = def.noise_params, - flags = def.flags or "place_center_x, place_center_y, force_placement", - biomes = def.biomes, - y_max = def.y_max, - y_min = def.y_min + sidelen = 80, + decoration = id, + deco_type = "simple", + place_on = def.place_on, + spawn_by = def.spawn_by, + num_spawn_by = def.num_spawn_by, + fill_ratio = def.fill_ratio, + noise_params = def.noise_params, + flags = def.flags or "place_center_x, place_center_y, force_placement", + biomes = def.biomes, + y_max = def.y_max, + y_min = def.y_min }) minetest.register_lbm({ - name = "pyutest_mapgen:spawn_"..name, - run_at_every_load = true, - nodenames = {id}, - action = function (pos, node) - minetest.remove_node(pos) - minetest.place_schematic( - pos, - PyuTestCore.get_schem_path(schematic), - def.rotation or "random", - def.replacements or {}, - def.force_placement or true, - def.flags or "place_center_x, place_center_z" - ) - end + name = "pyutest_mapgen:spawn_"..name, + run_at_every_load = true, + nodenames = {id}, + action = function (pos, node) + minetest.remove_node(pos) + minetest.place_schematic( + pos, + PyuTestCore.get_schem_path(schematic), + def.rotation or "random", + def.replacements or {}, + def.force_placement or true, + def.flags or "place_center_x, place_center_z" + ) + end }) end diff --git a/mods/pyutest/pyutest_mapgen/mapgen.lua b/mods/pyutest/pyutest_mapgen/mapgen.lua index e41f30e..c13688c 100644 --- a/mods/pyutest/pyutest_mapgen/mapgen.lua +++ b/mods/pyutest/pyutest_mapgen/mapgen.lua @@ -96,342 +96,342 @@ PyuTestCore.register_biome = function(name, type, opts) nopts["node_riverbed"] = nopts["node_riverbed"] or "pyutest_core:gravel_block" minetest.register_biome(PyuTestCore.util.tableconcat(nopts, { - _pyutest_biome_type = type, + _pyutest_biome_type = type, })) minetest.register_biome(PyuTestCore.util.tableconcat({ - name = name.."_ocean", - node_top = nopts["node_riverbed"], - depth_top = 2, - node_filler = nopts["node_riverbed"], - depth_filler = 3, - depth_riverbed = 2, + name = name.."_ocean", + node_top = nopts["node_riverbed"], + depth_top = 2, + node_filler = nopts["node_riverbed"], + depth_filler = 3, + depth_riverbed = 2, - node_water = nopts["node_water"], - node_river_water = nopts["node_river_water"], + node_water = nopts["node_water"], + node_river_water = nopts["node_river_water"], - heat_point = nopts["heat_point"], - humidity_point = nopts["humidity_point"], + heat_point = nopts["heat_point"], + humidity_point = nopts["humidity_point"], - y_max = 0, - y_min = PyuTestCore_OceanMin + y_max = 0, + y_min = PyuTestCore_OceanMin }, { - _pyutest_biome_type = PyuTestCore.BIOME_TYPES.OCEAN, - _pyutest_ocean_type = type + _pyutest_biome_type = PyuTestCore.BIOME_TYPES.OCEAN, + _pyutest_ocean_type = type })) minetest.register_biome(PyuTestCore.util.tableconcat({ - name = name.."_deep_ocean", + name = name.."_deep_ocean", - node_top = nopts["node_riverbed"], - depth_top = 2, - node_filler = nopts["node_riverbed"], - depth_filler = 3, - depth_riverbed = 2, + node_top = nopts["node_riverbed"], + depth_top = 2, + node_filler = nopts["node_riverbed"], + depth_filler = 3, + depth_riverbed = 2, - node_water = nopts["node_water"], - node_river_water = nopts["node_river_water"], + node_water = nopts["node_water"], + node_river_water = nopts["node_river_water"], - heat_point = nopts["heat_point"], - humidity_point = nopts["humidity_point"], + heat_point = nopts["heat_point"], + humidity_point = nopts["humidity_point"], - y_max = PyuTestCore_DeepOceanMax, - y_min = PyuTestCore_DeepOceanMin, + y_max = PyuTestCore_DeepOceanMax, + y_min = PyuTestCore_DeepOceanMin, - vertical_blend = 5 + vertical_blend = 5 }, { - _pyutest_biome_type = PyuTestCore.BIOME_TYPES.OCEAN, - _pyutest_ocean_type = type + _pyutest_biome_type = PyuTestCore.BIOME_TYPES.OCEAN, + _pyutest_ocean_type = type })) minetest.register_biome(PyuTestCore.util.tableconcat({ - name = name.."_cave", - heat_point = nopts["heat_point"], - humidity_point = nopts["humidity_point"], - y_max = PyuTestCore_DeepOceanMin - 1, - y_min = PyuTestCore_WorldBottom + name = name.."_cave", + heat_point = nopts["heat_point"], + humidity_point = nopts["humidity_point"], + y_max = PyuTestCore_DeepOceanMin - 1, + y_min = PyuTestCore_WorldBottom }, { - _pyutest_biome_type = PyuTestCore.BIOME_TYPES.CAVE, - _pyutest_cave_type = type + _pyutest_biome_type = PyuTestCore.BIOME_TYPES.CAVE, + _pyutest_cave_type = type })) end PyuTestCore.register_biome("grassland", PyuTestCore.BIOME_TYPES.NORMAL, { - node_top = "pyutest_core:grass_block", - node_filler = "pyutest_core:dirt_block", + node_top = "pyutest_core:grass_block", + node_filler = "pyutest_core:dirt_block", - y_max = PyuTestCore_BiomeTops.grassland, - y_min = PyuTestCore_SurfaceBottom, + y_max = PyuTestCore_BiomeTops.grassland, + y_min = PyuTestCore_SurfaceBottom, - heat_point = 53, - humidity_point = 50, + heat_point = 53, + humidity_point = 50, - _pyutest_biome_flowering = true + _pyutest_biome_flowering = true }) PyuTestCore.register_biome("forest", PyuTestCore.BIOME_TYPES.NORMAL, { - node_top = "pyutest_core:dark_grass_block", - node_filler = "pyutest_core:dirt_block", + node_top = "pyutest_core:dark_grass_block", + node_filler = "pyutest_core:dirt_block", - y_max = PyuTestCore_BiomeTops.forest, - y_min = PyuTestCore_SurfaceBottom, + y_max = PyuTestCore_BiomeTops.forest, + y_min = PyuTestCore_SurfaceBottom, - heat_point = 50, - humidity_point = 65, - _pyutest_biome_flowering = true + heat_point = 50, + humidity_point = 65, + _pyutest_biome_flowering = true }) PyuTestCore.register_biome("stony_mountains", PyuTestCore.BIOME_TYPES.CHILLY, { - node_top = "pyutest_core:stone_block", - node_filler = "pyutest_core:stone_block", + node_top = "pyutest_core:stone_block", + node_filler = "pyutest_core:stone_block", - y_max = PyuTestCore_BiomeTops.mountains, - y_min = PyuTestCore_BiomeTops.grassland, + y_max = PyuTestCore_BiomeTops.mountains, + y_min = PyuTestCore_BiomeTops.grassland, - heat_point = 45, - humidity_point = 34 + heat_point = 45, + humidity_point = 34 }) PyuTestCore.register_biome("desert", PyuTestCore.BIOME_TYPES.DESERT, { - node_top = "pyutest_core:sand_block", - node_filler = "pyutest_core:sandstone_block", - node_riverbed = "pyutest_core:sand_block", + node_top = "pyutest_core:sand_block", + node_filler = "pyutest_core:sandstone_block", + node_riverbed = "pyutest_core:sand_block", - y_max = PyuTestCore_BiomeTops.desert, - y_min = PyuTestCore_SurfaceBottom, + y_max = PyuTestCore_BiomeTops.desert, + y_min = PyuTestCore_SurfaceBottom, - heat_point = 84, - humidity_point = 4 + heat_point = 84, + humidity_point = 4 }) PyuTestCore.register_biome("desert_mountains", PyuTestCore.BIOME_TYPES.DESERT, { - node_top = "pyutest_core:sand_block", - node_filler = "pyutest_core:sandstone_block", + node_top = "pyutest_core:sand_block", + node_filler = "pyutest_core:sandstone_block", - y_max = PyuTestCore_BiomeTops.mountains, - y_min = PyuTestCore_BiomeTops.desert, + y_max = PyuTestCore_BiomeTops.mountains, + y_min = PyuTestCore_BiomeTops.desert, - heat_point = 83, - humidity_point = 6 + heat_point = 83, + humidity_point = 6 }) PyuTestCore.register_biome("snowy_mountains", PyuTestCore.BIOME_TYPES.COLD, { - node_top = "pyutest_core:snow_block", - node_filler = "pyutest_core:snow_block", + node_top = "pyutest_core:snow_block", + node_filler = "pyutest_core:snow_block", - y_max = PyuTestCore_BiomeTops.mountains, - y_min = PyuTestCore_BiomeTops.frozen_plains, + y_max = PyuTestCore_BiomeTops.mountains, + y_min = PyuTestCore_BiomeTops.frozen_plains, - heat_point = 6, - humidity_point = 45 + heat_point = 6, + humidity_point = 45 }) PyuTestCore.register_biome("frozen_plains", PyuTestCore.BIOME_TYPES.COLD, { - node_dust = "pyutest_core:snow_carpet", + node_dust = "pyutest_core:snow_carpet", - node_top = "pyutest_core:snow_block", - node_filler = "pyutest_core:snow_block", + node_top = "pyutest_core:snow_block", + node_filler = "pyutest_core:snow_block", - y_max = PyuTestCore_BiomeTops.frozen_plains, - y_min = PyuTestCore_SurfaceBottom, + y_max = PyuTestCore_BiomeTops.frozen_plains, + y_min = PyuTestCore_SurfaceBottom, - node_water_top = "pyutest_core:ice_block", - depth_water_top = 5, + node_water_top = "pyutest_core:ice_block", + depth_water_top = 5, - heat_point = 9, - humidity_point = 40 + heat_point = 9, + humidity_point = 40 }) PyuTestCore.register_biome("mushroom_fields", PyuTestCore.BIOME_TYPES.NORMAL, { - node_top = "pyutest_core:mycelium_block", - node_filler = "pyutest_core:dirt_block", + node_top = "pyutest_core:mycelium_block", + node_filler = "pyutest_core:dirt_block", - y_max = PyuTestCore_BiomeTops.mushroom_fields, - y_min = PyuTestCore_SurfaceBottom, + y_max = PyuTestCore_BiomeTops.mushroom_fields, + y_min = PyuTestCore_SurfaceBottom, - heat_point = 42, - humidity_point = 94 + heat_point = 42, + humidity_point = 94 }) PyuTestCore.register_biome("ice_spikes", PyuTestCore.BIOME_TYPES.COLD, { - node_top = "pyutest_core:ice_block", - node_filler = "pyutest_core:ice_block", + node_top = "pyutest_core:ice_block", + node_filler = "pyutest_core:ice_block", - y_max = PyuTestCore_BiomeTops.ice_spikes, - y_min = PyuTestCore_SurfaceBottom, + y_max = PyuTestCore_BiomeTops.ice_spikes, + y_min = PyuTestCore_SurfaceBottom, - node_water_top = "pyutest_core:ice_block", - depth_water_top = 5, + node_water_top = "pyutest_core:ice_block", + depth_water_top = 5, - heat_point = 9, - humidity_point = 47 + heat_point = 9, + humidity_point = 47 }) PyuTestCore.register_biome("meadow", PyuTestCore.BIOME_TYPES.NORMAL, { - node_top = "pyutest_core:dark_grass_block", - node_filler = "pyutest_core:dirt_block", - depth_filler = 4, + node_top = "pyutest_core:dark_grass_block", + node_filler = "pyutest_core:dirt_block", + depth_filler = 4, - y_max = PyuTestCore_BiomeTops.mountains, - y_min = PyuTestCore_SurfaceBottom, + y_max = PyuTestCore_BiomeTops.mountains, + y_min = PyuTestCore_SurfaceBottom, - heat_point = 52, - humidity_point = 83, + heat_point = 52, + humidity_point = 83, - _pyutest_biome_flowering = true, - _pyutest_biome_flowering_extra = true + _pyutest_biome_flowering = true, + _pyutest_biome_flowering_extra = true }) PyuTestCore.register_biome("old_growth_forest", PyuTestCore.BIOME_TYPES.NORMAL, { - node_top = "pyutest_core:dark_grass_block", - node_filler = "pyutest_core:dirt_block", + node_top = "pyutest_core:dark_grass_block", + node_filler = "pyutest_core:dirt_block", - y_max = PyuTestCore_BiomeTops.forest, - y_min = PyuTestCore_SurfaceBottom, + y_max = PyuTestCore_BiomeTops.forest, + y_min = PyuTestCore_SurfaceBottom, - heat_point = 45, - humidity_point = 92, + heat_point = 45, + humidity_point = 92, - _pyutest_biome_flowering = true + _pyutest_biome_flowering = true }) PyuTestCore.register_biome("snowy_forest", PyuTestCore.BIOME_TYPES.COLD, { - node_top = "pyutest_core:snow_block", - node_filler = "pyutest_core:dirt_block", + node_top = "pyutest_core:snow_block", + node_filler = "pyutest_core:dirt_block", - y_max = PyuTestCore_BiomeTops.forest, - y_min = PyuTestCore_SurfaceBottom, + y_max = PyuTestCore_BiomeTops.forest, + y_min = PyuTestCore_SurfaceBottom, - node_water_top = "pyutest_core:ice_block", - depth_water_top = 5, + node_water_top = "pyutest_core:ice_block", + depth_water_top = 5, - heat_point = 8, - humidity_point = 43 + heat_point = 8, + humidity_point = 43 }) PyuTestCore.register_biome("savanna", PyuTestCore.BIOME_TYPES.WARM, { - node_top = "pyutest_core:savanna_grass_block", - node_filler = "pyutest_core:dirt_block", + node_top = "pyutest_core:savanna_grass_block", + node_filler = "pyutest_core:dirt_block", - y_max = PyuTestCore_BiomeTops.grassland, - y_min = PyuTestCore_SurfaceBottom, + y_max = PyuTestCore_BiomeTops.grassland, + y_min = PyuTestCore_SurfaceBottom, - heat_point = 72, - humidity_point = 9 + heat_point = 72, + humidity_point = 9 }) PyuTestCore.register_biome("taiga", PyuTestCore.BIOME_TYPES.CHILLY, { - node_top = "pyutest_core:dark_grass_block", - node_filler = "pyutest_core:dirt_block", + node_top = "pyutest_core:dark_grass_block", + node_filler = "pyutest_core:dirt_block", - y_max = PyuTestCore_BiomeTops.forest, - y_min = PyuTestCore_SurfaceBottom, + y_max = PyuTestCore_BiomeTops.forest, + y_min = PyuTestCore_SurfaceBottom, - heat_point = 28, - humidity_point = 53, + heat_point = 28, + humidity_point = 53, - _pyutest_biome_flowering = true + _pyutest_biome_flowering = true }) PyuTestCore.register_biome("birch_forest", PyuTestCore.BIOME_TYPES.NORMAL, { - node_top = "pyutest_core:grass_block", - node_filler = "pyutest_core:dirt_block", + node_top = "pyutest_core:grass_block", + node_filler = "pyutest_core:dirt_block", - y_max = PyuTestCore_BiomeTops.forest, - y_min = PyuTestCore_SurfaceBottom, + y_max = PyuTestCore_BiomeTops.forest, + y_min = PyuTestCore_SurfaceBottom, - heat_point = 48, - humidity_point = 85, + heat_point = 48, + humidity_point = 85, - _pyutest_biome_flowering = true + _pyutest_biome_flowering = true }) PyuTestCore.register_biome("cherry_grove", PyuTestCore.BIOME_TYPES.NORMAL, { - node_top = "pyutest_core:grass_block", - node_filler = "pyutest_core:dirt_block", + node_top = "pyutest_core:grass_block", + node_filler = "pyutest_core:dirt_block", - y_max = PyuTestCore_BiomeTops.forest, - y_min = PyuTestCore_SurfaceBottom, + y_max = PyuTestCore_BiomeTops.forest, + y_min = PyuTestCore_SurfaceBottom, - heat_point = 52, - humidity_point = 78, + heat_point = 52, + humidity_point = 78, - _pyutest_biome_flowering = true, - _pyutest_biome_flowering_extra = true + _pyutest_biome_flowering = true, + _pyutest_biome_flowering_extra = true }) PyuTestCore.register_biome("swamp", PyuTestCore.BIOME_TYPES.WETLAND, { - node_top = "pyutest_core:swampy_grass_block", - node_filler = "pyutest_core:dirt_block", + node_top = "pyutest_core:swampy_grass_block", + node_filler = "pyutest_core:dirt_block", - y_max = PyuTestCore_BiomeTops.swamp, - y_min = PyuTestCore_SurfaceBottom, + y_max = PyuTestCore_BiomeTops.swamp, + y_min = PyuTestCore_SurfaceBottom, - heat_point = 30, - humidity_point = 88, + heat_point = 30, + humidity_point = 88, }) PyuTestCore.register_biome("old_growth_birch_forest", PyuTestCore.BIOME_TYPES.NORMAL, { - node_top = "pyutest_core:grass_block", - node_filler = "pyutest_core:dirt_block", + node_top = "pyutest_core:grass_block", + node_filler = "pyutest_core:dirt_block", - y_max = PyuTestCore_BiomeTops.forest, - y_min = PyuTestCore_SurfaceBottom, + y_max = PyuTestCore_BiomeTops.forest, + y_min = PyuTestCore_SurfaceBottom, - heat_point = 47, - humidity_point = 80, + heat_point = 47, + humidity_point = 80, - _pyutest_biome_flowering = true, - _pyutest_biome_flowering_extra = true + _pyutest_biome_flowering = true, + _pyutest_biome_flowering_extra = true }) PyuTestCore.register_biome("aspen_forest", PyuTestCore.BIOME_TYPES.CHILLY, { - node_top = "pyutest_core:aspen_grass_block", - node_filler = "pyutest_core:dirt_block", + node_top = "pyutest_core:aspen_grass_block", + node_filler = "pyutest_core:dirt_block", - y_max = PyuTestCore_BiomeTops.forest, - y_min = PyuTestCore_SurfaceBottom, + y_max = PyuTestCore_BiomeTops.forest, + y_min = PyuTestCore_SurfaceBottom, - heat_point = 25, - humidity_point = 52, + heat_point = 25, + humidity_point = 52, - _pyutest_biome_flowering = true + _pyutest_biome_flowering = true }) PyuTestCore.register_biome("redwood_forest", PyuTestCore.BIOME_TYPES.CHILLY, { - node_top = "pyutest_core:podzol_block", - node_filler = "pyutest_core:podzol_block", + node_top = "pyutest_core:podzol_block", + node_filler = "pyutest_core:podzol_block", - y_max = PyuTestCore_BiomeTops.forest, - y_min = PyuTestCore_SurfaceBottom, + y_max = PyuTestCore_BiomeTops.forest, + y_min = PyuTestCore_SurfaceBottom, - heat_point = 28, - humidity_point = 54, + heat_point = 28, + humidity_point = 54, - _pyutest_biome_flowering = true + _pyutest_biome_flowering = true }) PyuTestCore.register_biome("jungle", PyuTestCore.BIOME_TYPES.WARM, { - node_top = "pyutest_core:jungle_grass_block", - node_filler = "pyutest_core:dirt_block", + node_top = "pyutest_core:jungle_grass_block", + node_filler = "pyutest_core:dirt_block", - y_max = PyuTestCore_BiomeTops.forest, - y_min = PyuTestCore_SurfaceBottom, + y_max = PyuTestCore_BiomeTops.forest, + y_min = PyuTestCore_SurfaceBottom, - heat_point = 48, - humidity_point = 97, + heat_point = 48, + humidity_point = 97, - _pyutest_biome_flowering = true, - _pyutest_biome_flowering_extra = true + _pyutest_biome_flowering = true, + _pyutest_biome_flowering_extra = true }) PyuTestCore.register_biome("large_mushroom_forest", PyuTestCore.BIOME_TYPES.NORMAL, { - node_top = "pyutest_core:mycelium_block", - node_filler = "pyutest_core:dirt_block", + node_top = "pyutest_core:mycelium_block", + node_filler = "pyutest_core:dirt_block", - y_max = PyuTestCore_BiomeTops.mushroom_fields, - y_min = PyuTestCore_SurfaceBottom, + y_max = PyuTestCore_BiomeTops.mushroom_fields, + y_min = PyuTestCore_SurfaceBottom, - heat_point = 43, - humidity_point = 98 + heat_point = 43, + humidity_point = 98 }) diff --git a/mods/pyutest/pyutest_mapgen/structures.lua b/mods/pyutest/pyutest_mapgen/structures.lua index 2dd2941..a3f0fd1 100644 --- a/mods/pyutest/pyutest_mapgen/structures.lua +++ b/mods/pyutest/pyutest_mapgen/structures.lua @@ -1,88 +1,88 @@ minetest.register_decoration({ - deco_type = "simple", - sidelen = 16, - fill_ratio = 0.0003, - place_on = {"group:ground"}, - y_max = PyuTestCore_BiomeTops.mountains, - y_min = PyuTestCore_SurfaceBottom, - decoration = { - "pyutest_core:trash_lootbox", - "pyutest_core:resource_lootbox", - "pyutest_core:griefer_lootbox", - "pyutest_core:liquid_sources_lootbox", - "pyutest_core:lighting_lootbox", - } + deco_type = "simple", + sidelen = 16, + fill_ratio = 0.0003, + place_on = {"group:ground"}, + y_max = PyuTestCore_BiomeTops.mountains, + y_min = PyuTestCore_SurfaceBottom, + decoration = { + "pyutest_core:trash_lootbox", + "pyutest_core:resource_lootbox", + "pyutest_core:griefer_lootbox", + "pyutest_core:liquid_sources_lootbox", + "pyutest_core:lighting_lootbox", + } }) PyuTestMapgen.register_structure("igloo", "Igloo", { - place_on = {"pyutest_core:snow_block"}, - fill_ratio = 0.00004, - biomes = {"frozen_plains"}, - y_max = PyuTestCore_BiomeTops.frozen_plains, - y_min = 1, - rotation = "random", - flags = "place_center_x, place_center_z", - place_offset_y = 1 + place_on = {"pyutest_core:snow_block"}, + fill_ratio = 0.00004, + biomes = {"frozen_plains"}, + y_max = PyuTestCore_BiomeTops.frozen_plains, + y_min = 1, + rotation = "random", + flags = "place_center_x, place_center_z", + place_offset_y = 1 }) PyuTestMapgen.register_structure("desertwell", "DesertWell", { - place_on = {"pyutest_core:sand_block"}, - fill_ratio = 0.00006, - biomes = {"desert"}, - y_max = PyuTestCore_BiomeTops.desert, - y_min = 1, - rotation = "random" + place_on = {"pyutest_core:sand_block"}, + fill_ratio = 0.00006, + biomes = {"desert"}, + y_max = PyuTestCore_BiomeTops.desert, + y_min = 1, + rotation = "random" }) PyuTestMapgen.register_structure("ice_spike", "IceSpike", { - fill_ratio = 0.0008, - place_on = { - "pyutest_core:ice_block", - "pyutest_core:stone_block" - }, - biomes = { - "ice_spikes", - "ice_spikes_ocean", - "ice_spikes_cave" - }, - y_max = PyuTestCore_BiomeTops.ice_spikes, - y_min = PyuTestCore_WorldBottom, - -- place_offset_y = -1, - spawn_by = {"air"}, - num_spawn_by = 2 + fill_ratio = 0.0008, + place_on = { + "pyutest_core:ice_block", + "pyutest_core:stone_block" + }, + biomes = { + "ice_spikes", + "ice_spikes_ocean", + "ice_spikes_cave" + }, + y_max = PyuTestCore_BiomeTops.ice_spikes, + y_min = PyuTestCore_WorldBottom, + -- place_offset_y = -1, + spawn_by = {"air"}, + num_spawn_by = 2 }) PyuTestMapgen.register_structure("obsidian_mound", "ObsidianMound", { - fill_ratio = 0.0001, - place_on = {"pyutest_core:mycelium_block"}, - biomes = { - "mushroom_fields" - }, - y_max = PyuTestCore_BiomeTops.mushroom_fields, - y_min = PyuTestCore_SurfaceBottom, + fill_ratio = 0.0001, + place_on = {"pyutest_core:mycelium_block"}, + biomes = { + "mushroom_fields" + }, + y_max = PyuTestCore_BiomeTops.mushroom_fields, + y_min = PyuTestCore_SurfaceBottom, }) PyuTestMapgen.register_structure("ocean_ruins", "OceanRuins", { - fill_ratio = 0.0002, - place_on = {"pyutest_core:gravel_block"}, - biomes = PyuTestCore.get_biomes_from_type(PyuTestCore.BIOME_TYPES.OCEAN), - y_max = PyuTestCore_DeepOceanMax + 4, - y_min = PyuTestCore_DeepOceanMin, - spawn_by = {"pyutest_core:water_source"}, - num_spawn_by = 2 + fill_ratio = 0.0002, + place_on = {"pyutest_core:gravel_block"}, + biomes = PyuTestCore.get_biomes_from_type(PyuTestCore.BIOME_TYPES.OCEAN), + y_max = PyuTestCore_DeepOceanMax + 4, + y_min = PyuTestCore_DeepOceanMin, + spawn_by = {"pyutest_core:water_source"}, + num_spawn_by = 2 }) PyuTestMapgen.register_structure("snowman_tower", "SnowmanTower", { - fill_ratio = 0.00002, - place_on = { - "pyutest_core:ice_block", - "pyutest_core:snow_block" - }, - biomes = { - "frozen_plains", - "ice_spikes", - "snowy_forest" - }, - y_max = PyuTestCore_BiomeTops.forest, - y_min = PyuTestCore_WorldBottom, + fill_ratio = 0.00002, + place_on = { + "pyutest_core:ice_block", + "pyutest_core:snow_block" + }, + biomes = { + "frozen_plains", + "ice_spikes", + "snowy_forest" + }, + y_max = PyuTestCore_BiomeTops.forest, + y_min = PyuTestCore_WorldBottom, }) diff --git a/mods/pyutest/pyutest_mapgen/trees.lua b/mods/pyutest/pyutest_mapgen/trees.lua index d88b75d..b81926a 100644 --- a/mods/pyutest/pyutest_mapgen/trees.lua +++ b/mods/pyutest/pyutest_mapgen/trees.lua @@ -1,423 +1,423 @@ -- plants and other small decorations minetest.register_decoration({ - deco_type = "simple", - place_on = {"group:grass"}, - sidelen = 16, - fill_ratio = 0.009, - biomes = PyuTestCore.get_flowering_biomes(), - y_max = PyuTestCore_WorldTop, - y_min = 1, - decoration = PyuTestCore.registered_flowers + deco_type = "simple", + place_on = {"group:grass"}, + sidelen = 16, + fill_ratio = 0.009, + biomes = PyuTestCore.get_flowering_biomes(), + y_max = PyuTestCore_WorldTop, + y_min = 1, + decoration = PyuTestCore.registered_flowers }) minetest.register_decoration({ - deco_type = "simple", - place_on = {"group:grass"}, - sidelen = 16, - fill_ratio = 0.032, - biomes = PyuTestCore.get_extra_flowering_biomes(), - y_max = PyuTestCore_WorldTop, - y_min = 1, - decoration = PyuTestCore.registered_flowers + deco_type = "simple", + place_on = {"group:grass"}, + sidelen = 16, + fill_ratio = 0.032, + biomes = PyuTestCore.get_extra_flowering_biomes(), + y_max = PyuTestCore_WorldTop, + y_min = 1, + decoration = PyuTestCore.registered_flowers }) minetest.register_decoration({ - deco_type = "simple", - place_on = {"group:grass"}, - sidelen = 16, - fill_ratio = 0.048, - biomes = {"grassland"}, - y_max = PyuTestCore_WorldTop, - y_min = 1, - decoration = "pyutest_core:grass_plant" + deco_type = "simple", + place_on = {"group:grass"}, + sidelen = 16, + fill_ratio = 0.048, + biomes = {"grassland"}, + y_max = PyuTestCore_WorldTop, + y_min = 1, + decoration = "pyutest_core:grass_plant" }) minetest.register_decoration({ - deco_type = "simple", - place_on = {"group:grass"}, - sidelen = 16, - fill_ratio = 0.0018, - biomes = {"grassland"}, - y_max = PyuTestCore_WorldTop, - y_min = 1, - decoration = "pyutest_core:haybale_block" + deco_type = "simple", + place_on = {"group:grass"}, + sidelen = 16, + fill_ratio = 0.0018, + biomes = {"grassland"}, + y_max = PyuTestCore_WorldTop, + y_min = 1, + decoration = "pyutest_core:haybale_block" }) minetest.register_decoration({ - deco_type = "simple", - place_on = {"pyutest_core:dirt_block", "pyutest_core:sand_block"}, - sidelen = 16, - fill_ratio = 0.019, - biomes = {"desert"}, - y_max = PyuTestCore_WorldTop, - y_min = 1, - decoration = "pyutest_core:deadbush" + deco_type = "simple", + place_on = {"pyutest_core:dirt_block", "pyutest_core:sand_block"}, + sidelen = 16, + fill_ratio = 0.019, + biomes = {"desert"}, + y_max = PyuTestCore_WorldTop, + y_min = 1, + decoration = "pyutest_core:deadbush" }) minetest.register_decoration({ - deco_type = "simple", - sidelen = 16, - fill_ratio = 0.03, - place_on = {"pyutest_core:water_source"}, - biomes = {"swamp", "swamp_ocean"}, - y_max = PyuTestCore_WorldTop, - y_min = 0, - decoration = "pyutest_core:lilypad", - flags = "liquid_surface" + deco_type = "simple", + sidelen = 16, + fill_ratio = 0.03, + place_on = {"pyutest_core:water_source"}, + biomes = {"swamp", "swamp_ocean"}, + y_max = PyuTestCore_WorldTop, + y_min = 0, + decoration = "pyutest_core:lilypad", + flags = "liquid_surface" }) minetest.register_decoration({ - deco_type = "simple", - sidelen = 16, - fill_ratio = 0.04, - place_on = {"group:sugarcane_spawn_on"}, - decoration = "pyutest_core:sugarcane", - y_max = PyuTestCore_SurfaceBottom, - y_min = 0, - spawn_by = {"pyutest_core:water_source"}, - num_spawn_by = 1, - height = 1, - height_max = 4 + deco_type = "simple", + sidelen = 16, + fill_ratio = 0.04, + place_on = {"group:sugarcane_spawn_on"}, + decoration = "pyutest_core:sugarcane", + y_max = PyuTestCore_SurfaceBottom, + y_min = 0, + spawn_by = {"pyutest_core:water_source"}, + num_spawn_by = 1, + height = 1, + height_max = 4 }) -- trees minetest.register_decoration({ - deco_type = "schematic", - place_on = {"group:grass"}, - sidelen = 16, - fill_ratio = 0.004, - biomes = {"forest", "old_growth_forest"}, - y_max = PyuTestCore_WorldTop, - y_min = 1, - schematic = PyuTestCore.get_schem_path("Tree"), - rotation = "random", - flags = "place_center_x, place_center_z", + deco_type = "schematic", + place_on = {"group:grass"}, + sidelen = 16, + fill_ratio = 0.004, + biomes = {"forest", "old_growth_forest"}, + y_max = PyuTestCore_WorldTop, + y_min = 1, + schematic = PyuTestCore.get_schem_path("Tree"), + rotation = "random", + flags = "place_center_x, place_center_z", }) minetest.register_decoration({ - deco_type = "schematic", - place_on = {"group:grass"}, - sidelen = 16, - fill_ratio = 0.00045, - biomes = {"grassland"}, - y_max = PyuTestCore_WorldTop, - y_min = 1, - schematic = PyuTestCore.get_schem_path("Tree"), - rotation = "random", - flags = "place_center_x, place_center_z", + deco_type = "schematic", + place_on = {"group:grass"}, + sidelen = 16, + fill_ratio = 0.00045, + biomes = {"grassland"}, + y_max = PyuTestCore_WorldTop, + y_min = 1, + schematic = PyuTestCore.get_schem_path("Tree"), + rotation = "random", + flags = "place_center_x, place_center_z", }) minetest.register_decoration({ - deco_type = "schematic", - place_on = {"group:grass"}, - sidelen = 16, - fill_ratio = 0.004, - biomes = {"forest", "old_growth_forest"}, - y_max = PyuTestCore_WorldTop, - y_min = 1, - schematic = PyuTestCore.get_schem_path("Tree2"), - rotation = "random", - flags = "place_center_x, place_center_z", + deco_type = "schematic", + place_on = {"group:grass"}, + sidelen = 16, + fill_ratio = 0.004, + biomes = {"forest", "old_growth_forest"}, + y_max = PyuTestCore_WorldTop, + y_min = 1, + schematic = PyuTestCore.get_schem_path("Tree2"), + rotation = "random", + flags = "place_center_x, place_center_z", }) minetest.register_decoration({ - deco_type = "schematic", - place_on = {"group:grass"}, - sidelen = 16, - fill_ratio = 0.00085, - biomes = {"savanna"}, - y_max = PyuTestCore_WorldTop, - y_min = 1, - schematic = PyuTestCore.get_schem_path("SavannaTree"), - rotation = "random", - flags = "place_center_x, place_center_z", - place_offset_y = 1 + deco_type = "schematic", + place_on = {"group:grass"}, + sidelen = 16, + fill_ratio = 0.00085, + biomes = {"savanna"}, + y_max = PyuTestCore_WorldTop, + y_min = 1, + schematic = PyuTestCore.get_schem_path("SavannaTree"), + rotation = "random", + flags = "place_center_x, place_center_z", + place_offset_y = 1 }) minetest.register_decoration({ - deco_type = "schematic", - place_on = {"pyutest_core:mycelium_block"}, - sidelen = 16, - fill_ratio = 0.003, - biomes = {"mushroom_fields", "large_mushroom_forest"}, - y_max = PyuTestCore_WorldTop, - y_min = 1, - schematic = PyuTestCore.get_schem_path("Mushroom"), - rotation = "random", - flags = "place_center_x, place_center_z" + deco_type = "schematic", + place_on = {"pyutest_core:mycelium_block"}, + sidelen = 16, + fill_ratio = 0.003, + biomes = {"mushroom_fields", "large_mushroom_forest"}, + y_max = PyuTestCore_WorldTop, + y_min = 1, + schematic = PyuTestCore.get_schem_path("Mushroom"), + rotation = "random", + flags = "place_center_x, place_center_z" }) minetest.register_decoration({ - deco_type = "schematic", - place_on = {"group:grass"}, - sidelen = 16, - fill_ratio = 0.005, - biomes = {"old_growth_forest"}, - y_max = PyuTestCore_WorldTop, - y_min = 1, - schematic = PyuTestCore.get_schem_path("Mushroom"), - rotation = "random", - flags = "place_center_x, place_center_z" + deco_type = "schematic", + place_on = {"group:grass"}, + sidelen = 16, + fill_ratio = 0.005, + biomes = {"old_growth_forest"}, + y_max = PyuTestCore_WorldTop, + y_min = 1, + schematic = PyuTestCore.get_schem_path("Mushroom"), + rotation = "random", + flags = "place_center_x, place_center_z" }) minetest.register_decoration({ - deco_type = "schematic", - place_on = {"group:grass"}, - sidelen = 16, - fill_ratio = 0.0015, - biomes = {"old_growth_forest"}, - y_max = PyuTestCore_WorldTop, - y_min = 1, - schematic = PyuTestCore.get_schem_path("Tree"), - rotation = "random", - flags = "place_center_x, place_center_z" + deco_type = "schematic", + place_on = {"group:grass"}, + sidelen = 16, + fill_ratio = 0.0015, + biomes = {"old_growth_forest"}, + y_max = PyuTestCore_WorldTop, + y_min = 1, + schematic = PyuTestCore.get_schem_path("Tree"), + rotation = "random", + flags = "place_center_x, place_center_z" }) minetest.register_decoration({ - deco_type = "schematic", - place_on = {"group:grass"}, - sidelen = 16, - fill_ratio = 0.003, - biomes = {"old_growth_forest"}, - y_max = PyuTestCore_WorldTop, - y_min = 1, - schematic = PyuTestCore.get_schem_path("OldGrowthTree"), - rotation = "random", - flags = "place_center_x, place_center_z", + deco_type = "schematic", + place_on = {"group:grass"}, + sidelen = 16, + fill_ratio = 0.003, + biomes = {"old_growth_forest"}, + y_max = PyuTestCore_WorldTop, + y_min = 1, + schematic = PyuTestCore.get_schem_path("OldGrowthTree"), + rotation = "random", + flags = "place_center_x, place_center_z", }) minetest.register_decoration({ - deco_type = "schematic", - place_on = {"group:grass"}, - sidelen = 16, - fill_ratio = 0.005, - biomes = {"taiga"}, - y_max = PyuTestCore_WorldTop, - y_min = 1, - schematic = PyuTestCore.get_schem_path("TaigaTree"), - rotation = "random", - flags = "place_center_x, place_center_z", + deco_type = "schematic", + place_on = {"group:grass"}, + sidelen = 16, + fill_ratio = 0.005, + biomes = {"taiga"}, + y_max = PyuTestCore_WorldTop, + y_min = 1, + schematic = PyuTestCore.get_schem_path("TaigaTree"), + rotation = "random", + flags = "place_center_x, place_center_z", }) minetest.register_decoration({ - deco_type = "schematic", - place_on = {"pyutest_core:grass_block"}, - sidelen = 16, - fill_ratio = 0.005, - biomes = {"birch_forest"}, - y_max = PyuTestCore_WorldTop, - y_min = 1, - schematic = PyuTestCore.get_schem_path("BirchTree"), - rotation = "random", - flags = "place_center_x, place_center_z", + deco_type = "schematic", + place_on = {"pyutest_core:grass_block"}, + sidelen = 16, + fill_ratio = 0.005, + biomes = {"birch_forest"}, + y_max = PyuTestCore_WorldTop, + y_min = 1, + schematic = PyuTestCore.get_schem_path("BirchTree"), + rotation = "random", + flags = "place_center_x, place_center_z", }) minetest.register_decoration({ - deco_type = "schematic", - place_on = {"pyutest_core:grass_block"}, - sidelen = 16, - fill_ratio = 0.005, - biomes = {"birch_forest", "old_growth_birch_forest"}, - y_max = PyuTestCore_WorldTop, - y_min = 1, - schematic = PyuTestCore.get_schem_path("TallBirchTree"), - rotation = "random", - flags = "place_center_x, place_center_z", + deco_type = "schematic", + place_on = {"pyutest_core:grass_block"}, + sidelen = 16, + fill_ratio = 0.005, + biomes = {"birch_forest", "old_growth_birch_forest"}, + y_max = PyuTestCore_WorldTop, + y_min = 1, + schematic = PyuTestCore.get_schem_path("TallBirchTree"), + rotation = "random", + flags = "place_center_x, place_center_z", }) minetest.register_decoration({ - deco_type = "schematic", - place_on = {"pyutest_core:grass_block"}, - sidelen = 16, - fill_ratio = 0.005, - biomes = {"cherry_grove"}, - y_max = PyuTestCore_WorldTop, - y_min = 1, - schematic = PyuTestCore.get_schem_path("CherryTree"), - rotation = "random", - flags = "place_center_x, place_center_z", + deco_type = "schematic", + place_on = {"pyutest_core:grass_block"}, + sidelen = 16, + fill_ratio = 0.005, + biomes = {"cherry_grove"}, + y_max = PyuTestCore_WorldTop, + y_min = 1, + schematic = PyuTestCore.get_schem_path("CherryTree"), + rotation = "random", + flags = "place_center_x, place_center_z", }) minetest.register_decoration({ - deco_type = "schematic", - place_on = {"pyutest_core:snow_block"}, - sidelen = 16, - fill_ratio = 0.004, - biomes = {"snowy_forest"}, - y_max = PyuTestCore_WorldTop, - y_min = 1, - schematic = PyuTestCore.get_schem_path("SnowyTree1"), - rotation = "random", - flags = "place_center_x, place_center_z", + deco_type = "schematic", + place_on = {"pyutest_core:snow_block"}, + sidelen = 16, + fill_ratio = 0.004, + biomes = {"snowy_forest"}, + y_max = PyuTestCore_WorldTop, + y_min = 1, + schematic = PyuTestCore.get_schem_path("SnowyTree1"), + rotation = "random", + flags = "place_center_x, place_center_z", }) minetest.register_decoration({ - deco_type = "schematic", - place_on = {"pyutest_core:snow_block"}, - sidelen = 16, - fill_ratio = 0.004, - biomes = {"snowy_forest"}, - y_max = PyuTestCore_WorldTop, - y_min = 1, - schematic = PyuTestCore.get_schem_path("SnowyTree2"), - rotation = "random", - flags = "place_center_x, place_center_z", + deco_type = "schematic", + place_on = {"pyutest_core:snow_block"}, + sidelen = 16, + fill_ratio = 0.004, + biomes = {"snowy_forest"}, + y_max = PyuTestCore_WorldTop, + y_min = 1, + schematic = PyuTestCore.get_schem_path("SnowyTree2"), + rotation = "random", + flags = "place_center_x, place_center_z", }) minetest.register_decoration({ - deco_type = "schematic", - place_on = {"group:grass"}, - sidelen = 16, - fill_ratio = 0.004, - biomes = {"swamp"}, - y_max = PyuTestCore_WorldTop, - y_min = 1, - schematic = PyuTestCore.get_schem_path("SwampTree"), - rotation = "random", - flags = "place_center_x, place_center_z", + deco_type = "schematic", + place_on = {"group:grass"}, + sidelen = 16, + fill_ratio = 0.004, + biomes = {"swamp"}, + y_max = PyuTestCore_WorldTop, + y_min = 1, + schematic = PyuTestCore.get_schem_path("SwampTree"), + rotation = "random", + flags = "place_center_x, place_center_z", }) minetest.register_decoration({ - deco_type = "schematic", - place_on = {"pyutest_core:grass_block"}, - sidelen = 16, - fill_ratio = 0.004, - biomes = {"old_growth_birch_forest"}, - y_max = PyuTestCore_WorldTop, - y_min = 1, - schematic = PyuTestCore.get_schem_path("VeryTallBirchTree"), - rotation = "random", - flags = "place_center_x, place_center_z", + deco_type = "schematic", + place_on = {"pyutest_core:grass_block"}, + sidelen = 16, + fill_ratio = 0.004, + biomes = {"old_growth_birch_forest"}, + y_max = PyuTestCore_WorldTop, + y_min = 1, + schematic = PyuTestCore.get_schem_path("VeryTallBirchTree"), + rotation = "random", + flags = "place_center_x, place_center_z", }) minetest.register_decoration({ - deco_type = "schematic", - place_on = {"group:grass"}, - sidelen = 16, - fill_ratio = 0.016, - biomes = {"aspen_forest"}, - y_max = PyuTestCore_WorldTop, - y_min = 1, - schematic = PyuTestCore.get_schem_path("AspenTree1"), - rotation = "random", - flags = "place_center_x, place_center_z", + deco_type = "schematic", + place_on = {"group:grass"}, + sidelen = 16, + fill_ratio = 0.016, + biomes = {"aspen_forest"}, + y_max = PyuTestCore_WorldTop, + y_min = 1, + schematic = PyuTestCore.get_schem_path("AspenTree1"), + rotation = "random", + flags = "place_center_x, place_center_z", }) minetest.register_decoration({ - deco_type = "schematic", - place_on = {"group:grass"}, - sidelen = 16, - fill_ratio = 0.008, - biomes = {"aspen_forest"}, - y_max = PyuTestCore_WorldTop, - y_min = 1, - schematic = PyuTestCore.get_schem_path("AspenTree2"), - rotation = "random", - flags = "place_center_x, place_center_z", + deco_type = "schematic", + place_on = {"group:grass"}, + sidelen = 16, + fill_ratio = 0.008, + biomes = {"aspen_forest"}, + y_max = PyuTestCore_WorldTop, + y_min = 1, + schematic = PyuTestCore.get_schem_path("AspenTree2"), + rotation = "random", + flags = "place_center_x, place_center_z", }) minetest.register_decoration({ - deco_type = "schematic", - place_on = {"pyutest_core:podzol_block"}, - sidelen = 16, - fill_ratio = 0.019, - biomes = {"redwood_forest"}, - y_max = PyuTestCore_WorldTop, - y_min = 1, - schematic = PyuTestCore.get_schem_path("RedwoodTree"), - rotation = "random", - flags = "place_center_x, place_center_z", + deco_type = "schematic", + place_on = {"pyutest_core:podzol_block"}, + sidelen = 16, + fill_ratio = 0.019, + biomes = {"redwood_forest"}, + y_max = PyuTestCore_WorldTop, + y_min = 1, + schematic = PyuTestCore.get_schem_path("RedwoodTree"), + rotation = "random", + flags = "place_center_x, place_center_z", }) minetest.register_decoration({ - deco_type = "schematic", - place_on = {"group:grass"}, - sidelen = 16, - fill_ratio = 0.010, - biomes = {"jungle"}, - y_max = PyuTestCore_WorldTop, - y_min = 1, - schematic = PyuTestCore.get_schem_path("JungleTree"), - rotation = "random", - flags = "place_center_x, place_center_z", + deco_type = "schematic", + place_on = {"group:grass"}, + sidelen = 16, + fill_ratio = 0.010, + biomes = {"jungle"}, + y_max = PyuTestCore_WorldTop, + y_min = 1, + schematic = PyuTestCore.get_schem_path("JungleTree"), + rotation = "random", + flags = "place_center_x, place_center_z", }) minetest.register_decoration({ - deco_type = "schematic", - place_on = {"group:grass"}, - sidelen = 16, - fill_ratio = 0.008, - biomes = {"jungle"}, - y_max = PyuTestCore_WorldTop, - y_min = 1, - schematic = PyuTestCore.get_schem_path("SmallJungleTree"), - rotation = "random", - flags = "place_center_x, place_center_z", + deco_type = "schematic", + place_on = {"group:grass"}, + sidelen = 16, + fill_ratio = 0.008, + biomes = {"jungle"}, + y_max = PyuTestCore_WorldTop, + y_min = 1, + schematic = PyuTestCore.get_schem_path("SmallJungleTree"), + rotation = "random", + flags = "place_center_x, place_center_z", }) minetest.register_decoration({ - deco_type = "schematic", - place_on = {"group:grass"}, - sidelen = 16, - fill_ratio = 0.013, - biomes = {"jungle"}, - y_max = PyuTestCore_WorldTop, - y_min = 1, - schematic = PyuTestCore.get_schem_path("LargeJungleTree"), - rotation = "random", - flags = "place_center_x, place_center_z", + deco_type = "schematic", + place_on = {"group:grass"}, + sidelen = 16, + fill_ratio = 0.013, + biomes = {"jungle"}, + y_max = PyuTestCore_WorldTop, + y_min = 1, + schematic = PyuTestCore.get_schem_path("LargeJungleTree"), + rotation = "random", + flags = "place_center_x, place_center_z", }) minetest.register_decoration({ - deco_type = "schematic", - place_on = {"group:grass"}, - sidelen = 16, - fill_ratio = 0.008, - biomes = {"jungle"}, - y_max = PyuTestCore_WorldTop, - y_min = 1, - schematic = PyuTestCore.get_schem_path("JungleBush"), - rotation = "random", - flags = "place_center_x, place_center_z", + deco_type = "schematic", + place_on = {"group:grass"}, + sidelen = 16, + fill_ratio = 0.008, + biomes = {"jungle"}, + y_max = PyuTestCore_WorldTop, + y_min = 1, + schematic = PyuTestCore.get_schem_path("JungleBush"), + rotation = "random", + flags = "place_center_x, place_center_z", }) minetest.register_decoration({ - deco_type = "schematic", - place_on = {"pyutest_core:mycelium_block"}, - sidelen = 16, - fill_ratio = 0.006, - biomes = {"large_mushroom_forest"}, - y_max = PyuTestCore_WorldTop, - y_min = 1, - schematic = PyuTestCore.get_schem_path("TallMushroom"), - rotation = "random", - flags = "place_center_x, place_center_z" + deco_type = "schematic", + place_on = {"pyutest_core:mycelium_block"}, + sidelen = 16, + fill_ratio = 0.006, + biomes = {"large_mushroom_forest"}, + y_max = PyuTestCore_WorldTop, + y_min = 1, + schematic = PyuTestCore.get_schem_path("TallMushroom"), + rotation = "random", + flags = "place_center_x, place_center_z" }) minetest.register_decoration({ - deco_type = "schematic", - place_on = {"pyutest_core:mycelium_block"}, - sidelen = 16, - fill_ratio = 0.002, - biomes = {"large_mushroom_forest"}, - y_max = PyuTestCore_WorldTop, - y_min = 1, - schematic = PyuTestCore.get_schem_path("SmallMushroom"), - rotation = "random", - flags = "place_center_x, place_center_z", - place_offset_y = 1 + deco_type = "schematic", + place_on = {"pyutest_core:mycelium_block"}, + sidelen = 16, + fill_ratio = 0.002, + biomes = {"large_mushroom_forest"}, + y_max = PyuTestCore_WorldTop, + y_min = 1, + schematic = PyuTestCore.get_schem_path("SmallMushroom"), + rotation = "random", + flags = "place_center_x, place_center_z", + place_offset_y = 1 }) minetest.register_decoration({ - deco_type = "schematic", - place_on = {"pyutest_core:mycelium_block"}, - sidelen = 16, - fill_ratio = 0.007, - biomes = {"large_mushroom_forest"}, - y_max = PyuTestCore_WorldTop, - y_min = 1, - schematic = PyuTestCore.get_schem_path("FallenMushroom"), - rotation = "random", - flags = "place_center_x, place_center_z", - place_offset_y = 1 + deco_type = "schematic", + place_on = {"pyutest_core:mycelium_block"}, + sidelen = 16, + fill_ratio = 0.007, + biomes = {"large_mushroom_forest"}, + y_max = PyuTestCore_WorldTop, + y_min = 1, + schematic = PyuTestCore.get_schem_path("FallenMushroom"), + rotation = "random", + flags = "place_center_x, place_center_z", + place_offset_y = 1 }) diff --git a/mods/pyutest/pyutest_mobs/basic.lua b/mods/pyutest/pyutest_mobs/basic.lua index 8f9414d..0661957 100644 --- a/mods/pyutest/pyutest_mobs/basic.lua +++ b/mods/pyutest/pyutest_mobs/basic.lua @@ -1,129 +1,129 @@ mobs:register_mob("pyutest_mobs:monster", { - type = "monster", - hp_max = 20, - hp_min = 20, - walk_velocity = 1, - run_velocity = 3, - armor = 100, - passive = false, - walk_chance = 0, - stand_chance = 25, - damage = 2.7, - attack_chance = 1, - attack_type = "dogfight", - pathfinding = 1, - visual = "upright_sprite", - visual_size = {x = 1, y = 2}, - collisionbox = PyuTestMobs.HUMAN_LIKE_CBOX, - physical = true, - blood_amount = PyuTestMobs.ENTITY_BLOOD_AMOUNT, - view_range = 30, - reach = 2, - jump = 1, - group_attack = true, - makes_footstep_sound = true, + type = "monster", + hp_max = 20, + hp_min = 20, + walk_velocity = 1, + run_velocity = 3, + armor = 100, + passive = false, + walk_chance = 0, + stand_chance = 25, + damage = 2.7, + attack_chance = 1, + attack_type = "dogfight", + pathfinding = 1, + visual = "upright_sprite", + visual_size = {x = 1, y = 2}, + collisionbox = PyuTestMobs.HUMAN_LIKE_CBOX, + physical = true, + blood_amount = PyuTestMobs.ENTITY_BLOOD_AMOUNT, + view_range = 30, + reach = 2, + jump = 1, + group_attack = true, + makes_footstep_sound = true, - textures = { - "pyutest-monster.png", "pyutest-monster_back.png" - }, + textures = { + "pyutest-monster.png", "pyutest-monster_back.png" + }, - drops = { - { - name = "pyutest_core:bone", - min = 2, - max = 3, - chance = 1 - } - } + drops = { + { + name = "pyutest_core:bone", + min = 2, + max = 3, + chance = 1 + } + } }) mobs:register_egg("pyutest_mobs:monster", "Monster Spawn Egg", "pyutest-egg.png^[multiply:darkgreen", 0) mobs:register_mob("pyutest_mobs:human", { - type = "npc", - hp_max = 20, - hp_min = 20, - walk_velocity = 1, - run_velocity = 5, - armor = 100, - passive = true, - walk_chance = 50, - stand_chance = 50, - damage = 3, - attack_type = "dogfight", - pathfinding = 1, - visual = "upright_sprite", - visual_size = {x = 1, y = 2}, - collisionbox = PyuTestMobs.HUMAN_LIKE_CBOX, - textures = {"player.png", "player_back.png"}, - follow = {"pyutest_mobs:coin"}, - runaway = true, - view_range = 15, - reach = 2, - fear_height = 7, - blood_amount = PyuTestMobs.ENTITY_BLOOD_AMOUNT, - makes_footstep_sound = true, - drops = { - { - name = "pyutest_core:bone", - min = 2, - max = 3, - chance = 1 - } - } + type = "npc", + hp_max = 20, + hp_min = 20, + walk_velocity = 1, + run_velocity = 5, + armor = 100, + passive = true, + walk_chance = 50, + stand_chance = 50, + damage = 3, + attack_type = "dogfight", + pathfinding = 1, + visual = "upright_sprite", + visual_size = {x = 1, y = 2}, + collisionbox = PyuTestMobs.HUMAN_LIKE_CBOX, + textures = {"player.png", "player_back.png"}, + follow = {"pyutest_mobs:coin"}, + runaway = true, + view_range = 15, + reach = 2, + fear_height = 7, + blood_amount = PyuTestMobs.ENTITY_BLOOD_AMOUNT, + makes_footstep_sound = true, + drops = { + { + name = "pyutest_core:bone", + min = 2, + max = 3, + chance = 1 + } + } }) mobs:register_egg("pyutest_mobs:human", "Human Spawn Egg", "pyutest-egg.png^[multiply:peachpuff", 0) mobs:register_mob("pyutest_mobs:mimic", { - type = "monster", - hp_max = 15, - hp_min = 15, - walk_velocity = 1, - run_velocity = 3, - armor = 100, - passive = false, - stand_chance = 1, - walk_chance = 0, - damage = 4, - attack_type = "dogfight", - pathfinding = 1, - visual = "cube", - visual_size = {x = 1, y = 1, z = 1}, - collisionbox = { - -0.25, -0.5, -0.25, 0.25, 0.5, 0.25 - }, - textures = { - "pyutest-crate.png", - "pyutest-crate.png", - "pyutest-crate.png", - "pyutest-crate.png", - "pyutest-crate.png", - "pyutest-crate.png" - }, - view_range = 12, - blood_amount = PyuTestMobs.ENTITY_BLOOD_AMOUNT, - reach = 2, + type = "monster", + hp_max = 15, + hp_min = 15, + walk_velocity = 1, + run_velocity = 3, + armor = 100, + passive = false, + stand_chance = 1, + walk_chance = 0, + damage = 4, + attack_type = "dogfight", + pathfinding = 1, + visual = "cube", + visual_size = {x = 1, y = 1, z = 1}, + collisionbox = { + -0.25, -0.5, -0.25, 0.25, 0.5, 0.25 + }, + textures = { + "pyutest-crate.png", + "pyutest-crate.png", + "pyutest-crate.png", + "pyutest-crate.png", + "pyutest-crate.png", + "pyutest-crate.png" + }, + view_range = 12, + blood_amount = PyuTestMobs.ENTITY_BLOOD_AMOUNT, + reach = 2, }) mobs:register_egg("pyutest_mobs:mimic", "Mimic Spawn Egg", "pyutest-egg.png^[multiply:brown", 0) mobs:register_mob("pyutest_mobs:firefly", { - type = "animal", - hp_max = 3, - hp_min = 3, - walk_velocity = 1, - run_velocity = 3, - armor = 100, - passive = true, - stand_chance = 0, - walk_chance = 100, - fly = true, - keep_flying = true, - visual = "sprite", - visual_size = {x = 0.05, y = 0.05}, - collisionbox = { - -0.0, -0.0, -0.0, 0.0, 0.0, 0.0 - }, - textures = {"pyutest-firefly.png"}, - blood_amount = PyuTestMobs.ENTITY_BLOOD_AMOUNT, - glow = 7, + type = "animal", + hp_max = 3, + hp_min = 3, + walk_velocity = 1, + run_velocity = 3, + armor = 100, + passive = true, + stand_chance = 0, + walk_chance = 100, + fly = true, + keep_flying = true, + visual = "sprite", + visual_size = {x = 0.05, y = 0.05}, + collisionbox = { + -0.0, -0.0, -0.0, 0.0, 0.0, 0.0 + }, + textures = {"pyutest-firefly.png"}, + blood_amount = PyuTestMobs.ENTITY_BLOOD_AMOUNT, + glow = 7, }) mobs:register_egg("pyutest_mobs:firefly", "Firefly Spawn Egg", "pyutest-egg.png^[multiply:yellow", 0) diff --git a/mods/pyutest/pyutest_mobs/init.lua b/mods/pyutest/pyutest_mobs/init.lua index e9edc20..4635945 100644 --- a/mods/pyutest/pyutest_mobs/init.lua +++ b/mods/pyutest/pyutest_mobs/init.lua @@ -13,60 +13,60 @@ dofile(PyuTestMobs_Path.."/necromancer.lua") local mapgen = minetest.get_mapgen_params().mgname or "???" if mapgen ~= "flat" and mapgen ~= "singlenode" then mobs:spawn({ - name = "pyutest_mobs:monster", - nodes = {"group:ground"}, - interval = 6, - chance = 4, - active_object_count = 3, - min_light = 0, - max_light = 8, - y_max = PyuTestCore_WorldTop, - y_min = PyuTestCore_SurfaceBottom + name = "pyutest_mobs:monster", + nodes = {"group:ground"}, + interval = 6, + chance = 4, + active_object_count = 3, + min_light = 0, + max_light = 8, + y_max = PyuTestCore_WorldTop, + y_min = PyuTestCore_SurfaceBottom }) mobs:spawn({ - name = "pyutest_mobs:monster", - nodes = {"group:ground"}, - interval = 2, - chance = 2, - active_object_count = 6, - min_light = 0, - max_light = 8, - y_max = PyuTestCore_DeepOceanMin - 1, - y_min = PyuTestCore_WorldBottom + name = "pyutest_mobs:monster", + nodes = {"group:ground"}, + interval = 2, + chance = 2, + active_object_count = 6, + min_light = 0, + max_light = 8, + y_max = PyuTestCore_DeepOceanMin - 1, + y_min = PyuTestCore_WorldBottom }) mobs:spawn({ - name = "pyutest_mobs:human", - nodes = {"group:ground"}, - interval = 3, - chance = 4, - active_object_count = 3, - min_light = 9, - max_light = 15, - min_height = PyuTestCore_SurfaceBottom, - day_toggle = true, + name = "pyutest_mobs:human", + nodes = {"group:ground"}, + interval = 3, + chance = 4, + active_object_count = 3, + min_light = 9, + max_light = 15, + min_height = PyuTestCore_SurfaceBottom, + day_toggle = true, }) mobs:spawn({ - name = "pyutest_mobs:mimic", - nodes = {"group:ground"}, - interval = 3, - chance = 18, - active_object_count = 2, - min_light = 0, - max_light = 15, - day_toggle = true, + name = "pyutest_mobs:mimic", + nodes = {"group:ground"}, + interval = 3, + chance = 18, + active_object_count = 2, + min_light = 0, + max_light = 15, + day_toggle = true, }) mobs:spawn({ - name = "pyutest_mobs:firefly", - nodes = {"group:ground", "air"}, - interval = 3, - chance = 3, - active_object_count = 4, - min_light = 0, - max_light = 9, - day_toggle = false, + name = "pyutest_mobs:firefly", + nodes = {"group:ground", "air"}, + interval = 3, + chance = 3, + active_object_count = 4, + min_light = 0, + max_light = 9, + day_toggle = false, }) end diff --git a/mods/pyutest/pyutest_mobs/necromancer.lua b/mods/pyutest/pyutest_mobs/necromancer.lua index c8b2951..2f98939 100644 --- a/mods/pyutest/pyutest_mobs/necromancer.lua +++ b/mods/pyutest/pyutest_mobs/necromancer.lua @@ -1,40 +1,40 @@ local necroball_hit_player = function (self, player) player:punch(self.object, nil, { - damage_groups = {fleshy = 3} + damage_groups = {fleshy = 3} }, nil) end mobs:register_arrow("pyutest_mobs:arrow_necroball", { - visual = "sprite", - visual_size = {x = 1, y = 1}, - textures = {"pyutest-necroball.png"}, - hit_player = necroball_hit_player, - hit_mob = necroball_hit_player, + visual = "sprite", + visual_size = {x = 1, y = 1}, + textures = {"pyutest-necroball.png"}, + hit_player = necroball_hit_player, + hit_mob = necroball_hit_player, - hit_node = function(self, pos) - math.randomseed(os.time()) - local num_minions = math.random(2, 3) - local minions = { - "pyutest_mobs:monster", - "pyutest_mobs:mimic" - } - local m = minions[math.random(#minions)] + hit_node = function(self, pos) + math.randomseed(os.time()) + local num_minions = math.random(2, 3) + local minions = { + "pyutest_mobs:monster", + "pyutest_mobs:mimic" + } + local m = minions[math.random(#minions)] - for i = 1, num_minions do - mobs:add_mob(vector.add(pos, vector.new(0, 3, 0)), { - name = m, - child = false, - nametag = "Necromancer Minion", - ignore_count = true - }) - end + for i = 1, num_minions do + mobs:add_mob(vector.add(pos, vector.new(0, 3, 0)), { + name = m, + child = false, + nametag = "Necromancer Minion", + ignore_count = true + }) + end - self.object:remove() - end, - velocity = 18, - collisionbox = { - -1.5, -1.5, -1.5, 1.5, 1.5, 1.5 - } + self.object:remove() + end, + velocity = 18, + collisionbox = { + -1.5, -1.5, -1.5, 1.5, 1.5, 1.5 + } }) mobs:register_mob("pyutest_mobs:necromancer", { diff --git a/mods/pyutest/pyutest_mobs/snowman.lua b/mods/pyutest/pyutest_mobs/snowman.lua index 9102137..14ba3a4 100644 --- a/mods/pyutest/pyutest_mobs/snowman.lua +++ b/mods/pyutest/pyutest_mobs/snowman.lua @@ -1,76 +1,76 @@ local snowball_hit_player = function (self, player) player:punch(self.object, nil, { - damage_groups = {fleshy = 9} + damage_groups = {fleshy = 9} }, nil) end mobs:register_arrow("pyutest_mobs:arrow_snowball", { - visual = "sprite", - visual_size = {x = 1, y = 1}, - textures = {"pyutest-snowball.png"}, - hit_node = function (self, pos) - PyuTestCore.create_explosion(pos, 1, false, 9, self.object, false) - end, - hit_player = snowball_hit_player, - hit_mob = snowball_hit_player, - velocity = 9, - collisionbox = { - -1.5, -1.5, -1.5, 1.5, 1.5, 1.5 - } + visual = "sprite", + visual_size = {x = 1, y = 1}, + textures = {"pyutest-snowball.png"}, + hit_node = function (self, pos) + PyuTestCore.create_explosion(pos, 1, false, 9, self.object, false) + end, + hit_player = snowball_hit_player, + hit_mob = snowball_hit_player, + velocity = 9, + collisionbox = { + -1.5, -1.5, -1.5, 1.5, 1.5, 1.5 + } }) mobs:register_mob("pyutest_mobs:snowman", { - type = "monster", - hp_max = 450, - hp_min = 450, - walk_velocity = 1, - run_velocity = 4, - armor = 100, - passive = false, - walk_chance = 1, - stand_chance = 2, - damage = 9, - attack_chance = 1, - attack_type = "dogshoot", - arrow = "pyutest_mobs:arrow_snowball", - shoot_interval = 0.75, - shoot_offset = 2, - homing = true, - pathfinding = 1, - visual = "upright_sprite", - visual_size = {x = 1, y = 2}, - collisionbox = PyuTestMobs.HUMAN_LIKE_CBOX, - physical = true, - blood_amount = PyuTestMobs.ENTITY_BLOOD_AMOUNT, - view_range = 35, - reach = 2, - jump = 1, - group_attack = false, - makes_footstep_sound = true, - dogshoot_switch = 2, - dogshoot_count_max = 3, - dogshoot_count2_max = 6, + type = "monster", + hp_max = 450, + hp_min = 450, + walk_velocity = 1, + run_velocity = 4, + armor = 100, + passive = false, + walk_chance = 1, + stand_chance = 2, + damage = 9, + attack_chance = 1, + attack_type = "dogshoot", + arrow = "pyutest_mobs:arrow_snowball", + shoot_interval = 0.75, + shoot_offset = 2, + homing = true, + pathfinding = 1, + visual = "upright_sprite", + visual_size = {x = 1, y = 2}, + collisionbox = PyuTestMobs.HUMAN_LIKE_CBOX, + physical = true, + blood_amount = PyuTestMobs.ENTITY_BLOOD_AMOUNT, + view_range = 35, + reach = 2, + jump = 1, + group_attack = false, + makes_footstep_sound = true, + dogshoot_switch = 2, + dogshoot_count_max = 3, + dogshoot_count2_max = 6, - textures = { - "pyutest-snowman.png", "pyutest-snowman_back.png" - }, + textures = { + "pyutest-snowman.png", "pyutest-snowman_back.png" + }, - drops = { - { - name = "pyutest_core:magic_shards", - min = 2, - max = 5, - chance = 1 - }, + drops = { + { + name = "pyutest_core:magic_shards", + min = 2, + max = 5, + chance = 1 + }, - { - name = "pyutest_core:snowball", - min = 4, - max = 9, - chance = 1 - } - } + { + name = "pyutest_core:snowball", + min = 4, + max = 9, + chance = 1 + } + } }) PyuTestMobs.create_boss_egg("pyutest_mobs:snowman", "Snowman Spawn Egg", "pyutest-egg.png^[multiply:skyblue", 0, nil, diff --git a/mods/pyutest/pyutest_mobs/wind_warrior.lua b/mods/pyutest/pyutest_mobs/wind_warrior.lua index 5e7e347..aa0219e 100644 --- a/mods/pyutest/pyutest_mobs/wind_warrior.lua +++ b/mods/pyutest/pyutest_mobs/wind_warrior.lua @@ -1,79 +1,79 @@ local windball_hit_player = function (self, player) player:punch(self.object, nil, { - damage_groups = {fleshy = 3} + damage_groups = {fleshy = 3} }, nil) math.randomseed(os.time()) player:add_velocity({ - x = 0, - z = 0, - y = math.random(18, 25) + x = 0, + z = 0, + y = math.random(18, 25) }) end mobs:register_arrow("pyutest_mobs:arrow_windball", { - visual = "sprite", - visual_size = {x = 1, y = 1}, - textures = {"pyutest-windball.png"}, - hit_player = windball_hit_player, - hit_mob = windball_hit_player, - velocity = 9, - collisionbox = { - -1.5, -1.5, -1.5, 1.5, 1.5, 1.5 - } + visual = "sprite", + visual_size = {x = 1, y = 1}, + textures = {"pyutest-windball.png"}, + hit_player = windball_hit_player, + hit_mob = windball_hit_player, + velocity = 9, + collisionbox = { + -1.5, -1.5, -1.5, 1.5, 1.5, 1.5 + } }) mobs:register_mob("pyutest_mobs:wind_warrior", { - type = "monster", - hp_max = 350, - hp_min = 350, - walk_velocity = 1, - run_velocity = 4, - armor = 100, - passive = false, - walk_chance = 1, - stand_chance = 2, - damage = 9, - attack_chance = 1, - attack_type = "dogshoot", - arrow = "pyutest_mobs:arrow_windball", - shoot_interval = 0.75, - shoot_offset = 2, - homing = true, - pathfinding = 1, - visual = "upright_sprite", - visual_size = {x = 1, y = 2}, - collisionbox = PyuTestMobs.HUMAN_LIKE_CBOX, - physical = true, - blood_amount = PyuTestMobs.ENTITY_BLOOD_AMOUNT, - view_range = 35, - reach = 2, - jump = 1, - group_attack = false, - makes_footstep_sound = true, - dogshoot_switch = 1, - dogshoot_count_max = 3, - dogshoot_count2_max = 6, + type = "monster", + hp_max = 350, + hp_min = 350, + walk_velocity = 1, + run_velocity = 4, + armor = 100, + passive = false, + walk_chance = 1, + stand_chance = 2, + damage = 9, + attack_chance = 1, + attack_type = "dogshoot", + arrow = "pyutest_mobs:arrow_windball", + shoot_interval = 0.75, + shoot_offset = 2, + homing = true, + pathfinding = 1, + visual = "upright_sprite", + visual_size = {x = 1, y = 2}, + collisionbox = PyuTestMobs.HUMAN_LIKE_CBOX, + physical = true, + blood_amount = PyuTestMobs.ENTITY_BLOOD_AMOUNT, + view_range = 35, + reach = 2, + jump = 1, + group_attack = false, + makes_footstep_sound = true, + dogshoot_switch = 1, + dogshoot_count_max = 3, + dogshoot_count2_max = 6, - textures = { - "pyutest-wind-warrior.png", "pyutest-wind-warrior_back.png" - }, + textures = { + "pyutest-wind-warrior.png", "pyutest-wind-warrior_back.png" + }, - drops = { - { - name = "pyutest_core:magic_shards", - min = 4, - max = 7, - chance = 1 - }, + drops = { + { + name = "pyutest_core:magic_shards", + min = 4, + max = 7, + chance = 1 + }, - { - name = "pyutest_core:windball", - min = 2, - max = 4, - chance = 1 - } - } + { + name = "pyutest_core:windball", + min = 2, + max = 4, + chance = 1 + } + } }) PyuTestMobs.create_boss_egg("pyutest_mobs:wind_warrior", "Wind Warrior Spawn Egg", "pyutest-egg.png^[multiply:white", 0, nil, diff --git a/textures/pyutest-torch.png b/textures/pyutest-torch.png index 3100b05..1b47a0e 100644 Binary files a/textures/pyutest-torch.png and b/textures/pyutest-torch.png differ