mirror of
https://github.com/minetest-mods/craftguide.git
synced 2024-12-13 18:20:17 +01:00
remove shapeless, minor refactors
This commit is contained in:
parent
85ece2c8b9
commit
a7dd13994f
19
init.lua
19
init.lua
@ -590,7 +590,7 @@ local function item_in_inv(item, inv_items)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function init_data(player, name)
|
local function init_data(name)
|
||||||
player_data[name] = {
|
player_data[name] = {
|
||||||
filter = "",
|
filter = "",
|
||||||
pagenum = 1,
|
pagenum = 1,
|
||||||
@ -732,7 +732,7 @@ mt.register_on_mods_loaded(get_init_items)
|
|||||||
|
|
||||||
mt.register_on_joinplayer(function(player)
|
mt.register_on_joinplayer(function(player)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
init_data(player, name)
|
init_data(name)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
mt.register_on_leaveplayer(function(player)
|
mt.register_on_leaveplayer(function(player)
|
||||||
@ -752,10 +752,9 @@ if sfinv_only then
|
|||||||
end,
|
end,
|
||||||
|
|
||||||
on_enter = function(self, player, context)
|
on_enter = function(self, player, context)
|
||||||
|
if next(recipe_filters) then
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
local data = player_data[name]
|
local data = player_data[name]
|
||||||
|
|
||||||
if next(recipe_filters) then
|
|
||||||
data.items_raw = get_filtered_items(player)
|
data.items_raw = get_filtered_items(player)
|
||||||
search(data)
|
search(data)
|
||||||
end
|
end
|
||||||
@ -774,9 +773,9 @@ else
|
|||||||
|
|
||||||
local function on_use(user)
|
local function on_use(user)
|
||||||
local name = user:get_player_name()
|
local name = user:get_player_name()
|
||||||
local data = player_data[name]
|
|
||||||
|
|
||||||
if next(recipe_filters) then
|
if next(recipe_filters) then
|
||||||
|
local data = player_data[name]
|
||||||
data.items_raw = get_filtered_items(user)
|
data.items_raw = get_filtered_items(user)
|
||||||
search(data)
|
search(data)
|
||||||
end
|
end
|
||||||
@ -824,8 +823,9 @@ else
|
|||||||
|
|
||||||
mt.register_craft({
|
mt.register_craft({
|
||||||
output = "craftguide:book",
|
output = "craftguide:book",
|
||||||
type = "shapeless",
|
recipe = {
|
||||||
recipe = {"default:book"}
|
{"default:book"}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
mt.register_craft({
|
mt.register_craft({
|
||||||
@ -836,8 +836,9 @@ else
|
|||||||
|
|
||||||
mt.register_craft({
|
mt.register_craft({
|
||||||
output = "craftguide:sign",
|
output = "craftguide:sign",
|
||||||
type = "shapeless",
|
recipe = {
|
||||||
recipe = {"default:sign_wall_wood"}
|
{"default:sign_wall_wood"}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
mt.register_craft({
|
mt.register_craft({
|
||||||
|
Loading…
Reference in New Issue
Block a user