Added LanguagePanel for testing purposes

This commit is contained in:
Florian CUNY 2017-11-29 16:54:56 +01:00
parent dd40faa3b6
commit 0651d7c941
2 changed files with 49 additions and 2 deletions

View File

@ -29,6 +29,7 @@ import us.tastybento.bskyblock.api.events.team.TeamEvent.TeamReason;
import us.tastybento.bskyblock.config.Settings; import us.tastybento.bskyblock.config.Settings;
import us.tastybento.bskyblock.database.managers.island.NewIsland; import us.tastybento.bskyblock.database.managers.island.NewIsland;
import us.tastybento.bskyblock.database.objects.Island; import us.tastybento.bskyblock.database.objects.Island;
import us.tastybento.bskyblock.panels.LanguagePanel;
import us.tastybento.bskyblock.schematics.Schematic; import us.tastybento.bskyblock.schematics.Schematic;
import us.tastybento.bskyblock.util.Util; import us.tastybento.bskyblock.util.Util;
import us.tastybento.bskyblock.util.VaultHelper; import us.tastybento.bskyblock.util.VaultHelper;
@ -1490,12 +1491,12 @@ public class IslandCommand extends AbstractCommand {
@Override @Override
public CanUseResp canUse(CommandSender sender) { public CanUseResp canUse(CommandSender sender) {
return new CanUseResp(false); return new CanUseResp(true);
} }
@Override @Override
public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) {
LanguagePanel.openPanel((Player) sender);
} }
@Override @Override

View File

@ -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);
}
}