Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void blöckeRadiusLöschen(Location loc, Player p) {
- Location block = loc;
- ItemStack buck = new ItemStack(Material.BUCKET);
- ItemStack waterbucket = new ItemStack(Material.WATER_BUCKET);
- Bukkit.getScheduler().runTaskLater(Core.getPlugin(), new Runnable()
- {
- public void run()
- {
- for(double y = loc.getY() - 1; y <= loc.getY() + 1; y++ ) {
- for(double x = loc.getX() - 1; x <= loc.getX() + 1 ; x++ ) {
- for(double z = loc.getZ() - 1; z <= loc.getZ() + 1 ; z++ )
- {
- block.setX(x);
- block.setY(y);
- block.setZ(z);
- if(block.getBlock().getType().equals(Material.WATER) || block.getBlock().getType().equals(Material.STATIONARY_WATER)) {
- block.getBlock().setType(Material.AIR);
- }
- }
- }
- }
- }
- }, 40L);
- Bukkit.getScheduler().runTaskLater(Core.getPlugin(), new Runnable()
- {
- public void run()
- {
- for (int i = 0; i < 35; i++)
- {
- if(p.getInventory().getItem(i) == buck ){
- p.getInventory().setItem(i, waterbucket);
- }
- }
- }
- }, 40L);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement