Search in sources :

Example 1 with AdminVoteConfirmation

use of com.bencodez.votingplugin.commands.gui.admin.AdminVoteConfirmation in project VotingPlugin by Ben12345rocks.

the class AdminVoteCumulativeRemove method onChest.

@Override
public void onChest(Player player) {
    BInventory inv = new BInventory("Remove cumulative");
    inv.requirePermission("VotingPlugin.Commands.AdminVote.Edit.Cumulative");
    for (final String votes : plugin.getSpecialRewardsConfig().getCumulativeVotes()) {
        inv.addButton(new BInventoryButton(new ItemBuilder(Material.PAPER, 1).setName(votes).addLoreLine("&c&lClick to remove")) {

            @Override
            public void onClick(ClickEvent clickEvent) {
                new AdminVoteConfirmation(plugin, clickEvent.getPlayer(), "Remove cumulative " + votes + "?") {

                    @Override
                    public void onConfirm(Player p) {
                        plugin.getSpecialRewardsConfig().removeCumulative(votes);
                        p.sendMessage("Removed cumulative " + votes);
                        plugin.reload();
                    }

                    @Override
                    public void onDeny(Player p) {
                        new AdminVoteCumulative(plugin, p);
                    }
                }.open();
            }
        });
    }
    inv.openInventory(player);
}
Also used : ItemBuilder(com.bencodez.advancedcore.api.item.ItemBuilder) Player(org.bukkit.entity.Player) AdminVoteConfirmation(com.bencodez.votingplugin.commands.gui.admin.AdminVoteConfirmation) BInventoryButton(com.bencodez.advancedcore.api.inventory.BInventoryButton) ClickEvent(com.bencodez.advancedcore.api.inventory.BInventory.ClickEvent) BInventory(com.bencodez.advancedcore.api.inventory.BInventory)

Example 2 with AdminVoteConfirmation

use of com.bencodez.votingplugin.commands.gui.admin.AdminVoteConfirmation in project VotingPlugin by Ben12345rocks.

the class AdminVoteMilestoneRemove method onChest.

@Override
public void onChest(Player player) {
    BInventory inv = new BInventory("Remove milestones");
    inv.requirePermission("VotingPlugin.Commands.AdminVote.Edit.MileStones");
    for (final String votes : plugin.getSpecialRewardsConfig().getMilestoneVotes()) {
        inv.addButton(new BInventoryButton(new ItemBuilder(Material.PAPER, 1).setName(votes).addLoreLine("&c&lClick to remove")) {

            @Override
            public void onClick(ClickEvent clickEvent) {
                new AdminVoteConfirmation(plugin, clickEvent.getPlayer(), "Remove milestone " + votes + "?") {

                    @Override
                    public void onConfirm(Player p) {
                        plugin.getSpecialRewardsConfig().removeMilestone(votes);
                        p.sendMessage("Removed milestone " + votes);
                        plugin.reload();
                    }

                    @Override
                    public void onDeny(Player p) {
                        new AdminVoteMilestones(plugin, p);
                    }
                }.open();
            }
        });
    }
    inv.openInventory(player);
}
Also used : ItemBuilder(com.bencodez.advancedcore.api.item.ItemBuilder) Player(org.bukkit.entity.Player) AdminVoteConfirmation(com.bencodez.votingplugin.commands.gui.admin.AdminVoteConfirmation) BInventoryButton(com.bencodez.advancedcore.api.inventory.BInventoryButton) ClickEvent(com.bencodez.advancedcore.api.inventory.BInventory.ClickEvent) BInventory(com.bencodez.advancedcore.api.inventory.BInventory)

Example 3 with AdminVoteConfirmation

use of com.bencodez.votingplugin.commands.gui.admin.AdminVoteConfirmation 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);
}
Also used : ItemBuilder(com.bencodez.advancedcore.api.item.ItemBuilder) Player(org.bukkit.entity.Player) AdminVoteConfirmation(com.bencodez.votingplugin.commands.gui.admin.AdminVoteConfirmation) BInventoryButton(com.bencodez.advancedcore.api.inventory.BInventoryButton) ClickEvent(com.bencodez.advancedcore.api.inventory.BInventory.ClickEvent) BInventory(com.bencodez.advancedcore.api.inventory.BInventory)

Aggregations

BInventory (com.bencodez.advancedcore.api.inventory.BInventory)3 ClickEvent (com.bencodez.advancedcore.api.inventory.BInventory.ClickEvent)3 BInventoryButton (com.bencodez.advancedcore.api.inventory.BInventoryButton)3 ItemBuilder (com.bencodez.advancedcore.api.item.ItemBuilder)3 AdminVoteConfirmation (com.bencodez.votingplugin.commands.gui.admin.AdminVoteConfirmation)3 Player (org.bukkit.entity.Player)3