Feature/remove redundant exceptions

This commit is contained in:
Dominic Bridge 2023-01-10 14:36:39 +00:00 committed by John
parent 9ee1997c50
commit c3e00b927d
614 changed files with 1000 additions and 972 deletions

View File

@ -12,8 +12,8 @@ import com.eu.habbo.plugin.events.users.UserSavedMottoEvent;
public class Easter {
@EventHandler
public static void onUserChangeMotto(UserSavedMottoEvent event) {
if (Emulator.getConfig().getBoolean("easter_eggs.enabled") && event.newMotto.equalsIgnoreCase("crickey!")) {
event.habbo.getClient().sendResponse(new WhisperMessageComposer(new RoomChatMessage(event.newMotto, event.habbo, event.habbo, RoomChatMessageBubbles.ALERT)));
if (Emulator.getConfig().getBoolean("easter_eggs.enabled") && event.getNewMotto().equalsIgnoreCase("crickey!")) {
event.habbo.getClient().sendResponse(new WhisperMessageComposer(new RoomChatMessage(event.getNewMotto(), event.habbo, event.habbo, RoomChatMessageBubbles.ALERT)));
Room room = event.habbo.getHabboInfo().getCurrentRoom();

View File

@ -24,7 +24,7 @@ public class TextsManager {
}
}
public void reload() throws Exception {
public void reload() {
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); Statement statement = connection.createStatement(); ResultSet set = statement.executeQuery("SELECT * FROM emulator_texts")) {
while (set.next()) {
if (this.texts.containsKey(set.getString("key"))) {

View File

@ -14,7 +14,7 @@ public class ConsoleInfoCommand extends ConsoleCommand {
}
@Override
public void handle(String[] args) throws Exception {
public void handle(String[] args) {
int seconds = Emulator.getIntUnixTimestamp() - Emulator.getTimeStarted();
int day = (int) TimeUnit.SECONDS.toDays(seconds);
long hours = TimeUnit.SECONDS.toHours(seconds) - (day * 24);

View File

@ -11,7 +11,7 @@ public class ConsoleReconnectCameraCommand extends ConsoleCommand {
}
@Override
public void handle(String[] args) throws Exception {
public void handle(String[] args) {
log.info("Connecting to the camera...");
CameraClient.attemptReconnect = true;
}

View File

@ -13,7 +13,7 @@ public class ConsoleTestCommand extends ConsoleCommand {
}
@Override
public void handle(String[] args) throws Exception {
public void handle(String[] args) {
if (Emulator.debugging) {
log.info("This is a test command for live debugging.");

View File

@ -11,7 +11,7 @@ public class ShowInteractionsCommand extends ConsoleCommand {
}
@Override
public void handle(String[] args) throws Exception {
public void handle(String[] args) {
for (String interaction : Emulator.getGameEnvironment().getItemManager().getInteractionList()) {
log.info(interaction);
}

View File

@ -11,7 +11,7 @@ public class ShowRCONCommands extends ConsoleCommand {
}
@Override
public void handle(String[] args) throws Exception {
public void handle(String[] args) {
for (String command : Emulator.getRconServer().getCommands()) {
log.info(command);
}

View File

@ -11,7 +11,7 @@ public class ThankyouArcturusCommand extends ConsoleCommand {
}
@Override
public void handle(String[] args) throws Exception {
public void handle(String[] args) {
log.info("Arcturus Morningstar is an opensource community fork of Arcturus Emulator by TheGeneral");
log.info("Thankyou to the following people who have helped with it's development:");
log.info("TheGeneral - For Creating Arcturus.");

View File

@ -215,7 +215,7 @@ public class Bot implements Runnable {
return;
this.chatTimestamp = Emulator.getIntUnixTimestamp();
this.room.botChat(new ChatMessageComposer(new RoomChatMessage(event.message, this.roomUnit, RoomChatMessageBubbles.getBubble(this.getBubbleId()))).compose());
this.room.botChat(new ChatMessageComposer(new RoomChatMessage(event.getMessage(), this.roomUnit, RoomChatMessageBubbles.getBubble(this.getBubbleId()))).compose());
if (message.equals("o/") || message.equals("_o/")) {
this.room.sendComposer(new ExpressionMessageComposer(this.roomUnit, RoomUserAction.WAVE).compose());
@ -230,7 +230,7 @@ public class Bot implements Runnable {
return;
this.chatTimestamp = Emulator.getIntUnixTimestamp();
this.room.botChat(new ShoutMessageComposer(new RoomChatMessage(event.message, this.roomUnit, RoomChatMessageBubbles.getBubble(this.getBubbleId()))).compose());
this.room.botChat(new ShoutMessageComposer(new RoomChatMessage(event.getMessage(), this.roomUnit, RoomChatMessageBubbles.getBubble(this.getBubbleId()))).compose());
if (message.equals("o/") || message.equals("_o/")) {
this.room.sendComposer(new ExpressionMessageComposer(this.roomUnit, RoomUserAction.WAVE).compose());
@ -245,7 +245,7 @@ public class Bot implements Runnable {
return;
this.chatTimestamp = Emulator.getIntUnixTimestamp();
event.target.getClient().sendResponse(new WhisperMessageComposer(new RoomChatMessage(event.message, this.roomUnit, RoomChatMessageBubbles.getBubble(this.getBubbleId()))));
event.getTarget().getClient().sendResponse(new WhisperMessageComposer(new RoomChatMessage(event.getMessage(), this.roomUnit, RoomChatMessageBubbles.getBubble(this.getBubbleId()))));
}
}

View File

@ -85,19 +85,19 @@ public class ButlerBot extends Bot {
final Bot bot = this;
// Step 1: Look at Habbo
bot.lookAt(serveEvent.habbo);
bot.lookAt(serveEvent.getHabbo());
// Step 2: Prepare tasks for when the Bot (carrying the handitem) reaches the Habbo
final List<Runnable> tasks = new ArrayList<>();
tasks.add(new RoomUnitGiveHanditem(serveEvent.habbo.getRoomUnit(), serveEvent.habbo.getHabboInfo().getCurrentRoom(), serveEvent.itemId));
tasks.add(new RoomUnitGiveHanditem(this.getRoomUnit(), serveEvent.habbo.getHabboInfo().getCurrentRoom(), 0));
tasks.add(new RoomUnitGiveHanditem(serveEvent.getHabbo().getRoomUnit(), serveEvent.getHabbo().getHabboInfo().getCurrentRoom(), serveEvent.getItemId()));
tasks.add(new RoomUnitGiveHanditem(this.getRoomUnit(), serveEvent.getHabbo().getHabboInfo().getCurrentRoom(), 0));
tasks.add(() -> {
if (this.getRoom() != null) {
String botMessage = Emulator.getTexts()
.getValue("bots.butler.given")
.replace("%key%", key)
.replace("%username%", serveEvent.habbo.getHabboInfo().getUsername());
.replace("%username%", serveEvent.getHabbo().getHabboInfo().getUsername());
if (!WiredHandler.handle(WiredTriggerType.SAY_SOMETHING, this.getRoomUnit(), this.getRoom(), new Object[]{botMessage})) {
bot.talk(botMessage);
@ -115,18 +115,18 @@ public class ButlerBot extends Bot {
});
// Give bot the handitem that it's going to give the Habbo
Emulator.getThreading().run(new RoomUnitGiveHanditem(this.getRoomUnit(), serveEvent.habbo.getHabboInfo().getCurrentRoom(), serveEvent.itemId));
Emulator.getThreading().run(new RoomUnitGiveHanditem(this.getRoomUnit(), serveEvent.getHabbo().getHabboInfo().getCurrentRoom(), serveEvent.getItemId()));
if (distanceBetweenBotAndHabbo > Emulator.getConfig().getInt("hotel.bot.butler.reachdistance", 3)) {
Emulator.getThreading().run(new RoomUnitWalkToRoomUnit(this.getRoomUnit(), serveEvent.habbo.getRoomUnit(), serveEvent.habbo.getHabboInfo().getCurrentRoom(), tasks, failedReached, Emulator.getConfig().getInt("hotel.bot.butler.reachdistance", 3)));
Emulator.getThreading().run(new RoomUnitWalkToRoomUnit(this.getRoomUnit(), serveEvent.getHabbo().getRoomUnit(), serveEvent.getHabbo().getHabboInfo().getCurrentRoom(), tasks, failedReached, Emulator.getConfig().getInt("hotel.bot.butler.reachdistance", 3)));
} else {
Emulator.getThreading().run(failedReached.get(0), 1000);
}
} else {
if (this.getRoom() != null) {
this.getRoom().giveHandItem(serveEvent.habbo, serveEvent.itemId);
this.getRoom().giveHandItem(serveEvent.getHabbo(), serveEvent.getItemId());
String msg = Emulator.getTexts().getValue("bots.butler.given").replace("%key%", keyword).replace("%username%", serveEvent.habbo.getHabboInfo().getUsername());
String msg = Emulator.getTexts().getValue("bots.butler.given").replace("%key%", keyword).replace("%username%", serveEvent.getHabbo().getHabboInfo().getUsername());
if (!WiredHandler.handle(WiredTriggerType.SAY_SOMETHING, this.getRoomUnit(), this.getRoom(), new Object[]{msg})) {
this.talk(msg);
}

View File

@ -1054,16 +1054,16 @@ public class CatalogManager {
Emulator.getPluginManager().fireEvent(purchasedEvent);
if (!free && !habbo.getClient().getHabbo().hasPermission(Permission.ACC_INFINITE_CREDITS)) {
if (purchasedEvent.totalCredits > 0) {
habbo.getClient().getHabbo().getHabboInfo().addCredits(-purchasedEvent.totalCredits);
if (purchasedEvent.getTotalCredits() > 0) {
habbo.getClient().getHabbo().getHabboInfo().addCredits(-purchasedEvent.getTotalCredits());
habbo.getClient().sendResponse(new CreditBalanceComposer(habbo.getClient().getHabbo()));
}
}
if (!free && !habbo.getClient().getHabbo().hasPermission(Permission.ACC_INFINITE_POINTS)) {
if (purchasedEvent.totalPoints > 0) {
habbo.getClient().getHabbo().getHabboInfo().addCurrencyAmount(item.getPointsType(), -purchasedEvent.totalPoints);
habbo.getClient().sendResponse(new HabboActivityPointNotificationMessageComposer(habbo.getClient().getHabbo().getHabboInfo().getCurrencyAmount(item.getPointsType()), -purchasedEvent.totalPoints, item.getPointsType()));
if (purchasedEvent.getTotalPoints() > 0) {
habbo.getClient().getHabbo().getHabboInfo().addCurrencyAmount(item.getPointsType(), -purchasedEvent.getTotalPoints());
habbo.getClient().sendResponse(new HabboActivityPointNotificationMessageComposer(habbo.getClient().getHabbo().getHabboInfo().getCurrencyAmount(item.getPointsType()), -purchasedEvent.getTotalPoints(), item.getPointsType()));
}
}
@ -1080,11 +1080,11 @@ public class CatalogManager {
}
}
if (!purchasedEvent.badges.isEmpty() && !unseenItems.containsKey(UnseenItemsComposer.AddHabboItemCategory.BADGE)) {
if (!purchasedEvent.getBadges().isEmpty() && !unseenItems.containsKey(UnseenItemsComposer.AddHabboItemCategory.BADGE)) {
unseenItems.put(UnseenItemsComposer.AddHabboItemCategory.BADGE, new ArrayList<>());
}
for (String b : purchasedEvent.badges) {
for (String b : purchasedEvent.getBadges()) {
HabboBadge badge = new HabboBadge(0, b, 0, habbo);
Emulator.getThreading().run(badge);
habbo.getInventory().getBadgesComponent().addBadge(badge);
@ -1096,11 +1096,11 @@ public class CatalogManager {
habbo.getClient().sendResponse(new NotificationDialogMessageComposer(BubbleAlertKeys.RECEIVED_BADGE.getKey(), keys));
unseenItems.get(UnseenItemsComposer.AddHabboItemCategory.BADGE).add(badge.getId());
}
habbo.getClient().getHabbo().getHabboStats().addPurchase(purchasedEvent.catalogItem);
habbo.getClient().getHabbo().getHabboStats().addPurchase(purchasedEvent.getCatalogItem());
habbo.getClient().sendResponse(new UnseenItemsComposer(unseenItems));
habbo.getClient().sendResponse(new PurchaseOKMessageComposer(purchasedEvent.catalogItem));
habbo.getClient().sendResponse(new PurchaseOKMessageComposer(purchasedEvent.getCatalogItem()));
habbo.getClient().sendResponse(new FurniListInvalidateComposer());
THashSet<String> itemIds = new THashSet<>();
@ -1113,11 +1113,11 @@ public class CatalogManager {
Emulator.getThreading().run(new CatalogPurchaseLogEntry(
Emulator.getIntUnixTimestamp(),
purchasedEvent.habbo.getHabboInfo().getId(),
purchasedEvent.catalogItem != null ? purchasedEvent.catalogItem.getId() : 0,
purchasedEvent.getCatalogItem() != null ? purchasedEvent.getCatalogItem().getId() : 0,
String.join(";", itemIds),
purchasedEvent.catalogItem != null ? purchasedEvent.catalogItem.getName() : "",
purchasedEvent.totalCredits,
purchasedEvent.totalPoints,
purchasedEvent.getCatalogItem() != null ? purchasedEvent.getCatalogItem().getName() : "",
purchasedEvent.getTotalCredits(),
purchasedEvent.getTotalPoints(),
item.getPointsType(),
amount
));

View File

@ -346,14 +346,14 @@ public class MarketPlace {
GetMarketplaceOffersEvent.cachedResults.clear();
client.sendResponse(new FurniListRemoveComposer(event.item.getGiftAdjustedId()));
client.sendResponse(new FurniListRemoveComposer(event.getItem().getGiftAdjustedId()));
client.sendResponse(new FurniListInvalidateComposer());
event.item.setFromGift(false);
event.getItem().setFromGift(false);
MarketPlaceOffer offer = new MarketPlaceOffer(event.item, event.price, client.getHabbo());
MarketPlaceOffer offer = new MarketPlaceOffer(event.getItem(), event.getPrice(), client.getHabbo());
client.getHabbo().getInventory().addMarketplaceOffer(offer);
client.getHabbo().getInventory().getItemsComponent().removeHabboItem(event.item);
client.getHabbo().getInventory().getItemsComponent().removeHabboItem(event.getItem());
item.setUserId(-1);
item.needsUpdate(true);
Emulator.getThreading().run(item);

View File

@ -13,7 +13,7 @@ public class AboutCommand extends Command {
public AboutCommand() {
super(null, new String[]{"about", "info", "online", "server"});
}
public static String credits = "Arcturus Morningstar is an opensource project based on Arcturus By TheGeneral \n" +
public static final String credits = "Arcturus Morningstar is an opensource project based on Arcturus By TheGeneral \n" +
"The Following people have all contributed to this emulator:\n" +
" TheGeneral\n Beny\n Alejandro\n Capheus\n Skeletor\n Harmonic\n Mike\n Remco\n zGrav \n Quadral \n Harmony\n Swirny\n ArpyAge\n Mikkel\n Rodolfo\n Rasmus\n Kitt Mustang\n Snaiker\n nttzx\n necmi\n Dome\n Jose Flores\n Cam\n Oliver\n Narzo\n Tenshie\n MartenM\n Ridge\n SenpaiDipper\n Snaiker\n Thijmen";
@Override

View File

@ -9,7 +9,7 @@ public class ArcturusCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null) {
gameClient.getHabbo().whisper("This hotel is powered by Arcturus Emulator! \r" +
"Cet hôtel est alimenté par Arcturus émulateur! \r" +

View File

@ -21,7 +21,7 @@ public class BadgeCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (params.length == 1) {
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_badge.forgot_username"), RoomChatMessageBubbles.ALERT);
return true;

View File

@ -15,7 +15,7 @@ public class BanCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (params.length < 2) {
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_ban.forgot_user"), RoomChatMessageBubbles.ALERT);
return true;

View File

@ -10,7 +10,7 @@ public class BlockAlertCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null) {
gameClient.getHabbo().getHabboStats().setBlockStaffAlerts(!gameClient.getHabbo().getHabboStats().isBlockStaffAlerts());
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_blockalert").replace("%state%", (gameClient.getHabbo().getHabboStats().isBlockStaffAlerts() ? Emulator.getTexts().getValue("generic.on") : Emulator.getTexts().getValue("generic.off"))), RoomChatMessageBubbles.ALERT);

View File

@ -10,7 +10,7 @@ public class BotsCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() == null || !gameClient.getHabbo().getHabboInfo().getCurrentRoom().hasRights(gameClient.getHabbo()))
return false;

View File

@ -17,7 +17,7 @@ public class CalendarCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (Emulator.getConfig().getBoolean("hotel.calendar.enabled")) {
String campaignName = Emulator.getConfig().getValue("hotel.calendar.default");

View File

@ -11,7 +11,7 @@ public class ChangeNameCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
// check if there are no params
if (params.length < 2) {

View File

@ -12,7 +12,7 @@ public class ChatTypeCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (params.length >= 2) {
int chatColor;

View File

@ -11,7 +11,7 @@ public class CommandsCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
StringBuilder message = new StringBuilder(Emulator.getTexts().getValue("commands.generic.cmd_commands.text"));
List<Command> commands = Emulator.getGameEnvironment().getCommandHandler().getCommandsForRank(gameClient.getHabbo().getHabboInfo().getRank().getId());
message.append("(").append(commands.size()).append("):\r\n");

View File

@ -9,7 +9,7 @@ public class ConnectCameraCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
return false;
}
}

View File

@ -11,7 +11,7 @@ public class ControlCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null) {
if (params.length == 2) {
Habbo target = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbo(params[1]);

View File

@ -12,7 +12,7 @@ public class CoordsCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (gameClient.getHabbo().getRoomUnit() == null || gameClient.getHabbo().getHabboInfo().getCurrentRoom() == null)
return false;

View File

@ -13,7 +13,7 @@ public class CreditsCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (params.length == 3) {
HabboInfo info = HabboManager.getOfflineHabboInfo(params[1]);

View File

@ -10,7 +10,7 @@ public class DiagonalCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null) {
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom().hasRights(gameClient.getHabbo())) {
gameClient.getHabbo().getHabboInfo().getCurrentRoom().moveDiagonally(!gameClient.getHabbo().getHabboInfo().getCurrentRoom().moveDiagonally());

View File

@ -11,7 +11,7 @@ public class DisconnectCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (params.length < 2) {
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_disconnect.forgot_username"), RoomChatMessageBubbles.ALERT);
return true;

View File

@ -11,7 +11,7 @@ public class EjectAllCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
Room room = gameClient.getHabbo().getHabboInfo().getCurrentRoom();
if (room != null) {

View File

@ -16,7 +16,7 @@ public class EmptyBotsInventoryCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (params.length == 1 || (params.length >= 2 && !params[1].equals(Emulator.getTexts().getValue("generic.yes")))) {
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null) {
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom().getUserCount() > 10) {

View File

@ -18,7 +18,7 @@ public class EmptyInventoryCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (params.length == 1 || (params.length == 2 && !params[1].equals(Emulator.getTexts().getValue("generic.yes")))) {
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null) {
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom().getUserCount() > 10) {

View File

@ -16,7 +16,7 @@ public class EmptyPetsInventoryCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (params.length == 1 || (params.length >= 2 && !params[1].equals(Emulator.getTexts().getValue("generic.yes")))) {
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null) {
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom().getUserCount() > 10) {

View File

@ -14,7 +14,7 @@ public class EnableCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (params.length >= 2) {
int effectId;
try {

View File

@ -15,7 +15,7 @@ public class EventCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null) {
if (params.length >= 2) {
StringBuilder message = new StringBuilder();

View File

@ -12,7 +12,7 @@ public class FacelessCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null) {
try {

View File

@ -10,7 +10,7 @@ public class FastwalkCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null) {
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null) {
if (gameClient.getHabbo().getHabboInfo().getRiding() != null) //TODO Make this an event plugin which fires that can be cancelled

View File

@ -18,7 +18,7 @@ public class FilterWordCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (params.length < 2) {
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_filterword.missing_word"));
return true;

View File

@ -11,7 +11,7 @@ public class FreezeBotsCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null) {
if (gameClient.getHabbo().getHabboInfo().getId() == gameClient.getHabbo().getHabboInfo().getCurrentRoom().getOwnerId() || gameClient.getHabbo().hasPermission(Permission.ACC_ANYROOMOWNER)) {
gameClient.getHabbo().getHabboInfo().getCurrentRoom().setAllowBotsWalk(!gameClient.getHabbo().getHabboInfo().getCurrentRoom().isAllowBotsWalk());

View File

@ -11,7 +11,7 @@ public class FreezeCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (params.length == 2) {
Habbo habbo = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbo(params[1]);

View File

@ -19,7 +19,7 @@ public class GiftCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (params.length >= 3) {
String username = params[1];
int itemId;

View File

@ -8,7 +8,7 @@ public class HabnamCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (gameClient.getHabbo().getHabboStats().hasActiveClub()) {
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null) {
gameClient.getHabbo().getHabboInfo().getCurrentRoom().giveEffect(gameClient.getHabbo(), 140, 30);

View File

@ -10,7 +10,7 @@ public class HandItemCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (params.length == 2) {
try {
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null) {

View File

@ -14,7 +14,7 @@ public class HappyHourCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
Emulator.getGameServer().getGameClientManager().sendBroadcastResponse(new HabboBroadcastMessageComposer("Happy Hour!"));
for (Map.Entry<Integer, Habbo> set : Emulator.getGameEnvironment().getHabboManager().getOnlineHabbos().entrySet()) {

View File

@ -10,7 +10,7 @@ public class HideWiredCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
Room room = gameClient.getHabbo().getHabboInfo().getCurrentRoom();
if (room != null) {

View File

@ -10,7 +10,7 @@ public class HotelAlertLinkCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (params.length < 3) {
return true;
}

View File

@ -16,7 +16,7 @@ public class IPBanCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
HabboInfo habbo;
StringBuilder reason = new StringBuilder();
if (params.length >= 2) {

View File

@ -17,7 +17,7 @@ public class InvisibleCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
RoomUnit roomUnit = gameClient.getHabbo().getRoomUnit();
if (roomUnit.isInvisible()) {

View File

@ -13,7 +13,7 @@ public class LayCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (gameClient.getHabbo().getRoomUnit() == null || !gameClient.getHabbo().getRoomUnit().canForcePosture())
return true;

View File

@ -14,7 +14,7 @@ public class MachineBanCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
HabboInfo habbo = null;
StringBuilder reason = new StringBuilder();
if (params.length >= 2) {

View File

@ -20,7 +20,7 @@ public class MassBadgeCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (params.length == 2) {
String badge;

View File

@ -14,7 +14,7 @@ public class MassCreditsCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (params.length == 2) {
int amount;

View File

@ -20,7 +20,7 @@ public class MassGiftCommand extends Command {
}
@Override
public boolean handle(final GameClient gameClient, String[] params) throws Exception {
public boolean handle(final GameClient gameClient, String[] params) {
if (params.length >= 2) {
int itemId;

View File

@ -13,7 +13,7 @@ public class MassPixelsCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (params.length == 2) {
int amount;

View File

@ -13,7 +13,7 @@ public class MassPointsCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
int type = Emulator.getConfig().getInt("seasonal.primary.type");
String amountString;
if (params.length == 3) {

View File

@ -17,7 +17,7 @@ public class MimicCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (params.length == 2) {
Habbo habbo = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbo(params[1]);

View File

@ -9,7 +9,7 @@ public class MoonwalkCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null && gameClient.getHabbo().getHabboStats().hasActiveClub()) {
int effect = 136;
if (gameClient.getHabbo().getRoomUnit().getEffectId() == 136)

View File

@ -10,7 +10,7 @@ public class MultiCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
gameClient.sendResponse(new RequestSpamWallPostItMessageComposer(null));
return true;
}

View File

@ -10,7 +10,7 @@ public class MuteBotsCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
gameClient.getHabbo().getHabboStats().setIgnoreBots(!gameClient.getHabbo().getHabboStats().isIgnoreBots());
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_mute_bots." + (gameClient.getHabbo().getHabboStats().isIgnoreBots() ? "ignored" : "unignored")), RoomChatMessageBubbles.ALERT);
return true;

View File

@ -12,7 +12,7 @@ public class MuteCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (params.length == 1) {
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_mute.not_specified"), RoomChatMessageBubbles.ALERT);
return true;

View File

@ -10,7 +10,7 @@ public class MutePetsCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
gameClient.getHabbo().getHabboStats().setIgnorePets(!gameClient.getHabbo().getHabboStats().isIgnorePets());
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_mute_pets." + (gameClient.getHabbo().getHabboStats().isIgnorePets() ? "ignored" : "unignored")), RoomChatMessageBubbles.ALERT);
return true;

View File

@ -11,7 +11,7 @@ public class PetInfoCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (params.length > 1) {
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() == null)
return false;

View File

@ -10,7 +10,7 @@ public class PickallCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
Room room = gameClient.getHabbo().getHabboInfo().getCurrentRoom();
if (room != null) {

View File

@ -11,7 +11,7 @@ public class PixelCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (params.length == 3) {
Habbo habbo = Emulator.getGameServer().getGameClientManager().getHabbo(params[1]);

View File

@ -13,7 +13,7 @@ public class PluginsCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
StringBuilder message = new StringBuilder("Plugins (" + Emulator.getPluginManager().getPlugins().size() + ")\r");
for (HabboPlugin plugin : Emulator.getPluginManager().getPlugins()) {

View File

@ -11,7 +11,7 @@ public class PointsCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (params.length >= 3) {
Habbo habbo = Emulator.getGameServer().getGameClientManager().getHabbo(params[1]);

View File

@ -18,7 +18,7 @@ public class PromoteTargetOfferCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (params.length <= 1) {
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_promote_offer.not_found"));
return true;

View File

@ -15,7 +15,7 @@ public class PullCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (params.length != 2) return true;
Habbo habbo = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbo(params[1]);

View File

@ -15,7 +15,7 @@ public class PushCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (params.length != 2) return true;
Habbo habbo = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbo(params[1]);

View File

@ -18,7 +18,7 @@ public class RedeemCommand extends Command {
}
@Override
public boolean handle(final GameClient gameClient, String[] params) throws Exception {
public boolean handle(final GameClient gameClient, String[] params) {
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom().getActiveTradeForHabbo(gameClient.getHabbo()) != null)
return false;
ArrayList<HabboItem> items = new ArrayList<>();

View File

@ -16,7 +16,7 @@ public class ReloadRoomCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
Emulator.getThreading().run(() -> {
Room room = gameClient.getHabbo().getHabboInfo().getCurrentRoom();
if (room != null) {

View File

@ -12,7 +12,7 @@ public class RoomAlertCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
StringBuilder message = new StringBuilder();
if (params.length >= 2) {

View File

@ -18,7 +18,7 @@ public class RoomBadgeCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (gameClient == null)
return true;

View File

@ -19,7 +19,7 @@ public class RoomBundleCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
int parentId;
int credits;
int points;

View File

@ -11,7 +11,7 @@ public class RoomCreditsCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (params.length == 2) {
int amount;

View File

@ -13,7 +13,7 @@ public class RoomDanceCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (params.length == 2) {
int danceId;

View File

@ -12,7 +12,7 @@ public class RoomEffectCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (params.length < 2) {
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_roomeffect.no_effect"), RoomChatMessageBubbles.ALERT);
return true;

View File

@ -15,7 +15,7 @@ public class RoomGiftCommand extends Command {
}
@Override
public boolean handle(final GameClient gameClient, String[] params) throws Exception {
public boolean handle(final GameClient gameClient, String[] params) {
if (params.length >= 2) {
int itemId;

View File

@ -12,7 +12,7 @@ public class RoomItemCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
int itemId = 0;
if (params.length >= 2) {

View File

@ -13,7 +13,7 @@ public class RoomKickCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
final Room room = gameClient.getHabbo().getHabboInfo().getCurrentRoom();
if (room != null) {
if (params.length > 1) {

View File

@ -11,7 +11,7 @@ public class RoomMuteCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
Room room = gameClient.getHabbo().getHabboInfo().getCurrentRoom();
if (room != null) {

View File

@ -11,7 +11,7 @@ public class RoomPixelsCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (params.length == 2) {
int amount;

View File

@ -11,7 +11,7 @@ public class RoomPointsCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
int type = Emulator.getConfig().getInt("seasonal.primary.type");
String amountString;
if (params.length == 3) {

View File

@ -11,7 +11,7 @@ public class SayAllCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (params.length < 2) {
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_say_all.forgot_message"), RoomChatMessageBubbles.ALERT);
return true;

View File

@ -13,7 +13,7 @@ public class SayCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (params.length < 2) {
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_say.forgot_username"), RoomChatMessageBubbles.ALERT);
return true;

View File

@ -10,7 +10,7 @@ public class SetMaxCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (params.length >= 2) {
int max;
try {

View File

@ -10,7 +10,7 @@ public class SetPollCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (params.length >= 2) {
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null) {
int pollId = -1;

View File

@ -11,7 +11,7 @@ public class SetSpeedCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null) {
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom().hasRights(gameClient.getHabbo())) {
Room room = gameClient.getHabbo().getHabboInfo().getCurrentRoom();

View File

@ -11,7 +11,7 @@ public class ShoutAllCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (params.length < 2) {
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_shout_all.forgot_message"), RoomChatMessageBubbles.ALERT);
return true;

View File

@ -14,7 +14,7 @@ public class ShoutCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (params.length < 2) {
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_shout.forgot_username"), RoomChatMessageBubbles.ALERT);
return true;

View File

@ -14,7 +14,7 @@ public class ShutdownCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
StringBuilder reason = new StringBuilder("-");
int minutes = 0;
if (params.length > 2) {

View File

@ -9,7 +9,7 @@ public class SitCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (gameClient.getHabbo().getHabboInfo().getRiding() == null) //TODO Make this an event plugin which fires that can be cancelled
gameClient.getHabbo().getHabboInfo().getCurrentRoom().makeSit(gameClient.getHabbo());
return true;

View File

@ -11,7 +11,7 @@ public class SitDownCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
for (Habbo habbo : gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbos()) {
if (habbo.getRoomUnit().isWalking()) {
habbo.getRoomUnit().stopWalking();

View File

@ -13,7 +13,7 @@ public class SoftKickCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (params.length != 2) return true;
final Habbo habbo = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbo(params[1]);

View File

@ -12,7 +12,7 @@ public class StaffAlertCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (params.length > 1) {
StringBuilder message = new StringBuilder();
for (int i = 1; i < params.length; i++) {

View File

@ -15,7 +15,7 @@ public class StaffOnlineCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
int minRank = Emulator.getConfig().getInt("commands.cmd_staffonline.min_rank");
if (params.length >= 2) {

View File

@ -12,7 +12,7 @@ public class StalkCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() == null)
return true;

View File

@ -10,7 +10,7 @@ public class StandCommand extends Command {
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (gameClient.getHabbo().getHabboInfo().getRiding() == null)
gameClient.getHabbo().getHabboInfo().getCurrentRoom().makeStand(gameClient.getHabbo());
return true;

View File

@ -34,10 +34,9 @@ public class SubscriptionCommand extends Command {
* @param gameClient Client that executed the command
* @param params Command parameters
* @return Boolean indicating success
* @throws Exception Exception
*/
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (params.length >= 4) {
HabboInfo info = HabboManager.getOfflineHabboInfo(params[1]);

View File

@ -13,7 +13,7 @@ public class SummonCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() == null)
return true;

View File

@ -15,7 +15,7 @@ public class SummonRankCommand extends Command {
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
public boolean handle(GameClient gameClient, String[] params) {
int minRank;
if (params.length >= 2) {

Some files were not shown because too many files have changed in this diff Show More