mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-11-16 07:20:31 +01:00
fix typo in armors name fix craftitem "3d_armor:*" can't be placed in armor inv
This commit is contained in:
parent
22efd5dfb7
commit
4e89838761
|
@ -1,8 +1,7 @@
|
||||||
local armors_no_shields = {["3d_armor:helmet_leather"] = true,["3d_armor:chestplate_leather"] = true,
|
local armors_no_shields = { ["3d_armor:helmet_hardenedleather"] = true,["3d_armor:chestplate_hardenedleather"] = true,
|
||||||
["3d_armor:leggings_leather"] = true,["3d_armor:boots_leather"] = true,
|
["3d_armor:leggings_hardenedleather"] = true,["3d_armor:boots_hardenedleather"] = true,
|
||||||
["3d_armor:hardenedleather"] = true,["3d_armor:helmet_reinforcedleather"] = true,
|
["3d_armor:helmet_reinforcedleather"] = true,["3d_armor:chestplate_reinforcedleather"] = true,
|
||||||
["3d_armor:chestplate_reinforcedleather"] = true,["3d_armor:leggings_reinforcedleather"] = true,
|
["3d_armor:leggings_reinforcedleather"] = true,["3d_armor:boots_reinforcedleather"] = true,
|
||||||
["3d_armor:boots_reinforcedleather"] = true,["3d_armor:reinforcedleather"] = true
|
|
||||||
} -- modif MFF (crabman/24/06/2015)
|
} -- modif MFF (crabman/24/06/2015)
|
||||||
|
|
||||||
|
|
||||||
|
@ -483,13 +482,26 @@ minetest.register_on_joinplayer(function(player)
|
||||||
local name = stack:get_name()
|
local name = stack:get_name()
|
||||||
local player_inv = player:get_inventory()
|
local player_inv = player:get_inventory()
|
||||||
local size = player_inv:get_size(listname)
|
local size = player_inv:get_size(listname)
|
||||||
if not (name:split(":")[1] == "3d_armor" or name:split(":")[1] == "shields") then
|
if not ( (name:split(":")[1] == "3d_armor" and stack:get_definition().groups["armor_heal"]) or name:split(":")[1] == "shields") then
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- if player class != item class
|
||||||
if not pclasses.api.util.can_have_item(player:get_player_name(), name) then
|
if not pclasses.api.util.can_have_item(player:get_player_name(), name) then
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--MFF (crabman/27/11/2015) no same item type. *helmet*
|
||||||
|
local ptype = name:split(":")[2]:split("_")[1]
|
||||||
|
for i=1, size do
|
||||||
|
local stack = player_inv:get_stack(listname, i)
|
||||||
|
if stack:get_count() > 0 then
|
||||||
|
if stack:get_name():find(ptype) then
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if name:find("shield") then
|
if name:find("shield") then
|
||||||
for i=1, size do
|
for i=1, size do
|
||||||
local stack = player_inv:get_stack(listname, i)
|
local stack = player_inv:get_stack(listname, i)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user