[Where do I even begin?] Break APIs, add Worlds, add Darkstone and more.

This commit is contained in:
IamPyu 2024-09-29 14:16:51 -06:00
parent a4708277f7
commit 30ac0aa928
35 changed files with 668 additions and 570 deletions

View File

@ -1,5 +1,14 @@
# Changelog
# [Sep 29th 2024] World Update
This update completely breaks the API lol.
- Added "Worlds" which are like Minecraft's own Dimensions
- Added Special Cave world
- Added Icy Caves
- Added Darkstone
# [Sep 29th 2024] Unnamed Minor Update
- Replace Delayer Wire with Zinc Wire, giving Zinc a purpose

View File

@ -2,3 +2,4 @@ title = Nodelands
description = Pyu's Minetest Game
disallowed_mapgens = v6
min_minetest_version = 5.8
first_mod = pyutest

View File

@ -0,0 +1 @@
PyuTest = {}

View File

@ -17,7 +17,7 @@ minetest.register_chatcommand("explode", {
return false, "Please use a number for the range."
end
PyuTestCore.create_explosion(player:get_pos(), range, false, range, player, true)
PyuTest.create_explosion(player:get_pos(), range, false, range, player, true)
end
})

View File

@ -34,7 +34,7 @@ func = function (name, param)
end
end
PyuTestCore.dorange(pos, range, function(p)
PyuTest.dorange(pos, range, function(p)
replace(p)
end)
@ -53,7 +53,7 @@ minetest.register_chatcommand("place", {
func = function(name, param)
local player = minetest.get_player_by_name(name)
minetest.place_schematic(player:get_pos(),
PyuTestCore.get_schem_path(param),
PyuTest.get_schem_path(param),
"random",
nil,
false,

View File

@ -17,7 +17,7 @@ minetest.register_abm({
end
end
PyuTestCore.dorange(pos, range, function(p)
PyuTest.dorange(pos, range, function(p)
replace(p)
end)
end

View File

@ -1,4 +1,4 @@
PyuTestCore.make_node_sounds = function(tbl)
PyuTest.make_node_sounds = function(tbl)
local t = tbl or {}
t.footstep = t.footstep or {name = "block_walk", gain = 1}
t.dig = t.dig or {name = "block_dig", gain = 0.50}
@ -7,11 +7,11 @@ PyuTestCore.make_node_sounds = function(tbl)
return t
end
PyuTestCore.make_node = function(name, desc, groups, tiles, extra_conf)
PyuTest.make_node = function(name, desc, groups, tiles, extra_conf)
local conf = {
description = Translate(desc),
tiles = tiles,
groups = PyuTestCore.util.tableconcat(groups, {
groups = PyuTest.util.tableconcat(groups, {
block = 1
}),
}
@ -21,13 +21,13 @@ PyuTestCore.make_node = function(name, desc, groups, tiles, extra_conf)
conf[k] = v
end
conf["sounds"] = PyuTestCore.make_node_sounds(extra_conf.sounds)
conf["sounds"] = PyuTest.make_node_sounds(extra_conf.sounds)
end
minetest.register_node(name, conf)
end
PyuTestCore.node_boxes = {
PyuTest.node_boxes = {
CARPET = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -0.45, 0.5}
@ -48,10 +48,10 @@ PyuTestCore.node_boxes = {
},
},
}
PyuTestCore.building_blocks = {}
PyuTest.building_blocks = {}
PyuTestCore.make_building_blocks = function (name, desc, tex, colortint, cgroups, extra_conf)
local groups = PyuTestCore.util.tablecopy(cgroups) or {}
PyuTest.make_building_blocks = function (name, desc, tex, colortint, cgroups, extra_conf)
local groups = PyuTest.util.tablecopy(cgroups) or {}
groups["block"] = 1
local econf = extra_conf or {}
@ -65,7 +65,7 @@ PyuTestCore.make_building_blocks = function (name, desc, tex, colortint, cgroups
local id_stairs = name.."_stairs"
local id_fence = name.."_fence"
table.insert(PyuTestCore.building_blocks, {
table.insert(PyuTest.building_blocks, {
name = name,
desc = desc,
tiles = tex,
@ -73,61 +73,61 @@ PyuTestCore.make_building_blocks = function (name, desc, tex, colortint, cgroups
econf = econf
})
minetest.register_node(id_block, PyuTestCore.util.tableconcat({
minetest.register_node(id_block, PyuTest.util.tableconcat({
description = Translate(desc.." Block"),
tiles = tex,
groups = PyuTestCore.util.tableconcat(groups, {
groups = PyuTest.util.tableconcat(groups, {
solid = 1
}),
sounds = PyuTestCore.make_node_sounds(),
sounds = PyuTest.make_node_sounds(),
}, econf))
minetest.register_node(id_carpet, PyuTestCore.util.tableconcat({
minetest.register_node(id_carpet, PyuTest.util.tableconcat({
description = Translate(desc .. " Carpet"),
tiles = tex,
groups = PyuTestCore.util.tableconcat(PyuTestCore.util.tablecopy(groups), {
groups = PyuTest.util.tableconcat(PyuTest.util.tablecopy(groups), {
attached_node = 1
}),
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
node_box = PyuTestCore.node_boxes.CARPET,
sounds = PyuTestCore.make_node_sounds(),
node_box = PyuTest.node_boxes.CARPET,
sounds = PyuTest.make_node_sounds(),
buildable_to = true
}, econf))
minetest.register_node(id_slab, PyuTestCore.util.tableconcat({
minetest.register_node(id_slab, PyuTest.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(),
node_box = PyuTest.node_boxes.SLAB,
sounds = PyuTest.make_node_sounds(),
}, econf))
minetest.register_node(id_pillar, PyuTestCore.util.tableconcat({
minetest.register_node(id_pillar, PyuTest.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(),
node_box = PyuTest.node_boxes.PILLAR,
sounds = PyuTest.make_node_sounds(),
}, econf))
minetest.register_node(id_stairs, PyuTestCore.util.tableconcat({
minetest.register_node(id_stairs, PyuTest.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(),
node_box = PyuTest.node_boxes.STAIRS,
sounds = PyuTest.make_node_sounds(),
}, econf))
minetest.register_node(id_fence, PyuTestCore.util.tableconcat({
minetest.register_node(id_fence, PyuTest.util.tableconcat({
description = Translate(desc.." Fence"),
tiles = tex,
groups = groups,
@ -137,7 +137,7 @@ PyuTestCore.make_building_blocks = function (name, desc, tex, colortint, cgroups
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.5, 0.25}
},
sounds = PyuTestCore.make_node_sounds(),
sounds = PyuTest.make_node_sounds(),
}, econf))
minetest.register_craft({
@ -181,216 +181,223 @@ PyuTestCore.make_building_blocks = function (name, desc, tex, colortint, cgroups
})
end
PyuTestCore.make_building_blocks("pyutest_core:grass", "Grass", {
PyuTest.make_building_blocks("pyutest_core:grass", "Grass", {
"pyutest-grass.png"
}, nil, {
ground = 1,
acid_vulnerable = 1,
grass = 1,
crumbly = PyuTestCore.BLOCK_FAST
crumbly = PyuTest.BLOCK_FAST
})
PyuTestCore.make_building_blocks("pyutest_core:dark_grass", "Dark Grass", {
PyuTest.make_building_blocks("pyutest_core:dark_grass", "Dark Grass", {
"pyutest-dark-grass.png"
}, nil, {
ground = 1,
acid_vulnerable = 1,
grass = 1,
crumbly = PyuTestCore.BLOCK_FAST
crumbly = PyuTest.BLOCK_FAST
})
PyuTestCore.make_building_blocks("pyutest_core:swampy_grass", "Swampy Grass", {
PyuTest.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,
crumbly = PyuTestCore.BLOCK_FAST
crumbly = PyuTest.BLOCK_FAST
})
PyuTestCore.make_building_blocks("pyutest_core:savanna_grass", "Savanna Grass", {
PyuTest.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,
crumbly = PyuTestCore.BLOCK_FAST
crumbly = PyuTest.BLOCK_FAST
})
PyuTestCore.make_building_blocks("pyutest_core:aspen_grass", "Aspen Grass", {
PyuTest.make_building_blocks("pyutest_core:aspen_grass", "Aspen Grass", {
"pyutest-aspen-grass.png"
}, nil, {
ground = 1,
acid_vulnerable = 1,
grass = 1,
crumbly = PyuTestCore.BLOCK_FAST
crumbly = PyuTest.BLOCK_FAST
})
PyuTestCore.make_building_blocks("pyutest_core:jungle_grass", "Jungle Grass", {
PyuTest.make_building_blocks("pyutest_core:jungle_grass", "Jungle Grass", {
"pyutest-jungle-grass.png"
}, nil, {
ground = 1,
acid_vulnerable = 1,
grass = 1,
crumbly = PyuTestCore.BLOCK_FAST
crumbly = PyuTest.BLOCK_FAST
})
PyuTestCore.make_building_blocks("pyutest_core:dirt", "Dirt", {"pyutest-dirt.png"}, nil, {
PyuTest.make_building_blocks("pyutest_core:dirt", "Dirt", {"pyutest-dirt.png"}, nil, {
ground = 1,
acid_vulnerable = 1,
crumbly = PyuTestCore.BLOCK_FAST
crumbly = PyuTest.BLOCK_FAST
})
PyuTestCore.make_building_blocks("pyutest_core:podzol", "Podzol", {"pyutest-podzol.png"}, nil, {
PyuTest.make_building_blocks("pyutest_core:podzol", "Podzol", {"pyutest-podzol.png"}, nil, {
ground = 1,
acid_vulnerable = 1,
crumbly = PyuTestCore.BLOCK_FAST
crumbly = PyuTest.BLOCK_FAST
})
PyuTestCore.make_building_blocks("pyutest_core:snow", "Snow", {"pyutest-snow.png"}, nil, {
PyuTest.make_building_blocks("pyutest_core:snow", "Snow", {"pyutest-snow.png"}, nil, {
ground = 1,
acid_vulnerable = 1,
crumbly = PyuTestCore.BLOCK_FAST
crumbly = PyuTest.BLOCK_FAST
})
PyuTestCore.make_building_blocks("pyutest_core:sand", "Sand", {"pyutest-sand.png"}, nil, {
PyuTest.make_building_blocks("pyutest_core:sand", "Sand", {"pyutest-sand.png"}, nil, {
ground = 1,
acid_vulnerable = 1,
falling_node = 1,
sugarcane_spawn_on = 1,
crumbly = PyuTestCore.BLOCK_FAST
crumbly = PyuTest.BLOCK_FAST
})
PyuTestCore.make_building_blocks("pyutest_core:mycelium", "Mycelium", {
PyuTest.make_building_blocks("pyutest_core:mycelium", "Mycelium", {
"pyutest-mycelium.png"
}, nil, {
ground = 1,
crumbly = PyuTestCore.BLOCK_FAST
crumbly = PyuTest.BLOCK_FAST
})
PyuTestCore.make_building_blocks("pyutest_core:clay", "Clay", {"pyutest-clay-block.png"}, nil, {
PyuTest.make_building_blocks("pyutest_core:clay", "Clay", {"pyutest-clay-block.png"}, nil, {
acid_vulnerable = 1,
crumbly = PyuTestCore.BLOCK_FAST
crumbly = PyuTest.BLOCK_FAST
})
PyuTestCore.make_building_blocks("pyutest_core:gravel", "Gravel", {"pyutest-gravel.png"}, nil, {
PyuTest.make_building_blocks("pyutest_core:gravel", "Gravel", {"pyutest-gravel.png"}, nil, {
falling_node = 1,
acid_vulnerable = 1,
crumbly = PyuTestCore.BLOCK_FAST
crumbly = PyuTest.BLOCK_FAST
})
-- Cracky
PyuTestCore.make_building_blocks("pyutest_core:stone", "Stone", {"pyutest-stone.png"}, nil, {
PyuTest.make_building_blocks("pyutest_core:stone", "Stone", {"pyutest-stone.png"}, nil, {
ground = 1,
stone = 1,
cracky = PyuTestCore.BLOCK_NORMAL,
cracky = PyuTest.BLOCK_NORMAL,
level = 1
}, {is_ground_content = false})
PyuTestCore.make_building_blocks("pyutest_core:sandstone", "Sandstone", {"pyutest-sandstone.png"}, nil, {
PyuTest.make_building_blocks("pyutest_core:darkstone", "Darkstone", {"pyutest-darkstone.png"}, nil, {
ground = 1,
acid_vulnerable = 1,
cracky = PyuTestCore.BLOCK_FAST,
stone = 1,
cracky = PyuTest.BLOCK_NORMAL,
level = 1
}, {is_ground_content = false})
PyuTestCore.make_building_blocks("pyutest_core:ice", "Ice", {"pyutest-ice.png"}, nil, {
PyuTest.make_building_blocks("pyutest_core:sandstone", "Sandstone", {"pyutest-sandstone.png"}, nil, {
ground = 1,
acid_vulnerable = 1,
cracky = PyuTest.BLOCK_FAST,
}, {is_ground_content = false})
PyuTest.make_building_blocks("pyutest_core:ice", "Ice", {"pyutest-ice.png"}, nil, {
ground = 1,
acid_vulnerable = 1,
slippery = 4,
cracky = PyuTestCore.BLOCK_FAST,
cracky = PyuTest.BLOCK_FAST,
thawable = 1
})
PyuTestCore.make_building_blocks("pyutest_core:molten_rock", "Molten Rock", {"pyutest-molten-rock.png"}, nil, {
PyuTest.make_building_blocks("pyutest_core:molten_rock", "Molten Rock", {"pyutest-molten-rock.png"}, nil, {
ground = 1,
cracky = PyuTestCore.BLOCK_FAST,
cracky = PyuTest.BLOCK_FAST,
}, {is_ground_content = false})
PyuTestCore.make_building_blocks("pyutest_core:basalt", "Basalt", {"pyutest-basalt.png"}, nil, {
PyuTest.make_building_blocks("pyutest_core:basalt", "Basalt", {"pyutest-basalt.png"}, nil, {
ground = 1,
cracky = PyuTestCore.BLOCK_FAST,
cracky = PyuTest.BLOCK_FAST,
}, {is_ground_content = false})
PyuTestCore.make_building_blocks("pyutest_core:obsidian", "Obsidian", {"pyutest-obsidian.png"}, nil, {
cracky = PyuTestCore.BLOCK_SLOW,
PyuTest.make_building_blocks("pyutest_core:obsidian", "Obsidian", {"pyutest-obsidian.png"}, nil, {
cracky = PyuTest.BLOCK_SLOW,
}, {is_ground_content = false})
PyuTestCore.make_building_blocks("pyutest_core:crystal_lantern", "Crystal Lantern", {"pyutest-crystal-lantern.png"}, nil, {
cracky = PyuTestCore.BLOCK_FAST
PyuTest.make_building_blocks("pyutest_core:crystal_lantern", "Crystal Lantern", {"pyutest-crystal-lantern.png"}, nil, {
cracky = PyuTest.BLOCK_FAST
}, {
light_source = minetest.LIGHT_MAX
})
PyuTestCore.make_building_blocks("pyutest_core:bone", "Bone", {
PyuTest.make_building_blocks("pyutest_core:bone", "Bone", {
"pyutest-bone-block-top-bottom.png",
"pyutest-bone-block-top-bottom.png",
"pyutest-bone-block.png"
}, nil, {
cracky = PyuTestCore.BLOCK_FAST
cracky = PyuTest.BLOCK_FAST
})
PyuTestCore.make_building_blocks("pyutest_core:enchanted_obsidian", "Enchanted Obsidian", {
PyuTest.make_building_blocks("pyutest_core:enchanted_obsidian", "Enchanted Obsidian", {
"pyutest-enchanted-obsidian.png"
}, nil, {
cracky = PyuTestCore.BLOCK_SLOW
cracky = PyuTest.BLOCK_SLOW
}, {
is_ground_content = false
})
PyuTestCore.make_building_blocks("pyutest_core:brick", "Brick", {"pyutest-bricks.png"}, nil, {
cracky = PyuTestCore.BLOCK_NORMAL
PyuTest.make_building_blocks("pyutest_core:brick", "Brick", {"pyutest-bricks.png"}, nil, {
cracky = PyuTest.BLOCK_NORMAL
}, {
is_ground_content = false
})
PyuTestCore.make_building_blocks("pyutest_core:stone_bricks", "Stone Bricks", {"pyutest-stone-bricks.png"}, nil, {
cracky = PyuTestCore.BLOCK_SLOW
PyuTest.make_building_blocks("pyutest_core:stone_bricks", "Stone Bricks", {"pyutest-stone-bricks.png"}, nil, {
cracky = PyuTest.BLOCK_SLOW
}, {
is_ground_content = false
})
-- Choppy
PyuTestCore.make_building_blocks("pyutest_core:mushroom", "Mushroom", {"pyutest-mushroom.png"}, nil, {
PyuTest.make_building_blocks("pyutest_core:mushroom", "Mushroom", {"pyutest-mushroom.png"}, nil, {
flammable = 1,
choppy = PyuTestCore.BLOCK_FAST
choppy = PyuTest.BLOCK_FAST
}, {is_ground_content = false})
PyuTestCore.make_building_blocks("pyutest_core:mushroom_stem", "Mushroom Stem", {"pyutest-mushroom-stem.png"}, nil, {
PyuTest.make_building_blocks("pyutest_core:mushroom_stem", "Mushroom Stem", {"pyutest-mushroom-stem.png"}, nil, {
flammable = 1,
choppy = PyuTestCore.BLOCK_FAST
choppy = PyuTest.BLOCK_FAST
}, {is_ground_content = false})
PyuTestCore.make_building_blocks("pyutest_core:purple_mushroom", "Purple Mushroom", {
PyuTest.make_building_blocks("pyutest_core:purple_mushroom", "Purple Mushroom", {
"pyutest-purple-mushroom.png"
}, nil, {
flammable = 1,
choppy = PyuTestCore.BLOCK_FAST
choppy = PyuTest.BLOCK_FAST
}, {is_ground_content = false})
-- Breakable by hand
PyuTestCore.make_building_blocks("pyutest_core:haybale", "Haybale", {
PyuTest.make_building_blocks("pyutest_core:haybale", "Haybale", {
"pyutest-haybale-top-bottom.png",
"pyutest-haybale-top-bottom.png",
"pyutest-haybale.png"
}, nil, {
oddly_breakable_by_hand = PyuTestCore.BLOCK_FAST
oddly_breakable_by_hand = PyuTest.BLOCK_FAST
})
PyuTestCore.make_building_blocks("pyutest_core:slime", "Slime", {"pyutest-slime.png"}, nil, {
PyuTest.make_building_blocks("pyutest_core:slime", "Slime", {"pyutest-slime.png"}, nil, {
bouncy = 85,
oddly_breakable_by_hand = PyuTestCore.BLOCK_FAST
oddly_breakable_by_hand = PyuTest.BLOCK_FAST
})
PyuTestCore.make_node("pyutest_core:sponge", "Sponge", {
oddly_breakable_by_hand = PyuTestCore.BLOCK_FAST
PyuTest.make_node("pyutest_core:sponge", "Sponge", {
oddly_breakable_by_hand = PyuTest.BLOCK_FAST
}, {"pyutest-sponge.png"})
PyuTestCore.make_node("pyutest_core:light", "Light", {
PyuTest.make_node("pyutest_core:light", "Light", {
light = 1,
dig_immediate = 1,
oddly_breakable_by_hand = PyuTestCore.BLOCK_FAST
oddly_breakable_by_hand = PyuTest.BLOCK_FAST
}, {
"pyutest-light.png"
}, {
@ -402,11 +409,11 @@ PyuTestCore.make_node("pyutest_core:light", "Light", {
floodable = true
})
PyuTestCore.make_node("pyutest_core:torch", "Torch", {
PyuTest.make_node("pyutest_core:torch", "Torch", {
dig_immediate = 1,
light = 1,
attached_node = 1,
oddly_breakable_by_hand = PyuTestCore.BLOCK_FAST
oddly_breakable_by_hand = PyuTest.BLOCK_FAST
}, {
"pyutest-torch.png",
"pyutest-torch.png^[transform6",
@ -421,8 +428,8 @@ PyuTestCore.make_node("pyutest_core:torch", "Torch", {
floodable = true
})
PyuTestCore.make_node("pyutest_core:glass", "Glass", {
block = PyuTestCore.BLOCK_BREAKABLE_INSTANT
PyuTest.make_node("pyutest_core:glass", "Glass", {
block = PyuTest.BLOCK_BREAKABLE_INSTANT
}, {"pyutest-glass.png"}, {
drawtype = "glasslike_framed",
paramtype = "light",
@ -430,8 +437,8 @@ PyuTestCore.make_node("pyutest_core:glass", "Glass", {
})
-- FIXME: This has been in the game for a month, implement it already!
PyuTestCore.make_node("pyutest_core:trapdoor", "Trapdoor", {
choppy = PyuTestCore.BLOCK_NORMAL,
PyuTest.make_node("pyutest_core:trapdoor", "Trapdoor", {
choppy = PyuTest.BLOCK_NORMAL,
flammable = 1
}, {"pyutest-trapdoor.png"}, {
drawtype = "nodebox",
@ -443,12 +450,12 @@ PyuTestCore.make_node("pyutest_core:trapdoor", "Trapdoor", {
}
})
PyuTestCore.make_node("pyutest_core:contagious_acid", "Contagious Acid", {
crumbly = PyuTestCore.BLOCK_NORMAL,
PyuTest.make_node("pyutest_core:contagious_acid", "Contagious Acid", {
crumbly = PyuTest.BLOCK_NORMAL,
solid_node = 1
}, {"pyutest-acid.png"}, {})
PyuTestCore.make_node("pyutest_core:fire", "Fire", {
PyuTest.make_node("pyutest_core:fire", "Fire", {
dig_immediate = 1
}, {"pyutest-fire.png"}, {
drawtype = "firelike",
@ -461,9 +468,9 @@ PyuTestCore.make_node("pyutest_core:fire", "Fire", {
drop = "pyutest_core:ash 4"
})
PyuTestCore.make_node("pyutest_core:tnt", "TNT", {
PyuTest.make_node("pyutest_core:tnt", "TNT", {
dig_immediate = 1,
oddly_breakable_by_hand = PyuTestCore.BLOCK_FAST
oddly_breakable_by_hand = PyuTest.BLOCK_FAST
}, {
"pyutest-tnt-top-bottom.png",
"pyutest-tnt-top-bottom.png",
@ -474,7 +481,7 @@ PyuTestCore.make_node("pyutest_core:tnt", "TNT", {
if minetest.get_node(pos).name ~= "pyutest_core:tnt" then
return
end
PyuTestCore.create_explosion(pos, 3, true, 7, clicker, true)
PyuTest.create_explosion(pos, 3, true, 7, clicker, true)
end)
end,
@ -483,13 +490,13 @@ PyuTestCore.make_node("pyutest_core:tnt", "TNT", {
if minetest.get_node(pos).name ~= "pyutest_core:tnt" then
return
end
PyuTestCore.create_explosion(pos, 3, true, 7, clicker, true)
PyuTest.create_explosion(pos, 3, true, 7, clicker, true)
end)
end,
})
PyuTestCore.make_node("pyutest_core:crate", "Crate", {
choppy = PyuTestCore.BLOCK_NORMAL
PyuTest.make_node("pyutest_core:crate", "Crate", {
choppy = PyuTest.BLOCK_NORMAL
}, {"pyutest-crate.png"}, {
on_construct = function (pos)
local meta = minetest.get_meta(pos)
@ -522,8 +529,8 @@ PyuTestCore.make_node("pyutest_core:crate", "Crate", {
end
})
PyuTestCore.make_node("pyutest_core:workbench", "Workbench", {
choppy = PyuTestCore.BLOCK_NORMAL
PyuTest.make_node("pyutest_core:workbench", "Workbench", {
choppy = PyuTest.BLOCK_NORMAL
}, {
"pyutest-workbench-top.png",
"pyutest-workbench-bottom.png",
@ -538,7 +545,7 @@ PyuTestCore.make_node("pyutest_core:workbench", "Workbench", {
end
})
PyuTestCore.make_node("pyutest_core:ladder", "Ladder", {
PyuTest.make_node("pyutest_core:ladder", "Ladder", {
dig_immediate = 1
}, {"pyutest-ladder.png"}, {
drawtype = "signlike",

View File

@ -1,9 +1,9 @@
PyuTestCore.make_sword = function (nsname, desc, texture, damage, durability, atkspeed)
PyuTestCore.make_tool(nsname, desc, {
PyuTest.make_sword = function (nsname, desc, texture, damage, durability, atkspeed)
PyuTest.make_tool(nsname, desc, {
weapon = 1
}, texture, {
stack_max = 1,
tool_capabilities = PyuTestCore.tool_caps({
tool_capabilities = PyuTest.tool_caps({
uses = durability / 2,
attack_uses = durability,
damage_groups = {fleshy = damage or 3},
@ -12,7 +12,7 @@ PyuTestCore.make_sword = function (nsname, desc, texture, damage, durability, at
})
end
PyuTestCore.make_sword("pyutest_core:wooden_sword", "Wooden Sword", "pyutest-wooden-sword.png", 4, 69, 1.1)
PyuTestCore.make_sword("pyutest_core:stone_sword", "Stone Sword", "pyutest-stone-sword.png", 5, 274, 1.05)
PyuTestCore.make_sword("pyutest_core:iron_sword", "Iron Sword", "pyutest-iron-sword.png", 6, 689, 0.8)
PyuTestCore.make_sword("pyutest_core:diamond_sword", "Diamond Sword", "pyutest-diamond-sword.png", 7, 1345, 0.7)
PyuTest.make_sword("pyutest_core:wooden_sword", "Wooden Sword", "pyutest-wooden-sword.png", 4, 69, 1.1)
PyuTest.make_sword("pyutest_core:stone_sword", "Stone Sword", "pyutest-stone-sword.png", 5, 274, 1.05)
PyuTest.make_sword("pyutest_core:iron_sword", "Iron Sword", "pyutest-iron-sword.png", 6, 689, 0.8)
PyuTest.make_sword("pyutest_core:diamond_sword", "Diamond Sword", "pyutest-diamond-sword.png", 7, 1345, 0.7)

View File

@ -19,8 +19,8 @@ local function get_neighbours(pos)
}
end
PyuTestCore.make_button = function (id, desc, groups, tiles)
PyuTestCore.make_node(id, desc, PyuTestCore.util.tableconcat(groups, {
PyuTest.make_button = function (id, desc, groups, tiles)
PyuTest.make_node(id, desc, PyuTest.util.tableconcat(groups, {
electric = 1
}), tiles, {
is_ground_content = false,
@ -42,12 +42,12 @@ PyuTestCore.make_button = function (id, desc, groups, tiles)
})
end
PyuTestCore.make_wire = function (id, desc, groups, color, efn)
PyuTest.make_wire = function (id, desc, groups, color, efn)
local fn = efn or function (def, pos, node, clicker, sender_pos)
def.__on_electricity_activated(pos, node, clicker, sender_pos)
end
PyuTestCore.make_node(id, desc, PyuTestCore.util.tableconcat(groups, {
PyuTest.make_node(id, desc, PyuTest.util.tableconcat(groups, {
electric = 1
}), {"pyutest-wire.png"}, {
drawtype = "signlike",
@ -80,28 +80,28 @@ PyuTestCore.make_wire = function (id, desc, groups, color, efn)
})
end
PyuTestCore.make_button("pyutest_core:button", "Button", {
cracky = PyuTestCore.BLOCK_NORMAL,
PyuTest.make_button("pyutest_core:button", "Button", {
cracky = PyuTest.BLOCK_NORMAL,
}, {"pyutest-button.png"})
PyuTestCore.make_wire("pyutest_core:copper_wire", "Copper Wire", {
snappy = PyuTestCore.BLOCK_NORMAL
PyuTest.make_wire("pyutest_core:copper_wire", "Copper Wire", {
snappy = PyuTest.BLOCK_NORMAL
}, "darkgoldenrod")
PyuTestCore.make_wire("pyutest_core:zinc_wire", "Zinc Wire", {
snappy = PyuTestCore.BLOCK_NORMAL
PyuTest.make_wire("pyutest_core:zinc_wire", "Zinc Wire", {
snappy = PyuTest.BLOCK_NORMAL
}, "#bed3d4", function (def, pos, node, clicker, sender_pos)
minetest.after(0.2, function ()
def.__on_electricity_activated(pos, node, clicker, sender_pos)
end)
end)
PyuTestCore.make_node("pyutest_core:freezer_device", "Freezer Device", {
cracky = PyuTestCore.BLOCK_FAST,
PyuTest.make_node("pyutest_core:freezer_device", "Freezer Device", {
cracky = PyuTest.BLOCK_FAST,
electric = 1
}, {"pyutest-freezer.png"}, {
__on_electricity_activated = function(pos, node, clicker)
PyuTestCore.dorange(pos, 2, function (p)
PyuTest.dorange(pos, 2, function (p)
local n = minetest.get_node(p)
if minetest.get_item_group(n.name, "freezable") ~= 0 then
@ -111,12 +111,12 @@ PyuTestCore.make_node("pyutest_core:freezer_device", "Freezer Device", {
end
})
PyuTestCore.make_node("pyutest_core:heater_device", "Heater Device", {
cracky = PyuTestCore.BLOCK_FAST,
PyuTest.make_node("pyutest_core:heater_device", "Heater Device", {
cracky = PyuTest.BLOCK_FAST,
electric = 1
}, {"pyutest-heater.png"}, {
__on_electricity_activated = function(pos, node, clicker)
PyuTestCore.dorange(pos, 2, function (p)
PyuTest.dorange(pos, 2, function (p)
local n = minetest.get_node(p)
if minetest.get_item_group(n.name, "thawable") ~= 0 then

View File

@ -1,12 +1,12 @@
PyuTestCore.registered_flowers = {}
PyuTestCore.make_flower = function (name, desc, texture, dye, add_to_registry, drawtype, econf)
PyuTestCore.make_node(name, desc, {
PyuTest.registered_flowers = {}
PyuTest.make_flower = function (name, desc, texture, dye, add_to_registry, drawtype, econf)
PyuTest.make_node(name, desc, {
flammable = 1,
flower = 1,
attached_node = 3,
dig_immediate = 1,
oddly_breakable_by_hand = PyuTestCore.BLOCK_FAST
}, {texture}, PyuTestCore.util.tableconcat({
oddly_breakable_by_hand = PyuTest.BLOCK_FAST
}, {texture}, PyuTest.util.tableconcat({
drawtype = drawtype or "plantlike",
walkable = false,
waving = 1,
@ -27,27 +27,27 @@ PyuTestCore.make_flower = function (name, desc, texture, dye, add_to_registry, d
-- This is for plants like deadbushes which I do not want spawning in for say, Forests.
if add_to_registry then
table.insert(PyuTestCore.registered_flowers, name)
table.insert(PyuTest.registered_flowers, name)
end
end
-- Plants from before the floral update
PyuTestCore.make_flower("pyutest_core:rose", "Rose", "pyutest-flower.png", "pyutest_core:red_dye", true)
PyuTestCore.make_flower("pyutest_core:dandelion", "Dandelion", "pyutest-flower2.png", "pyutest_core:yellow_dye", true)
PyuTestCore.make_flower("pyutest_core:blue_daisy", "Blue Daisy", "pyutest-flower3.png", "pyutest_core:blue_dye", true)
PyuTestCore.make_flower("pyutest_core:lavender", "Lavender", "pyutest-flower4.png", "pyutest_core:purple_dye", true)
PyuTest.make_flower("pyutest_core:rose", "Rose", "pyutest-flower.png", "pyutest_core:red_dye", true)
PyuTest.make_flower("pyutest_core:dandelion", "Dandelion", "pyutest-flower2.png", "pyutest_core:yellow_dye", true)
PyuTest.make_flower("pyutest_core:blue_daisy", "Blue Daisy", "pyutest-flower3.png", "pyutest_core:blue_dye", true)
PyuTest.make_flower("pyutest_core:lavender", "Lavender", "pyutest-flower4.png", "pyutest_core:purple_dye", true)
minetest.register_alias("pyutest_core:flower", "pyutest_core:rose")
minetest.register_alias("pyutest_core:flower2", "pyutest_core:dandelion")
minetest.register_alias("pyutest_core:flower3", "pyutest_core:blue_daisy")
minetest.register_alias("pyutest_core:flower4", "pyutest_core:lavender")
PyuTestCore.make_flower("pyutest_core:deadbush", "Deadbush", "pyutest-deadbush.png", "pyutest_core:brown_dye")
PyuTestCore.make_flower("pyutest_core:grass_plant", "Grass", "pyutest-grass-plant.png", "pyutest_core:green_dye")
PyuTestCore.make_flower("pyutest_core:sugarcane", "Sugarcane", "pyutest-sugarcane.png", "pyutest_core:green_dye", false, nil)
PyuTest.make_flower("pyutest_core:deadbush", "Deadbush", "pyutest-deadbush.png", "pyutest_core:brown_dye")
PyuTest.make_flower("pyutest_core:grass_plant", "Grass", "pyutest-grass-plant.png", "pyutest_core:green_dye")
PyuTest.make_flower("pyutest_core:sugarcane", "Sugarcane", "pyutest-sugarcane.png", "pyutest_core:green_dye", false, nil)
PyuTestCore.make_node("pyutest_core:lilypad", "Lily Pad", {
block = PyuTestCore.BLOCK_BREAKABLE_INSTANT
PyuTest.make_node("pyutest_core:lilypad", "Lily Pad", {
block = PyuTest.BLOCK_BREAKABLE_INSTANT
}, {"pyutest-lilypad.png"}, {
drawtype = "signlike",
paramtype = "light",
@ -61,12 +61,12 @@ 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", false)
PyuTest.make_flower("pyutest_core:maybell", "Maybell", "pyutest-maybell.png", "pyutest_core:white_dye", true)
PyuTest.make_flower("pyutest_core:orange_tulip", "Orange Tulip", "pyutest-orange-tulip.png", "pyutest_core:orange_dye", true)
PyuTest.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,
PyuTest.make_node("pyutest_core:vines", "Vines", {
block = PyuTest.BLOCK_BREAKABLE_INSTANT,
attached_node = 1,
flammable = 1
}, {"pyutest-vines.png"}, {
@ -83,7 +83,7 @@ PyuTestCore.make_node("pyutest_core:vines", "Vines", {
inventory_image = "pyutest-vines.png"
})
PyuTestCore.make_flower("pyutest_core:kelp", "Kelp", "pyutest-kelp.png", "pyutest_core:green_dye", false, "plantlike_rooted", {
PyuTest.make_flower("pyutest_core:kelp", "Kelp", "pyutest-kelp.png", "pyutest_core:green_dye", false, "plantlike_rooted", {
paramtype2 = "leveled",
place_param2 = 128,
wield_image = "pyutest-kelp.png",
@ -101,13 +101,13 @@ PyuTestCore.make_flower("pyutest_core:kelp", "Kelp", "pyutest-kelp.png", "pyutes
})
PyuTestCore.make_flower("pyutest_core:small_mushroom",
PyuTest.make_flower("pyutest_core:small_mushroom",
"Small Mushroom",
"pyutest-mushroom-small.png",
"pyutest_core:red_dye",
false, nil, {
groups = {
block = PyuTestCore.BLOCK_BREAKABLE_INSTANT,
block = PyuTest.BLOCK_BREAKABLE_INSTANT,
flammable = 1,
flower = 1,
dig_immediate = 1,

View File

@ -1,7 +1,7 @@
PyuTestCore.make_food = function (nsname, desc, wield_image, health_fill, extra_code)
PyuTest.make_food = function (nsname, desc, wield_image, health_fill, extra_code)
local code = extra_code or function()end
PyuTestCore.make_item(nsname, desc, {}, wield_image, {
PyuTest.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})
@ -11,6 +11,6 @@ PyuTestCore.make_food = function (nsname, desc, wield_image, health_fill, extra_
})
end
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)
PyuTest.make_food("pyutest_core:apple", "Apple", "pyutest-apple.png", 6)
PyuTest.make_food("pyutest_core:bread", "Bread", "pyutest-bread.png", 4)
PyuTest.make_food("pyutest_core:water_bottle", "Water Bottle", "pyutest-water-bottle.png", 0)

View File

@ -15,8 +15,8 @@ local function furnace_formspec(pos)
return table.concat(formspec)
end
PyuTestCore.make_node("pyutest_core:furnace", "Furnace", {
cracky = PyuTestCore.BLOCK_NORMAL,
PyuTest.make_node("pyutest_core:furnace", "Furnace", {
cracky = PyuTest.BLOCK_NORMAL,
level = 1
}, {
"pyutest-furnace-top-bottom.png",

View File

@ -1,4 +1,4 @@
PyuTestCore.FURNITURE_NODEBOXES = {
PyuTest.FURNITURE_NODEBOXES = {
TABLE = {
type = "connected",
fixed = {
@ -8,40 +8,40 @@ PyuTestCore.FURNITURE_NODEBOXES = {
}
}
PyuTestCore.registered_furniture = {}
PyuTestCore.make_furniture = function(name, desc, craft, tiles, cgroups, extra_conf)
PyuTest.registered_furniture = {}
PyuTest.make_furniture = function(name, desc, craft, tiles, cgroups, extra_conf)
local econf = extra_conf or {}
local groups = PyuTestCore.util.tablecopy(cgroups) or {
block = PyuTestCore.BLOCK_BREAKABLE_NORMAL
local groups = PyuTest.util.tablecopy(cgroups) or {
block = PyuTest.BLOCK_BREAKABLE_NORMAL
}
groups["block"] = groups["block"] or PyuTestCore.BLOCK_BREAKABLE_NORMAL
groups["block"] = groups["block"] or PyuTest.BLOCK_BREAKABLE_NORMAL
groups["furniture"] = 1
local id_table = name.."_table"
local id_chair = name.."_chair"
local id_mtable = name.."_mtable"
minetest.register_node(id_table, PyuTestCore.util.tableconcat({
minetest.register_node(id_table, PyuTest.util.tableconcat({
description = Translate(desc.." Table"),
tiles = tiles,
groups = PyuTestCore.util.tableconcat(groups, {
groups = PyuTest.util.tableconcat(groups, {
table = 1
}),
sounds = PyuTestCore.make_node_sounds(),
sounds = PyuTest.make_node_sounds(),
drawtype = "nodebox",
paramtype = "light",
node_box = PyuTestCore.FURNITURE_NODEBOXES.TABLE,
node_box = PyuTest.FURNITURE_NODEBOXES.TABLE,
connects_to = {"group:table"}
}, econf))
minetest.register_node(id_chair, PyuTestCore.util.tableconcat({
minetest.register_node(id_chair, PyuTest.util.tableconcat({
description = Translate(desc.." Chair"),
tiles = tiles,
groups = PyuTestCore.util.tableconcat(groups, {
groups = PyuTest.util.tableconcat(groups, {
chair = 1,
attached_node = 3,
}),
sounds = PyuTestCore.make_node_sounds(),
sounds = PyuTest.make_node_sounds(),
paramtype = "light",
paramtype2 = "4dir",
drawtype = "mesh",
@ -58,14 +58,14 @@ PyuTestCore.make_furniture = function(name, desc, craft, tiles, cgroups, extra_c
}
}, econf))
minetest.register_node(id_mtable, PyuTestCore.util.tableconcat({
minetest.register_node(id_mtable, PyuTest.util.tableconcat({
description = Translate(desc.." Mini Table"),
tiles = tiles,
groups = PyuTestCore.util.tableconcat(groups, {
groups = PyuTest.util.tableconcat(groups, {
mtable = 1,
attached_node = 3,
}),
sounds = PyuTestCore.make_node_sounds(),
sounds = PyuTest.make_node_sounds(),
paramtype = "light",
paramtype2 = "4dir",
drawtype = "mesh",
@ -108,7 +108,7 @@ PyuTestCore.make_furniture = function(name, desc, craft, tiles, cgroups, extra_c
}
})
PyuTestCore.registered_furniture[name] = {
PyuTest.registered_furniture[name] = {
craft = craft,
groups = groups,
tiles = tiles,
@ -116,6 +116,6 @@ PyuTestCore.make_furniture = function(name, desc, craft, tiles, cgroups, extra_c
}
end
for _, v in pairs(PyuTestCore.building_blocks) do
PyuTestCore.make_furniture(v.name, v.desc, v.name.."_block", v.tiles, v.groups, v.econf)
for _, v in pairs(PyuTest.building_blocks) do
PyuTest.make_furniture(v.name, v.desc, v.name.."_block", v.tiles, v.groups, v.econf)
end

View File

@ -1,20 +1,19 @@
Translate = minetest.get_translator("pyutest_core")
PyuTestCore = {
BLOCK_FAST = 3,
BLOCK_NORMAL = 2,
BLOCK_SLOW = 1
}
PyuTestCore_SurfaceBottom = 1
PyuTestCore_WorldTop = 31000
PyuTestCore_WorldBottom = -31000
PyuTest.BLOCK_FAST = 3
PyuTest.BLOCK_NORMAL = 2
PyuTest.BLOCK_SLOW = 1
PyuTest.SURFACE_BOTTOM = 1
PyuTest.OVERWORLD_TOP = 4096
PyuTest.OVERWORLD_BOTTOM = -70
-- these values are yoinked from VoxeLibre
-- (https://git.minetest.land/VoxeLibre/VoxeLibre/src/branch/master/mods/MAPGEN/mcl_biomes/init.lua)
PyuTestCore_OceanMin = -15
PyuTestCore_DeepOceanMax = PyuTestCore_OceanMin - 1
PyuTestCore_DeepOceanMin = -31
PyuTest.OCEAN_MIN = -15
PyuTest.DEEP_OCEAN_MAX = PyuTest.OCEAN_MIN - 1
PyuTest.DEEP_OCEAN_MIN = -31
PyuTestCore.get_schem_path = function (name)
PyuTest.get_schem_path = function (name)
return minetest.get_modpath("pyutest_mapgen") .. "/schematics/"..name..".mts"
end
PyuTestCore_Path = minetest.get_modpath("pyutest_core")

View File

@ -1,4 +1,4 @@
PyuTestCore.make_item = function (nsname, desc, groups, wield_image, extra_conf)
PyuTest.make_item = function (nsname, desc, groups, wield_image, extra_conf)
local conf = {
description = Translate(desc),
wield_image = wield_image,
@ -15,21 +15,21 @@ PyuTestCore.make_item = function (nsname, desc, groups, wield_image, extra_conf)
minetest.register_craftitem(nsname, conf)
end
PyuTestCore.make_item("pyutest_core:stick", "Stick", {}, "pyutest-stick.png")
PyuTest.make_item("pyutest_core:stick", "Stick", {}, "pyutest-stick.png")
PyuTestCore.make_item("pyutest_core:bone", "Bone", {}, "pyutest-bone.png", {})
PyuTest.make_item("pyutest_core:bone", "Bone", {}, "pyutest-bone.png", {})
PyuTestCore.make_item("pyutest_core:gunpowder", "Gunpowder", {}, "pyutest-powder.png", {
PyuTest.make_item("pyutest_core:gunpowder", "Gunpowder", {}, "pyutest-powder.png", {
color = "dimgray",
})
PyuTestCore.make_item("pyutest_core:ash", "Ash", {}, "pyutest-powder.png", {
PyuTest.make_item("pyutest_core:ash", "Ash", {}, "pyutest-powder.png", {
color = "gray",
})
PyuTestCore.make_item("pyutest_core:sugar", "Sugar", {}, "pyutest-powder.png")
PyuTest.make_item("pyutest_core:sugar", "Sugar", {}, "pyutest-powder.png")
PyuTestCore.make_item("pyutest_core:coin", "Coin", {}, "pyutest-coin.png", {
PyuTest.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}, {
@ -39,15 +39,15 @@ PyuTestCore.make_item("pyutest_core:coin", "Coin", {}, "pyutest-coin.png", {
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", {
PyuTest.make_item("pyutest_core:wheat", "Wheat", {}, "pyutest-wheat.png")
PyuTest.make_item("pyutest_core:string", "String", {}, "pyutest-string.png")
PyuTest.make_item("pyutest_core:egg", "Egg", {}, "pyutest-egg.png", {
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", {
PyuTest.make_item("pyutest_core:clay", "Clay Ball", {}, "pyutest-clay.png")
PyuTest.make_item("pyutest_core:glass_bottle", "Glass Bottle", {}, "pyutest-glass-bottle.png", {
stack_max = 16
})
PyuTestCore.make_item("pyutest_core:brick", "Brick", {}, "pyutest-brick.png")
PyuTestCore.make_item("pyutest_core:snowball", "Snowball", {}, "pyutest-snowball.png")
PyuTestCore.make_item("pyutest_core:bone", "Bone", {}, "pyutest-bone.png")
PyuTest.make_item("pyutest_core:brick", "Brick", {}, "pyutest-brick.png")
PyuTest.make_item("pyutest_core:snowball", "Snowball", {}, "pyutest-snowball.png")
PyuTest.make_item("pyutest_core:bone", "Bone", {}, "pyutest-bone.png")

View File

@ -1,12 +1,12 @@
PyuTestCore.registered_leaves = {}
PyuTestCore.make_leaves = function (id, desc, tiles)
PyuTest.registered_leaves = {}
PyuTest.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, {
PyuTest.make_building_blocks(_id, _desc, tiles, nil, {
acid_vulnerable = 1,
flammable = 1,
snappy = PyuTestCore.BLOCK_FAST
snappy = PyuTest.BLOCK_FAST
}, {
is_ground_content = false
})
@ -28,15 +28,15 @@ PyuTestCore.make_leaves = function (id, desc, tiles)
}
})
PyuTestCore.registered_leaves[_id] = {
PyuTest.registered_leaves[_id] = {
tiles = tiles
}
end
PyuTestCore.make_leaves(nil, nil, {"pyutest-leaves.png"})
PyuTestCore.make_leaves("pyutest_core:snowy", "Snowy", {"pyutest-snowy-leaves.png"})
PyuTestCore.make_leaves("pyutest_core:cherry", "Cherry", {"pyutest-cherry-leaves.png"})
PyuTestCore.make_leaves("pyutest_core:dark", "Dark", {"pyutest-dark-leaves.png"})
PyuTestCore.make_leaves("pyutest_core:aspen", "Aspen", {"pyutest-aspen-leaves.png"})
PyuTestCore.make_leaves("pyutest_core:red_aspen", "Red Aspen", {"pyutest-red-aspen-leaves.png"})
PyuTestCore.make_leaves("pyutest_core:vyn", "Vyn", {"pyutest-vyn-leaves.png"})
PyuTest.make_leaves(nil, nil, {"pyutest-leaves.png"})
PyuTest.make_leaves("pyutest_core:snowy", "Snowy", {"pyutest-snowy-leaves.png"})
PyuTest.make_leaves("pyutest_core:cherry", "Cherry", {"pyutest-cherry-leaves.png"})
PyuTest.make_leaves("pyutest_core:dark", "Dark", {"pyutest-dark-leaves.png"})
PyuTest.make_leaves("pyutest_core:aspen", "Aspen", {"pyutest-aspen-leaves.png"})
PyuTest.make_leaves("pyutest_core:red_aspen", "Red Aspen", {"pyutest-red-aspen-leaves.png"})
PyuTest.make_leaves("pyutest_core:vyn", "Vyn", {"pyutest-vyn-leaves.png"})

View File

@ -1,5 +1,5 @@
PyuTestCore.registered_liquids = {}
PyuTestCore.make_liquid = function (name, desc, groups, texture, speed, extra_conf)
PyuTest.registered_liquids = {}
PyuTest.make_liquid = function (name, desc, groups, texture, speed, extra_conf)
local function make_liquid_flags(liquidtype)
local drawtype = ""
@ -9,7 +9,7 @@ PyuTestCore.make_liquid = function (name, desc, groups, texture, speed, extra_co
drawtype = "flowingliquid"
end
local t = PyuTestCore.util.tableconcat({
local t = PyuTest.util.tableconcat({
drawtype = drawtype,
waving = 3,
walkable = false,
@ -43,10 +43,10 @@ PyuTestCore.make_liquid = function (name, desc, groups, texture, speed, extra_co
local g = groups or {}
g["liquid"] = 1
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"))
PyuTest.make_node(name.."_source", desc .. " Source", g, {texture}, make_liquid_flags("source"))
PyuTest.make_node(name.."_flowing", "Flowing " .. desc, g, {texture}, make_liquid_flags("flowing"))
PyuTestCore.registered_liquids[name] = {
PyuTest.registered_liquids[name] = {
source = name.."_source",
flowing = name.."_flowing",
texture = texture,
@ -54,7 +54,7 @@ PyuTestCore.make_liquid = function (name, desc, groups, texture, speed, extra_co
}
end
PyuTestCore.make_liquid("pyutest_core:water", "Water", {
PyuTest.make_liquid("pyutest_core:water", "Water", {
water = 1,
freezable = 1
}, "pyutest-water.png", 1, {
@ -62,13 +62,13 @@ PyuTestCore.make_liquid("pyutest_core:water", "Water", {
paramtype2 = "color",
})
PyuTestCore.make_liquid("pyutest_core:lava", "Lava", {
PyuTest.make_liquid("pyutest_core:lava", "Lava", {
lava = 1
}, "pyutest-lava.png", 5, {
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, {
PyuTest.make_liquid("pyutest_core:oil", "Oil", {}, "pyutest-oil.png", 3)
PyuTest.make_liquid("pyutest_core:liquid_acid", "Acid", {}, "pyutest-acid.png", 7, {
damage_per_second = 4
})

View File

@ -1,14 +1,14 @@
PyuTestCore.registered_lootboxes = {}
PyuTestCore.make_lootbox = function (name, dname, items)
PyuTest.registered_lootboxes = {}
PyuTest.make_lootbox = function (name, dname, items)
local id = name.."_lootbox"
minetest.register_node(id, {
description = Translate(dname .. " Lootbox"),
groups = {
choppy = PyuTestCore.BLOCK_NORMAL,
choppy = PyuTest.BLOCK_NORMAL,
not_in_creative_inventory = 1
},
tiles = {"pyutest-crate.png"},
sounds = PyuTestCore.make_node_sounds(),
sounds = PyuTest.make_node_sounds(),
drop = "",
after_destruct = function (pos)
for _, v in pairs(items) do
@ -22,19 +22,19 @@ PyuTestCore.make_lootbox = function (name, dname, items)
minetest.remove_node(pos)
end
})
PyuTestCore.registered_lootboxes[name] = {
PyuTest.registered_lootboxes[name] = {
id = id,
items = items
}
end
PyuTestCore.make_lootbox("pyutest_core:trash", "Trash", {
PyuTest.make_lootbox("pyutest_core:trash", "Trash", {
ItemStack("pyutest_core:deadbush 6"),
ItemStack("pyutest_core:bone 3"),
ItemStack("pyutest_core:ash 2")
})
PyuTestCore.make_lootbox("pyutest_core:resource", "Resource", {
PyuTest.make_lootbox("pyutest_core:resource", "Resource", {
ItemStack("pyutest_core:gunpowder 3"),
ItemStack("pyutest_core:stick 4"),
ItemStack("pyutest_core:sugar 2"),
@ -43,17 +43,17 @@ PyuTestCore.make_lootbox("pyutest_core:resource", "Resource", {
ItemStack("pyutest_core:string 5")
})
PyuTestCore.make_lootbox("pyutest_core:griefer", "Griefer's Dream", {
PyuTest.make_lootbox("pyutest_core:griefer", "Griefer's Dream", {
ItemStack("pyutest_core:tnt 3"),
ItemStack("pyutest_core:bomb 2")
})
PyuTestCore.make_lootbox("pyutest_core:lighting", "Lighting", {
PyuTest.make_lootbox("pyutest_core:lighting", "Lighting", {
ItemStack("pyutest_core:light 2"),
ItemStack("pyutest_core:torch 5")
})
PyuTestCore.make_lootbox("pyutest_core:color", "Color", {
PyuTest.make_lootbox("pyutest_core:color", "Color", {
ItemStack("pyutest_core:green_dye 2"),
ItemStack("pyutest_core:pink_dye 3"),
ItemStack("pyutest_core:white_dye 1"),

View File

@ -1,4 +1,4 @@
PyuTestCore.make_item("pyutest_core:magic_shards", "Magic Shards", {}, "pyutest-magic-shards.png")
PyuTest.make_item("pyutest_core:magic_shards", "Magic Shards", {}, "pyutest-magic-shards.png")
minetest.override_item("pyutest_core:enchanted_obsidian_block", {
drop = {
max_items = 1,
@ -15,13 +15,13 @@ minetest.override_item("pyutest_core:enchanted_obsidian_block", {
}
})
PyuTestCore.registered_spellbooks = {}
PyuTestCore.make_spellbook = function (nsname, desc, color, craftitem, action)
PyuTest.registered_spellbooks = {}
PyuTest.make_spellbook = function (nsname, desc, color, craftitem, action)
if action == nil then
action = function(_, _, _)end
end
PyuTestCore.make_item(nsname, desc, {}, "pyutest-spellbook.png", {
PyuTest.make_item(nsname, desc, {}, "pyutest-spellbook.png", {
stack_max = 1,
color = color,
on_use = function (itemstack, user, pointed_thing)
@ -40,18 +40,18 @@ PyuTestCore.make_spellbook = function (nsname, desc, color, craftitem, action)
}
})
PyuTestCore.registered_spellbooks[nsname] = {
PyuTest.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)
PyuTest.make_spellbook("pyutest_core:explosions_spellbook", "Spellbook of Explosions", "gray", "pyutest_core:bomb", function (itemstack, user)
PyuTest.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)
PyuTest.make_spellbook("pyutest_core:fire_spellbook", "Spellbook of Fire", "crimson", "pyutest_core:hellstone_block", function (itemstack, user)
local range = 2
local function replace(pos)
@ -75,7 +75,7 @@ PyuTestCore.make_spellbook("pyutest_core:fire_spellbook", "Spellbook of Fire", "
end)
PyuTestCore.make_item("pyutest_core:enchanted_shard", "Enchanted Shard", {}, "pyutest-shard.png", {
PyuTest.make_item("pyutest_core:enchanted_shard", "Enchanted Shard", {}, "pyutest-shard.png", {
color = "indigo",
})
@ -88,18 +88,18 @@ minetest.register_craft({
}
})
PyuTestCore.make_tool("pyutest_core:enchanted_pickaxe", "Enchanted Pickaxe", {}, "pyutest-enchanted-pickaxe.png", {
PyuTest.make_tool("pyutest_core:enchanted_pickaxe", "Enchanted Pickaxe", {}, "pyutest-enchanted-pickaxe.png", {
stack_max = 1,
tool_capabilities = PyuTestCore.tool_caps({
tool_capabilities = PyuTest.tool_caps({
uses = 2768,
attack_uses = 2768 / 2,
maxlevel = 4,
groupcaps = {
cracky = {
times = {
[PyuTestCore.BLOCK_FAST] = 0.25,
[PyuTestCore.BLOCK_NORMAL] = 0.6,
[PyuTestCore.BLOCK_SLOW] = 7
[PyuTest.BLOCK_FAST] = 0.25,
[PyuTest.BLOCK_NORMAL] = 0.6,
[PyuTest.BLOCK_SLOW] = 7
}
}
}
@ -115,7 +115,7 @@ minetest.register_craft({
}
})
PyuTestCore.make_sword("pyutest_core:enchanted_sword", "Enchanted Sword", "pyutest-enchanted-sword.png", 9, 3600, 0.7)
PyuTest.make_sword("pyutest_core:enchanted_sword", "Enchanted Sword", "pyutest-enchanted-sword.png", 9, 3600, 0.7)
minetest.register_craft({
@ -128,7 +128,7 @@ minetest.register_craft({
})
PyuTestCore.make_item("pyutest_core:windball", "Windball", {}, "pyutest-windball.png", {
PyuTest.make_item("pyutest_core:windball", "Windball", {}, "pyutest-windball.png", {
stack_max = 16,
on_use = function (_, user)
if user == nil then

View File

@ -1,18 +1,18 @@
PyuTestCore.make_building_blocks("pyutest_core:granite", "Granite", {"pyutest-granite.png"}, nil, {
PyuTest.make_building_blocks("pyutest_core:granite", "Granite", {"pyutest-granite.png"}, nil, {
ground = 1,
stone = 1,
cracky = PyuTestCore.BLOCK_NORMAL,
cracky = PyuTest.BLOCK_NORMAL,
level = 1
})
PyuTestCore.make_building_blocks("pyutest_core:andesite", "Andesite", {"pyutest-andesite.png"}, nil, {
PyuTest.make_building_blocks("pyutest_core:andesite", "Andesite", {"pyutest-andesite.png"}, nil, {
ground = 1,
stone = 1,
cracky = PyuTestCore.BLOCK_NORMAL,
cracky = PyuTest.BLOCK_NORMAL,
level = 1
})
PyuTestCore.SPECIALSTONE_NOISE_PARAMS = {
PyuTest.SPECIALSTONE_NOISE_PARAMS = {
offset = 0,
scale = 1,
spread = {x = 250, y = 250, z = 250},
@ -30,9 +30,9 @@ minetest.register_ore({
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
y_max = PyuTest.SURFACE_BOTTOM - 1,
y_min = PyuTest.OVERWORLD_BOTTOM,
noise_params = PyuTest.SPECIALSTONE_NOISE_PARAMS
})
minetest.register_ore({
@ -42,9 +42,9 @@ minetest.register_ore({
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
y_max = PyuTest.SURFACE_BOTTOM - 1,
y_min = PyuTest.OVERWORLD_BOTTOM,
noise_params = PyuTest.SPECIALSTONE_NOISE_PARAMS
})
minetest.register_ore({
@ -54,26 +54,26 @@ minetest.register_ore({
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
y_max = PyuTest.SURFACE_BOTTOM - 1,
y_min = PyuTest.DEAP_OCEAN_MIN,
noise_params = PyuTest.SPECIALSTONE_NOISE_PARAMS
})
PyuTestCore.ORE_STONES = {
PyuTest.ORE_STONES = {
"pyutest_core:stone_block",
"pyutest_core:granite_block",
"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 = {}
PyuTest.registered_ores = {}
PyuTestCore.make_ore = function(id, desc, item_id_suffix, item_description_suffix, options)
PyuTest.make_ore = function(id, desc, item_id_suffix, item_description_suffix, options)
local default_options = {
scarcity = 5 * 5 * 5,
y_max = 31000,
ore_strength = PyuTestCore.BLOCK_NORMAL,
ore_strength = PyuTest.BLOCK_NORMAL,
ore_conf = {},
ore_groups = {},
ore_drop = nil,
@ -113,22 +113,22 @@ PyuTestCore.make_ore = function(id, desc, item_id_suffix, item_description_suffi
local iid = id.."_"..item_id_suffix
local rid = conf.make_raw and id.."_raw" or nil
minetest.register_node(oid, PyuTestCore.util.tableconcat({
minetest.register_node(oid, PyuTest.util.tableconcat({
description = Translate(desc .. " Ore"),
groups = PyuTestCore.util.tableconcat({
groups = PyuTest.util.tableconcat({
cracky = conf.ore_strength,
mineral = 1,
level = conf.ore_level
}, conf.ore_groups),
light_source = 2.2,
drop = conf.ore_drop or (conf.make_raw and rid or iid) .. " " .. tostring(conf.ore_drop_count or 1),
sounds = PyuTestCore.make_node_sounds(conf.ore_sounds),
sounds = PyuTest.make_node_sounds(conf.ore_sounds),
tiles = conf.ore_tiles
}, conf.ore_conf))
minetest.register_craftitem(iid, PyuTestCore.util.tableconcat({
minetest.register_craftitem(iid, PyuTest.util.tableconcat({
description = Translate(desc .. " " .. item_description_suffix),
groups = PyuTestCore.util.tableconcat({
groups = PyuTest.util.tableconcat({
mineral = 1
}, conf.item_groups),
wield_image = conf.item_texture,
@ -136,9 +136,9 @@ PyuTestCore.make_ore = function(id, desc, item_id_suffix, item_description_suffi
}, conf.item_conf))
if conf.make_raw then
minetest.register_craftitem(rid, PyuTestCore.util.tableconcat({
minetest.register_craftitem(rid, PyuTest.util.tableconcat({
description = Translate("Raw " .. desc),
groups = PyuTestCore.util.tableconcat({
groups = PyuTest.util.tableconcat({
mineral = 1,
raw_mineral = 1
}, conf.raw_groups),
@ -156,37 +156,37 @@ PyuTestCore.make_ore = function(id, desc, item_id_suffix, item_description_suffi
minetest.register_ore({
ore_type = "scatter",
ore = oid,
wherein = PyuTestCore.ORE_STONES,
wherein = PyuTest.ORE_STONES,
clust_scarcity = conf.scarcity,
clust_num_ores = 4,
clust_size = 3,
y_max = conf.y_max,
y_min = PyuTestCore_WorldBottom,
y_min = PyuTest.OVERWORLD_BOTTOM,
})
minetest.register_ore({
ore_type = "scatter",
ore = oid,
wherein = PyuTestCore.ORE_STONES,
wherein = PyuTest.ORE_STONES,
clust_scarcity = conf.scarcity * 2.2,
clust_num_ores = 9,
clust_size = 3,
y_max = conf.y_max,
y_min = PyuTestCore_WorldBottom,
y_min = PyuTest.OVERWORLD_BOTTOM,
})
minetest.register_ore({
ore_type = "scatter",
ore = oid,
wherein = PyuTestCore.ORE_STONES,
wherein = PyuTest.ORE_STONES,
clust_scarcity = conf.scarcity * 3,
clust_num_ores = 18,
clust_size = 6,
y_max = conf.y_max,
y_min = PyuTestCore_WorldBottom,
y_min = PyuTest.OVERWORLD_BOTTOM,
})
PyuTestCore.make_building_blocks(id, desc, conf.block_tiles, conf.block_color, PyuTestCore.util.tableconcat({
PyuTest.make_building_blocks(id, desc, conf.block_tiles, conf.block_color, PyuTest.util.tableconcat({
cracky = conf.ore_strength
}, conf.block_groups), conf.block_conf)
@ -209,11 +209,11 @@ PyuTestCore.make_ore = function(id, desc, item_id_suffix, item_description_suffi
end
-- "Primary" Ores
PyuTestCore.make_ore("pyutest_core:coal", "Coal", "lump", "Lump", {
PyuTest.make_ore("pyutest_core:coal", "Coal", "lump", "Lump", {
scarcity = 8 * 8 * 8,
y_max = 48,
ore_strength = PyuTestCore.BLOCK_NORMAL,
ore_strength = PyuTest.BLOCK_NORMAL,
ore_drop_count = 2,
ore_tiles = {"pyutest-ore-coal.png"},
@ -226,11 +226,11 @@ PyuTestCore.make_ore("pyutest_core:coal", "Coal", "lump", "Lump", {
block_color = {r = 32, g = 32, b = 32}
})
PyuTestCore.make_ore("pyutest_core:iron", "Iron", "ingot", "Ingot", {
PyuTest.make_ore("pyutest_core:iron", "Iron", "ingot", "Ingot", {
scarcity = 11 * 11 * 11,
y_max = 18,
ore_strength = PyuTestCore.BLOCK_NORMAL,
ore_strength = PyuTest.BLOCK_NORMAL,
ore_tiles = {"pyutest-ore-iron.png"},
ore_level = 2,
@ -242,11 +242,11 @@ PyuTestCore.make_ore("pyutest_core:iron", "Iron", "ingot", "Ingot", {
block_tiles = {"pyutest-metal.png"}
})
PyuTestCore.make_ore("pyutest_core:copper", "Copper", "ingot", "Ingot", {
PyuTest.make_ore("pyutest_core:copper", "Copper", "ingot", "Ingot", {
scarcity = 11 * 11 * 11,
y_max = 18,
ore_strength = PyuTestCore.BLOCK_NORMAL,
ore_strength = PyuTest.BLOCK_NORMAL,
ore_tiles = {"pyutest-ore-copper.png"},
ore_level = 2,
@ -265,11 +265,11 @@ PyuTestCore.make_ore("pyutest_core:copper", "Copper", "ingot", "Ingot", {
block_color = "darkgoldenrod"
})
PyuTestCore.make_ore("pyutest_core:gold", "Gold", "ingot", "Ingot", {
PyuTest.make_ore("pyutest_core:gold", "Gold", "ingot", "Ingot", {
scarcity = 15.5 * 15.5 * 15.5,
y_max = -35,
ore_strength = PyuTestCore.BLOCK_NORMAL,
ore_strength = PyuTest.BLOCK_NORMAL,
ore_tiles = {"pyutest-ore-gold.png"},
ore_level = 3,
@ -288,11 +288,11 @@ PyuTestCore.make_ore("pyutest_core:gold", "Gold", "ingot", "Ingot", {
block_color = "gold"
})
PyuTestCore.make_ore("pyutest_core:diamond", "Diamond", "shard", "Shard", {
PyuTest.make_ore("pyutest_core:diamond", "Diamond", "shard", "Shard", {
scarcity = 16.7 * 16.7 * 16.7,
y_max = -50,
ore_strength = PyuTestCore.BLOCK_NORMAL,
ore_strength = PyuTest.BLOCK_NORMAL,
ore_tiles = {"pyutest-ore-diamond.png"},
ore_level = 3,
@ -305,11 +305,11 @@ PyuTestCore.make_ore("pyutest_core:diamond", "Diamond", "shard", "Shard", {
block_color = "cyan"
})
PyuTestCore.make_ore("pyutest_core:emerald", "Emerald", "shard", "Shard", {
PyuTest.make_ore("pyutest_core:emerald", "Emerald", "shard", "Shard", {
scarcity = 18.3 * 18.3 * 18.3,
y_max = -50,
ore_strength = PyuTestCore.BLOCK_NORMAL,
ore_strength = PyuTest.BLOCK_NORMAL,
ore_tiles = {"pyutest-ore-emerald.png"},
ore_level = 3,
@ -322,11 +322,11 @@ PyuTestCore.make_ore("pyutest_core:emerald", "Emerald", "shard", "Shard", {
block_color = "seagreen"
})
PyuTestCore.make_ore("pyutest_core:zinc", "Zinc", "ingot", "Ingot", {
PyuTest.make_ore("pyutest_core:zinc", "Zinc", "ingot", "Ingot", {
scarcity = 11 * 11 * 11,
y_max = 18,
ore_strength = PyuTestCore.BLOCK_NORMAL,
ore_strength = PyuTest.BLOCK_NORMAL,
ore_tiles = {"pyutest-ore-zinc.png"},
ore_level = 2,
@ -347,11 +347,11 @@ PyuTestCore.make_ore("pyutest_core:zinc", "Zinc", "ingot", "Ingot", {
-- "Secondary" Ores
PyuTestCore.make_ore("pyutest_core:tin", "Tin", "ingot", "Ingot", {
PyuTest.make_ore("pyutest_core:tin", "Tin", "ingot", "Ingot", {
scarcity = 11 * 11 * 11,
y_max = 18,
ore_strength = PyuTestCore.BLOCK_NORMAL,
ore_strength = PyuTest.BLOCK_NORMAL,
ore_tiles = {"pyutest-ore-tin.png"},
ore_levle = 2,

View File

@ -12,7 +12,7 @@ minetest.register_on_joinplayer(function (player)
-- creative mode privs
if minetest.is_creative_enabled(name) then
minetest.set_player_privs(name, PyuTestCore.util.tableconcat({
minetest.set_player_privs(name, PyuTest.util.tableconcat({
fly = true,
fast = true,
noclip = true,
@ -55,7 +55,7 @@ if minetest.is_creative_enabled("") then
minetest.override_item("", {
range = 9,
tool_capabilities = PyuTestCore.tool_caps({
tool_capabilities = PyuTest.tool_caps({
uses = 0,
time = 0.35,
@ -75,7 +75,7 @@ if minetest.is_creative_enabled("") then
else
minetest.override_item("", {
range = 5,
tool_capabilities = PyuTestCore.tool_caps({
tool_capabilities = PyuTest.tool_caps({
uses = 0,
attck_uses = 0,
damage_groups = {fleshy = 2},
@ -83,37 +83,37 @@ else
groupcaps = {
oddly_breakable_by_hand = {
times = {
[PyuTestCore.BLOCK_FAST] = 0.35,
[PyuTestCore.BLOCK_NORMAL] = 0.50,
[PyuTestCore.BLOCK_SLOW] = 0.65,
[PyuTest.BLOCK_FAST] = 0.35,
[PyuTest.BLOCK_NORMAL] = 0.50,
[PyuTest.BLOCK_SLOW] = 0.65,
}
},
snappy = {
times = {
[PyuTestCore.BLOCK_FAST] = 0.55,
[PyuTestCore.BLOCK_NORMAL] = 0.70,
[PyuTestCore.BLOCK_SLOW] = 0.70
[PyuTest.BLOCK_FAST] = 0.55,
[PyuTest.BLOCK_NORMAL] = 0.70,
[PyuTest.BLOCK_SLOW] = 0.70
}
},
crumbly = {
times = {
[PyuTestCore.BLOCK_FAST] = 0.75,
[PyuTestCore.BLOCK_NORMAL] = 0.80,
[PyuTestCore.BLOCK_SLOW] = 0.90
[PyuTest.BLOCK_FAST] = 0.75,
[PyuTest.BLOCK_NORMAL] = 0.80,
[PyuTest.BLOCK_SLOW] = 0.90
}
},
choppy = {
times = {
[PyuTestCore.BLOCK_FAST] = 1.2,
[PyuTestCore.BLOCK_NORMAL] = 2.3,
[PyuTestCore.BLOCK_SLOW] = 2.9,
[PyuTest.BLOCK_FAST] = 1.2,
[PyuTest.BLOCK_NORMAL] = 2.3,
[PyuTest.BLOCK_SLOW] = 2.9,
}
},
cracky = {
times = {
[PyuTestCore.BLOCK_FAST] = 6,
[PyuTestCore.BLOCK_NORMAL] = 10,
[PyuTestCore.BLOCK_SLOW] = 45,
[PyuTest.BLOCK_FAST] = 6,
[PyuTest.BLOCK_NORMAL] = 10,
[PyuTest.BLOCK_SLOW] = 45,
}
}
}

View File

@ -1,9 +1,9 @@
PyuTestCore.make_tool = function (nsname, desc, groups, wield_image, extra_conf)
PyuTest.make_tool = function (nsname, desc, groups, wield_image, extra_conf)
local conf = {
description = Translate(desc),
wield_image = wield_image,
inventory_image = wield_image,
groups = PyuTestCore.util.tableconcat(groups, {
groups = PyuTest.util.tableconcat(groups, {
tool = 1
})
}
@ -17,151 +17,151 @@ PyuTestCore.make_tool = function (nsname, desc, groups, wield_image, extra_conf)
minetest.register_tool(nsname, conf)
end
PyuTestCore.make_tool("pyutest_core:wooden_pickaxe", "Wooden Pickaxe", {}, "pyutest-wooden-pickaxe.png", {
PyuTest.make_tool("pyutest_core:wooden_pickaxe", "Wooden Pickaxe", {}, "pyutest-wooden-pickaxe.png", {
stack_max = 1,
tool_capabilities = PyuTestCore.tool_caps({
tool_capabilities = PyuTest.tool_caps({
uses = 69,
attack_uses = 69 / 2,
maxlevel = 1,
groupcaps = {
cracky = {
times = {
[PyuTestCore.BLOCK_FAST] = 2,
[PyuTestCore.BLOCK_NORMAL] = 3
[PyuTest.BLOCK_FAST] = 2,
[PyuTest.BLOCK_NORMAL] = 3
}
}
}
})
})
PyuTestCore.make_tool("pyutest_core:stone_pickaxe", "Stone Pickaxe", {}, "pyutest-stone-pickaxe.png", {
PyuTest.make_tool("pyutest_core:stone_pickaxe", "Stone Pickaxe", {}, "pyutest-stone-pickaxe.png", {
stack_max = 1,
tool_capabilities = PyuTestCore.tool_caps({
tool_capabilities = PyuTest.tool_caps({
uses = 274,
attack_uses = 274 / 2,
maxlevel = 2,
groupcaps = {
cracky = {
times = {
[PyuTestCore.BLOCK_FAST] = 1.8,
[PyuTestCore.BLOCK_NORMAL] = 2.4
[PyuTest.BLOCK_FAST] = 1.8,
[PyuTest.BLOCK_NORMAL] = 2.4
}
}
}
})
})
PyuTestCore.make_tool("pyutest_core:iron_pickaxe", "Iron Pickaxe", {}, "pyutest-iron-pickaxe.png", {
PyuTest.make_tool("pyutest_core:iron_pickaxe", "Iron Pickaxe", {}, "pyutest-iron-pickaxe.png", {
stack_max = 1,
tool_capabilities = PyuTestCore.tool_caps({
tool_capabilities = PyuTest.tool_caps({
uses = 689,
attack_uses = 689 / 2,
maxlevel = 3,
groupcaps = {
cracky = {
times = {
[PyuTestCore.BLOCK_FAST] = 0.7,
[PyuTestCore.BLOCK_NORMAL] = 1.5
[PyuTest.BLOCK_FAST] = 0.7,
[PyuTest.BLOCK_NORMAL] = 1.5
}
}
}
})
})
PyuTestCore.make_tool("pyutest_core:diamond_pickaxe", "Diamond Pickaxe", {}, "pyutest-diamond-pickaxe.png", {
PyuTest.make_tool("pyutest_core:diamond_pickaxe", "Diamond Pickaxe", {}, "pyutest-diamond-pickaxe.png", {
stack_max = 1,
tool_capabilities = PyuTestCore.tool_caps({
tool_capabilities = PyuTest.tool_caps({
uses = 1345,
attack_uses = 1345 / 2,
maxlevel = 3,
groupcaps = {
cracky = {
times = {
[PyuTestCore.BLOCK_FAST] = 0.3,
[PyuTestCore.BLOCK_NORMAL] = 0.8,
[PyuTestCore.BLOCK_SLOW] = 8
[PyuTest.BLOCK_FAST] = 0.3,
[PyuTest.BLOCK_NORMAL] = 0.8,
[PyuTest.BLOCK_SLOW] = 8
}
}
}
})
})
PyuTestCore.make_tool("pyutest_core:wooden_axe", "Wooden Axe", {}, "pyutest-wooden-axe.png", {
PyuTest.make_tool("pyutest_core:wooden_axe", "Wooden Axe", {}, "pyutest-wooden-axe.png", {
stack_max = 1,
tool_capabilities = PyuTestCore.tool_caps({
tool_capabilities = PyuTest.tool_caps({
uses = 69,
attack_uses = 69 / 2,
groupcaps = {
choppy = {
times = {
[PyuTestCore.BLOCK_FAST] = 1.1,
[PyuTestCore.BLOCK_NORMAL] = 1.6,
[PyuTestCore.BLOCK_SLOW] = 2.2
[PyuTest.BLOCK_FAST] = 1.1,
[PyuTest.BLOCK_NORMAL] = 1.6,
[PyuTest.BLOCK_SLOW] = 2.2
}
}
}
})
})
PyuTestCore.make_tool("pyutest_core:stone_axe", "Stone Axe", {}, "pyutest-stone-axe.png", {
PyuTest.make_tool("pyutest_core:stone_axe", "Stone Axe", {}, "pyutest-stone-axe.png", {
stack_max = 1,
tool_capabilities = PyuTestCore.tool_caps({
tool_capabilities = PyuTest.tool_caps({
uses = 274,
attack_uses = 274 / 2,
groupcaps = {
choppy = {
times = {
[PyuTestCore.BLOCK_FAST] = 0.98,
[PyuTestCore.BLOCK_NORMAL] = 1.23,
[PyuTestCore.BLOCK_SLOW] = 2
[PyuTest.BLOCK_FAST] = 0.98,
[PyuTest.BLOCK_NORMAL] = 1.23,
[PyuTest.BLOCK_SLOW] = 2
}
}
}
})
})
PyuTestCore.make_tool("pyutest_core:iron_axe", "Iron Axe", {}, "pyutest-iron-axe.png", {
PyuTest.make_tool("pyutest_core:iron_axe", "Iron Axe", {}, "pyutest-iron-axe.png", {
stack_max = 1,
tool_capabilities = PyuTestCore.tool_caps({
tool_capabilities = PyuTest.tool_caps({
uses = 689,
attack_uses = 689 / 2,
groupcaps = {
choppy = {
times = {
[PyuTestCore.BLOCK_FAST] = 0.4,
[PyuTestCore.BLOCK_NORMAL] = 0.6,
[PyuTestCore.BLOCK_SLOW] = 1.8
[PyuTest.BLOCK_FAST] = 0.4,
[PyuTest.BLOCK_NORMAL] = 0.6,
[PyuTest.BLOCK_SLOW] = 1.8
}
}
}
})
})
PyuTestCore.make_tool("pyutest_core:diamond_axe", "Diamond Axe", {}, "pyutest-diamond-axe.png", {
PyuTest.make_tool("pyutest_core:diamond_axe", "Diamond Axe", {}, "pyutest-diamond-axe.png", {
stack_max = 1,
tool_capabilities = PyuTestCore.tool_caps({
tool_capabilities = PyuTest.tool_caps({
uses = 1345,
attack_uses = 1345 / 2,
groupcaps = {
choppy = {
times = {
[PyuTestCore.BLOCK_FAST] = 0.3,
[PyuTestCore.BLOCK_NORMAL] = 0.4,
[PyuTestCore.BLOCK_SLOW] = 1.4
[PyuTest.BLOCK_FAST] = 0.3,
[PyuTest.BLOCK_NORMAL] = 0.4,
[PyuTest.BLOCK_SLOW] = 1.4
}
}
}
})
})
PyuTestCore.make_item("pyutest_core:bomb", "Bomb", {}, "pyutest-bomb.png", {
PyuTest.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, 6, user)
PyuTest.create_explosion(pos, 2, false, 6, user)
local stack = user:get_wielded_item()
stack:set_count(stack:get_count() - 1)

View File

@ -1,4 +1,4 @@
PyuTestCore.util = {
PyuTest.util = {
tablecopy = function(t)
if t == nil then return nil end
local t2 = {}
@ -9,7 +9,7 @@ PyuTestCore.util = {
end,
tableconcat = function (t1, t2)
local nt = PyuTestCore.util.tablecopy(t1)
local nt = PyuTest.util.tablecopy(t1)
for k, v in pairs(t2) do
nt[k] = v
end
@ -17,7 +17,7 @@ PyuTestCore.util = {
end,
tableconcat2 = function(t1, t2)
local nt = PyuTestCore.util.tablecopy(t1)
local nt = PyuTest.util.tablecopy(t1)
for i = 1, #t2 do
nt[#nt+i] = t2[i]
end
@ -25,7 +25,7 @@ PyuTestCore.util = {
end,
}
PyuTestCore.dorange = function(origin, range, action)
PyuTest.dorange = function(origin, range, action)
for dx = -range, range do
for dz = -range, range do
for dy = -range, range do
@ -35,16 +35,16 @@ PyuTestCore.dorange = function(origin, range, action)
end
end
PyuTestCore.create_explosion = function (pos, range, rm_pos, dmg, creator, dmg_creator)
PyuTest.create_explosion = function (pos, range, rm_pos, dmg, creator, dmg_creator)
if rm_pos then
minetest.remove_node(pos)
end
PyuTestCore.dorange(pos, range, function(p)
PyuTest.dorange(pos, range, function(p)
if minetest.get_node(p).name == "pyutest_core:tnt" then
minetest.after(0.8, function()
minetest.remove_node(p)
PyuTestCore.create_explosion(p, range, rm_pos, dmg, creator, dmg_creator)
PyuTest.create_explosion(p, range, rm_pos, dmg, creator, dmg_creator)
end)
else
minetest.dig_node(p)
@ -134,7 +134,7 @@ PyuTestCore.create_explosion = function (pos, range, rm_pos, dmg, creator, dmg_c
})
end
PyuTestCore.tool_caps = function(options)
PyuTest.tool_caps = function(options)
local default_uses = 100
local groupcaps = {}
@ -142,9 +142,9 @@ PyuTestCore.tool_caps = function(options)
groupcaps[k] = {
maxlevel = v.maxlevel or options.maxlevel,
times = v.times or {
[PyuTestCore.BLOCK_FAST] = options.time or 3,
[PyuTestCore.BLOCK_NORMAL] = options.time or 3,
[PyuTestCore.BLOCK_SLOW] = options.time or 3
[PyuTest.BLOCK_FAST] = options.time or 3,
[PyuTest.BLOCK_NORMAL] = options.time or 3,
[PyuTest.BLOCK_SLOW] = options.time or 3
},
uses = v.uses or options.uses or default_uses
}

View File

@ -1,15 +1,15 @@
PyuTestCore.registered_wood = {}
PyuTestCore.make_wood = function (id, desc, ltiles, btiles)
PyuTestCore.make_building_blocks(id.."_log", desc .. " Log", ltiles, nil, {
choppy = PyuTestCore.BLOCK_NORMAL,
PyuTest.registered_wood = {}
PyuTest.make_wood = function (id, desc, ltiles, btiles)
PyuTest.make_building_blocks(id.."_log", desc .. " Log", ltiles, nil, {
choppy = PyuTest.BLOCK_NORMAL,
acid_vulnerable = 1,
flammable = 1,
}, {
is_ground_content = false
})
PyuTestCore.make_building_blocks(id.."_wood", desc .. " Wood", btiles, nil, {
choppy = PyuTestCore.BLOCK_NORMAL,
PyuTest.make_building_blocks(id.."_wood", desc .. " Wood", btiles, nil, {
choppy = PyuTest.BLOCK_NORMAL,
acid_vulnerable = 1,
flammable = 1,
}, {
@ -20,7 +20,7 @@ PyuTestCore.make_wood = function (id, desc, ltiles, btiles)
local wood_id = id.."_wood_block"
minetest.override_item(log_id, {
groups = PyuTestCore.util.tableconcat(minetest.registered_nodes[log_id].groups, {
groups = PyuTest.util.tableconcat(minetest.registered_nodes[log_id].groups, {
wooden_log = 1,
fuel = 1
}),
@ -29,7 +29,7 @@ PyuTestCore.make_wood = function (id, desc, ltiles, btiles)
})
minetest.override_item(wood_id, {
groups = PyuTestCore.util.tableconcat(minetest.registered_nodes[wood_id].groups, {
groups = PyuTest.util.tableconcat(minetest.registered_nodes[wood_id].groups, {
wooden_planks = 1,
fuel = 1
})
@ -41,13 +41,13 @@ PyuTestCore.make_wood = function (id, desc, ltiles, btiles)
type = "shapeless"
})
PyuTestCore.registered_wood[id] = {
PyuTest.registered_wood[id] = {
log = log_id,
wood = wood_id
}
end
PyuTestCore.make_wood("pyutest_core:wooden", "Oak", {
PyuTest.make_wood("pyutest_core:wooden", "Oak", {
"pyutest-log-top-bottom.png",
"pyutest-log-top-bottom.png",
"pyutest-log.png"
@ -55,7 +55,7 @@ PyuTestCore.make_wood("pyutest_core:wooden", "Oak", {
"pyutest-wood.png"
})
PyuTestCore.make_wood("pyutest_core:savanna", "Savanna", {
PyuTest.make_wood("pyutest_core:savanna", "Savanna", {
"pyutest-savanna-log-top-bottom.png",
"pyutest-savanna-log-top-bottom.png",
"pyutest-savanna-log.png"
@ -63,7 +63,7 @@ PyuTestCore.make_wood("pyutest_core:savanna", "Savanna", {
"pyutest-savanna-wood.png"
})
PyuTestCore.make_wood("pyutest_core:birch", "Birch", {
PyuTest.make_wood("pyutest_core:birch", "Birch", {
"pyutest-birch-log-top-bottom.png",
"pyutest-birch-log-top-bottom.png",
"pyutest-birch-log.png"
@ -71,7 +71,7 @@ PyuTestCore.make_wood("pyutest_core:birch", "Birch", {
"pyutest-birch-wood.png"
})
PyuTestCore.make_wood("pyutest_core:cherry", "Cherry", {
PyuTest.make_wood("pyutest_core:cherry", "Cherry", {
"pyutest-cherry-log-top-bottom.png",
"pyutest-cherry-log-top-bottom.png",
"pyutest-cherry-log.png"
@ -79,7 +79,7 @@ PyuTestCore.make_wood("pyutest_core:cherry", "Cherry", {
"pyutest-cherry-wood.png"
})
PyuTestCore.make_wood("pyutest_core:redwood", "Redwood", {
PyuTest.make_wood("pyutest_core:redwood", "Redwood", {
"pyutest-redwood-log-top-bottom.png",
"pyutest-redwood-log-top-bottom.png",
"pyutest-redwood-log.png"
@ -87,7 +87,7 @@ PyuTestCore.make_wood("pyutest_core:redwood", "Redwood", {
"pyutest-redwood.png"
})
PyuTestCore.make_wood("pyutest_core:jungle", "Jungle", {
PyuTest.make_wood("pyutest_core:jungle", "Jungle", {
"pyutest-jungle-log-top-bottom.png",
"pyutest-jungle-log-top-bottom.png",
"pyutest-jungle-log.png"
@ -95,7 +95,7 @@ PyuTestCore.make_wood("pyutest_core:jungle", "Jungle", {
"pyutest-jungle-wood.png"
})
PyuTestCore.make_wood("pyutest_core:vyn", "Vyn", {
PyuTest.make_wood("pyutest_core:vyn", "Vyn", {
"pyutest-vyn-log-top-bottom.png",
"pyutest-vyn-log-top-bottom.png",
"pyutest-vyn-log.png"

View File

@ -1,20 +1,20 @@
PyuTestCore.registered_colored_blocks = {}
PyuTestCore.make_colored_blocks = function(name, desc, color)
PyuTestCore.make_building_blocks(name.."_wool", desc.." Wool", {
PyuTest.registered_colored_blocks = {}
PyuTest.make_colored_blocks = function(name, desc, color)
PyuTest.make_building_blocks(name.."_wool", desc.." Wool", {
"pyutest-wool.png"
}, color or "white", {
oddly_breakable_by_hand = PyuTestCore.BLOCK_NORMAL,
oddly_breakable_by_hand = PyuTest.BLOCK_NORMAL,
colored = 1
})
PyuTestCore.make_building_blocks(name.."_terracotta", desc .. " Terracotta", {
PyuTest.make_building_blocks(name.."_terracotta", desc .. " Terracotta", {
"pyutest-terracotta.png"
}, color or "white", {
cracky = PyuTestCore.BLOCK_FAST,
cracky = PyuTest.BLOCK_FAST,
colored = 1
})
PyuTestCore.make_item(name.."_dye", desc.." Dye", {}, "pyutest-dye.png", {
PyuTest.make_item(name.."_dye", desc.." Dye", {}, "pyutest-dye.png", {
color = color or "white"
})
@ -37,14 +37,14 @@ PyuTestCore.make_colored_blocks = function(name, desc, color)
}
})
PyuTestCore.registered_colored_blocks[name] = {
PyuTest.registered_colored_blocks[name] = {
wool = name.."_wool",
terracotta = name.."_terracotta",
dye = name.."_dye"
}
end
PyuTestCore.make_colored_blocks("pyutest_core:white", "White", "white")
PyuTest.make_colored_blocks("pyutest_core:white", "White", "white")
minetest.register_craft({
output = "pyutest_core:white_wool_block 4",
recipe = {
@ -59,7 +59,7 @@ minetest.register_craft({
recipe = "pyutest_core:clay_block"
})
PyuTestCore.COLORS = {
PyuTest.COLORS = {
white = {"White", nil},
black = {"Black", {r = 32, g = 32, b = 32}},
brown = {"Brown", "saddlebrown"},
@ -73,11 +73,11 @@ PyuTestCore.COLORS = {
lime = {"Lime", "#64C044"}
}
for k, v in pairs(PyuTestCore.COLORS) do
PyuTestCore.make_colored_blocks("pyutest_core:"..k, v[1], v[2])
for k, v in pairs(PyuTest.COLORS) do
PyuTest.make_colored_blocks("pyutest_core:"..k, v[1], v[2])
end
PyuTestCore.make_dye_mixing_recipe = function(c1, c2, out)
PyuTest.make_dye_mixing_recipe = function(c1, c2, out)
minetest.register_craft({
type = "shapeless",
output = out .. " 2",
@ -87,8 +87,8 @@ PyuTestCore.make_dye_mixing_recipe = function(c1, c2, out)
})
end
PyuTestCore.make_dye_mixing_recipe("pyutest_core:red_dye", "pyutest_core:blue_dye", "pyutest_core:purple_dye")
PyuTestCore.make_dye_mixing_recipe("pyutest_core:red_dye", "pyutest_core:yellow_dye", "pyutest_core:orange_dye")
PyuTestCore.make_dye_mixing_recipe("pyutest_core:yellow_dye", "pyutest_core:blue_dye", "pyutest_core:green_dye")
PyuTestCore.make_dye_mixing_recipe("pyutest_core:red_dye", "pyutest_core:white_dye", "pyutest_core:pink_dye")
PyuTestCore.make_dye_mixing_recipe("pyutest_core:red_dye", "pyutest_core:green_dye", "pyutest_core:brown_dye")
PyuTest.make_dye_mixing_recipe("pyutest_core:red_dye", "pyutest_core:blue_dye", "pyutest_core:purple_dye")
PyuTest.make_dye_mixing_recipe("pyutest_core:red_dye", "pyutest_core:yellow_dye", "pyutest_core:orange_dye")
PyuTest.make_dye_mixing_recipe("pyutest_core:yellow_dye", "pyutest_core:blue_dye", "pyutest_core:green_dye")
PyuTest.make_dye_mixing_recipe("pyutest_core:red_dye", "pyutest_core:white_dye", "pyutest_core:pink_dye")
PyuTest.make_dye_mixing_recipe("pyutest_core:red_dye", "pyutest_core:green_dye", "pyutest_core:brown_dye")

View File

@ -1,16 +1,12 @@
PyuTestMapgen = {}
-- This function is used for structures because it will update the lighting when placed.
PyuTestMapgen.register_structure = function (name, schematic, def)
PyuTest.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"
},
drawtype = "airlike",
walkable = false,
pointable = false,
})
@ -38,7 +34,7 @@ PyuTestMapgen.register_structure = function (name, schematic, def)
minetest.remove_node(pos)
minetest.place_schematic(
pos,
PyuTestCore.get_schem_path(schematic),
PyuTest.get_schem_path(schematic),
def.rotation or "random",
def.replacements or {},
def.force_placement or true,
@ -48,6 +44,6 @@ PyuTestMapgen.register_structure = function (name, schematic, def)
})
end
PyuTestMapgen.is_flat = function()
PyuTest.is_flat = function()
return minetest.get_mapgen_setting("mg_name") == "flat"
end

View File

@ -1,10 +1,10 @@
PyuTestMapgen_Path = minetest.get_modpath("pyutest_mapgen")
dofile(PyuTestMapgen_Path.."/api.lua")
dofile(PyuTestMapgen_Path.."/mapgen.lua")
dofile(PyuTestMapgen_Path.."/worlds.lua")
if not PyuTestMapgen.is_flat() then
if not PyuTest.is_flat() then
dofile(PyuTestMapgen_Path.."/structures.lua")
dofile(PyuTestMapgen_Path.."/trees.lua")
end

View File

@ -9,7 +9,7 @@ minetest.set_mapgen_setting(string.format("mg%s_cavern_threshold", mg_name), "0.
-- Biomes
PyuTestCore_BiomeTops = {
PyuTest.BIOME_TOPS = {
grassland = 30,
forest = 35,
desert = 70,
@ -20,7 +20,7 @@ PyuTestCore_BiomeTops = {
swamp = 10
}
PyuTestCore.BIOME_TYPES = {
PyuTest.BIOME_TYPES = {
-- Normal biomes (Forests for example)
NORMAL = 1,
@ -49,7 +49,7 @@ PyuTestCore.BIOME_TYPES = {
CAVE = 9
}
PyuTestCore.get_biomes_from_type = function(type)
PyuTest.get_biomes_from_type = function(type)
local biomes = {}
for k, v in pairs(minetest.registered_biomes) do
@ -61,7 +61,7 @@ PyuTestCore.get_biomes_from_type = function(type)
return biomes
end
PyuTestCore.get_flowering_biomes = function ()
PyuTest.get_flowering_biomes = function ()
local biomes = {}
for k, v in pairs(minetest.registered_biomes) do
@ -73,7 +73,7 @@ PyuTestCore.get_flowering_biomes = function ()
return biomes
end
PyuTestCore.get_extra_flowering_biomes = function ()
PyuTest.get_extra_flowering_biomes = function ()
local biomes = {}
for k, v in pairs(minetest.registered_biomes) do
@ -86,8 +86,8 @@ PyuTestCore.get_extra_flowering_biomes = function ()
end
-- wrapper around minetest.register_biome but with defaults and caves
PyuTestCore.register_biome = function(name, type, opts)
local nopts = PyuTestCore.util.tablecopy(opts) or {}
PyuTest.register_overworld_biome = function(name, type, opts)
local nopts = PyuTest.util.tablecopy(opts) or {}
nopts["name"] = name
nopts["depth_top"] = nopts["depth_top"] or 1
nopts["depth_filler"] = nopts["depth_filler"] or 3
@ -98,11 +98,11 @@ PyuTestCore.register_biome = function(name, type, opts)
nopts["node_river_water"] = nopts["node_river_water"] or "pyutest_core:water_source"
nopts["node_riverbed"] = nopts["node_riverbed"] or "pyutest_core:gravel_block"
minetest.register_biome(PyuTestCore.util.tableconcat(nopts, {
minetest.register_biome(PyuTest.util.tableconcat(nopts, {
_pyutest_biome_type = type,
}))
minetest.register_biome(PyuTestCore.util.tableconcat({
minetest.register_biome(PyuTest.util.tableconcat({
name = name.."_ocean",
node_top = nopts["node_riverbed"],
depth_top = 2,
@ -117,13 +117,13 @@ PyuTestCore.register_biome = function(name, type, opts)
humidity_point = nopts["humidity_point"],
y_max = 0,
y_min = PyuTestCore_OceanMin
y_min = PyuTest.OCEAN_MIN
}, {
_pyutest_biome_type = PyuTestCore.BIOME_TYPES.OCEAN,
_pyutest_biome_type = PyuTest.BIOME_TYPES.OCEAN,
_pyutest_ocean_type = type
}))
minetest.register_biome(PyuTestCore.util.tableconcat({
minetest.register_biome(PyuTest.util.tableconcat({
name = name.."_deep_ocean",
node_top = nopts["node_riverbed"],
@ -138,34 +138,33 @@ PyuTestCore.register_biome = function(name, type, opts)
heat_point = nopts["heat_point"],
humidity_point = nopts["humidity_point"],
y_max = PyuTestCore_DeepOceanMax,
y_min = PyuTestCore_DeepOceanMin,
y_max = PyuTest.DEEP_OCEAN_MAX,
y_min = PyuTest.DEEP_OCEAN_MIN,
vertical_blend = 5
}, {
_pyutest_biome_type = PyuTestCore.BIOME_TYPES.OCEAN,
_pyutest_biome_type = PyuTest.BIOME_TYPES.OCEAN,
_pyutest_ocean_type = type
}))
minetest.register_biome(PyuTestCore.util.tableconcat({
minetest.register_biome(PyuTest.util.tableconcat({
name = name.."_cave",
heat_point = nopts["heat_point"],
humidity_point = nopts["humidity_point"],
y_max = PyuTestCore_DeepOceanMin - 1,
y_min = PyuTestCore_WorldBottom
y_max = PyuTest.DEEP_OCEAN_MIN - 1,
y_min = PyuTest.OVERWORLD_BOTTOM,
}, {
_pyutest_biome_type = PyuTestCore.BIOME_TYPES.CAVE,
_pyutest_biome_type = PyuTest.BIOME_TYPES.CAVE,
_pyutest_cave_type = type
}))
end
if PyuTestMapgen.is_flat() then
PyuTestCore.register_biome("flat", PyuTestCore.BIOME_TYPES.NORMAL, {
if PyuTest.is_flat() then
PyuTest.register_overworld_biome("flat", PyuTest.BIOME_TYPES.NORMAL, {
node_top = "pyutest_core:dark_grass_block",
node_filler = "pyutest_core:dirt_block",
y_max = PyuTestCore_BiomeTops.grassland,
y_min = PyuTestCore_SurfaceBottom,
y_max = PyuTest.BIOME_TOPS.grassland,
y_min = PyuTest.SURFACE_BOTTOM,
heat_point = 50,
humidity_point = 50,
@ -174,12 +173,12 @@ if PyuTestMapgen.is_flat() then
return
end
PyuTestCore.register_biome("grassland", PyuTestCore.BIOME_TYPES.NORMAL, {
PyuTest.register_overworld_biome("grassland", PyuTest.BIOME_TYPES.NORMAL, {
node_top = "pyutest_core:grass_block",
node_filler = "pyutest_core:dirt_block",
y_max = PyuTestCore_BiomeTops.grassland,
y_min = PyuTestCore_SurfaceBottom,
y_max = PyuTest.BIOME_TOPS.grassland,
y_min = PyuTest.SURFACE_BOTTOM,
heat_point = 53,
humidity_point = 57,
@ -187,71 +186,71 @@ PyuTestCore.register_biome("grassland", PyuTestCore.BIOME_TYPES.NORMAL, {
_pyutest_biome_flowering = true
})
PyuTestCore.register_biome("forest", PyuTestCore.BIOME_TYPES.NORMAL, {
PyuTest.register_overworld_biome("forest", PyuTest.BIOME_TYPES.NORMAL, {
node_top = "pyutest_core:dark_grass_block",
node_filler = "pyutest_core:dirt_block",
y_max = PyuTestCore_BiomeTops.forest,
y_min = PyuTestCore_SurfaceBottom,
y_max = PyuTest.BIOME_TOPS.forest,
y_min = PyuTest.SURFACE_BOTTOM,
heat_point = 50,
humidity_point = 65,
_pyutest_biome_flowering = true
})
PyuTestCore.register_biome("stony_mountains", PyuTestCore.BIOME_TYPES.WARM, {
PyuTest.register_overworld_biome("stony_mountains", PyuTest.BIOME_TYPES.WARM, {
node_top = "pyutest_core:stone_block",
node_filler = "pyutest_core:stone_block",
y_max = PyuTestCore_BiomeTops.mountains,
y_min = PyuTestCore_BiomeTops.grassland,
y_max = PyuTest.BIOME_TOPS.mountains,
y_min = PyuTest.BIOME_TOPS.grassland,
heat_point = 65,
humidity_point = 8
})
PyuTestCore.register_biome("desert", PyuTestCore.BIOME_TYPES.DESERT, {
PyuTest.register_overworld_biome("desert", PyuTest.BIOME_TYPES.DESERT, {
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 = PyuTest.BIOME_TOPS.desert,
y_min = PyuTest.SURFACE_BOTTOM,
heat_point = 84,
humidity_point = 4
})
PyuTestCore.register_biome("desert_mountains", PyuTestCore.BIOME_TYPES.DESERT, {
PyuTest.register_overworld_biome("desert_mountains", PyuTest.BIOME_TYPES.DESERT, {
node_top = "pyutest_core:sand_block",
node_filler = "pyutest_core:sandstone_block",
y_max = PyuTestCore_BiomeTops.mountains,
y_min = PyuTestCore_BiomeTops.desert,
y_max = PyuTest.BIOME_TOPS.mountains,
y_min = PyuTest.BIOME_TOPS.desert,
heat_point = 83,
humidity_point = 6
})
PyuTestCore.register_biome("snowy_mountains", PyuTestCore.BIOME_TYPES.COLD, {
PyuTest.register_overworld_biome("snowy_mountains", PyuTest.BIOME_TYPES.COLD, {
node_dust = "pyutest_core:snow_carpet",
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 = PyuTest.BIOME_TOPS.mountains,
y_min = PyuTest.BIOME_TOPS.frozen_plains,
heat_point = 6,
humidity_point = 72
})
PyuTestCore.register_biome("frozen_plains", PyuTestCore.BIOME_TYPES.COLD, {
PyuTest.register_overworld_biome("frozen_plains", PyuTest.BIOME_TYPES.COLD, {
node_dust = "pyutest_core:snow_carpet",
node_top = "pyutest_core:snow_block",
node_filler = "pyutest_core:snow_block",
y_max = PyuTestCore_BiomeTops.frozen_plains,
y_min = PyuTestCore_SurfaceBottom,
y_max = PyuTest.BIOME_TOPS.frozen_plains,
y_min = PyuTest.SURFACE_BOTTOM,
node_water_top = "pyutest_core:ice_block",
depth_water_top = 5,
@ -260,23 +259,23 @@ PyuTestCore.register_biome("frozen_plains", PyuTestCore.BIOME_TYPES.COLD, {
humidity_point = 67
})
PyuTestCore.register_biome("mushroom_fields", PyuTestCore.BIOME_TYPES.NORMAL, {
PyuTest.register_overworld_biome("mushroom_fields", PyuTest.BIOME_TYPES.NORMAL, {
node_top = "pyutest_core:mycelium_block",
node_filler = "pyutest_core:dirt_block",
y_max = PyuTestCore_BiomeTops.mushroom_fields,
y_min = PyuTestCore_SurfaceBottom,
y_max = PyuTest.BIOME_TOPS.mushroom_fields,
y_min = PyuTest.SURFACE_BOTTOM,
heat_point = 53,
humidity_point = 94
})
PyuTestCore.register_biome("ice_spikes", PyuTestCore.BIOME_TYPES.COLD, {
PyuTest.register_overworld_biome("ice_spikes", PyuTest.BIOME_TYPES.COLD, {
node_top = "pyutest_core:ice_block",
node_filler = "pyutest_core:ice_block",
y_max = PyuTestCore_BiomeTops.ice_spikes,
y_min = PyuTestCore_SurfaceBottom,
y_max = PyuTest.BIOME_TOPS.ice_spikes,
y_min = PyuTest.SURFACE_BOTTOM,
node_water_top = "pyutest_core:ice_block",
depth_water_top = 5,
@ -285,13 +284,13 @@ PyuTestCore.register_biome("ice_spikes", PyuTestCore.BIOME_TYPES.COLD, {
humidity_point = 70
})
PyuTestCore.register_biome("meadow", PyuTestCore.BIOME_TYPES.NORMAL, {
PyuTest.register_overworld_biome("meadow", PyuTest.BIOME_TYPES.NORMAL, {
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 = PyuTest.BIOME_TOPS.mountains,
y_min = PyuTest.SURFACE_BOTTOM,
heat_point = 52,
humidity_point = 83,
@ -300,12 +299,12 @@ PyuTestCore.register_biome("meadow", PyuTestCore.BIOME_TYPES.NORMAL, {
_pyutest_biome_flowering_extra = true
})
PyuTestCore.register_biome("old_growth_forest", PyuTestCore.BIOME_TYPES.NORMAL, {
PyuTest.register_overworld_biome("old_growth_forest", PyuTest.BIOME_TYPES.NORMAL, {
node_top = "pyutest_core:dark_grass_block",
node_filler = "pyutest_core:dirt_block",
y_max = PyuTestCore_BiomeTops.forest,
y_min = PyuTestCore_SurfaceBottom,
y_max = PyuTest.BIOME_TOPS.forest,
y_min = PyuTest.SURFACE_BOTTOM,
heat_point = 45,
humidity_point = 92,
@ -313,13 +312,13 @@ PyuTestCore.register_biome("old_growth_forest", PyuTestCore.BIOME_TYPES.NORMAL,
_pyutest_biome_flowering = true
})
PyuTestCore.register_biome("snowy_forest", PyuTestCore.BIOME_TYPES.COLD, {
PyuTest.register_overworld_biome("snowy_forest", PyuTest.BIOME_TYPES.COLD, {
node_dust = "pyutest_core:snow_carpet",
node_top = "pyutest_core:snow_block",
node_filler = "pyutest_core:dirt_block",
y_max = PyuTestCore_BiomeTops.forest,
y_min = PyuTestCore_SurfaceBottom,
y_max = PyuTest.BIOME_TOPS.forest,
y_min = PyuTest.SURFACE_BOTTOM,
node_water_top = "pyutest_core:ice_block",
depth_water_top = 5,
@ -328,23 +327,23 @@ PyuTestCore.register_biome("snowy_forest", PyuTestCore.BIOME_TYPES.COLD, {
humidity_point = 69
})
PyuTestCore.register_biome("savanna", PyuTestCore.BIOME_TYPES.WARM, {
PyuTest.register_overworld_biome("savanna", PyuTest.BIOME_TYPES.WARM, {
node_top = "pyutest_core:savanna_grass_block",
node_filler = "pyutest_core:dirt_block",
y_max = PyuTestCore_BiomeTops.grassland,
y_min = PyuTestCore_SurfaceBottom,
y_max = PyuTest.BIOME_TOPS.grassland,
y_min = PyuTest.SURFACE_BOTTOM,
heat_point = 72,
humidity_point = 9
})
PyuTestCore.register_biome("taiga", PyuTestCore.BIOME_TYPES.CHILLY, {
PyuTest.register_overworld_biome("taiga", PyuTest.BIOME_TYPES.CHILLY, {
node_top = "pyutest_core:dark_grass_block",
node_filler = "pyutest_core:dirt_block",
y_max = PyuTestCore_BiomeTops.forest,
y_min = PyuTestCore_SurfaceBottom,
y_max = PyuTest.BIOME_TOPS.forest,
y_min = PyuTest.SURFACE_BOTTOM,
heat_point = 28,
humidity_point = 72,
@ -352,12 +351,12 @@ PyuTestCore.register_biome("taiga", PyuTestCore.BIOME_TYPES.CHILLY, {
_pyutest_biome_flowering = true
})
PyuTestCore.register_biome("birch_forest", PyuTestCore.BIOME_TYPES.NORMAL, {
PyuTest.register_overworld_biome("birch_forest", PyuTest.BIOME_TYPES.NORMAL, {
node_top = "pyutest_core:grass_block",
node_filler = "pyutest_core:dirt_block",
y_max = PyuTestCore_BiomeTops.forest,
y_min = PyuTestCore_SurfaceBottom,
y_max = PyuTest.BIOME_TOPS.forest,
y_min = PyuTest.SURFACE_BOTTOM,
heat_point = 48,
humidity_point = 85,
@ -365,12 +364,12 @@ PyuTestCore.register_biome("birch_forest", PyuTestCore.BIOME_TYPES.NORMAL, {
_pyutest_biome_flowering = true
})
PyuTestCore.register_biome("cherry_grove", PyuTestCore.BIOME_TYPES.NORMAL, {
PyuTest.register_overworld_biome("cherry_grove", PyuTest.BIOME_TYPES.NORMAL, {
node_top = "pyutest_core:grass_block",
node_filler = "pyutest_core:dirt_block",
y_max = PyuTestCore_BiomeTops.forest,
y_min = PyuTestCore_SurfaceBottom,
y_max = PyuTest.BIOME_TOPS.forest,
y_min = PyuTest.SURFACE_BOTTOM,
heat_point = 52,
humidity_point = 78,
@ -379,23 +378,23 @@ PyuTestCore.register_biome("cherry_grove", PyuTestCore.BIOME_TYPES.NORMAL, {
_pyutest_biome_flowering_extra = true
})
PyuTestCore.register_biome("swamp", PyuTestCore.BIOME_TYPES.WETLAND, {
PyuTest.register_overworld_biome("swamp", PyuTest.BIOME_TYPES.WETLAND, {
node_top = "pyutest_core:swampy_grass_block",
node_filler = "pyutest_core:dirt_block",
y_max = PyuTestCore_BiomeTops.swamp,
y_min = PyuTestCore_SurfaceBottom,
y_max = PyuTest.BIOME_TOPS.swamp,
y_min = PyuTest.SURFACE_BOTTOM,
heat_point = 52,
humidity_point = 88,
})
PyuTestCore.register_biome("old_growth_birch_forest", PyuTestCore.BIOME_TYPES.NORMAL, {
PyuTest.register_overworld_biome("old_growth_birch_forest", PyuTest.BIOME_TYPES.NORMAL, {
node_top = "pyutest_core:grass_block",
node_filler = "pyutest_core:dirt_block",
y_max = PyuTestCore_BiomeTops.forest,
y_min = PyuTestCore_SurfaceBottom,
y_max = PyuTest.BIOME_TOPS.forest,
y_min = PyuTest.SURFACE_BOTTOM,
heat_point = 47,
humidity_point = 73,
@ -404,12 +403,12 @@ PyuTestCore.register_biome("old_growth_birch_forest", PyuTestCore.BIOME_TYPES.NO
_pyutest_biome_flowering_extra = true
})
PyuTestCore.register_biome("aspen_forest", PyuTestCore.BIOME_TYPES.CHILLY, {
PyuTest.register_overworld_biome("aspen_forest", PyuTest.BIOME_TYPES.CHILLY, {
node_top = "pyutest_core:aspen_grass_block",
node_filler = "pyutest_core:dirt_block",
y_max = PyuTestCore_BiomeTops.forest,
y_min = PyuTestCore_SurfaceBottom,
y_max = PyuTest.BIOME_TOPS.forest,
y_min = PyuTest.SURFACE_BOTTOM,
heat_point = 25,
humidity_point = 63,
@ -417,12 +416,12 @@ PyuTestCore.register_biome("aspen_forest", PyuTestCore.BIOME_TYPES.CHILLY, {
_pyutest_biome_flowering = true
})
PyuTestCore.register_biome("redwood_forest", PyuTestCore.BIOME_TYPES.CHILLY, {
PyuTest.register_overworld_biome("redwood_forest", PyuTest.BIOME_TYPES.CHILLY, {
node_top = "pyutest_core:podzol_block",
node_filler = "pyutest_core:podzol_block",
y_max = PyuTestCore_BiomeTops.forest,
y_min = PyuTestCore_SurfaceBottom,
y_max = PyuTest.BIOME_TOPS.forest,
y_min = PyuTest.SURFACE_BOTTOM,
heat_point = 21,
humidity_point = 65,
@ -430,12 +429,12 @@ PyuTestCore.register_biome("redwood_forest", PyuTestCore.BIOME_TYPES.CHILLY, {
_pyutest_biome_flowering = true
})
PyuTestCore.register_biome("jungle", PyuTestCore.BIOME_TYPES.WARM, {
PyuTest.register_overworld_biome("jungle", PyuTest.BIOME_TYPES.WARM, {
node_top = "pyutest_core:jungle_grass_block",
node_filler = "pyutest_core:dirt_block",
y_max = PyuTestCore_BiomeTops.forest,
y_min = PyuTestCore_SurfaceBottom,
y_max = PyuTest.BIOME_TOPS.forest,
y_min = PyuTest.SURFACE_BOTTOM,
heat_point = 52,
humidity_point = 103,
@ -444,24 +443,24 @@ PyuTestCore.register_biome("jungle", PyuTestCore.BIOME_TYPES.WARM, {
_pyutest_biome_flowering_extra = true
})
PyuTestCore.register_biome("large_mushroom_forest", PyuTestCore.BIOME_TYPES.NORMAL, {
PyuTest.register_overworld_biome("large_mushroom_forest", PyuTest.BIOME_TYPES.NORMAL, {
node_top = "pyutest_core:mycelium_block",
node_filler = "pyutest_core:dirt_block",
y_max = PyuTestCore_BiomeTops.mushroom_fields,
y_min = PyuTestCore_SurfaceBottom,
y_max = PyuTest.BIOME_TOPS.mushroom_fields,
y_min = PyuTest.SURFACE_BOTTOM,
heat_point = 53,
humidity_point = 98
})
PyuTestCore.register_biome("vyn_forest", PyuTestCore.BIOME_TYPES.COLD, {
PyuTest.register_overworld_biome("vyn_forest", PyuTest.BIOME_TYPES.COLD, {
node_dust = "pyutest_core:snow_carpet",
node_top = "pyutest_core:snow_block",
node_filler = "pyutest_core:dirt_block",
y_max = PyuTestCore_BiomeTops.forest,
y_min = PyuTestCore_SurfaceBottom,
y_max = PyuTest.BIOME_TOPS.forest,
y_min = PyuTest.SURFACE_BOTTOM,
node_water_top = "pyutest_core:ice_block",
depth_water_top = 5,

View File

@ -3,8 +3,8 @@ minetest.register_decoration({
sidelen = 16,
fill_ratio = 0.0003,
place_on = {"group:ground"},
y_max = PyuTestCore_BiomeTops.mountains,
y_min = PyuTestCore_SurfaceBottom,
y_max = PyuTest.BIOME_TOPS.mountains,
y_min = PyuTest.SURFACE_BOTTOM,
decoration = {
"pyutest_core:trash_lootbox",
"pyutest_core:resource_lootbox",
@ -14,27 +14,27 @@ minetest.register_decoration({
}
})
PyuTestMapgen.register_structure("igloo", "Igloo", {
PyuTest.register_structure("igloo", "Igloo", {
place_on = {"pyutest_core:snow_block"},
fill_ratio = 0.00004,
biomes = {"frozen_plains"},
y_max = PyuTestCore_BiomeTops.frozen_plains,
y_max = PyuTest.BIOME_TOPS.frozen_plains,
y_min = 1,
rotation = "random",
flags = "place_center_x, place_center_z",
place_offset_y = 1
})
PyuTestMapgen.register_structure("desertwell", "DesertWell", {
PyuTest.register_structure("desertwell", "DesertWell", {
place_on = {"pyutest_core:sand_block"},
fill_ratio = 0.00006,
biomes = {"desert"},
y_max = PyuTestCore_BiomeTops.desert,
y_max = PyuTest.BIOME_TOPS.desert,
y_min = 1,
rotation = "random"
})
PyuTestMapgen.register_structure("ice_spike", "IceSpike", {
PyuTest.register_structure("ice_spike", "IceSpike", {
fill_ratio = 0.0008,
place_on = {
"pyutest_core:ice_block",
@ -42,21 +42,21 @@ PyuTestMapgen.register_structure("ice_spike", "IceSpike", {
biomes = {
"ice_spikes",
},
y_max = PyuTestCore_BiomeTops.ice_spikes,
y_min = PyuTestCore_WorldBottom,
y_max = PyuTest.BIOME_TOPS.ice_spikes,
y_min = PyuTest.OVERWORLD_BOTTOM,
})
PyuTestMapgen.register_structure("ocean_ruins", "OceanRuins", {
PyuTest.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,
biomes = PyuTest.get_biomes_from_type(PyuTest.BIOME_TYPES.OCEAN),
y_max = PyuTest.DEEP_OCEAN_MAX + 4,
y_min = PyuTest.DEAP_OCEAN_MIN,
spawn_by = {"pyutest_core:water_source"},
num_spawn_by = 2
})
PyuTestMapgen.register_structure("snowman_tower", "SnowmanTower", {
PyuTest.register_structure("snowman_tower", "SnowmanTower", {
fill_ratio = 0.000007,
place_on = {
"pyutest_core:ice_block",
@ -67,6 +67,6 @@ PyuTestMapgen.register_structure("snowman_tower", "SnowmanTower", {
"ice_spikes",
"snowy_forest"
},
y_max = PyuTestCore_BiomeTops.forest,
y_min = PyuTestCore_WorldBottom,
y_max = PyuTest.BIOME_TOPS.forest,
y_min = PyuTest.OVERWORLD_BOTTOM,
})

View File

@ -4,8 +4,8 @@ minetest.register_decoration({
place_on = {"group:grass"},
sidelen = 16,
fill_ratio = 0.009,
biomes = PyuTestCore.get_flowering_biomes(),
decoration = PyuTestCore.registered_flowers
biomes = PyuTest.get_flowering_biomes(),
decoration = PyuTest.registered_flowers
})
minetest.register_decoration({
@ -13,8 +13,8 @@ minetest.register_decoration({
place_on = {"group:grass"},
sidelen = 16,
fill_ratio = 0.032,
biomes = PyuTestCore.get_extra_flowering_biomes(),
decoration = PyuTestCore.registered_flowers
biomes = PyuTest.get_extra_flowering_biomes(),
decoration = PyuTest.registered_flowers
})
minetest.register_decoration({
@ -50,7 +50,7 @@ minetest.register_decoration({
fill_ratio = 0.03,
place_on = {"pyutest_core:water_source"},
biomes = {"swamp", "swamp_ocean"},
y_max = PyuTestCore_WorldTop,
y_max = PyuTest.OVERWORLD_TOP,
y_min = 0,
decoration = "pyutest_core:lilypad",
flags = "liquid_surface"
@ -62,7 +62,7 @@ minetest.register_decoration({
fill_ratio = 0.04,
place_on = {"group:sugarcane_spawn_on"},
decoration = "pyutest_core:sugarcane",
y_max = PyuTestCore_SurfaceBottom,
y_max = PyuTest.SURFACE_BOTTOM,
y_min = 0,
spawn_by = {"pyutest_core:water_source"},
num_spawn_by = 1,
@ -77,7 +77,7 @@ minetest.register_decoration({
sidelen = 16,
fill_ratio = 0.004,
biomes = {"forest", "old_growth_forest"},
schematic = PyuTestCore.get_schem_path("Tree"),
schematic = PyuTest.get_schem_path("Tree"),
rotation = "random",
flags = "place_center_x, place_center_z",
force_placement = true
@ -89,7 +89,7 @@ minetest.register_decoration({
sidelen = 16,
fill_ratio = 0.00045,
biomes = {"grassland"},
schematic = PyuTestCore.get_schem_path("Tree"),
schematic = PyuTest.get_schem_path("Tree"),
rotation = "random",
flags = "place_center_x, place_center_z",
force_placement = true
@ -101,7 +101,7 @@ minetest.register_decoration({
sidelen = 16,
fill_ratio = 0.004,
biomes = {"forest", "old_growth_forest"},
schematic = PyuTestCore.get_schem_path("Tree2"),
schematic = PyuTest.get_schem_path("Tree2"),
rotation = "random",
flags = "place_center_x, place_center_z",
force_placement = true
@ -113,7 +113,7 @@ minetest.register_decoration({
sidelen = 16,
fill_ratio = 0.00085,
biomes = {"savanna"},
schematic = PyuTestCore.get_schem_path("SavannaTree"),
schematic = PyuTest.get_schem_path("SavannaTree"),
rotation = "random",
flags = "place_center_x, place_center_z",
force_placement = true
@ -125,7 +125,7 @@ minetest.register_decoration({
sidelen = 16,
fill_ratio = 0.003,
biomes = {"mushroom_fields", "large_mushroom_forest"},
schematic = PyuTestCore.get_schem_path("Mushroom"),
schematic = PyuTest.get_schem_path("Mushroom"),
rotation = "random",
flags = "place_center_x, place_center_z",
force_placement = true
@ -137,7 +137,7 @@ minetest.register_decoration({
sidelen = 16,
fill_ratio = 0.003,
biomes = {"old_growth_forest"},
schematic = PyuTestCore.get_schem_path("OldGrowthTree"),
schematic = PyuTest.get_schem_path("OldGrowthTree"),
rotation = "random",
flags = "place_center_x, place_center_z",
force_placement = true
@ -149,7 +149,7 @@ minetest.register_decoration({
sidelen = 16,
fill_ratio = 0.005,
biomes = {"taiga"},
schematic = PyuTestCore.get_schem_path("TaigaTree"),
schematic = PyuTest.get_schem_path("TaigaTree"),
rotation = "random",
flags = "place_center_x, place_center_z",
force_placement = true
@ -161,7 +161,7 @@ minetest.register_decoration({
sidelen = 16,
fill_ratio = 0.005,
biomes = {"birch_forest"},
schematic = PyuTestCore.get_schem_path("BirchTree"),
schematic = PyuTest.get_schem_path("BirchTree"),
rotation = "random",
flags = "place_center_x, place_center_z",
force_placement = true
@ -173,7 +173,7 @@ minetest.register_decoration({
sidelen = 16,
fill_ratio = 0.005,
biomes = {"birch_forest", "old_growth_birch_forest"},
schematic = PyuTestCore.get_schem_path("TallBirchTree"),
schematic = PyuTest.get_schem_path("TallBirchTree"),
rotation = "random",
flags = "place_center_x, place_center_z",
force_placement = true
@ -185,7 +185,7 @@ minetest.register_decoration({
sidelen = 16,
fill_ratio = 0.005,
biomes = {"cherry_grove"},
schematic = PyuTestCore.get_schem_path("CherryTree"),
schematic = PyuTest.get_schem_path("CherryTree"),
rotation = "random",
flags = "place_center_x, place_center_z",
force_placement = true
@ -197,7 +197,7 @@ minetest.register_decoration({
sidelen = 16,
fill_ratio = 0.004,
biomes = {"snowy_forest"},
schematic = PyuTestCore.get_schem_path("SnowyTree1"),
schematic = PyuTest.get_schem_path("SnowyTree1"),
rotation = "random",
flags = "place_center_x, place_center_z",
force_placement = true
@ -209,7 +209,7 @@ minetest.register_decoration({
sidelen = 16,
fill_ratio = 0.004,
biomes = {"snowy_forest"},
schematic = PyuTestCore.get_schem_path("SnowyTree2"),
schematic = PyuTest.get_schem_path("SnowyTree2"),
rotation = "random",
flags = "place_center_x, place_center_z",
force_placement = true
@ -221,7 +221,7 @@ minetest.register_decoration({
sidelen = 16,
fill_ratio = 0.004,
biomes = {"swamp"},
schematic = PyuTestCore.get_schem_path("SwampTree"),
schematic = PyuTest.get_schem_path("SwampTree"),
rotation = "random",
flags = "place_center_x, place_center_z",
force_placement = true
@ -233,7 +233,7 @@ minetest.register_decoration({
sidelen = 16,
fill_ratio = 0.004,
biomes = {"old_growth_birch_forest"},
schematic = PyuTestCore.get_schem_path("VeryTallBirchTree"),
schematic = PyuTest.get_schem_path("VeryTallBirchTree"),
rotation = "random",
flags = "place_center_x, place_center_z",
force_placement = true
@ -245,7 +245,7 @@ minetest.register_decoration({
sidelen = 16,
fill_ratio = 0.016,
biomes = {"aspen_forest"},
schematic = PyuTestCore.get_schem_path("AspenTree1"),
schematic = PyuTest.get_schem_path("AspenTree1"),
rotation = "random",
flags = "place_center_x, place_center_z",
force_placement = true
@ -257,7 +257,7 @@ minetest.register_decoration({
sidelen = 16,
fill_ratio = 0.008,
biomes = {"aspen_forest"},
schematic = PyuTestCore.get_schem_path("AspenTree2"),
schematic = PyuTest.get_schem_path("AspenTree2"),
rotation = "random",
flags = "place_center_x, place_center_z",
force_placement = true
@ -269,7 +269,7 @@ minetest.register_decoration({
sidelen = 16,
fill_ratio = 0.019,
biomes = {"redwood_forest"},
schematic = PyuTestCore.get_schem_path("RedwoodTree"),
schematic = PyuTest.get_schem_path("RedwoodTree"),
rotation = "random",
flags = "place_center_x, place_center_z",
force_placement = true
@ -281,7 +281,7 @@ minetest.register_decoration({
sidelen = 16,
fill_ratio = 0.010,
biomes = {"jungle"},
schematic = PyuTestCore.get_schem_path("JungleTree"),
schematic = PyuTest.get_schem_path("JungleTree"),
rotation = "random",
flags = "place_center_x, place_center_z",
force_placement = true
@ -293,7 +293,7 @@ minetest.register_decoration({
sidelen = 16,
fill_ratio = 0.008,
biomes = {"jungle"},
schematic = PyuTestCore.get_schem_path("SmallJungleTree"),
schematic = PyuTest.get_schem_path("SmallJungleTree"),
rotation = "random",
flags = "place_center_x, place_center_z",
force_placement = true
@ -305,7 +305,7 @@ minetest.register_decoration({
sidelen = 16,
fill_ratio = 0.013,
biomes = {"jungle"},
schematic = PyuTestCore.get_schem_path("LargeJungleTree"),
schematic = PyuTest.get_schem_path("LargeJungleTree"),
rotation = "random",
flags = "place_center_x, place_center_z",
force_placement = true
@ -317,7 +317,7 @@ minetest.register_decoration({
sidelen = 16,
fill_ratio = 0.008,
biomes = {"jungle"},
schematic = PyuTestCore.get_schem_path("JungleBush"),
schematic = PyuTest.get_schem_path("JungleBush"),
rotation = "random",
flags = "place_center_x, place_center_z",
force_placement = true
@ -329,7 +329,7 @@ minetest.register_decoration({
sidelen = 16,
fill_ratio = 0.006,
biomes = {"large_mushroom_forest"},
schematic = PyuTestCore.get_schem_path("TallMushroom"),
schematic = PyuTest.get_schem_path("TallMushroom"),
rotation = "random",
flags = "place_center_x, place_center_z",
force_placement = true
@ -341,7 +341,7 @@ minetest.register_decoration({
sidelen = 16,
fill_ratio = 0.002,
biomes = {"large_mushroom_forest"},
schematic = PyuTestCore.get_schem_path("SmallMushroom"),
schematic = PyuTest.get_schem_path("SmallMushroom"),
rotation = "random",
flags = "place_center_x, place_center_z",
place_offset_y = 1,
@ -354,7 +354,7 @@ minetest.register_decoration({
sidelen = 16,
fill_ratio = 0.007,
biomes = {"large_mushroom_forest"},
schematic = PyuTestCore.get_schem_path("FallenMushroom"),
schematic = PyuTest.get_schem_path("FallenMushroom"),
rotation = "random",
flags = "place_center_x, place_center_z",
place_offset_y = 1,
@ -367,7 +367,7 @@ minetest.register_decoration({
sidelen = 16,
fill_ratio = 0.003,
biomes = {"vyn_forest"},
schematic = PyuTestCore.get_schem_path("VynTree"),
schematic = PyuTest.get_schem_path("VynTree"),
rotation = "random",
flags = "place_center_x, place_center_z",
place_offset_y = 1,

View File

@ -0,0 +1,86 @@
PyuTest.register_world = function (options)
local default_options = {}
local conf = {}
for k, v in pairs(options) do
conf[k] = v
end
for k, v in pairs(default_options) do
if conf[k] == nil then
conf[k] = v
end
end
if conf.y_max == nil or conf.y_min == nil then
error("Please supply 'y_max' and 'y_min' to the options table!")
end
if conf.name == nil then
error("Please supply 'name' in the options table!")
end
return {
name = conf.name,
y_max = conf.y_max,
y_min = conf.y_min,
register_biome = function (o)
local name = conf.name .. "-" .. o.name
minetest.register_biome(PyuTest.util.tableconcat(o, {
name = name,
depth_top = 0,
depth_filler = 0,
y_max = conf.y_max,
y_min = conf.y_min,
node_water = "air",
node_cave_liquid = "air",
vertical_blend = 5
}))
return name
end,
register_ore = function (o)
minetest.register_ore(PyuTest.util.tableconcat(o, {
y_max = conf.y_max,
y_min = conf.y_min,
}))
end
}
end
SpecialCaveWorld = PyuTest.register_world({
name = "special_cave_world",
y_max = PyuTest.OVERWORLD_BOTTOM,
y_min = PyuTest.OVERWORLD_BOTTOM * 2
})
local icy_cave = SpecialCaveWorld.register_biome({
name = "icy_cave",
node_stone = "pyutest_core:ice_block",
heat_point = 14,
humidity_point = 0
})
SpecialCaveWorld.register_ore({
ore_type = "blob",
ore = "pyutest_core:snow_block",
wherein = "pyutest_core:ice_block",
clust_scarcity = 3 * 3 * 3,
clust_num_ores = 35,
clust_size = 5,
biomes = {icy_cave},
noise_params = PyuTest.SPECIALSTONE_NOISE_PARAMS
})
SpecialCaveWorld.register_ore({
ore_type = "blob",
ore = "pyutest_core:crystal_lantern_block",
wherein = "pyutest_core:ice_block",
clust_scarcity = 5 * 5 * 5,
clust_num_ores = 4,
clust_size = 5,
biomes = {icy_cave},
noise_params = PyuTest.SPECIALSTONE_NOISE_PARAMS
})

View File

@ -19,8 +19,8 @@ PyuTestMobs.create_boss_egg = function(mob_id, desc, texture, addegg, no_creativ
local mob_name = t[#t]
local cage_id = "pyutest_mobs:"..mob_name.."_spawn_cage"
PyuTestCore.make_node(cage_id, desc:gsub("Spawn Egg", "") .. "Boss Spawner Cage", {
block = PyuTestCore.BLOCK_BREAKABLE_LONG
PyuTest.make_node(cage_id, desc:gsub("Spawn Egg", "") .. "Boss Spawner Cage", {
block = PyuTest.BLOCK_BREAKABLE_LONG
}, {"pyutest-cage.png"}, {
drawtype = "glasslike",
on_rightclick = function(pos)

View File

@ -20,8 +20,8 @@ if mapgen ~= "flat" and mapgen ~= "singlenode" then
active_object_count = 3,
min_light = 0,
max_light = 8,
max_height = PyuTestCore_WorldTop,
min_height = PyuTestCore_SurfaceBottom,
max_height = PyuTest.OVERWORLD_TOP,
min_height = PyuTest.SURFACE_BOTTOM,
day_toggle = false
})
@ -33,8 +33,8 @@ if mapgen ~= "flat" and mapgen ~= "singlenode" then
active_object_count = 6,
min_light = 0,
max_light = 8,
min_height = PyuTestCore_SurfaceBottom - 1,
max_height= PyuTestCore_WorldBottom
min_height = PyuTest.SURFACE_BOTTOM - 1,
max_height= PyuTest.OVERWORLD_BOTTOM
})
mobs:spawn({
@ -45,7 +45,7 @@ if mapgen ~= "flat" and mapgen ~= "singlenode" then
active_object_count = 3,
min_light = 9,
max_light = 15,
min_height = PyuTestCore_SurfaceBottom,
min_height = PyuTest.SURFACE_BOTTOM,
day_toggle = true,
})
@ -69,6 +69,6 @@ if mapgen ~= "flat" and mapgen ~= "singlenode" then
min_light = 0,
max_light = 9,
day_toggle = false,
min_height = PyuTestCore_SurfaceBottom
min_height = PyuTest.SURFACE_BOTTOM
})
end

View File

@ -9,7 +9,7 @@ mobs:register_arrow("pyutest_mobs:arrow_snowball", {
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)
PyuTest.create_explosion(pos, 1, false, 9, self.object, false)
end,
hit_player = snowball_hit_player,
hit_mob = snowball_hit_player,

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 B