forked from VoxeLibre/VoxeLibre
Make it possible to xraft a banner on an enchanted shield
This commit is contained in:
parent
fc9e83c059
commit
976cfba53a
|
@ -301,7 +301,7 @@ function mcl_enchanting.initialize()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function
|
function mcl_enchanting.random(pr, ...)
|
||||||
(pr, ...)
|
(pr, ...)
|
||||||
local r = pr and pr:next(...) or math.random(...)
|
local r = pr and pr:next(...) or math.random(...)
|
||||||
|
|
||||||
|
|
|
@ -397,7 +397,8 @@ minetest.register_craft({
|
||||||
})
|
})
|
||||||
|
|
||||||
for _, colortab in pairs(mcl_banners.colors) do
|
for _, colortab in pairs(mcl_banners.colors) do
|
||||||
minetest.register_tool("mcl_shields:shield_" .. colortab[1], {
|
local color = colortab[1]
|
||||||
|
minetest.register_tool("mcl_shields:shield_" .. color, {
|
||||||
description = S(colortab[6] .. " Shield"),
|
description = S(colortab[6] .. " Shield"),
|
||||||
_doc_items_longdesc = S("A shield is a tool used for protecting the player against attacks."),
|
_doc_items_longdesc = S("A shield is a tool used for protecting the player against attacks."),
|
||||||
inventory_image = "mcl_shield.png^(mcl_shield_item_overlay.png^[colorize:" .. colortab[4] ..")",
|
inventory_image = "mcl_shield.png^(mcl_shield_item_overlay.png^[colorize:" .. colortab[4] ..")",
|
||||||
|
@ -416,12 +417,17 @@ for _, colortab in pairs(mcl_banners.colors) do
|
||||||
_shield_color = colortab[4],
|
_shield_color = colortab[4],
|
||||||
})
|
})
|
||||||
|
|
||||||
local banner = "mcl_banners:banner_item_" .. colortab[1]
|
local banner = "mcl_banners:banner_item_" .. color
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
output = "mcl_shields:shield_" .. colortab[1],
|
output = "mcl_shields:shield_" .. color,
|
||||||
recipe = {"mcl_shields:shield", banner},
|
recipe = {"mcl_shields:shield", banner},
|
||||||
})
|
})
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "shapeless",
|
||||||
|
output = "mcl_shields:shield_" .. color .. "_enchanted",
|
||||||
|
recipe = {"mcl_shields:shield_enchanted", banner},
|
||||||
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
local function to_shield_texture(banner_texture)
|
local function to_shield_texture(banner_texture)
|
||||||
|
@ -438,7 +444,7 @@ local function craft_banner_on_shield(itemstack, player, old_craft_grid, craft_i
|
||||||
for i = 1, player:get_inventory():get_size("craft") do
|
for i = 1, player:get_inventory():get_size("craft") do
|
||||||
local stack = old_craft_grid[i]
|
local stack = old_craft_grid[i]
|
||||||
local name = stack:get_name()
|
local name = stack:get_name()
|
||||||
if name == "mcl_shields:shield" then
|
if minetest.get_item_group(name, "shield") then
|
||||||
shield_stack = stack
|
shield_stack = stack
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue