0
0
Fork 0

Merge pull request 'Allow villager to claim filled cauldrons.' (#3856) from Codiac/MineClone2:cauldron_job_site_fix into master

Reviewed-on: MineClone2/MineClone2#3856
Reviewed-by: 𝕵𝖔𝖍𝖆𝖓𝖓𝖊𝖘 𝕱𝖗𝖎𝖙𝖟 <mrrar@noreply.git.minetest.land>
This commit is contained in:
commit aa3b3421d5
1 changed files with 10 additions and 2 deletions

View File

@ -351,7 +351,7 @@ local professions = {
leatherworker = {
name = N("Leatherworker"),
texture = "mobs_mc_villager_leatherworker.png",
jobsite = "mcl_cauldrons:cauldron",
jobsite = "group:cauldron",
trades = {
{
{ { "mcl_mobitems:leather", 9, 12 }, E1 },
@ -1008,7 +1008,15 @@ end
----- JOBSITE LOGIC
local function get_profession_by_jobsite(js)
for k,v in pairs(professions) do
if v.jobsite == js then return k end
if v.jobsite == js then
return k
-- Catch Nitwit doesn't have a jobsite
elseif v.jobsite and v.jobsite:find("^group:") then
local group = v.jobsite:gsub("^group:", "")
if minetest.get_item_group(js, group) > 0 then
return k
end
end
end
end