use of com.bencodez.advancedcore.api.inventory.BInventory in project VotingPlugin by Ben12345rocks.
the class AdminVoteVoteShop method onChest.
@Override
public void onChest(Player player) {
BInventory inv = new BInventory("Edit VoteShop");
inv.requirePermission("VotingPlugin.Commands.AdminVote.Edit.VoteShop");
inv.addButton(new BInventoryButton(new ItemBuilder(Material.DIAMOND).setName("&cEdit existing item")) {
@Override
public void onClick(ClickEvent clickEvent) {
new AdminVoteVoteShopItems(plugin, clickEvent.getPlayer()).open(GUIMethod.CHEST);
}
});
inv.addButton(new BInventoryButton(new ItemBuilder(Material.EMERALD_BLOCK).setName("&aAdd voteshop item")) {
@Override
public void onClick(ClickEvent clickEvent) {
new ValueRequest().requestString(player, new StringListener() {
@Override
public void onInput(Player player, String value) {
plugin.getGui().createShop(value);
plugin.reload();
}
});
}
});
inv.addButton(new BInventoryButton(new ItemBuilder(Material.REDSTONE_BLOCK).setName("&cRemove item")) {
@Override
public void onClick(ClickEvent clickEvent) {
new AdminVoteVoteShopItemRemove(plugin, clickEvent.getPlayer()).open();
}
});
inv.openInventory(player);
}
use of com.bencodez.advancedcore.api.inventory.BInventory in project VotingPlugin by Ben12345rocks.
the class AdminVoteVoteShopItemRemove method onChest.
@Override
public void onChest(Player player) {
BInventory inv = new BInventory("Edit VoteShop Remove Item");
inv.requirePermission("VotingPlugin.Commands.AdminVote.Edit.VoteShop");
for (final String identifier : plugin.getGui().getChestShopIdentifiers()) {
inv.addButton(new BInventoryButton(new ItemBuilder(plugin.getGui().getChestShopIdentifierSection(identifier)).addLoreLine("&c&lClick to remove")) {
@Override
public void onClick(ClickEvent clickEvent) {
new AdminVoteConfirmation(plugin, clickEvent.getPlayer(), "Remove shop item " + identifier + "?") {
@Override
public void onConfirm(Player p) {
plugin.getGui().removeShop(identifier);
p.sendMessage("Removed " + identifier);
plugin.reload();
}
@Override
public void onDeny(Player p) {
new AdminVoteVoteShop(plugin, p).open();
}
}.open();
}
}.addData("ident", identifier));
}
inv.openInventory(player);
}
use of com.bencodez.advancedcore.api.inventory.BInventory in project VotingPlugin by Ben12345rocks.
the class VoteNext method onChest.
@Override
public void onChest(Player player) {
BInventory inv = new BInventory(plugin.getGui().getChestVoteNextName());
inv.addPlaceholder("player", user.getPlayerName());
for (VoteSite site : plugin.getVoteSites()) {
if (!site.isHidden()) {
inv.addButton(inv.getNextSlot(), new UpdatingBInventoryButton(site.getItem().setName(site.getDisplayName()).setLore(user.voteCommandNextInfo(site)).setAmountNone(1), 1000, 1000) {
@Override
public void onClick(ClickEvent clickEvent) {
}
@Override
public ItemBuilder onUpdate(Player player) {
return site.getItem().setName(site.getDisplayName()).setLore(user.voteCommandNextInfo(site)).setAmountNone(1).addPlaceholder("player", user.getPlayerName());
}
});
}
}
if (plugin.getGui().getChestVoteNextBackButton()) {
inv.addButton(plugin.getCommandLoader().getBackButton(user));
}
inv.openInventory(player);
}
use of com.bencodez.advancedcore.api.inventory.BInventory in project VotingPlugin by Ben12345rocks.
the class VoteLast method onChest.
@Override
public void onChest(Player player) {
BInventory inv = new BInventory(plugin.getGui().getChestVoteLastName());
inv.addPlaceholder("player", user.getPlayerName());
for (VoteSite site : plugin.getVoteSites()) {
if (!site.isHidden()) {
inv.addButton(inv.getNextSlot(), new UpdatingBInventoryButton(site.getItem().setName(site.getDisplayName()).setLore(user.voteCommandLastGUILine(site)).setAmountNone(1), 1000, 1000) {
@Override
public void onClick(ClickEvent clickEvent) {
}
@Override
public ItemBuilder onUpdate(Player p) {
return site.getItem().setName(site.getDisplayName()).setLore(user.voteCommandLastGUILine(site)).setAmountNone(1);
}
});
}
}
if (plugin.getGui().getChestVoteLastBackButton()) {
inv.addButton(plugin.getCommandLoader().getBackButton(user));
}
inv.openInventory(player);
}
use of com.bencodez.advancedcore.api.inventory.BInventory in project VotingPlugin by Ben12345rocks.
the class VoteStreak method onChest.
@Override
public void onChest(Player player) {
BInventory inv = new BInventory(plugin.getGui().getChestVoteStreakName());
inv.addPlaceholder("player", user.getPlayerName());
inv.addButton(new BInventoryButton(new ItemBuilder(plugin.getGui().getChestVoteStreakCurrentDayStreakItem()).addPlaceholder("Streak", "" + user.getDayVoteStreak())) {
@Override
public void onClick(ClickEvent clickEvent) {
}
});
inv.addButton(new BInventoryButton(new ItemBuilder(plugin.getGui().getChestVoteStreakCurrentWeekStreakItem()).addPlaceholder("Streak", "" + user.getWeekVoteStreak())) {
@Override
public void onClick(ClickEvent clickEvent) {
}
});
inv.addButton(new BInventoryButton(new ItemBuilder(plugin.getGui().getChestVoteStreakCurrentMonthStreakItem()).addPlaceholder("Streak", "" + user.getMonthVoteStreak())) {
@Override
public void onClick(ClickEvent clickEvent) {
}
});
inv.addButton(new BInventoryButton(new ItemBuilder(plugin.getGui().getChestVoteStreakHighestDayStreakItem()).addPlaceholder("Streak", "" + user.getBestDayVoteStreak())) {
@Override
public void onClick(ClickEvent clickEvent) {
}
});
inv.addButton(new BInventoryButton(new ItemBuilder(plugin.getGui().getChestVoteStreakHighestWeekStreakItem()).addPlaceholder("Streak", "" + user.getBestWeekVoteStreak())) {
@Override
public void onClick(ClickEvent clickEvent) {
}
});
inv.addButton(new BInventoryButton(new ItemBuilder(plugin.getGui().getChestVoteStreakHighestMonthStreakItem()).addPlaceholder("Streak", "" + user.getBestMonthVoteStreak())) {
@Override
public void onClick(ClickEvent clickEvent) {
}
});
if (plugin.getGui().getChestVoteStreakBackButton()) {
inv.addButton(plugin.getCommandLoader().getBackButton(user));
}
inv.openInventory(player);
}
Aggregations