本文整理汇总了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);
}
}
开发者ID:IntellectualSites,项目名称:PlotSquared,代码行数:21,代码来源:PlayerEvents.java
示例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;
}
}
开发者ID:IntellectualSites,项目名称:PlotSquared,代码行数:30,代码来源:PlayerEvents.java
示例3: PotionCollideEvent
import cn.nukkit.entity.item.EntityPotion; //导入依赖的package包/类
public PotionCollideEvent(Potion potion, EntityPotion thrownPotion) {
super(potion);
this.thrownPotion = thrownPotion;
}
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:5,代码来源:PotionCollideEvent.java
示例4: getThrownPotion
import cn.nukkit.entity.item.EntityPotion; //导入依赖的package包/类
public EntityPotion getThrownPotion() {
return thrownPotion;
}
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:4,代码来源:PotionCollideEvent.java
注:本文中的cn.nukkit.entity.item.EntityPotion类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论