Rename and clean up MapleInventoryType
This commit is contained in:
@@ -27,9 +27,9 @@ import client.MapleCharacter;
|
||||
import client.MapleClient;
|
||||
import client.autoban.AutobanFactory;
|
||||
import client.inventory.Inventory;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.ItemFactory;
|
||||
import client.inventory.MapleInventoryType;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
import client.inventory.manipulator.MapleKarmaManipulator;
|
||||
import config.YamlConfig;
|
||||
@@ -146,7 +146,7 @@ public class DueyProcessor {
|
||||
try {
|
||||
int packageId = rs.getInt("PackageId");
|
||||
|
||||
List<Pair<Item, MapleInventoryType>> dueyItems = ItemFactory.DUEY.loadItems(packageId, false);
|
||||
List<Pair<Item, InventoryType>> dueyItems = ItemFactory.DUEY.loadItems(packageId, false);
|
||||
DueyPackage dueypack;
|
||||
|
||||
if (!dueyItems.isEmpty()) { // in a duey package there's only one item
|
||||
@@ -226,7 +226,7 @@ public class DueyProcessor {
|
||||
}
|
||||
|
||||
private static boolean insertPackageItem(int packageId, Item item) {
|
||||
Pair<Item, MapleInventoryType> dueyItem = new Pair<>(item, MapleInventoryType.getByType(item.getItemType()));
|
||||
Pair<Item, InventoryType> dueyItem = new Pair<>(item, InventoryType.getByType(item.getItemType()));
|
||||
try (Connection con = DatabaseConnection.getConnection()) {
|
||||
ItemFactory.DUEY.saveItems(Collections.singletonList(dueyItem), packageId, con);
|
||||
return true;
|
||||
@@ -241,7 +241,7 @@ public class DueyProcessor {
|
||||
if (invTypeId > 0) {
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
|
||||
MapleInventoryType invType = MapleInventoryType.getByType(invTypeId);
|
||||
InventoryType invType = InventoryType.getByType(invTypeId);
|
||||
Inventory inv = c.getPlayer().getInventory(invType);
|
||||
|
||||
Item item;
|
||||
@@ -324,7 +324,7 @@ public class DueyProcessor {
|
||||
}
|
||||
|
||||
if (quick) {
|
||||
MapleInventoryManipulator.removeById(c, MapleInventoryType.CASH, 5330000, (short) 1, false, false);
|
||||
MapleInventoryManipulator.removeById(c, InventoryType.CASH, 5330000, (short) 1, false, false);
|
||||
}
|
||||
|
||||
int packageId = createPackage(sendMesos, sendMessage, c.getPlayer().getName(), recipientCid, quick);
|
||||
|
||||
@@ -26,9 +26,9 @@ package client.processor.npc;
|
||||
import client.MapleCharacter;
|
||||
import client.MapleClient;
|
||||
import client.inventory.Inventory;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.ItemFactory;
|
||||
import client.inventory.MapleInventoryType;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
import net.server.Server;
|
||||
import net.server.world.World;
|
||||
@@ -52,10 +52,10 @@ public class FredrickProcessor {
|
||||
|
||||
private static int[] dailyReminders = new int[]{2, 5, 10, 15, 30, 60, 90, Integer.MAX_VALUE};
|
||||
|
||||
private static byte canRetrieveFromFredrick(MapleCharacter chr, List<Pair<Item, MapleInventoryType>> items) {
|
||||
private static byte canRetrieveFromFredrick(MapleCharacter chr, List<Pair<Item, InventoryType>> items) {
|
||||
if (!Inventory.checkSpotsAndOwnership(chr, items)) {
|
||||
List<Integer> itemids = new LinkedList<>();
|
||||
for (Pair<Item, MapleInventoryType> it : items) {
|
||||
for (Pair<Item, InventoryType> it : items) {
|
||||
itemids.add(it.getLeft().getItemId());
|
||||
}
|
||||
|
||||
@@ -269,7 +269,7 @@ public class FredrickProcessor {
|
||||
try {
|
||||
MapleCharacter chr = c.getPlayer();
|
||||
|
||||
List<Pair<Item, MapleInventoryType>> items;
|
||||
List<Pair<Item, InventoryType>> items;
|
||||
try {
|
||||
items = ItemFactory.MERCHANT.loadItems(chr.getId(), false);
|
||||
|
||||
@@ -287,7 +287,7 @@ public class FredrickProcessor {
|
||||
if(merchant != null)
|
||||
merchant.clearItems();
|
||||
|
||||
for (Pair<Item, MapleInventoryType> it : items) {
|
||||
for (Pair<Item, InventoryType> it : items) {
|
||||
Item item = it.getLeft();
|
||||
MapleInventoryManipulator.addFromDrop(chr.getClient(), item, false);
|
||||
String itemName = MapleItemInformationProvider.getInstance().getName(item.getItemId());
|
||||
|
||||
@@ -25,8 +25,8 @@ import client.MapleCharacter;
|
||||
import client.MapleClient;
|
||||
import client.autoban.AutobanFactory;
|
||||
import client.inventory.Inventory;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.MapleInventoryType;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
import client.inventory.manipulator.MapleKarmaManipulator;
|
||||
import config.YamlConfig;
|
||||
@@ -67,7 +67,7 @@ public class StorageProcessor {
|
||||
c.disconnect(true, false);
|
||||
return;
|
||||
}
|
||||
slot = storage.getSlot(MapleInventoryType.getByType(type), slot);
|
||||
slot = storage.getSlot(InventoryType.getByType(type), slot);
|
||||
Item item = storage.getItem(slot);
|
||||
if (item != null) {
|
||||
if (ii.isPickupRestricted(item.getItemId()) && chr.haveItemWithId(item.getItemId(), true)) {
|
||||
@@ -106,7 +106,7 @@ public class StorageProcessor {
|
||||
short slot = p.readShort();
|
||||
int itemId = p.readInt();
|
||||
short quantity = p.readShort();
|
||||
MapleInventoryType invType = ItemConstants.getInventoryType(itemId);
|
||||
InventoryType invType = ItemConstants.getInventoryType(itemId);
|
||||
Inventory inv = chr.getInventory(invType);
|
||||
if (slot < 1 || slot > inv.getSlotLimit()) { //player inv starts at one
|
||||
AutobanFactory.PACKET_EDIT.alert(c.getPlayer(), c.getPlayer().getName() + " tried to packet edit with storage.");
|
||||
|
||||
Reference in New Issue
Block a user