mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-19 09:31:07 +01:00
Fix enchanted books losing their enchantments in creative inventory
This commit is contained in:
parent
c757e98b4f
commit
9919011aca
1 changed files with 4 additions and 3 deletions
|
@ -695,8 +695,9 @@ minetest.register_on_joinplayer(function(player)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
minetest.register_on_player_inventory_action(function(player, action, inventory, inventory_info)
|
minetest.register_on_player_inventory_action(function(player, action, inventory, inventory_info)
|
||||||
if minetest.is_creative_enabled(player:get_player_name()) and action == "put" and inventory_info.listname == "main" and get_stack_size(player) == 64 then
|
local stack = inventory_info.stack
|
||||||
local stack = inventory_info.stack
|
local item = stack:get_name()
|
||||||
player:get_inventory():set_stack("main", inventory_info.index, stack:get_name() .. " " .. stack:get_stack_max())
|
if minetest.is_creative_enabled(player:get_player_name()) and action == "put" and inventory_info.listname == "main" and get_stack_size(player) == 64 and not item:find("mcl_enchanting:book_enchanted") then
|
||||||
|
player:get_inventory():set_stack("main", inventory_info.index, item .. " " .. stack:get_stack_max())
|
||||||
end
|
end
|
||||||
end)
|
end)
|
Loading…
Reference in a new issue