Arcturus-Community/src/main/java/com/eu/habbo/habbohotel/commands/PluginsCommand.java

33 lines
1.2 KiB
Java
Raw Normal View History

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