本文整理汇总了Java中cn.nukkit.event.potion.PotionCollideEvent类的典型用法代码示例。如果您正苦于以下问题:Java PotionCollideEvent类的具体用法?Java PotionCollideEvent怎么用?Java PotionCollideEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PotionCollideEvent类属于cn.nukkit.event.potion包,在下文中一共展示了PotionCollideEvent类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onPotionSplash
import cn.nukkit.event.potion.PotionCollideEvent; //导入依赖的package包/类
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onPotionSplash(PotionCollideEvent event) {
EntityPotion entity = event.getThrownPotion();
Location l = NukkitUtil.getLocation(entity);
if (!PS.get().hasPlotArea(l.getWorld())) {
return;
}
Entity shooter = entity.shootingEntity;
if (shooter instanceof Player) {
PlotPlayer pp = NukkitUtil.getPlayer((Player) shooter);
Plot plot = l.getOwnedPlotAbs();
if (plot == null) {
if (!Permissions.hasPermission(pp, C.PERMISSION_PROJECTILE_UNOWNED)) {
kill(entity, event);
return;
}
return;
}
if (plot.isAdded(pp.getUUID()) || Permissions.hasPermission(pp, C.PERMISSION_PROJECTILE_OTHER)) {
return;
}
kill(entity, event);
return;
}
if (shooter == null) {
kill(entity, event);
return;
}
}
示例2: onSplashPotion
import cn.nukkit.event.potion.PotionCollideEvent; //导入依赖的package包/类
public void onSplashPotion(PotionCollideEvent event) {
}