diff --git a/src/main/java/us/tastybento/bskyblock/commands/IslandCommand.java b/src/main/java/us/tastybento/bskyblock/commands/IslandCommand.java index fb1890f54..881afefc0 100755 --- a/src/main/java/us/tastybento/bskyblock/commands/IslandCommand.java +++ b/src/main/java/us/tastybento/bskyblock/commands/IslandCommand.java @@ -29,6 +29,7 @@ import us.tastybento.bskyblock.api.events.team.TeamEvent.TeamReason; import us.tastybento.bskyblock.config.Settings; import us.tastybento.bskyblock.database.managers.island.NewIsland; import us.tastybento.bskyblock.database.objects.Island; +import us.tastybento.bskyblock.panels.LanguagePanel; import us.tastybento.bskyblock.schematics.Schematic; import us.tastybento.bskyblock.util.Util; import us.tastybento.bskyblock.util.VaultHelper; @@ -1490,12 +1491,12 @@ public class IslandCommand extends AbstractCommand { @Override public CanUseResp canUse(CommandSender sender) { - return new CanUseResp(false); + return new CanUseResp(true); } @Override public void execute(CommandSender sender, String[] args) { - + LanguagePanel.openPanel((Player) sender); } @Override diff --git a/src/main/java/us/tastybento/bskyblock/panels/LanguagePanel.java b/src/main/java/us/tastybento/bskyblock/panels/LanguagePanel.java new file mode 100644 index 000000000..fb4b24903 --- /dev/null +++ b/src/main/java/us/tastybento/bskyblock/panels/LanguagePanel.java @@ -0,0 +1,46 @@ +package us.tastybento.bskyblock.panels; + +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; +import us.tastybento.bskyblock.BSkyBlock; +import us.tastybento.bskyblock.api.panels.ClickType; +import us.tastybento.bskyblock.api.panels.Panel; +import us.tastybento.bskyblock.api.panels.PanelItem; +import us.tastybento.bskyblock.api.panels.builders.PanelBuilder; +import us.tastybento.bskyblock.api.panels.builders.PanelItemBuilder; + +public class LanguagePanel { + + public static void openPanel(Player player) { + PanelBuilder panelBuilder = new PanelBuilder() + .setName(BSkyBlock.getPlugin().getLocale(player).get("panel.languages")); + + PanelItem test = new PanelItemBuilder() + .setIcon(new ItemStack(Material.BEDROCK)) + .setName(BSkyBlock.getPlugin().getLocale(player).get("panel.languages.test.name")) + .setDescription(BSkyBlock.getPlugin().getLocale(player).get("panel.languages.test.description")) + .setGlow(true) + .setClickHandler(new PanelItem.ClickHandler() { + @Override + public boolean onClick(Player player, ClickType click) { + player.sendMessage("Hi!"); + return false; + } + }) + .build(); + + PanelItem something = new PanelItemBuilder() + .setIcon(new ItemStack(Material.ANVIL)) + .setName(BSkyBlock.getPlugin().getLocale(player).get("panel.languages.something.name")) + .setDescription(BSkyBlock.getPlugin().getLocale(player).get("panel.languages.something.description")) + .build(); + + panelBuilder.addItem(1, test); + panelBuilder.addItem(3, something); + + Panel panel = panelBuilder.build(); + + panel.open(player); + } +}