forked from VoxeLibre/VoxeLibre
85 lines
3.0 KiB
Lua
85 lines
3.0 KiB
Lua
---
|
|
--- Generated by EmmyLua(https://github.com/EmmyLua)
|
|
--- Created by michieal.
|
|
--- DateTime: 10/23/22 4:50 AM
|
|
---
|
|
-- LOCALIZATION
|
|
local S = minetest.get_translator("hamburger_mod")
|
|
|
|
local modname = minetest.get_current_modname()
|
|
local modpath = minetest.get_modpath(modname)
|
|
|
|
local table = table
|
|
local DEBUG = false
|
|
hamburger_mod = {}
|
|
|
|
-- quick api for hamburgers. call to register your hamburger.
|
|
function hamburger_mod.register_burger_craft( hamburger_item, cooked_meat, use_alt)
|
|
|
|
if use_alt == nil or use_alt == "" then
|
|
use_alt = false
|
|
end
|
|
|
|
minetest.register_craft({
|
|
type = "fuel",
|
|
recipe = "hamburger_mod:hamburger" .. hamburger_item,
|
|
burntime = 2,
|
|
})
|
|
|
|
-- register crafts (actual recipe)
|
|
if minetest.get_modpath(modname) then
|
|
|
|
local itemstring = "hamburger_mod:hamburger"
|
|
|
|
minetest.register_craft({
|
|
output = itemstring .. hamburger_item,
|
|
recipe = {
|
|
{ "mcl_farming:bread"},
|
|
{ cooked_meat }, -- "mcl_mobitems:cooked_beef" for a reg hamburger. grind up clowns for a McDonald's hambeurger
|
|
{ "mcl_farming:bread" },
|
|
},
|
|
})
|
|
end
|
|
|
|
if use_alt == false then
|
|
minetest.register_craftitem("hamburger_mod:hamburger" .. hamburger_item, {
|
|
description = S("Hamburger"),
|
|
_doc_items_longdesc = S("A tasty hamburger that is sure to lure villagers around like a LEASH. Can be eaten."),
|
|
_doc_items_usagehelp = S("wield this item to pull villagers to you."),
|
|
_tt_help = S("A tasty hamburger that is sure to lure villagers"),
|
|
inventory_image = "hamburger.png",
|
|
wield_image = "hamburger.png",
|
|
on_place = minetest.item_eat(8),
|
|
on_secondary_use = minetest.item_eat(8),
|
|
groups = { food = 2, eatable = 8 },
|
|
_mcl_saturation = 12.8,
|
|
stack_max = 64,
|
|
})
|
|
else
|
|
minetest.register_craftitem("hamburger_mod:hamburger" .. hamburger_item, {
|
|
description = S("Hamburger"),
|
|
_doc_items_longdesc = S("A tasty hamburger that is sure to lure villagers around like a LEASH. Can be eaten."),
|
|
_doc_items_usagehelp = S("wield this item to pull villagers to you."),
|
|
_tt_help = S("A tasty hamburger that is sure to lure villagers"),
|
|
inventory_image = "hamburger_alt.png",
|
|
wield_image = "hamburger_alt.png",
|
|
on_place = minetest.item_eat(8),
|
|
on_secondary_use = minetest.item_eat(8),
|
|
groups = { food = 2, eatable = 8 },
|
|
_mcl_saturation = 12.8,
|
|
stack_max = 64,
|
|
})
|
|
end
|
|
|
|
|
|
end
|
|
|
|
-- make the villagers follow the hamburger item
|
|
minetest.registered_entities["mobs_mc:villager"].nofollow = nil
|
|
|
|
hamburger_mod.register_burger_craft( "", "mcl_mobitems:cooked_beef")
|
|
table.insert(minetest.registered_entities["mobs_mc:villager"].follow,"hamburger_mod:hamburger")
|
|
|
|
if DEBUG then
|
|
minetest.log (dump(minetest.registered_entities["mobs_mc:villager"].follow))
|
|
end |