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