feat: make that putting the egg in a container reset the owner
This commit is contained in:
parent
4a4fdaefed
commit
fb951eae05
1 changed files with 2 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue