Added stick group and revamped fences

This commit is contained in:
IamPyu 2024-12-04 16:00:51 -06:00
parent 44d1b4f7a8
commit 354f7008e2
8 changed files with 114 additions and 82 deletions

View File

@ -13,10 +13,12 @@ Game Changes:
- Added "Hand Strength" item to emulate the strength of the hand of survival mode in creative mode.
- Added Reinforced Glass
- Make Fireworks faster
- Revamp Fences
Code Changes:
- Reorganize `pyutest_crafts` mod
- Added `stick` group for sticks
## [Dec 1st] Unnamed Minor Update

View File

@ -1,3 +1,31 @@
PyuTest.NODE_BOXES = {
CARPET = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, -0.45, 0.5 }
},
SLAB = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, 0, 0.5 }
},
PILLAR = {
type = "fixed",
fixed = { -0.15, -0.5, -0.15, 0.15, 0.5, 0.15 }
},
STAIRS = {
type = "fixed",
fixed = {
{ -0.5, -0.5, -0.5, 0.5, 0, 0.5 },
{ -0.5, 0, 0, 0.5, 0.5, 0.5 },
},
},
SLIGHTLY_SMALLER = {
type = "fixed",
fixed = {
{ -0.5, -0.5, -0.5, 0.5, 0.45, 0.5 },
}
}
}
PyuTest.make_node_sounds = function(tbl)
local t = tbl or {}
t.footstep = t.footstep or { name = "block_walk", gain = 1 }
@ -28,35 +56,7 @@ PyuTest.make_node = function(name, desc, groups, tiles, extra_conf)
core.register_node(name, conf)
end
PyuTest.NODE_BOXES = {
CARPET = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, -0.45, 0.5 }
},
SLAB = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, 0, 0.5 }
},
PILLAR = {
type = "fixed",
fixed = { -0.15, -0.5, -0.15, 0.15, 0.5, 0.15 }
},
STAIRS = {
type = "fixed",
fixed = {
{ -0.5, -0.5, -0.5, 0.5, 0, 0.5 },
{ -0.5, 0, 0, 0.5, 0.5, 0.5 },
},
},
SLIGHTLY_SMALLER = {
type = "fixed",
fixed = {
{ -0.5, -0.5, -0.5, 0.5, 0.45, 0.5 },
}
}
}
PyuTest.building_blocks = {}
PyuTest.make_building_blocks = function(name, desc, tex, colortint, cgroups, extra_conf)
local groups = PyuTest.util.tablecopy(cgroups) or {}
groups["block"] = 1
@ -72,7 +72,6 @@ PyuTest.make_building_blocks = function(name, desc, tex, colortint, cgroups, ext
local id_stairs = name .. "_stairs"
local id_fence = name .. "_fence"
table.insert(PyuTest.building_blocks, {
ns = name:split(":")[1],
name = name:split(":")[2],
@ -138,19 +137,7 @@ PyuTest.make_building_blocks = function(name, desc, tex, colortint, cgroups, ext
sounds = PyuTest.make_node_sounds(),
}, econf))
core.register_node(id_fence, PyuTest.util.tableconcat({
description = Translate(desc .. " Fence"),
tiles = tex,
groups = groups,
drawtype = "fencelike",
paramtype = "light",
collision_box = {
type = "fixed",
fixed = { -0.25, -0.5, -0.25, 0.25, 0.9, 0.25 }
},
selection_box = PyuTest.NODEBOX_DEFAULT,
sounds = PyuTest.make_node_sounds(),
}, econf))
PyuTest.make_fence(id_fence, Translate(desc .. " Fence"), id_block, tex[1], groups)
core.register_craft({
output = id_carpet .. " 2",
@ -183,14 +170,6 @@ PyuTest.make_building_blocks = function(name, desc, tex, colortint, cgroups, ext
{ id_block, id_block, id_block }
}
})
core.register_craft({
output = id_fence .. " 4",
recipe = {
{ id_block, "pyutest_tools:stick", id_block },
{ id_block, "pyutest_tools:stick", id_block }
}
})
end
PyuTest.make_liquid = function(name, desc, groups, texture, speed, extra_conf)

View File

@ -0,0 +1,46 @@
PyuTest.make_fence = function(name, desc, craftitem, texture, groups)
core.register_node(name, {
description = desc,
groups = PyuTest.util.tableconcat(groups, {
block = 1,
fence = 1,
}),
connects_to = {"group:block", "group:fence"},
tiles = {texture},
is_ground_content = false,
sunlight_propagates = true,
sounds = PyuTest.make_node_sounds(),
paramtype = "light",
drawtype = "nodebox",
-- Node boxes from Minetest Game
node_box = {
type = "connected",
fixed = {-1/8, -1/2, -1/8, 1/8, 1/2, 1/8},
connect_front = {{-1/16, 3/16, -1/2, 1/16, 5/16, -1/8 },
{-1/16, -5/16, -1/2, 1/16, -3/16, -1/8 }},
connect_left = {{-1/2, 3/16, -1/16, -1/8, 5/16, 1/16},
{-1/2, -5/16, -1/16, -1/8, -3/16, 1/16}},
connect_back = {{-1/16, 3/16, 1/8, 1/16, 5/16, 1/2 },
{-1/16, -5/16, 1/8, 1/16, -3/16, 1/2 }},
connect_right = {{ 1/8, 3/16, -1/16, 1/2, 5/16, 1/16},
{ 1/8, -5/16, -1/16, 1/2, -3/16, 1/16}}
},
collision_box = {
type = "connected",
fixed = {-1/8, -1/2, -1/8, 1/8, 1/2 + 3/8, 1/8},
connect_front = {-1/8, -1/2, -1/2, 1/8, 1/2 + 3/8, -1/8},
connect_left = {-1/2, -1/2, -1/8, -1/8, 1/2 + 3/8, 1/8},
connect_back = {-1/8, -1/2, 1/8, 1/8, 1/2 + 3/8, 1/2},
connect_right = { 1/8, -1/2, -1/8, 1/2, 1/2 + 3/8, 1/8}
},
})
core.register_craft({
output = name .. " 4",
recipe = {
{ craftitem, "group:stick", craftitem },
{ craftitem, "group:stick", craftitem }
}
})
end

View File

@ -1,6 +1,9 @@
local modpath = core.get_modpath("pyutest_blocks")
dofile(modpath .. "/api/types.lua")
dofile(modpath .. "/api.lua")
dofile(modpath .. "/basic.lua")
dofile(modpath .. "/liquid.lua")
dofile(modpath .. "/special.lua")

View File

@ -96,16 +96,16 @@ core.register_craft({
output = "pyutest_blocks:torch 4",
recipe = {
{ "pyutest_ores:coal_lump" },
{ "pyutest_tools:stick" }
{ "group:stick" }
}
})
core.register_craft({
output = "pyutest_blocks:ladder 16",
recipe = {
{ "pyutest_tools:stick", "", "pyutest_tools:stick" },
{ "pyutest_tools:stick", "pyutest_tools:stick", "pyutest_tools:stick" },
{ "pyutest_tools:stick", "", "pyutest_tools:stick" }
{ "group:stick", "", "group:stick" },
{ "group:stick", "group:stick", "group:stick" },
{ "group:stick", "", "group:stick" }
}
})

View File

@ -2,8 +2,8 @@ core.register_craft({
output = "pyutest_tools:wooden_pickaxe 1",
recipe = {
{ "group:wooden_planks", "group:wooden_planks", "group:wooden_planks" },
{ "", "pyutest_tools:stick", "" },
{ "", "pyutest_tools:stick", "" }
{ "", "group:stick", "" },
{ "", "group:stick", "" }
}
})
@ -11,8 +11,8 @@ core.register_craft({
output = "pyutest_tools:wooden_axe 1",
recipe = {
{ "group:wooden_planks", "group:wooden_planks", "" },
{ "group:wooden_planks", "pyutest_tools:stick", "" },
{ "", "pyutest_tools:stick", "" }
{ "group:wooden_planks", "group:stick", "" },
{ "", "group:stick", "" }
}
})
@ -21,7 +21,7 @@ core.register_craft({
recipe = {
{ "", "group:wooden_planks", "" },
{ "", "group:wooden_planks", "" },
{ "", "pyutest_tools:stick", "" }
{ "", "group:stick", "" }
}
})
@ -29,8 +29,8 @@ core.register_craft({
output = "pyutest_tools:stone_pickaxe",
recipe = {
{ "group:cobble", "group:cobble", "group:cobble" },
{ "", "pyutest_tools:stick", "" },
{ "", "pyutest_tools:stick", "" }
{ "", "group:stick", "" },
{ "", "group:stick", "" }
}
})
@ -38,8 +38,8 @@ core.register_craft({
output = "pyutest_tools:stone_axe",
recipe = {
{ "group:cobble", "group:cobble", "" },
{ "group:cobble", "pyutest_tools:stick", "" },
{ "", "pyutest_tools:stick", "" }
{ "group:cobble", "group:stick", "" },
{ "", "group:stick", "" }
}
})
@ -48,7 +48,7 @@ core.register_craft({
recipe = {
{ "", "group:cobble", "" },
{ "", "group:cobble", "" },
{ "", "pyutest_tools:stick", "" }
{ "", "group:stick", "" }
}
})
@ -56,8 +56,8 @@ core.register_craft({
output = "pyutest_tools:iron_pickaxe",
recipe = {
{ "pyutest_ores:iron_ingot", "pyutest_ores:iron_ingot", "pyutest_ores:iron_ingot" },
{ "", "pyutest_tools:stick", "" },
{ "", "pyutest_tools:stick", "" }
{ "", "group:stick", "" },
{ "", "group:stick", "" }
}
})
@ -65,8 +65,8 @@ core.register_craft({
output = "pyutest_tools:iron_axe",
recipe = {
{ "pyutest_ores:iron_ingot", "pyutest_ores:iron_ingot", "" },
{ "pyutest_ores:iron_ingot", "pyutest_tools:stick", "" },
{ "", "pyutest_tools:stick", "" }
{ "pyutest_ores:iron_ingot", "group:stick", "" },
{ "", "group:stick", "" }
}
})
@ -75,7 +75,7 @@ core.register_craft({
recipe = {
{ "pyutest_ores:iron_ingot" },
{ "pyutest_ores:iron_ingot" },
{ "pyutest_tools:stick" }
{ "group:stick" }
}
})
@ -83,8 +83,8 @@ core.register_craft({
output = "pyutest_farming:hoe",
recipe = {
{ "pyutest_ores:iron_ingot", "pyutest_ores:iron_ingot", "" },
{ "", "pyutest_tools:stick", "" },
{ "", "pyutest_tools:stick", "" }
{ "", "group:stick", "" },
{ "", "group:stick", "" }
}
})
@ -101,8 +101,8 @@ core.register_craft({
output = "pyutest_tools:diamond_pickaxe",
recipe = {
{ "pyutest_ores:diamond_shard", "pyutest_ores:diamond_shard", "pyutest_ores:diamond_shard" },
{ "", "pyutest_tools:stick", "" },
{ "", "pyutest_tools:stick", "" }
{ "", "group:stick", "" },
{ "", "group:stick", "" }
}
})
@ -110,8 +110,8 @@ core.register_craft({
output = "pyutest_tools:diamond_axe",
recipe = {
{ "pyutest_ores:diamond_shard", "pyutest_ores:diamond_shard", "" },
{ "pyutest_ores:diamond_shard", "pyutest_tools:stick", "" },
{ "", "pyutest_tools:stick", "" }
{ "pyutest_ores:diamond_shard", "group:stick", "" },
{ "", "group:stick", "" }
}
})
@ -120,7 +120,7 @@ core.register_craft({
recipe = {
{ "pyutest_ores:diamond_shard" },
{ "pyutest_ores:diamond_shard" },
{ "pyutest_tools:stick" }
{ "group:stick" }
}
})

View File

@ -104,8 +104,8 @@ core.register_craft({
output = "pyutest_magic:enchanted_pickaxe",
recipe = {
{ "pyutest_magic:enchanted_shard", "pyutest_magic:enchanted_shard", "pyutest_magic:enchanted_shard" },
{ "", "pyutest_tools:stick", "" },
{ "", "pyutest_tools:stick", "" }
{ "", "group:stick", "" },
{ "", "group:stick", "" }
}
})
@ -131,8 +131,8 @@ core.register_craft({
output = "pyutest_magic:enchanted_axe",
recipe = {
{ "pyutest_magic:enchanted_shard", "pyutest_magic:enchanted_shard", "" },
{ "pyutest_magic:enchanted_shard", "pyutest_tools:stick", "" },
{ "", "pyutest_tools:stick", "" }
{ "pyutest_magic:enchanted_shard", "group:stick", "" },
{ "", "group:stick", "" }
}
})
@ -144,7 +144,7 @@ core.register_craft({
recipe = {
{ "pyutest_magic:enchanted_shard" },
{ "pyutest_magic:enchanted_shard" },
{ "pyutest_tools:stick" }
{ "group:stick" }
}
})

View File

@ -1,4 +1,6 @@
PyuTest.make_item("pyutest_tools:stick", "Stick", {}, "pyutest-stick.png")
PyuTest.make_item("pyutest_tools:stick", "Stick", {
stick = 1
}, "pyutest-stick.png")
PyuTest.make_item("pyutest_tools:bone", "Bone", {}, "pyutest-bone.png", {})
PyuTest.make_item("pyutest_tools:gunpowder", "Gunpowder", {}, "pyutest-powder.png", {
color = "dimgray",