Advertisement
Guest User

Untitled

a guest
Apr 20th, 2014
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. public static HashMap<Location, Material> blocks = new HashMap<Location, Material>();
  2.  
  3. @EventHandler
  4. public void onProjecitle(ProjectileHitEvent event){
  5. if(event.getEntity().getType() == EntityType.ENDER_PEARL){
  6. Block block = event.getEntity().getLocation().getBlock();
  7. for (int z = -1; z <= 1; z++) {
  8. for (int x = -1; x <= 1; x++) {
  9. for (int y = -1; y <= 1; y++) {
  10. final Location loc = block.getRelative(x, y, z).getLocation();
  11. if(loc.getBlock().getType() != Material.AIR){
  12. Aure.blocks.put(loc.getBlock().getLocation(), block.getType());
  13. loc.getBlock().setType(Material.WOOL);
  14. Bukkit.getScheduler().runTaskLater(plugin, new Runnable(){
  15. @Override
  16. public void run() {
  17. loc.getBlock().setType(Aure.blocks.get(loc.getBlock().getLocation()));
  18. }
  19. }, 40L);
  20. }
  21. }
  22. }
  23. }
  24. }
  25. }
  26.  
  27. Location theRealBlock = event.getEntity().getLocation().substract(0.0D, 1.0D, 0.0D);
  28.  
  29. event.getEntity().getLocation();
  30.  
  31. Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
  32.  
  33. Bukkit.getScheduler().runTaskLater(plugin, new Runnable(){
  34.  
  35. Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
  36. public void run(){
  37. loc.getBlock().setType(Aure.blocks.get(loc)); //no need to use loc.getBlock().getLocation(), same thing as just using loc
  38. }
  39. }, 40L);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement