mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2025-02-17 03:02:35 +01:00
Command Cancel Event
This commit is contained in:
parent
d1f18a2154
commit
d867160e08
@ -74,7 +74,12 @@ public class CommandHandler {
|
||||
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().guildRightLevel(gameClient.getHabbo()) >= 2))) {
|
||||
try {
|
||||
Emulator.getPluginManager().fireEvent(new UserExecuteCommandEvent(gameClient.getHabbo(), command, parts));
|
||||
UserExecuteCommandEvent userExecuteCommandEvent = new UserExecuteCommandEvent(gameClient.getHabbo(), command, parts);
|
||||
Emulator.getPluginManager().fireEvent(userExecuteCommandEvent);
|
||||
|
||||
if(userExecuteCommandEvent.isCancelled()) {
|
||||
return userExecuteCommandEvent.isSuccess();
|
||||
}
|
||||
|
||||
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null)
|
||||
gameClient.getHabbo().getHabboInfo().getCurrentRoom().sendComposer(new RoomUserTypingComposer(gameClient.getHabbo().getRoomUnit(), false).compose());
|
||||
|
@ -6,15 +6,22 @@ import com.eu.habbo.habbohotel.users.Habbo;
|
||||
public class UserExecuteCommandEvent extends UserEvent {
|
||||
|
||||
public final Command command;
|
||||
|
||||
|
||||
public final String[] params;
|
||||
|
||||
private boolean success;
|
||||
|
||||
public UserExecuteCommandEvent(Habbo habbo, Command command, String[] params) {
|
||||
super(habbo);
|
||||
|
||||
this.command = command;
|
||||
this.params = params;
|
||||
this.success = true;
|
||||
}
|
||||
|
||||
public void setSuccess(boolean success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public boolean isSuccess() {
|
||||
return success;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user