fix:egg dissapears while holding a full stack of the same eggs; eggs max stack set to 64

master
root 2022-06-12 09:28:16 +02:00
parent 87e20a0f80
commit d2d3cedf05
4 changed files with 6 additions and 5 deletions

View File

@ -1,5 +1,3 @@
local _id = 0
function kitz.logon_mob(self)
table.insert(kitz.active_mobs, self.object)
end

View File

@ -42,8 +42,9 @@ end
petz.extract_egg_from_nest = function(pos, player, itemstack, egg_type)
local inv = player:get_inventory()
if inv:room_for_item("main", egg_type) then
if itemstack:get_name() == egg_type or itemstack:get_name() == "" then
itemstack:add_item(egg_type)
if ((itemstack:get_name() == egg_type) and not(itemstack:get_count() >= itemstack:get_stack_max()))
or (itemstack:get_name() == "") then
itemstack:add_item(egg_type)
else
inv:add_item("main", egg_type) --add the egg to the player's inventory
end

View File

@ -5,7 +5,7 @@
function petz.bh_breed(self, pos)
if self.breed and self.is_rut and self.is_male then --search a couple for a male!
local couple_name = "petz:"..self.type
if self.type == "elephant" then
if self.type == "elephant" then
couple_name = couple_name.."_female"
end
local couple_obj = kitz.get_closest_entity(self, couple_name) -- look for a couple

View File

@ -6,6 +6,7 @@ minetest.register_craftitem("petz:ducky_egg", {
description = S("Ducky Egg"),
inventory_image = "petz_ducky_egg.png",
wield_image = "petz_ducky_egg.png",
stack_max = 64,
on_use = minetest.item_eat(2),
groups = {flammable = 2, food = 2, food_egg = 1},
})
@ -14,6 +15,7 @@ minetest.register_craftitem("petz:chicken_egg", {
description = S("Chicken Egg"),
inventory_image = "petz_chicken_egg.png",
wield_image = "petz_chicken_egg.png",
stack_max = 64,
on_use = minetest.item_eat(2),
groups = {flammable = 2, food = 2, food_egg = 1},
})