Rename and clean up MapleInventoryType
This commit is contained in:
@@ -22,8 +22,8 @@ package client.processor.action;
|
||||
import client.MapleCharacter;
|
||||
import client.MapleClient;
|
||||
import client.inventory.Equip;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.MapleInventoryType;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
import config.YamlConfig;
|
||||
import constants.game.GameConstants;
|
||||
@@ -75,7 +75,7 @@ public class MakerProcessor {
|
||||
p.readInt(); // 1... probably inventory type
|
||||
pos = p.readInt();
|
||||
|
||||
Item it = c.getPlayer().getInventory(MapleInventoryType.EQUIP).getItem((short) pos);
|
||||
Item it = c.getPlayer().getInventory(InventoryType.EQUIP).getItem((short) pos);
|
||||
if(it != null && it.getItemId() == toCreate) {
|
||||
toDisassemble = toCreate;
|
||||
|
||||
@@ -182,7 +182,7 @@ public class MakerProcessor {
|
||||
|
||||
default:
|
||||
if(toDisassemble != -1) {
|
||||
MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.EQUIP, (short) pos, (short) 1, false);
|
||||
MapleInventoryManipulator.removeFromSlot(c, InventoryType.EQUIP, (short) pos, (short) 1, false);
|
||||
} else {
|
||||
for (Pair<Integer, Integer> pair : recipe.getReqItems()) {
|
||||
c.getAbstractPlayerInteraction().gainItem(pair.getLeft(), (short) -pair.getRight(), false);
|
||||
|
||||
@@ -24,8 +24,8 @@ package client.processor.action;
|
||||
import client.MapleCharacter;
|
||||
import client.MapleClient;
|
||||
import client.inventory.Inventory;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.MapleInventoryType;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
import config.YamlConfig;
|
||||
import server.MapleItemInformationProvider;
|
||||
@@ -55,7 +55,7 @@ public class PetAutopotProcessor {
|
||||
|
||||
private boolean cursorOnNextAvailablePot(MapleCharacter chr) {
|
||||
if(toUseList == null) {
|
||||
toUseList = chr.getInventory(MapleInventoryType.USE).linkedListById(itemId);
|
||||
toUseList = chr.getInventory(InventoryType.USE).linkedListById(itemId);
|
||||
}
|
||||
|
||||
toUse = null;
|
||||
@@ -96,7 +96,7 @@ public class PetAutopotProcessor {
|
||||
curHp = chr.getHp();
|
||||
curMp = chr.getMp();
|
||||
|
||||
Inventory useInv = chr.getInventory(MapleInventoryType.USE);
|
||||
Inventory useInv = chr.getInventory(InventoryType.USE);
|
||||
useInv.lockInventory();
|
||||
try {
|
||||
toUse = useInv.getItem(slot);
|
||||
@@ -150,7 +150,7 @@ public class PetAutopotProcessor {
|
||||
|
||||
while (true) {
|
||||
short qtyToUse = (short) Math.min(qtyCount, toUse.getQuantity());
|
||||
MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.USE, slot, qtyToUse, false);
|
||||
MapleInventoryManipulator.removeFromSlot(c, InventoryType.USE, slot, qtyToUse, false);
|
||||
|
||||
curHp += (incHp * qtyToUse);
|
||||
curMp += (incMp * qtyToUse);
|
||||
|
||||
@@ -22,7 +22,7 @@ package client.processor.action;
|
||||
import client.MapleCharacter;
|
||||
import client.MapleClient;
|
||||
import client.SkillFactory;
|
||||
import client.inventory.MapleInventoryType;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.MaplePet;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
import provider.MapleDataProvider;
|
||||
@@ -44,7 +44,7 @@ public class SpawnPetProcessor {
|
||||
if (c.tryacquireClient()) {
|
||||
try {
|
||||
MapleCharacter chr = c.getPlayer();
|
||||
MaplePet pet = chr.getInventory(MapleInventoryType.CASH).getItem(slot).getPet();
|
||||
MaplePet pet = chr.getInventory(InventoryType.CASH).getItem(slot).getPet();
|
||||
if (pet == null) return;
|
||||
|
||||
int petid = pet.getItemId();
|
||||
@@ -60,8 +60,8 @@ public class SpawnPetProcessor {
|
||||
if (petId == -1) {
|
||||
return;
|
||||
}
|
||||
long expiration = chr.getInventory(MapleInventoryType.CASH).getItem(slot).getExpiration();
|
||||
MapleInventoryManipulator.removeById(c, MapleInventoryType.CASH, petid, (short) 1, false, false);
|
||||
long expiration = chr.getInventory(InventoryType.CASH).getItem(slot).getExpiration();
|
||||
MapleInventoryManipulator.removeById(c, InventoryType.CASH, petid, (short) 1, false, false);
|
||||
MapleInventoryManipulator.addById(c, evolveid, (short) 1, null, petId, expiration);
|
||||
|
||||
c.sendPacket(PacketCreator.enableActions());
|
||||
|
||||
@@ -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.");
|
||||
|
||||
@@ -26,8 +26,8 @@ package client.processor.stat;
|
||||
import client.*;
|
||||
import client.autoban.AutobanFactory;
|
||||
import client.inventory.Equip;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.MapleInventoryType;
|
||||
import config.YamlConfig;
|
||||
import constants.skills.*;
|
||||
import net.packet.InPacket;
|
||||
@@ -49,7 +49,7 @@ public class AssignAPProcessor {
|
||||
MapleCharacter chr = c.getPlayer();
|
||||
if (chr.getRemainingAp() < 1) return;
|
||||
|
||||
Collection<Item> equippedC = chr.getInventory(MapleInventoryType.EQUIPPED).list();
|
||||
Collection<Item> equippedC = chr.getInventory(InventoryType.EQUIPPED).list();
|
||||
|
||||
c.lockClient();
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user