示例#1
0
 @Override
 public void remove(Hero hero) {
   super.remove(hero);
   Player p = hero.getPlayer();
   broadcast(p.getLocation(), expireText, p.getDisplayName());
   if (lastLoc != null) {
     p.sendBlockChange(lastLoc, lastMat, lastData);
   }
 }
示例#2
0
 @Override
 public void apply(Hero hero) {
   super.apply(hero);
   Player p = hero.getPlayer();
   broadcast(p.getLocation(), applyText, p.getDisplayName());
   Block thisBlock = p.getLocation().getBlock().getRelative(BlockFace.DOWN);
   if (allowedBlocks.contains(thisBlock.getType())) {
     lastLoc = thisBlock.getLocation();
     lastMat = thisBlock.getType();
     lastData = thisBlock.getData();
     p.sendBlockChange(lastLoc, Material.GLOWSTONE, (byte) 0);
   }
 }
示例#3
0
 @Override
 public void tick(Hero hero) {
   super.tick(hero);
   Player p = hero.getPlayer();
   Block thisBlock = p.getLocation().getBlock().getRelative(BlockFace.DOWN);
   if (thisBlock.getLocation().equals(lastLoc)) {
     return;
   } else if (allowedBlocks.contains(thisBlock.getType())) {
     if (lastLoc != null) {
       p.sendBlockChange(lastLoc, lastMat, lastData);
     }
     lastLoc = thisBlock.getLocation();
     lastMat = thisBlock.getType();
     lastData = thisBlock.getData();
     p.sendBlockChange(lastLoc, Material.GLOWSTONE, (byte) 0);
   } else if (lastLoc != null) {
     p.sendBlockChange(lastLoc, lastMat, lastData);
   }
 }