diff --git a/Server/src/main/content/global/skill/construction/HouseZone.java b/Server/src/main/content/global/skill/construction/HouseZone.java index 8b6a89548..afa32bd02 100644 --- a/Server/src/main/content/global/skill/construction/HouseZone.java +++ b/Server/src/main/content/global/skill/construction/HouseZone.java @@ -156,9 +156,9 @@ public final class HouseZone extends MapZone { }; private void remove_items(Player p) { - // todo check BoB for (int item : itemsToRemove) { - removeItem(p, item, Container.INVENTORY); + removeAll(p, item, Container.INVENTORY); + removeAll(p, item, Container.BoB); } } } diff --git a/Server/src/main/core/api/Container.kt b/Server/src/main/core/api/Container.kt index 590d94a61..bdcfd4900 100644 --- a/Server/src/main/core/api/Container.kt +++ b/Server/src/main/core/api/Container.kt @@ -3,5 +3,6 @@ package core.api enum class Container { INVENTORY, BANK, - EQUIPMENT + EQUIPMENT, + BoB } \ No newline at end of file diff --git a/Server/src/main/core/api/ContentAPI.kt b/Server/src/main/core/api/ContentAPI.kt index ef1cfbad7..cca729909 100644 --- a/Server/src/main/core/api/ContentAPI.kt +++ b/Server/src/main/core/api/ContentAPI.kt @@ -340,6 +340,12 @@ fun removeItem(player: Player, item: T, container: Container = Container.INV Container.INVENTORY -> player.inventory.remove(it) Container.BANK -> player.bank.remove(it) || player.bankSecondary.remove(it) Container.EQUIPMENT -> player.equipment.remove(it) + Container.BoB -> { + if (player.familiarManager.hasFamiliar() && player.familiarManager.familiar.isBurdenBeast) + (player.familiarManager.familiar as BurdenBeast).container.remove(it) + else + false + } } } @@ -356,6 +362,12 @@ fun addItem(player: Player, id: Int, amount: Int = 1, container: Container = Con Container.INVENTORY -> player.inventory Container.BANK -> player.bank Container.EQUIPMENT -> player.equipment + Container.BoB -> { + if(player.familiarManager.hasFamiliar() && player.familiarManager.familiar.isBurdenBeast) + (player.familiarManager.familiar as BurdenBeast).container + else + return false + } } return cont.add(Item(id, amount)) @@ -375,6 +387,7 @@ fun replaceSlot(player: Player, slot: Int, item: Item, currentItem: Item? = null Container.INVENTORY -> player.inventory Container.EQUIPMENT -> player.equipment Container.BANK -> player.bank + Container.BoB -> (player.familiarManager.familiar as BurdenBeast).container } if (item.id == 65535 || item.amount <= 0) { @@ -1665,6 +1678,14 @@ fun removeAll(player: Player, item: T, container: Container = Container.INVE player.bank.remove(Item(it, amountInPrimary)) && player.bankSecondary.remove(Item(it, amountInSecondary)) } Container.INVENTORY -> player.inventory.remove(Item(it, amountInInventory(player, it))) + Container.BoB -> { + if (player.familiarManager.hasFamiliar() && player.familiarManager.familiar.isBurdenBeast){ + val cont = (player.familiarManager.familiar as BurdenBeast).container + cont.remove(Item(it, cont.getAmount(it))) + } + else + false + } } }