mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2025-02-17 03:02:35 +01:00
Merge branch 'dev' of https://git.krews.org/morningstar/Arcturus-Community into dev-latest
This commit is contained in:
commit
ad2f8fdb0a
@ -6,6 +6,7 @@ import com.eu.habbo.habbohotel.gameclients.GameClient;
|
|||||||
import com.eu.habbo.habbohotel.permissions.Permission;
|
import com.eu.habbo.habbohotel.permissions.Permission;
|
||||||
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
|
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
|
||||||
import com.eu.habbo.habbohotel.users.Habbo;
|
import com.eu.habbo.habbohotel.users.Habbo;
|
||||||
|
import com.eu.habbo.messages.outgoing.inventory.InventoryBotsComposer;
|
||||||
import com.eu.habbo.messages.outgoing.inventory.InventoryRefreshComposer;
|
import com.eu.habbo.messages.outgoing.inventory.InventoryRefreshComposer;
|
||||||
import gnu.trove.map.hash.TIntObjectHashMap;
|
import gnu.trove.map.hash.TIntObjectHashMap;
|
||||||
import gnu.trove.procedure.TObjectProcedure;
|
import gnu.trove.procedure.TObjectProcedure;
|
||||||
@ -30,26 +31,24 @@ public class EmptyBotsInventoryCommand extends Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (params.length >= 2 && params[1].equalsIgnoreCase(Emulator.getTexts().getValue("generic.yes"))) {
|
if (params.length >= 2 && params[1].equalsIgnoreCase(Emulator.getTexts().getValue("generic.yes"))) {
|
||||||
Habbo habbo = gameClient.getHabbo();
|
|
||||||
if (params.length == 3 && gameClient.getHabbo().hasPermission(Permission.ACC_EMPTY_OTHERS)) {
|
Habbo habbo = (params.length == 3 && gameClient.getHabbo().hasPermission(Permission.ACC_EMPTY_OTHERS)) ? Emulator.getGameEnvironment().getHabboManager().getHabbo(params[2]) : gameClient.getHabbo();
|
||||||
habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(params[2]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (habbo != null) {
|
if (habbo != null) {
|
||||||
TIntObjectHashMap<Bot> bots = new TIntObjectHashMap<>();
|
TIntObjectHashMap<Bot> bots = new TIntObjectHashMap<>();
|
||||||
bots.putAll(habbo.getInventory().getBotsComponent().getBots());
|
bots.putAll(habbo.getInventory().getBotsComponent().getBots());
|
||||||
habbo.getInventory().getBotsComponent().getBots().clear();
|
habbo.getInventory().getBotsComponent().getBots().clear();
|
||||||
bots.forEachValue(new TObjectProcedure<Bot>() {
|
bots.forEachValue(object -> {
|
||||||
@Override
|
Emulator.getGameEnvironment().getBotManager().deleteBot(object);
|
||||||
public boolean execute(Bot object) {
|
return true;
|
||||||
Emulator.getGameEnvironment().getBotManager().deleteBot(object);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
habbo.getClient().sendResponse(new InventoryRefreshComposer());
|
habbo.getClient().sendResponse(new InventoryRefreshComposer());
|
||||||
|
habbo.getClient().sendResponse(new InventoryBotsComposer(habbo));
|
||||||
|
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_empty_bots.cleared"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_empty_bots.cleared").replace("%username%", habbo.getHabboInfo().getUsername()), RoomChatMessageBubbles.ALERT);
|
||||||
|
} else {
|
||||||
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_empty_bots"), RoomChatMessageBubbles.ALERT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,10 +2,8 @@ package com.eu.habbo.habbohotel.commands;
|
|||||||
|
|
||||||
import com.eu.habbo.Emulator;
|
import com.eu.habbo.Emulator;
|
||||||
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
||||||
import com.eu.habbo.habbohotel.items.interactions.InteractionJukeBox;
|
|
||||||
import com.eu.habbo.habbohotel.permissions.Permission;
|
import com.eu.habbo.habbohotel.permissions.Permission;
|
||||||
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
|
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
|
||||||
import com.eu.habbo.habbohotel.rooms.TraxManager;
|
|
||||||
import com.eu.habbo.habbohotel.users.Habbo;
|
import com.eu.habbo.habbohotel.users.Habbo;
|
||||||
import com.eu.habbo.habbohotel.users.HabboItem;
|
import com.eu.habbo.habbohotel.users.HabboItem;
|
||||||
import com.eu.habbo.messages.outgoing.inventory.InventoryItemsComposer;
|
import com.eu.habbo.messages.outgoing.inventory.InventoryItemsComposer;
|
||||||
@ -34,31 +32,24 @@ public class EmptyInventoryCommand extends Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (params.length >= 2 && params[1].equalsIgnoreCase(Emulator.getTexts().getValue("generic.yes"))) {
|
if (params.length >= 2 && params[1].equalsIgnoreCase(Emulator.getTexts().getValue("generic.yes"))) {
|
||||||
Habbo habbo = gameClient.getHabbo();
|
|
||||||
if (params.length == 3 && gameClient.getHabbo().hasPermission(Permission.ACC_EMPTY_OTHERS)) {
|
Habbo habbo = (params.length == 3 && gameClient.getHabbo().hasPermission(Permission.ACC_EMPTY_OTHERS)) ? Emulator.getGameEnvironment().getHabboManager().getHabbo(params[2]) : gameClient.getHabbo();
|
||||||
habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(params[2]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (habbo != null) {
|
if (habbo != null) {
|
||||||
|
|
||||||
TIntObjectMap<HabboItem> items = new TIntObjectHashMap<>();
|
TIntObjectMap<HabboItem> items = new TIntObjectHashMap<>();
|
||||||
items.putAll(habbo.getInventory().getItemsComponent().getItems());
|
items.putAll(habbo.getInventory().getItemsComponent().getItems());
|
||||||
habbo.getInventory().getItemsComponent().getItems().clear();
|
habbo.getInventory().getItemsComponent().getItems().clear();
|
||||||
|
|
||||||
for (HabboItem item : items.valueCollection()) {
|
|
||||||
if(item instanceof InteractionJukeBox)
|
|
||||||
TraxManager.removeAllSongs((InteractionJukeBox) item);
|
|
||||||
}
|
|
||||||
|
|
||||||
Emulator.getThreading().run(new QueryDeleteHabboItems(items));
|
Emulator.getThreading().run(new QueryDeleteHabboItems(items));
|
||||||
|
|
||||||
habbo.getClient().sendResponse(new InventoryRefreshComposer());
|
habbo.getClient().sendResponse(new InventoryRefreshComposer());
|
||||||
habbo.getClient().sendResponse(new InventoryItemsComposer(0, 1, gameClient.getHabbo().getInventory().getItemsComponent().getItems()));
|
habbo.getClient().sendResponse(new InventoryItemsComposer(0, 1, gameClient.getHabbo().getInventory().getItemsComponent().getItems()));
|
||||||
|
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_empty.cleared"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_empty.cleared").replace("%username%", habbo.getHabboInfo().getUsername()), RoomChatMessageBubbles.ALERT);
|
||||||
|
} else {
|
||||||
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_empty"), RoomChatMessageBubbles.ALERT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -6,6 +6,7 @@ import com.eu.habbo.habbohotel.permissions.Permission;
|
|||||||
import com.eu.habbo.habbohotel.pets.Pet;
|
import com.eu.habbo.habbohotel.pets.Pet;
|
||||||
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
|
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
|
||||||
import com.eu.habbo.habbohotel.users.Habbo;
|
import com.eu.habbo.habbohotel.users.Habbo;
|
||||||
|
import com.eu.habbo.messages.outgoing.inventory.InventoryPetsComposer;
|
||||||
import com.eu.habbo.messages.outgoing.inventory.InventoryRefreshComposer;
|
import com.eu.habbo.messages.outgoing.inventory.InventoryRefreshComposer;
|
||||||
import gnu.trove.map.hash.TIntObjectHashMap;
|
import gnu.trove.map.hash.TIntObjectHashMap;
|
||||||
import gnu.trove.procedure.TObjectProcedure;
|
import gnu.trove.procedure.TObjectProcedure;
|
||||||
@ -30,25 +31,24 @@ public class EmptyPetsInventoryCommand extends Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (params.length >= 2 && params[1].equalsIgnoreCase(Emulator.getTexts().getValue("generic.yes"))) {
|
if (params.length >= 2 && params[1].equalsIgnoreCase(Emulator.getTexts().getValue("generic.yes"))) {
|
||||||
Habbo habbo = gameClient.getHabbo();
|
|
||||||
if (params.length == 3 && gameClient.getHabbo().hasPermission(Permission.ACC_EMPTY_OTHERS)) {
|
Habbo habbo = (params.length == 3 && gameClient.getHabbo().hasPermission(Permission.ACC_EMPTY_OTHERS)) ? Emulator.getGameEnvironment().getHabboManager().getHabbo(params[2]) : gameClient.getHabbo();
|
||||||
habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(params[2]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (habbo != null) {
|
if (habbo != null) {
|
||||||
TIntObjectHashMap<Pet> pets = new TIntObjectHashMap<>();
|
TIntObjectHashMap<Pet> pets = new TIntObjectHashMap<>();
|
||||||
pets.putAll(habbo.getInventory().getPetsComponent().getPets());
|
pets.putAll(habbo.getInventory().getPetsComponent().getPets());
|
||||||
habbo.getInventory().getPetsComponent().getPets().clear();
|
habbo.getInventory().getPetsComponent().getPets().clear();
|
||||||
pets.forEachValue(new TObjectProcedure<Pet>() {
|
pets.forEachValue(object -> {
|
||||||
@Override
|
Emulator.getGameEnvironment().getPetManager().deletePet(object);
|
||||||
public boolean execute(Pet object) {
|
return true;
|
||||||
Emulator.getGameEnvironment().getPetManager().deletePet(object);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
habbo.getClient().sendResponse(new InventoryRefreshComposer());
|
habbo.getClient().sendResponse(new InventoryRefreshComposer());
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_empty_pets.cleared"), RoomChatMessageBubbles.ALERT);
|
habbo.getClient().sendResponse(new InventoryPetsComposer(habbo));
|
||||||
|
|
||||||
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_empty_pets.cleared").replace("%username%", habbo.getHabboInfo().getUsername()), RoomChatMessageBubbles.ALERT);
|
||||||
|
} else {
|
||||||
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_empty_pets"), RoomChatMessageBubbles.ALERT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3005,7 +3005,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void talk(Habbo habbo, RoomChatMessage roomChatMessage, RoomChatType chatType) {
|
public void talk(Habbo habbo, RoomChatMessage roomChatMessage, RoomChatType chatType) {
|
||||||
this.talk(habbo, roomChatMessage, chatType, false);
|
this.talk(habbo, roomChatMessage, chatType, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void talk(final Habbo habbo, final RoomChatMessage roomChatMessage, RoomChatType chatType, boolean ignoreWired) {
|
public void talk(final Habbo habbo, final RoomChatMessage roomChatMessage, RoomChatType chatType, boolean ignoreWired) {
|
||||||
@ -3570,7 +3570,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
HabboItem lowestChair = this.getLowestChair(x, y);
|
HabboItem lowestChair = this.getLowestChair(x, y);
|
||||||
if (lowestChair != null && lowestChair != exclude) {
|
if (lowestChair != null && lowestChair != exclude) {
|
||||||
canStack = true;
|
canStack = true;
|
||||||
height = lowestChair.getZ() + Item.getCurrentHeight(lowestChair);
|
height = lowestChair.getZ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,10 +25,6 @@ public class FriendRequestEvent extends MessageHandler {
|
|||||||
String username = this.packet.readString();
|
String username = this.packet.readString();
|
||||||
Habbo habbo = Emulator.getGameServer().getGameClientManager().getHabbo(username);
|
Habbo habbo = Emulator.getGameServer().getGameClientManager().getHabbo(username);
|
||||||
|
|
||||||
if (habbo.getHabboInfo().getId() == this.client.getHabbo().getHabboInfo().getId()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Emulator.getPluginManager().fireEvent(new UserRequestFriendshipEvent(this.client.getHabbo(), username, habbo)).isCancelled()) {
|
if (Emulator.getPluginManager().fireEvent(new UserRequestFriendshipEvent(this.client.getHabbo(), username, habbo)).isCancelled()) {
|
||||||
this.client.sendResponse(new FriendRequestErrorComposer(2));
|
this.client.sendResponse(new FriendRequestErrorComposer(2));
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user