[UNSOLVED] Blocks not fading.

Discussion in 'Plugin Development' started by _Error, Jul 2, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    _Error

    Code:
    package com.gmail.BurnyDaKath.BurnFall;
    
    import org.bukkit.*;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.block.Action;
    import org.bukkit.event.player.PlayerInteractEvent;
    
    import java.util.HashMap;
    
    public class Powerups implements Listener {
    int nameoftimer;
    HashMap<String, Integer> count = new HashMap<String, Integer>();
    
    @EventHandlerpublic void powerups(PlayerInteractEvent e) {
    Player p = e.getPlayer();
    //Block Selectionfinal Location BA = p.getLocation();
    BA.setZ(BA.getZ() - 1);
    BA.setY(BA.getY() - -2);
    final Location B1 = p.getLocation();
    B1.setZ(B1.getZ() - -1);
    B1.setY(B1.getY() - -2);
    final Location B2 = p.getLocation();
    B2.setX(B2.getX() - 1);
    B2.setY(B2.getY() - -2);
    final Location B3 = p.getLocation();
    B3.setX(B3.getX() - -1);
    B3.setY(B3.getY() - -2);
    final Location B4 = p.getLocation();
    B4.setY(B4.getY() - -2);
    //Block Selection > Cornersfinal Location B5 = p.getLocation();
    B5.setZ(B5.getZ() - 1);
    B5.setX(B5.getX() - 1);
    B5.setY(B5.getY() - -2);
    final Location B6 = p.getLocation();
    B6.setZ(B6.getZ() - -1);
    B6.setX(B6.getX() - -1);
    B6.setY(B6.getY() - -2);
    final Location B7 = p.getLocation();
    B7.setX(B7.getX() - 1);
    B7.setZ(B7.getZ() - -1);
    B7.setY(B7.getY() - -2);
    final Location B8 = p.getLocation();
    B8.setX(B8.getX() - -1);
    B8.setZ(B8.getZ() - 1);
    B8.setY(B8.getY() - -2);
    
    if (e.getAction() == Action.RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK) {
    if (e.getPlayer().getItemInHand().getType() == Material.FEATHER) {
    BA.getBlock().setType(Material.HARD_CLAY);
    B1.getBlock().setType(Material.HARD_CLAY);
    B2.getBlock().setType(Material.HARD_CLAY);
    B3.getBlock().setType(Material.HARD_CLAY);
    B4.getBlock().setType(Material.HARD_CLAY);
    B5.getBlock().setType(Material.HARD_CLAY);
    B6.getBlock().setType(Material.HARD_CLAY);
    B7.getBlock().setType(Material.HARD_CLAY);
    B8.getBlock().setType(Material.HARD_CLAY);
    
    
    
    }
    
    }
    count.put("", 10);
    nameoftimer = Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(Bukkit.getPluginManager().getPlugin("BurnFall"), new Runnable() {
    public void run() {
    if (count.get("") != 0) {
    count.put("", count.get("") - 1);
    } else {
    Bukkit.getScheduler().cancelTask(nameoftimer);
    BA.getBlock().setType(Material.AIR);
    B1.getBlock().setType(Material.AIR);
    B2.getBlock().setType(Material.AIR);
    B3.getBlock().setType(Material.AIR);
    B4.getBlock().setType(Material.AIR);
    B5.getBlock().setType(Material.AIR);
    B6.getBlock().setType(Material.AIR);
    B7.getBlock().setType(Material.AIR);
    B8.getBlock().setType(Material.AIR);
    }
    }
    }, 0L, 20L);
    
    }
    }
    I have this code, It will place the blocks but it won't remove them, Help?
     
  2. Offline

    lilian58660

    1. @EventHandlerpublic void powerups(PlayerInteractEvent e) {
    2. The space under @EventHandler and powerups ?
     
  3. Offline

    _Error

    Just a copy and paste problem.
    http://hastebin.com/vibiqucoya.avrasm
     
  4. Offline

    lilian58660

Thread Status:
Not open for further replies.

Share This Page