org.bukkit.entity.TippedArrow Java Examples

The following examples show how to use org.bukkit.entity.TippedArrow. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Compat19.java    From RedProtect with GNU General Public License v3.0 6 votes vote down vote up
@EventHandler(ignoreCancelled = true)
public void onShootBow(EntityShootBowEvent e) {
    if (!(e.getEntity() instanceof Player)) {
        return;
    }

    Player p = (Player) e.getEntity();
    Entity proj = e.getProjectile();
    List<String> Pots = RedProtect.get().config.globalFlagsRoot().worlds.get(p.getWorld().getName()).deny_potions;

    if ((proj instanceof TippedArrow)) {
        TippedArrow arr = (TippedArrow) proj;
        if (Pots.contains(arr.getBasePotionData().getType().name())) {
            RedProtect.get().lang.sendMessage(p, "playerlistener.denypotion");
            e.setCancelled(true);
        }
    }
}
 
Example #2
Source File: PotionUtils.java    From ProjectAres with GNU Affero General Public License v3.0 4 votes vote down vote up
public static Collection<PotionEffect> effects(TippedArrow arrow) {
    return effects(arrow.getBasePotionData(), arrow.getCustomEffects());
}