Compare commits

..

5 Commits

Author SHA1 Message Date
OgelGames b0fe7fa471 remove deprecated depends.txt 2022-05-20 12:05:48 +02:00
OgelGames 9d3c507a46 minor fixes (typos, grammar, whitespace) 2022-05-20 12:05:48 +02:00
OgelGames 61ba569aee fix pointless crafting recipe 2022-05-20 12:05:48 +02:00
Lejo1 e7ea4f5859
Fix new dependency 2022-02-02 16:25:36 +01:00
Lejo1 39e5b8f3d6
Update for 5.5.0 (mod name change) 2022-02-01 17:56:18 +01:00
4 changed files with 37 additions and 32 deletions

View File

@ -1,15 +1,13 @@
# Advaned Keys
# Advanced Keys
This mod replaces the skeleton_key with a multiple use skeleton_key.
So you can open multiple chests with it.
This mod replaces the single-use skeleton key with a multiple-use skeleton key, so you can open multiple chests with it.
It is also player specific so if you lost it nobody can access your chests.
Depends: default
Depends: default, keys
License: LGPL-2.1
Created by [Lejo](https://github.com/Lejo1)
Parts Derived from [minetest_game](https://github.com/minetest/minetest_game)
Parts derived from [minetest_game](https://github.com/minetest/minetest_game)

View File

@ -1 +0,0 @@
default

View File

@ -39,14 +39,21 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
end
end)
minetest.unregister_item("default:skeleton_key")
-- Clear old key crafts (would otherwise be pointless gold to gold crafts)
minetest.clear_craft({
output = "keys:skeleton_key",
})
minetest.clear_craft({
type = "cooking",
recipe = "keys:skeleton_key",
})
-- register alias for existing keys (in this case a replacement ingot)
minetest.register_alias("default:skeleton_key", "default:gold_ingot")
-- Register alias for existing keys (in this case a replacement ingot)
minetest.register_alias_force("keys:skeleton_key", "default:gold_ingot")
minetest.override_item("default:key", {
minetest.override_item("keys:key", {
description = "Advanced Key",
inventory_image = "default_key.png",
inventory_image = "keys_key.png",
groups = {key = 1},
stack_max = 1,
on_use = function(itemstack, user, pointed_thing)
@ -77,7 +84,7 @@ minetest.override_item("default:key", {
return itemstack
end
-- make a new key secret in case the node callback needs it
-- Make a new key secret in case the node callback needs it
local random = math.random
local newsecret = string.format(
"%04x%04x%04x%04x",
@ -116,14 +123,15 @@ minetest.override_item("default:key", {
on_key_use(pos, placer)
end)
end
else meta:set_string("secret", "no")
else
meta:set_string("secret", "no")
end
return itemstack
end
})
minetest.register_craft({
output = "default:key",
output = "keys:key",
recipe = {
{"default:gold_ingot", "", "default:gold_ingot"},
{"", "default:diamondblock", ""},

View File

@ -1,3 +1,3 @@
name = adv_keys
description = Replaces the Skeleton Key with one with multiple chests.
depends = default
description = Replaces the Skeleton Key with one that opens multiple chests.
depends = default,keys