Rename and clean up MaplePet
This commit is contained in:
@@ -23,7 +23,7 @@ package net.server.channel.handlers;
|
||||
|
||||
import client.MapleCharacter;
|
||||
import client.MapleClient;
|
||||
import client.inventory.MaplePet;
|
||||
import client.inventory.Pet;
|
||||
import client.inventory.PetCommand;
|
||||
import client.inventory.PetDataFactory;
|
||||
import net.AbstractPacketHandler;
|
||||
@@ -38,7 +38,7 @@ public final class PetCommandHandler extends AbstractPacketHandler {
|
||||
MapleCharacter chr = c.getPlayer();
|
||||
int petId = p.readInt();
|
||||
byte petIndex = chr.getPetIndex(petId);
|
||||
MaplePet pet;
|
||||
Pet pet;
|
||||
if (petIndex == -1) {
|
||||
return;
|
||||
} else {
|
||||
|
||||
@@ -24,7 +24,7 @@ package net.server.channel.handlers;
|
||||
import client.MapleCharacter;
|
||||
import client.MapleClient;
|
||||
import client.autoban.AutobanFactory;
|
||||
import client.inventory.MaplePet;
|
||||
import client.inventory.Pet;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.packet.InPacket;
|
||||
|
||||
@@ -43,7 +43,7 @@ public final class PetExcludeItemsHandler extends AbstractPacketHandler {
|
||||
byte petIndex = chr.getPetIndex(petId);
|
||||
if (petIndex < 0) return;
|
||||
|
||||
final MaplePet pet = chr.getPet(petIndex);
|
||||
final Pet pet = chr.getPet(petIndex);
|
||||
if (pet == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ import client.autoban.AutobanManager;
|
||||
import client.inventory.Inventory;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.MaplePet;
|
||||
import client.inventory.Pet;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.packet.InPacket;
|
||||
@@ -53,7 +53,7 @@ public final class PetFoodHandler extends AbstractPacketHandler {
|
||||
}
|
||||
int previousFullness = 100;
|
||||
byte slot = 0;
|
||||
MaplePet[] pets = chr.getPets();
|
||||
Pet[] pets = chr.getPets();
|
||||
for (byte i = 0; i < 3; i++) {
|
||||
if (pets[i] != null) {
|
||||
if (pets[i].getFullness() < previousFullness) {
|
||||
@@ -63,7 +63,7 @@ public final class PetFoodHandler extends AbstractPacketHandler {
|
||||
}
|
||||
}
|
||||
|
||||
MaplePet pet = chr.getPet(slot);
|
||||
Pet pet = chr.getPet(slot);
|
||||
if(pet == null) return;
|
||||
|
||||
short pos = p.readShort();
|
||||
|
||||
@@ -23,7 +23,7 @@ package net.server.channel.handlers;
|
||||
|
||||
import client.MapleCharacter;
|
||||
import client.MapleClient;
|
||||
import client.inventory.MaplePet;
|
||||
import client.inventory.Pet;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.packet.InPacket;
|
||||
import server.maps.MapleMapItem;
|
||||
@@ -42,7 +42,7 @@ public final class PetLootHandler extends AbstractPacketHandler {
|
||||
MapleCharacter chr = c.getPlayer();
|
||||
|
||||
int petIndex = chr.getPetIndex(p.readInt());
|
||||
MaplePet pet = chr.getPet(petIndex);
|
||||
Pet pet = chr.getPet(petIndex);
|
||||
if (pet == null || !pet.isSummoned()) {
|
||||
c.sendPacket(PacketCreator.enableActions());
|
||||
return;
|
||||
|
||||
@@ -338,7 +338,7 @@ public final class PlayerLoggedinHandler extends AbstractPacketHandler {
|
||||
player.checkBerserk(player.isHidden());
|
||||
|
||||
if (newcomer) {
|
||||
for (MaplePet pet : player.getPets()) {
|
||||
for (Pet pet : player.getPets()) {
|
||||
if (pet != null) {
|
||||
wserv.registerPetHunger(player, player.getPetIndex(pet));
|
||||
}
|
||||
|
||||
@@ -367,7 +367,7 @@ public final class UseCashItemHandler extends AbstractPacketHandler {
|
||||
player.getMap().startMapEffect(ii.getMsg(itemId).replaceFirst("%s", player.getName()).replaceFirst("%s", p.readString()), itemId);
|
||||
remove(c, position, itemId);
|
||||
} else if (itemType == 517) {
|
||||
MaplePet pet = player.getPet(0);
|
||||
Pet pet = player.getPet(0);
|
||||
if (pet == null) {
|
||||
c.sendPacket(PacketCreator.enableActions());
|
||||
return;
|
||||
@@ -405,7 +405,7 @@ public final class UseCashItemHandler extends AbstractPacketHandler {
|
||||
|
||||
} else if (itemType == 524) {
|
||||
for (byte i = 0; i < 3; i++) {
|
||||
MaplePet pet = player.getPet(i);
|
||||
Pet pet = player.getPet(i);
|
||||
if (pet != null) {
|
||||
Pair<Integer, Boolean> pair = pet.canConsume(itemId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user