@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void onPlayerEggThrow(final PlayerEggThrowEvent e) {
final Location l = BukkitUtil.getLocation(e.getEgg().getLocation());
if (PlotSquared.isPlotWorld(l.getWorld())) {
final Player p = e.getPlayer();
final PlotPlayer pp = BukkitUtil.getPlayer(p);
Plot plot = MainUtil.getPlot(l);
if (plot == null) {
if (!MainUtil.isPlotAreaAbs(l)) {
return;
}
if (!Permissions.hasPermission(pp, "plots.admin.projectile.road")) {
MainUtil.sendMessage(pp, C.NO_PERMISSION, "plots.admin.projectile.road");
e.setHatching(false);
return;
}
} else {
if (!plot.hasOwner()) {
if (!Permissions.hasPermission(pp, "plots.admin.projectile.unowned")) {
MainUtil.sendMessage(pp, C.NO_PERMISSION, "plots.admin.projectile.unowned");
e.setHatching(false);
return;
}
} else if (!plot.isAdded(pp.getUUID())) {
if (!Permissions.hasPermission(pp, "plots.admin.projectile.other")) {
if (MainUtil.isPlotArea(l)) {
MainUtil.sendMessage(pp, C.NO_PERMISSION, "plots.admin.projectile.other");
e.setHatching(false);
return;
}
}
}
}
}
}
PlayerEvents.java 文件源码
java
阅读 29
收藏 0
点赞 0
评论 0
项目:PlotSquared-Chinese
作者:
评论列表
文章目录