2018-07-06 13:30:00 +00:00
|
|
|
package com.eu.habbo.habbohotel.commands;
|
|
|
|
|
|
|
|
import com.eu.habbo.Emulator;
|
|
|
|
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
2019-05-14 20:14:15 +01:00
|
|
|
import com.eu.habbo.messages.outgoing.generic.alerts.MessagesForYouComposer;
|
2018-07-06 13:30:00 +00:00
|
|
|
import com.eu.habbo.plugin.HabboPlugin;
|
|
|
|
|
2019-05-14 20:14:15 +01:00
|
|
|
import java.util.Collections;
|
|
|
|
|
2019-05-26 21:14:53 +03:00
|
|
|
public class PluginsCommand extends Command {
|
|
|
|
public PluginsCommand() {
|
2020-03-13 19:07:34 +00:00
|
|
|
super(null, Emulator.getTexts().getValue("commands.keys.cmd_plugins").split(";"));
|
2018-07-06 13:30:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2019-05-26 21:14:53 +03:00
|
|
|
public boolean handle(GameClient gameClient, String[] params) throws Exception {
|
2019-03-18 01:22:00 +00:00
|
|
|
StringBuilder message = new StringBuilder("Plugins (" + Emulator.getPluginManager().getPlugins().size() + ")\r");
|
2018-07-06 13:30:00 +00:00
|
|
|
|
2019-05-26 21:14:53 +03:00
|
|
|
for (HabboPlugin plugin : Emulator.getPluginManager().getPlugins()) {
|
2019-03-18 01:22:00 +00:00
|
|
|
message.append("\r").append(plugin.configuration.name).append(" By ").append(plugin.configuration.author);
|
2018-07-06 13:30:00 +00:00
|
|
|
}
|
|
|
|
|
2019-05-14 20:14:15 +01:00
|
|
|
|
2019-05-26 21:14:53 +03:00
|
|
|
if (Emulator.getConfig().getBoolean("commands.plugins.oldstyle")) {
|
2019-05-14 20:14:15 +01:00
|
|
|
gameClient.sendResponse(new MessagesForYouComposer(Collections.singletonList(message.toString())));
|
2019-05-26 21:14:53 +03:00
|
|
|
} else {
|
2019-05-14 20:14:15 +01:00
|
|
|
gameClient.getHabbo().alert(message.toString());
|
|
|
|
}
|
2018-07-06 13:30:00 +00:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|