mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-23 07:20:50 +01:00
Update src/main/java/com/eu/habbo/messages/incoming/inventory/RequestInventoryItemsEvent.java
This commit is contained in:
parent
471dae3068
commit
002c53e8bb
@ -17,6 +17,12 @@ public class RequestInventoryItemsEvent extends MessageHandler {
|
|||||||
@Override
|
@Override
|
||||||
public void handle() throws Exception {
|
public void handle() throws Exception {
|
||||||
int totalItems = this.client.getHabbo().getInventory().getItemsComponent().getItems().size();
|
int totalItems = this.client.getHabbo().getInventory().getItemsComponent().getItems().size();
|
||||||
|
|
||||||
|
if (totalItems == 0) {
|
||||||
|
this.client.sendResponse(new InventoryItemsComposer(0, 1, new TIntObjectHashMap<>()));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int totalFragments = (int) Math.ceil((double) totalItems / 1000.0);
|
int totalFragments = (int) Math.ceil((double) totalItems / 1000.0);
|
||||||
|
|
||||||
if (totalFragments == 0) {
|
if (totalFragments == 0) {
|
||||||
@ -26,11 +32,6 @@ public class RequestInventoryItemsEvent extends MessageHandler {
|
|||||||
synchronized (this.client.getHabbo().getInventory().getItemsComponent().getItems()) {
|
synchronized (this.client.getHabbo().getInventory().getItemsComponent().getItems()) {
|
||||||
TIntObjectMap<HabboItem> items = new TIntObjectHashMap<>();
|
TIntObjectMap<HabboItem> items = new TIntObjectHashMap<>();
|
||||||
|
|
||||||
if (totalItems == 0) {
|
|
||||||
this.client.sendResponse(new InventoryItemsComposer(0, 1, new TIntObjectHashMap<>()));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
TIntObjectIterator<HabboItem> iterator = this.client.getHabbo().getInventory().getItemsComponent().getItems().iterator();
|
TIntObjectIterator<HabboItem> iterator = this.client.getHabbo().getInventory().getItemsComponent().getItems().iterator();
|
||||||
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user