Advertisement
Guest User

Untitled

a guest
Nov 14th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. HashMap<Material, Location> block = new HashMap<>();
  2.  
  3. @EventHandler
  4. public void Blockläufer(PlayerMoveEvent e) {
  5. Player p = e.getPlayer();
  6. if (p.hasMetadata("angel")) {
  7. if (p.getLocation().add(0, -1, 0).getBlock().getType().equals(Material.AIR)) {
  8. p.getLocation().add(0, -1, 0).getBlock().setType(Material.GLASS);
  9. block.put(Material.GLASS, p.getLocation().add(0,-1,0));
  10. Bukkit.getScheduler().scheduleAsyncDelayedTask(Main.getPlugin(), new Runnable() {
  11. @Override
  12. public void run() {
  13. Bukkit.getScheduler().runTask(Main.getPlugin(), new Runnable() {
  14. @Override
  15. public void run() {
  16. block.get(Material.GLASS).getBlock().setType(Material.AIR);
  17. Bukkit.broadcastMessage("remove");
  18. }
  19. });
  20. }
  21. }, 20);
  22. }
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement