feat: make that putting the egg in a container reset the owner

This commit is contained in:
HerozDotExe 2026-02-05 09:06:09 +01:00
parent 4a4fdaefed
commit fb951eae05

View file

@ -159,7 +159,9 @@ public class InventoryListener implements Listener {
if (holder instanceof Container || holder instanceof DoubleChest) { //DoubleChest implements InventoryHolder directly instead of implementing Container
//this is a container (furnace, chest boat, etc), so the egg will stay here
logger.log("inventory close- inside container block");
data.resetEggOwner(false, config);
data.updateEggLocation(otherInv);
Announcement.announce(String.format("%s putted the egg in a container!", player.getName()), logger);
} else {
//this is not a container (anvil, crafting table, villager, etc), so it will move back to the player's inventory
//note- if the player's inventory is full, it will instead drop as an item, which will trigger the item drop event