Rename and clean up MapleInventoryType

This commit is contained in:
P0nk
2021-09-09 20:49:05 +02:00
parent ba647db6cf
commit 5ed7cf73d1
97 changed files with 556 additions and 556 deletions

View File

@@ -24,9 +24,9 @@ package server.maps;
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 client.inventory.manipulator.MapleKarmaManipulator;
import client.processor.npc.FredrickProcessor;
@@ -266,7 +266,7 @@ public class MapleHiredMerchant extends AbstractMapleMapObject {
if (quantity < 1 || !pItem.isExist() || pItem.getBundles() < quantity) {
c.sendPacket(PacketCreator.enableActions());
return;
} else if (newItem.getInventoryType().equals(MapleInventoryType.EQUIP) && newItem.getQuantity() > 1) {
} else if (newItem.getInventoryType().equals(InventoryType.EQUIP) && newItem.getQuantity() > 1) {
c.sendPacket(PacketCreator.enableActions());
return;
}
@@ -410,7 +410,7 @@ public class MapleHiredMerchant extends AbstractMapleMapObject {
if (check(c.getPlayer(), copyItems) && !timeout) {
for (MaplePlayerShopItem mpsi : copyItems) {
if (mpsi.isExist()) {
if (mpsi.getItem().getInventoryType().equals(MapleInventoryType.EQUIP)) {
if (mpsi.getItem().getInventoryType().equals(InventoryType.EQUIP)) {
MapleInventoryManipulator.addFromDrop(c, mpsi.getItem(), false);
} else {
MapleInventoryManipulator.addById(c, mpsi.getItem().getItemId(), (short) (mpsi.getBundles() * mpsi.getItem().getQuantity()), mpsi.getItem().getOwner(), -1, mpsi.getItem().getFlag(), mpsi.getItem().getExpiration());
@@ -622,7 +622,7 @@ public class MapleHiredMerchant extends AbstractMapleMapObject {
}
public void saveItems(boolean shutdown) throws SQLException {
List<Pair<Item, MapleInventoryType>> itemsWithType = new ArrayList<>();
List<Pair<Item, InventoryType>> itemsWithType = new ArrayList<>();
List<Short> bundles = new ArrayList<>();
for (MaplePlayerShopItem pItems : getItems()) {
@@ -648,7 +648,7 @@ public class MapleHiredMerchant extends AbstractMapleMapObject {
}
private static boolean check(MapleCharacter chr, List<MaplePlayerShopItem> items) {
List<Pair<Item, MapleInventoryType>> li = new ArrayList<>();
List<Pair<Item, InventoryType>> li = new ArrayList<>();
for (MaplePlayerShopItem item : items) {
Item it = item.getItem().copy();
it.setQuantity((short)(it.getQuantity() * item.getBundles()));

View File

@@ -26,8 +26,8 @@ import client.MapleCharacter;
import client.MapleClient;
import client.autoban.AutobanFactory;
import client.inventory.Equip;
import client.inventory.InventoryType;
import client.inventory.Item;
import client.inventory.MapleInventoryType;
import client.inventory.MaplePet;
import client.status.MonsterStatus;
import client.status.MonsterStatusEffect;
@@ -659,7 +659,7 @@ public class MapleMap {
spawnMesoDrop(mesos, calcDropPos(pos, mob.getPosition()), mob, chr, false, droptype);
}
} else {
if (ItemConstants.getInventoryType(de.itemId) == MapleInventoryType.EQUIP) {
if (ItemConstants.getInventoryType(de.itemId) == InventoryType.EQUIP) {
idrop = ii.randomizeStats((Equip) ii.getEquipById(de.itemId));
} else {
idrop = new Item(de.itemId, (short) 0, (short) (de.Maximum != 1 ? Randomizer.nextInt(de.Maximum - de.Minimum) + de.Minimum : 1));
@@ -687,7 +687,7 @@ public class MapleMap {
pos.x = mobpos + ((d % 2 == 0) ? (25 * (d + 1) / 2) : -(25 * (d / 2)));
}
if (de.itemId != 0) {
if (ItemConstants.getInventoryType(de.itemId) == MapleInventoryType.EQUIP) {
if (ItemConstants.getInventoryType(de.itemId) == InventoryType.EQUIP) {
idrop = ii.randomizeStats((Equip) ii.getEquipById(de.itemId));
} else {
idrop = new Item(de.itemId, (short) 0, (short) (de.Maximum != 1 ? Randomizer.nextInt(de.Maximum - de.Minimum) + de.Minimum : 1));
@@ -2189,7 +2189,7 @@ public class MapleMap {
final Item drop;
int randomedId = integer;
if (ItemConstants.getInventoryType(randomedId) != MapleInventoryType.EQUIP) {
if (ItemConstants.getInventoryType(randomedId) != InventoryType.EQUIP) {
drop = new Item(randomedId, (short) 0, (short) (rnd.nextInt(copies) + minCopies));
} else {
drop = ii.randomizeStats((Equip) ii.getEquipById(randomedId));

View File

@@ -24,8 +24,8 @@ package server.maps;
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 client.inventory.manipulator.MapleKarmaManipulator;
import net.packet.Packet;
@@ -255,7 +255,7 @@ public class MaplePlayerShop extends AbstractMapleMapObject {
if (quantity < 1 || !pItem.isExist() || pItem.getBundles() < quantity) {
c.sendPacket(PacketCreator.enableActions());
return false;
} else if (newItem.getInventoryType().equals(MapleInventoryType.EQUIP) && newItem.getQuantity() > 1) {
} else if (newItem.getInventoryType().equals(InventoryType.EQUIP) && newItem.getQuantity() > 1) {
c.sendPacket(PacketCreator.enableActions());
return false;
}