Examples of Chest


Examples of org.bukkit.block.Chest

        }
    }

    private void chestCheck(String player, Block block) {
        if (block.getState() instanceof Chest) {
            Chest chest = (Chest) block.getState();
            bystanders.add(new DeltaChest(player, chest, chest.getInventory().getContents(),new ItemStack[chest.getInventory().getSize()]));
        }
    }
View Full Code Here

Examples of org.bukkit.block.Chest

        super.send();
    }

    private void chestCheck(String player, Block block) {
        if (block.getState() instanceof Chest) {
            Chest chest = (Chest) block.getState();
            ItemStack[] destroyedStack=new ItemStack[chest.getInventory().getSize()];
            ItemStack[] contents = chest.getInventory().getContents();
            bystanders.add(new DeltaChest(player, chest, contents,destroyedStack));
        }
    }
View Full Code Here

Examples of org.bukkit.block.Chest

            do_OldRollback(currWorld,block);
        }
    }
    private void do_NewRollback(World currWorld, Block block) {
        if (block.getState() instanceof Chest) {
            Chest chest = (Chest) block.getState();
            DeltaEntry[] diff = processDeltaStream(chest.getInventory().getSize(),data);
            Inventory inv = chest.getInventory();
            for(int i = 0;i<chest.getInventory().getSize();i++) {
                switch(diff[i].Type) {
                case ADDED:
                case REMOVED:
                    ItemStack stack = inv.getItem(i);
                    stack.setAmount(stack.getAmount()-diff[i].Amount);
View Full Code Here

Examples of org.bukkit.block.Chest

    }

    public void do_OldRollback(World currWorld,Block block) {
        String[] changes = data.split(";");
        if (block.getState() instanceof Chest) {
            Chest chest = (Chest) block.getState();
            Inventory inv = chest.getInventory();
            for (int i = 0; i < changes.length; i++) {
                String change = changes[i];
                try {
                    if (change.equals("")) {
                        continue;
View Full Code Here

Examples of org.bukkit.block.Chest

        }

        String[] changes = data.split(";");
        Block block = currWorld.getBlockAt(x, y, z);
        if (block.getState() instanceof Chest) {
            Chest chest = (Chest) block.getState();
            Inventory inv = chest.getInventory();
            for (int i = 0; i < changes.length; i++) {
                String change = changes[i];
                try {
                    if (change.equals("")) {
                        continue;
View Full Code Here

Examples of org.bukkit.block.Chest

                World world = pi.getOpenedChest().getWorld();
                int x = pi.getOpenedChest().getX();
                int y = pi.getOpenedChest().getY();
                int z = pi.getOpenedChest().getZ();
                if(world.getBlockAt(x, y, z).getState() instanceof Chest) {
                    Chest chest = (Chest)world.getBlockAt(x, y, z).getState();
                    ItemStack[] orig = pi.getOldChestContents();
                    ItemStack[] latest = chest.getInventory().getContents();
                    DeltaChest dc = new DeltaChest(pi.getName(), chest, orig, latest);
                    dc.send();
                }
            }
            BBUsersTable.getInstance().userOpenedChest(pi.getName(), null, null); // Chest closed.
View Full Code Here

Examples of org.bukkit.block.Chest

                World world;
                Block block = event.getClickedBlock();
               
                plugin.closeChestIfOpen(pi);
                if(block.getState() instanceof Chest) {
                    Chest chest = ((Chest)block.getState());
                    // OH SHI-
                    BBUsersTable.getInstance().userOpenedChest(player.getName(),chest,chest.getInventory().getContents());
                    return;
                }
                switch (event.getMaterial()) {
                //TODO Door logging
                case LAVA_BUCKET:
View Full Code Here

Examples of org.bukkit.block.Chest

        if (ChestShopSign.isAdminShop(nameLine)) {
            return;
        }

        Chest connectedChest = uBlock.findConnectedChest(event.getSign().getBlock());

        if (connectedChest == null) {
            event.setOutcome(NO_CHEST);
            return;
        }

        Player player = event.getPlayer();

        if (Permission.has(player, ADMIN)) {
            return;
        }

        if (!Security.canAccess(player, connectedChest.getBlock())) {
            event.setOutcome(NO_PERMISSION_FOR_CHEST);
        }
    }
View Full Code Here

Examples of org.bukkit.block.Chest

        OfflinePlayer owner = Bukkit.getOfflinePlayer(uuid);

        Action buy = Properties.REVERSE_BUTTONS ? LEFT_CLICK_BLOCK : RIGHT_CLICK_BLOCK;
        double price = (action == buy ? PriceUtil.getBuyPrice(prices) : PriceUtil.getSellPrice(prices));

        Chest chest = uBlock.findConnectedChest(sign);
        Inventory ownerInventory = (ChestShopSign.isAdminShop(sign) ? new AdminInventory() : chest != null ? chest.getInventory() : null);

        ItemStack item = MaterialUtil.getItem(material);

        if (item == null || !NumberUtil.isInteger(quantity)) {
            player.sendMessage(Messages.prefix(Messages.INVALID_SHOP_DETECTED));
View Full Code Here

Examples of org.bukkit.block.Chest

    public static boolean canOpenOtherShops(Player player) {
        return Permission.has(player, Permission.ADMIN) || Permission.has(player, Permission.MOD);
    }

    private static void showChestGUI(Player player, Block signBlock) {
        Chest chest = uBlock.findConnectedChest(signBlock);

        if (chest == null) {
            player.sendMessage(Messages.prefix(Messages.NO_CHEST_DETECTED));
            return;
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.