Remove Glowslime and add Spawnpoints

This commit is contained in:
IamPyu 2024-11-15 20:01:04 -06:00
parent aa3c14abcc
commit 10243aba44
5 changed files with 48 additions and 8 deletions

View File

@ -21,6 +21,8 @@ I should just start giving updates a version number to avoid naming updates.
- Remove "Block" from a bunch of item names excluding ore blocks
- Fire is no longer in the creative inventory
- Lower the size of explosive items/nodes
- Removed Glowslime
- Added Spawnpoints
## [Oct 20th - Nov 2nd] Update: The Something Update

View File

@ -231,11 +231,3 @@ PyuTest.make_building_blocks("pyutest_blocks:slime", "Slime", { "pyutest-slime.p
bouncy = 85,
oddly_breakable_by_hand = PyuTest.BLOCK_FAST
})
PyuTest.make_building_blocks("pyutest_blocks:glowslime", "Glowslime", { "pyutest-slime.png" }, "gray", {
bouncy = 85,
oddly_breakable_by_hand = PyuTest.BLOCK_FAST
}, {
paramtype = "light",
light_source = minetest.LIGHT_MAX
})

View File

@ -0,0 +1,45 @@
local storage = minetest.get_mod_storage()
local spawnpoints = minetest.deserialize(storage:get("player_spawns")) or {}
minetest.register_on_joinplayer(function (player)
local name = player:get_player_name()
if spawnpoints[name] == nil then
spawnpoints[name] = player:get_pos()
end
end)
minetest.register_on_respawnplayer(function(player)
local name = player:get_player_name()
if spawnpoints[name] ~= nil then
player:set_pos(spawnpoints[name])
return true
end
end)
local function save_data()
storage:set_string("player_spawns", minetest.serialize(spawnpoints))
end
minetest.register_on_shutdown(save_data)
PyuTest.register_interval(save_data, 10)
PyuTest.make_node("pyutest_spawnpoints:spawnpoint", "Spawnpoint", {
choppy = PyuTest.BLOCK_FAST
}, {"pyutest-spawnpoint.png"}, {
on_rightclick = function (pos, node, clicker)
if clicker == nil then return end
if not clicker:is_player() then return end
local name = clicker:get_player_name()
spawnpoints[name] = pos
end
})
minetest.register_craft({
output = "pyutest_spawnpoints:spawnpoint",
recipe = {
{"pyutest_blocks:stone_block", "pyutest_blocks:stone_block", "pyutest_blocks:stone_block"},
{"pyutest_blocks:stone_block", "pyutest_blocks:stone_block", "pyutest_blocks:stone_block"},
{"pyutest_blocks:stone_block", "pyutest_blocks:stone_block", "pyutest_blocks:stone_block"},
}
})

View File

@ -0,0 +1 @@
depends = pyutest_blocks

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 B