Package me.taylorkelly.bigbrother.datablock

Examples of me.taylorkelly.bigbrother.datablock.BBDataBlock


        return new MiscExplosion(player, block, block.getWorld().getName());
    }

    public static void create(Location location, List<Block> blockList, String world) {
        for (Block block : blockList) {
            BBDataBlock dataBlock = new MiscExplosion(ENVIRONMENT, block, world);
            dataBlock.send();
            if (block.getType() == Material.TNT) {
                TNTLogger.log(ENVIRONMENT, block);
            }
        }
    }
View Full Code Here


        return new CreeperExplosion(player, block, block.getWorld().getName());
    }

    public static void create(Location location, List<Block> blockList, String world) {
        for (Block block : blockList) {
            BBDataBlock dataBlock = new CreeperExplosion(ENVIRONMENT, block, world);
            dataBlock.send();
            if (block.getType() == Material.TNT) {
                TNTLogger.log(ENVIRONMENT, block);
            }
        }
    }
View Full Code Here

        }
        if (bestLocation != null) {
            player = tntMap.remove(bestLocation);
        }
        for (Block block : blockList) {
            BBDataBlock dataBlock = new TNTExplosion(player, block, location.getWorld().getName());
            dataBlock.send();
            if (block.getType() == Material.TNT) {
                TNTLogger.log(player, block);
            }
        }
    }
View Full Code Here

                ps.setInt(4, manager.getWorld(block.getWorld().getName()));
                rs = ps.executeQuery();
                conn.commit();
               
                while (rs.next()) {
                    BBDataBlock newBlock = BBDataBlock.getBBDataBlock(BBUsersTable.getInstance().getUserByID(rs.getInt("player")), Action.values()[rs.getInt("action")], rs.getString("world"), rs.getInt("x"), rs.getInt("y"), rs.getInt("z"), rs.getInt("type"), rs.getString("data"));
                    newBlock.date = rs.getLong("date");
                    blockList.add(newBlock);
                }
            }
        } catch (SQLException ex) {
View Full Code Here

    @Override
    public void onLeavesDecay(LeavesDecayEvent event) {
        if (BBSettings.leafDrops && !event.isCancelled()) {
            // TODO try to find a player that did it.
            final Block block = event.getBlock();
            BBDataBlock dataBlock = LeafDecay.create(block, block.getWorld().getName());
            dataBlock.send();
        }
    }
View Full Code Here

    @Override
    public void onBlockIgnite(BlockIgniteEvent event) {
        if (BBSettings.fire && event.getCause() == IgniteCause.FLINT_AND_STEEL && !event.isCancelled()) {
            final Block block = event.getBlock();
            BBDataBlock dataBlock = new FlintAndSteel(event.getPlayer().getName(), block, block.getWorld().getName());
            dataBlock.send();
        }
    }
View Full Code Here

    @Override
    public void onBlockBurn(BlockBurnEvent event) {
        if (BBSettings.fire && !event.isCancelled()) {
            final Block block = event.getBlock();
            BBDataBlock dataBlock = BlockBurnLogger.create(block, block.getWorld().getName());
            dataBlock.send();
        }
    }
View Full Code Here

                            buttonDataBlock.send();
                        }
                        break;
                    case CHEST:
                        if (BBSettings.chestChanges) {
                            BBDataBlock chestDataBlock = new ChestOpen(event.getPlayer().getName(), block, block.getWorld().getName());
                            chestDataBlock.send();
                        }
                        break;
                    }
                    break;
                }
View Full Code Here

    }

    public static void undo(Server server, Player player) {
        int i = 0;
        while (lastRollback.size() > 0) {
            BBDataBlock dataBlock = lastRollback.removeFirst();
            if (dataBlock != null) {
                dataBlock.redo(server);
                i++;
            }
        }
        if (undoRollback != null) {
            Connection conn = null;
View Full Code Here

        @Override
        public void run() {
            int count = 0;

            while (count < BBSettings.rollbacksPerTick && listBlocks.size() > 0) {
                BBDataBlock dataBlock = listBlocks.removeFirst();
                if (dataBlock != null) {
                    lastRollback.addFirst(dataBlock);
                    try {
                        dataBlock.rollback(server.getWorld(dataBlock.world));
                    } catch (Exception e) {
                        BBLogging.warning("Caught exception when rolling back a " + dataBlock.action);
                    }
                    count++;
                }
View Full Code Here

TOP

Related Classes of me.taylorkelly.bigbrother.datablock.BBDataBlock

Copyright © 2018 www.massapicom. 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.