You've already forked Arcturus-Morningstar-Extended
mirror of
https://github.com/duckietm/Arcturus-Morningstar-Extended.git
synced 2026-06-20 15:36:17 +00:00
:up Added Delete Pet from inventory
This commit is contained in:
@@ -368,6 +368,7 @@ public class PacketManager {
|
|||||||
this.registerHandler(Incoming.RequestInventoryItemsEvent, RequestInventoryItemsEvent.class);
|
this.registerHandler(Incoming.RequestInventoryItemsEvent, RequestInventoryItemsEvent.class);
|
||||||
this.registerHandler(Incoming.HotelViewInventoryEvent, RequestInventoryItemsEvent.class);
|
this.registerHandler(Incoming.HotelViewInventoryEvent, RequestInventoryItemsEvent.class);
|
||||||
this.registerHandler(Incoming.RequestInventoryPetsEvent, RequestInventoryPetsEvent.class);
|
this.registerHandler(Incoming.RequestInventoryPetsEvent, RequestInventoryPetsEvent.class);
|
||||||
|
this.registerHandler(Incoming.RequestInventoryPetDelete, RequestInventoryPetDelete.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
void registerRooms() throws Exception {
|
void registerRooms() throws Exception {
|
||||||
|
|||||||
@@ -407,4 +407,5 @@ public class Incoming {
|
|||||||
|
|
||||||
// CUSTOM
|
// CUSTOM
|
||||||
public static final int UpdateFurniturePositionEvent = 10019;
|
public static final int UpdateFurniturePositionEvent = 10019;
|
||||||
|
public static final int RequestInventoryPetDelete = 10030;
|
||||||
}
|
}
|
||||||
|
|||||||
+33
@@ -0,0 +1,33 @@
|
|||||||
|
package com.eu.habbo.messages.incoming.inventory;
|
||||||
|
|
||||||
|
import com.eu.habbo.Emulator;
|
||||||
|
import com.eu.habbo.habbohotel.pets.Pet;
|
||||||
|
import com.eu.habbo.habbohotel.users.Habbo;
|
||||||
|
import com.eu.habbo.messages.incoming.MessageHandler;
|
||||||
|
import com.eu.habbo.messages.outgoing.inventory.InventoryPetsComposer;
|
||||||
|
import com.eu.habbo.messages.outgoing.inventory.InventoryRefreshComposer;
|
||||||
|
|
||||||
|
public class RequestInventoryPetDelete extends MessageHandler {
|
||||||
|
public int getRatelimit() {
|
||||||
|
return 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void handle() {
|
||||||
|
final int petId = this.packet.readInt();
|
||||||
|
final Habbo habbo = this.client.getHabbo();
|
||||||
|
|
||||||
|
if (habbo == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
final Pet pet = habbo.getInventory().getPetsComponent().getPet(petId);
|
||||||
|
|
||||||
|
if (pet == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
habbo.getInventory().getPetsComponent().removePet(pet);
|
||||||
|
Emulator.getGameEnvironment().getPetManager().deletePet(pet);
|
||||||
|
|
||||||
|
habbo.getClient().sendResponse(new InventoryRefreshComposer());
|
||||||
|
habbo.getClient().sendResponse(new InventoryPetsComposer(habbo));
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
Reference in New Issue
Block a user