Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler
- public void onBlockPlace(BlockPlaceEvent event)
- {
- blocks_placed.push(event.getBlockPlaced().getLocation());
- }
- @EventHandler
- public void onBlockBreak(BlockBreakEvent event)
- {
- blocks_broke_location.push(event.getBlock().getLocation());
- blocks_broke_type.add(event.getBlock().getType());
- }
- public void resetGame()
- {
- Bukkit.broadcastMessage(ChatColor.RED + "[ChaoticUnited] " + ChatColor.AQUA + "Restoring arena... This may cause some lag.");
- int i;
- for (i = 0; i < blocks_placed.size() - 1; i++)
- {
- Location loc = (Location)blocks_placed.pop();
- loc.getBlock().setType(Material.AIR);
- }
- for (i = 0; i < blocks_broke_location.size() - 1; i++)
- {
- Material mat = (Material)blocks_broke_type.pop();
- Location loc = (Location)blocks_broke_location.pop();
- loc.getBlock().setType(mat);
- }
- Bukkit.broadcastMessage(ChatColor.RED + "[ChaoticUnited] " + ChatColor.AQUA + "Done!");
- gameRunning = false;
- }
Advertisement
Add Comment
Please, Sign In to add comment