Rename and clean up MaplePlayerShopItem

This commit is contained in:
P0nk
2021-09-09 22:35:46 +02:00
parent f1ca5991c6
commit 667bc69eb1
8 changed files with 47 additions and 48 deletions

View File

@@ -599,7 +599,7 @@ public final class PlayerInteractionHandler extends AbstractPacketHandler {
sellItem.setQuantity(perBundle);
}
MaplePlayerShopItem shopItem = new MaplePlayerShopItem(sellItem, bundles, price);
PlayerShopItem shopItem = new PlayerShopItem(sellItem, bundles, price);
PlayerShop shop = chr.getPlayerShop();
HiredMerchant merchant = chr.getHiredMerchant();
if (shop != null && shop.isOwner(chr)) {

View File

@@ -396,7 +396,7 @@ public final class UseCashItemHandler extends AbstractPacketHandler {
c.getWorldServer().addOwlItemSearch(itemid);
}
player.setOwlSearch(itemid);
List<Pair<MaplePlayerShopItem, AbstractMapObject>> hmsAvailable = c.getWorldServer().getAvailableItemBundles(itemid);
List<Pair<PlayerShopItem, AbstractMapObject>> hmsAvailable = c.getWorldServer().getAvailableItemBundles(itemid);
if (!hmsAvailable.isEmpty()) {
remove(c, position, itemId);
}

View File

@@ -1813,21 +1813,21 @@ public class World {
}
}
public List<Pair<MaplePlayerShopItem, AbstractMapObject>> getAvailableItemBundles(int itemid) {
List<Pair<MaplePlayerShopItem, AbstractMapObject>> hmsAvailable = new ArrayList<>();
public List<Pair<PlayerShopItem, AbstractMapObject>> getAvailableItemBundles(int itemid) {
List<Pair<PlayerShopItem, AbstractMapObject>> hmsAvailable = new ArrayList<>();
for (HiredMerchant hm : getActiveMerchants()) {
List<MaplePlayerShopItem> itemBundles = hm.sendAvailableBundles(itemid);
List<PlayerShopItem> itemBundles = hm.sendAvailableBundles(itemid);
for(MaplePlayerShopItem mpsi : itemBundles) {
for(PlayerShopItem mpsi : itemBundles) {
hmsAvailable.add(new Pair<>(mpsi, hm));
}
}
for (PlayerShop ps : getActivePlayerShops()) {
List<MaplePlayerShopItem> itemBundles = ps.sendAvailableBundles(itemid);
List<PlayerShopItem> itemBundles = ps.sendAvailableBundles(itemid);
for(MaplePlayerShopItem mpsi : itemBundles) {
for(PlayerShopItem mpsi : itemBundles) {
hmsAvailable.add(new Pair<>(mpsi, ps));
}
}