This commit is contained in:
IamPyu 2024-06-21 17:22:34 -06:00
parent 2d96fa083c
commit b5b748d8fd
11 changed files with 43 additions and 32 deletions

10
.gitmodules vendored
View File

@ -1,6 +1,4 @@
[submodule "mods/sfinv"]
path = mods/sfinv
url = https://github.com/rubenwardy/sfinv
[submodule "mods/cg_plus"]
path = mods/cg_plus
url = https://github.com/random-geek/cg_plus
[submodule "mods/unified_inventory"]
path = mods/unified_inventory
url = https://github.com/minetest-mods/unified_inventory

@ -1 +0,0 @@
Subproject commit 6511eb8261cb1c292228e76c0906b642e26f2a16

View File

@ -462,9 +462,9 @@ PyuTestCore.make_node("pyutest_core:crate", "crate", "Crate", {
on_rightclick = function (pos, node, clicker)
local spos = string.format("%d,%d,%d", pos.x, pos.y, pos.z)
local formspec =
"size[8,8]" ..
"size[8,9]" ..
"list[nodemeta:"..spos..";main;0,0;8,4;]" ..
"list[current_player;main;0,5;8,3;]" ..
"list[current_player;main;0,5;8,4;]" ..
"listring[nodemeta:"..spos..";main]" ..
"listring[current_player;main]"
minetest.show_formspec(clicker:get_player_name(), string.format("pyutest_core:crate_%d_%d_%d", pos.x, pos.y, pos.z), formspec)

View File

@ -7,7 +7,7 @@ minetest.register_craft({
})
minetest.register_craft({
output = "pyutest_core:pickaxe 1",
output = "pyutest_core:wooden_pickaxe 1",
recipe = {
{"pyutest_core:wooden_block", "pyutest_core:wooden_block", "pyutest_core:wooden_block"},
{"", "pyutest_core:stick", ""},

View File

@ -83,7 +83,7 @@ minetest.register_craft({
type = "shapeless"
})
PyuTestCore.make_device = function (ns, sname, desc, color, action, setup, extra_conf)
PyuTestCore.make_device = function (ns, sname, desc, color, craftitem, action, setup, extra_conf)
PyuTestCore.make_node(ns..":"..sname.."_device", sname.."_device", desc, {
block = PyuTestCore.BLOCK_BREAKABLE_NORMAL
}, {"device.png"}, PyuTestCore.util.tableconcat({
@ -106,14 +106,23 @@ PyuTestCore.make_device = function (ns, sname, desc, color, action, setup, extra
timer:start(PyuTestCore.ELECTRICITY_UPDATE_TIME)
end
}, extra_conf or {}))
minetest.register_craft({
output = ns..":"..sname.."_device 4",
recipe = {
{"pyutest_core:copper_ingot", "pyutest_core:copper_ingot", "pyutest_core:copper_ingot"},
{"pyutest_core:copper_ingot", craftitem, "pyutest_core:copper_ingot"},
{"pyutest_core:copper_ingot", "pyutest_core:copper_ingot", "pyutest_core:copper_ingot"}
}
})
end
PyuTestCore.make_device("pyutest_core", "time", "Time Device", "orange", function (e)
PyuTestCore.make_device("pyutest_core", "time", "Time Device", "orange", "pyutest_core:light", function (e)
if not e then return end
minetest.chat_send_all(string.format("Time: " .. os.date("%I:%M:%S", os.time())))
end)
PyuTestCore.make_device("pyutest_core", "block_setter", "Block Setter Device", "blue", function (e, pos)
PyuTestCore.make_device("pyutest_core", "block_setter", "Block Setter Device", "blue", "pyutest_core:stone_block", function (e, pos)
if not e then return end
local blocks = {}
for k, _ in pairs(minetest.registered_nodes) do

View File

@ -1,4 +1,11 @@
local Dummy = {
PyuTestCore.make_entity = function(name, def, setup)
local ndef = def
setup(ndef)
minetest.register_entity(name, ndef)
end
PyuTestCore.make_entity("pyutest_core:dummy", {
initial_properties = {
hp_max = 20,
physical = true,
@ -6,17 +13,15 @@ local Dummy = {
collide_with_objects = false,
textures = {"player.png", "player_back.png"},
visual_size = {x = 1, y = 2},
nametag = "Dummy\nThis is not a human",
nametag = "Dummy",
automatic_rotate = 15,
}
}
}, function (def)
function def:on_rightclick(clicker)
self.object:set_velocity({x = 0, y = 10, z = 0})
end
function Dummy:on_rightclick(clicker)
self.object:set_velocity({x = 0, y = 10, z = 0})
end
function Dummy:on_step(dtime)
self.object:add_velocity({x = 0, y = -1 * dtime, z = 0})
end
minetest.register_entity("pyutest_core:dummy", Dummy)
function def:on_step(dtime)
self.object:add_velocity({x = 0, y = -1 * dtime, z = 0})
end
end)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 280 B

After

Width:  |  Height:  |  Size: 277 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 302 B

After

Width:  |  Height:  |  Size: 291 B

View File

@ -58,10 +58,10 @@ PyuTestCore.make_tool("pyutest_core:wooden_pickaxe", "wooden_pickaxe", "Wooden P
[PyuTestCore.BLOCK_BREAKABLE_CHOPPY] = 1.2,
[PyuTestCore.BLOCK_BREAKABLE_MIDDLE] = 2,
},
uses = 100,
uses = 200,
}
},
punch_attack_uses = 50,
punch_attack_uses = 100,
damage_groups = {fleshy = 2}
}
})
@ -79,10 +79,10 @@ PyuTestCore.make_tool("pyutest_core:iron_pickaxe", "iron_pickaxe", "Iron Pickaxe
[PyuTestCore.BLOCK_BREAKABLE_LONG] = 2,
[PyuTestCore.BLOCK_BREAKABLE_FOREVER] = 4
},
uses = 400,
uses = 750,
}
},
punch_attack_uses = 200,
punch_attack_uses = 375,
damage_groups = {fleshy = 4}
}
})
@ -100,10 +100,10 @@ PyuTestCore.make_tool("pyutest_core:diamond_pickaxe", "diamond_pickaxe", "Diamon
[PyuTestCore.BLOCK_BREAKABLE_LONG] = 0.85,
[PyuTestCore.BLOCK_BREAKABLE_FOREVER] = 1.7
},
uses = 600,
uses = 1200,
}
},
punch_attack_uses = 300,
punch_attack_uses = 600,
damage_groups = {fleshy = 4}
}
})

@ -1 +0,0 @@
Subproject commit dbe59fd71b45542fe086bb18dfc0421aa323ca05

@ -0,0 +1 @@
Subproject commit 2c9449b6e796c5a4bcf832b10595c5a78e237dc6