This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local CRAFT_TABLE_SIZE = 4 | |
local update_craft_table_inv = function(inv) | |
inv:set_stack("craftpreview", 1, minetest.get_craft_result({method = "normal", items = inv:get_list("craft"), width = CRAFT_TABLE_SIZE}).item) | |
end | |
local update_craft_table = function(pos) | |
local meta = minetest.get_meta(pos) | |
local inv = meta:get_inventory() | |
update_craft_table_inv(inv) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local achievements_file=minetest.get_worldpath() .. "/achievements" | |
function read_file(filename) | |
local f = io.open(filename, "r") | |
if f==nil then return {} end | |
local t = f:read("*all") | |
f:close() | |
if t=="" or t==nil then return {} end | |
return minetest.deserialize(t) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local achievements_file=minetest.get_worldpath() .. "/achievements" | |
function read_file(filename) | |
local f = io.open(filename, "r") | |
if f==nil then return {} end | |
local t = f:read("*all") | |
f:close() | |
if t=="" or t==nil then return {} end | |
return minetest.deserialize(t) | |
end |
NewerOlder