Advertisement
Guest User

Untitled

a guest
Dec 6th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. public void blöckeRadiusLöschen(Location loc, Player p) {
  2. Location block = loc;
  3. ItemStack buck = new ItemStack(Material.BUCKET);
  4. ItemStack waterbucket = new ItemStack(Material.WATER_BUCKET);
  5. Bukkit.getScheduler().runTaskLater(Core.getPlugin(), new Runnable()
  6. {
  7.  
  8. public void run()
  9. {
  10. for(double y = loc.getY() - 1; y <= loc.getY() + 1; y++ ) {
  11. for(double x = loc.getX() - 1; x <= loc.getX() + 1 ; x++ ) {
  12. for(double z = loc.getZ() - 1; z <= loc.getZ() + 1 ; z++ )
  13. {
  14.  
  15. block.setX(x);
  16. block.setY(y);
  17. block.setZ(z);
  18. if(block.getBlock().getType().equals(Material.WATER) || block.getBlock().getType().equals(Material.STATIONARY_WATER)) {
  19. block.getBlock().setType(Material.AIR);
  20.  
  21. }
  22.  
  23. }
  24.  
  25. }
  26. }
  27. }
  28. }, 40L);
  29. Bukkit.getScheduler().runTaskLater(Core.getPlugin(), new Runnable()
  30. {
  31.  
  32. public void run()
  33. {
  34. for (int i = 0; i < 35; i++)
  35. {
  36. if(p.getInventory().getItem(i) == buck ){
  37. p.getInventory().setItem(i, waterbucket);
  38.  
  39. }
  40. }
  41. }
  42. }, 40L);
  43.  
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement