mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-30 09:50:51 +01:00
Merge this if statement with the enclosing one.
This commit is contained in:
parent
73c5aa78b3
commit
572961c2fa
@ -14,12 +14,11 @@ public class SoftKickCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handle(GameClient gameClient, String[] params) throws Exception {
|
public boolean handle(GameClient gameClient, String[] params) throws Exception {
|
||||||
if (params.length == 2) {
|
if (params.length != 2) return true;
|
||||||
final String username = params[1];
|
final Habbo habbo = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbo(params[1]);
|
||||||
final Habbo habbo = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbo(username);
|
|
||||||
|
|
||||||
if (habbo == null) {
|
if (habbo == null) {
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.keys.cmd_softkick_error").replace("%user%", username), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.keys.cmd_softkick_error").replace("%user%", params[1]), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -30,12 +29,9 @@ public class SoftKickCommand extends Command {
|
|||||||
|
|
||||||
final Room room = gameClient.getHabbo().getHabboInfo().getCurrentRoom();
|
final Room room = gameClient.getHabbo().getHabboInfo().getCurrentRoom();
|
||||||
|
|
||||||
if (room != null) {
|
if (room != null && (!(habbo.hasPermission(Permission.ACC_UNKICKABLE) || habbo.hasPermission(Permission.ACC_SUPPORTTOOL) || room.isOwner(habbo)))) {
|
||||||
if (!(habbo.hasPermission(Permission.ACC_UNKICKABLE) || habbo.hasPermission(Permission.ACC_SUPPORTTOOL) || room.isOwner(habbo))) {
|
|
||||||
room.kickHabbo(habbo, false);
|
room.kickHabbo(habbo, false);
|
||||||
}
|
}
|
||||||
}
|
return true;
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user