Added /bentobox catalog

This commit is contained in:
Florian CUNY 2019-04-18 14:42:32 +02:00
parent e7cd9d1453
commit 8601cd6a0d
3 changed files with 34 additions and 2 deletions

View File

@ -0,0 +1,31 @@
package world.bentobox.bentobox.commands;
import world.bentobox.bentobox.api.commands.CompositeCommand;
import world.bentobox.bentobox.api.user.User;
import world.bentobox.bentobox.panels.CatalogPanel;
import java.util.List;
/**
* Displays the Addons Catalog.
*
* @since 1.5.0
* @author Poslovitch
*/
public class BentoBoxCatalogCommand extends CompositeCommand {
public BentoBoxCatalogCommand(CompositeCommand parent) {
super(parent, "catalog");
}
@Override
public void setup() {
setOnlyPlayer(true);
}
@Override
public boolean execute(User user, String label, List<String> args) {
CatalogPanel.openPanel(user);
return true;
}
}

View File

@ -20,6 +20,7 @@ public class BentoBoxCommand extends CompositeCommand {
new BentoBoxVersionCommand(this);
new BentoBoxAboutCommand(this);
new BentoBoxManageCommand(this);
new BentoBoxCatalogCommand(this);
new BentoBoxReloadCommand(this);
}

View File

@ -117,7 +117,7 @@ public class ManagementPanel {
.name(user.getTranslation(LOCALE_REF + "buttons.catalog.name"))
.description(user.getTranslation(LOCALE_REF + "buttons.catalog.description"))
.clickHandler((panel, user1, clickType, slot) -> {
user1.sendRawMessage("opening the catalog... (not implemented yet)");
CatalogPanel.openPanel(user);
return true;
})
.build();
@ -230,7 +230,7 @@ public class ManagementPanel {
.name(user.getTranslation(LOCALE_REF + "buttons.empty-here.name"))
.description(user.getTranslation(LOCALE_REF + "buttons.empty-here.description"))
.clickHandler((panel, user1, clickType, slot) -> {
user1.sendRawMessage("opening the catalog... (not implemented yet)");
CatalogPanel.openPanel(user);
return true;
})
.build();