🆙 Cleanup 2

This commit is contained in:
duckietm 2025-02-04 11:26:31 +01:00
parent 9060541fab
commit c116cbae22
8 changed files with 11 additions and 9 deletions

View File

@ -39,7 +39,7 @@ public class BanCommand extends Command {
return true;
}
if (params[1].toLowerCase().equals(gameClient.getHabbo().getHabboInfo().getUsername().toLowerCase())) {
if (params[1].equalsIgnoreCase(gameClient.getHabbo().getHabboInfo().getUsername())) {
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_ban.ban_self"), RoomChatMessageBubbles.ALERT);
return true;
}

View File

@ -39,7 +39,7 @@ public class CommandHandler {
public CommandHandler() {
long millis = System.currentTimeMillis();
this.reloadCommands();
LOGGER.info("Command Handler -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)");
LOGGER.info("Command Handler -> Loaded! ({} MS)", System.currentTimeMillis() - millis);
}
public static void addCommand(Command command) {
@ -71,7 +71,7 @@ public class CommandHandler {
if (parts.length >= 1) {
for (Command command : commands.values()) {
for (String s : command.keys) {
if (s.toLowerCase().equals(parts[0].toLowerCase())) {
if (s.equalsIgnoreCase(parts[0])) {
boolean succes = false;
if (command.permission == null || gameClient.getHabbo().hasPermission(command.permission, gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null && (gameClient.getHabbo().getHabboInfo().getCurrentRoom().hasRights(gameClient.getHabbo())) || gameClient.getHabbo().hasPermission(Permission.ACC_PLACEFURNI) || (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null && gameClient.getHabbo().getHabboInfo().getCurrentRoom().getGuildId() > 0 && gameClient.getHabbo().getHabboInfo().getCurrentRoom().getGuildRightLevel(gameClient.getHabbo()).isEqualOrGreaterThan(RoomRightLevels.GUILD_RIGHTS)))) {
try {

View File

@ -30,7 +30,7 @@ public class CoordsCommand extends Command {
"Tile stack height: " + gameClient.getHabbo().getHabboInfo().getCurrentRoom().getLayout().getTile(gameClient.getHabbo().getRoomUnit().getX(), gameClient.getHabbo().getRoomUnit().getY()).getStackHeight());
} else {
RoomTile tile = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getLayout().getTile(Short.valueOf(params[1]), Short.valueOf(params[2]));
RoomTile tile = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getLayout().getTile(Short.parseShort(params[1]), Short.parseShort(params[2]));
if (tile != null) {
gameClient.getHabbo().alert(Emulator.getTexts().getValue("commands.generic.cmd_coords.title") + "\r\n" +

View File

@ -17,7 +17,7 @@ public class DisconnectCommand extends Command {
return true;
}
if (params[1].toLowerCase().equals(gameClient.getHabbo().getHabboInfo().getUsername().toLowerCase())) {
if (params[1].equalsIgnoreCase(gameClient.getHabbo().getHabboInfo().getUsername())) {
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_disconnect.disconnect_self"), RoomChatMessageBubbles.ALERT);
return true;
}

View File

@ -770,7 +770,7 @@ public class ItemManager {
for (int i = this.items.size(); i-- > 0; ) {
try {
item.advance();
if (item.value().getName().toLowerCase().equals(itemName.toLowerCase())) {
if (item.value().getName().equalsIgnoreCase(itemName)) {
return item.value();
}
} catch (NoSuchElementException e) {
@ -781,6 +781,7 @@ public class ItemManager {
return null;
}
public YoutubeManager getYoutubeManager() {
return this.youtubeManager;
}

View File

@ -1126,7 +1126,7 @@ public class RoomManager {
for (Room room : this.activeRooms.values()) {
for (String s : room.getTags().split(";")) {
if (s.toLowerCase().equals(tag.toLowerCase())) {
if (s.equalsIgnoreCase(tag)) {
rooms.add(room);
break;
}
@ -1138,6 +1138,7 @@ public class RoomManager {
return rooms;
}
public ArrayList<Room> getGroupRoomsWithName(String name) {
ArrayList<Room> rooms = new ArrayList<>();

View File

@ -107,7 +107,7 @@ public abstract class HabboItem implements Runnable, IEventTriggers {
serverMessage.appendInt(this.getRotation());
serverMessage.appendString(Double.toString(this.z));
serverMessage.appendString((this.getBaseItem().getInteractionType().getType() == InteractionTrophy.class || this.getBaseItem().getInteractionType().getType() == InteractionCrackable.class || this.getBaseItem().getName().toLowerCase().equals("gnome_box")) ? "1.0" : ((this.getBaseItem().allowWalk() || this.getBaseItem().allowSit() && this.roomId != 0) ? Item.getCurrentHeight(this) + "" : ""));
serverMessage.appendString((this.getBaseItem().getInteractionType().getType() == InteractionTrophy.class || this.getBaseItem().getInteractionType().getType() == InteractionCrackable.class || this.getBaseItem().getName().equalsIgnoreCase("gnome_box")) ? "1.0" : ((this.getBaseItem().allowWalk() || this.getBaseItem().allowSit() && this.roomId != 0) ? Item.getCurrentHeight(this) + "" : ""));
//serverMessage.appendString( ? "1.0" : ((this.getBaseItem().allowWalk() || this.getBaseItem().allowSit() && this.roomId != 0) ? Item.getCurrentHeight(this) : ""));
} catch (Exception e) {

View File

@ -42,7 +42,7 @@ public class GuildChangeBadgeEvent extends MessageHandler {
base += 3;
}
if (guild.getBadge().toLowerCase().equals(badge.toLowerCase()))
if (guild.getBadge().equalsIgnoreCase(badge))
return;
GuildChangedBadgeEvent badgeEvent = new GuildChangedBadgeEvent(guild, badge);