Better handling of offline projectile shooters (#3705)

This commit is contained in:
Traks 2022-06-22 13:50:46 +02:00 committed by GitHub
parent f218902581
commit 312cb2996c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -149,6 +149,18 @@ public class ProjectileEventListener implements Listener {
Plot plot = area.getPlot(location);
ProjectileSource shooter = entity.getShooter();
if (shooter instanceof Player) {
if (!((Player) shooter).isOnline()) {
if (plot != null) {
if (plot.isAdded(((Player) shooter).getUniqueId()) || plot.getFlag(ProjectilesFlag.class)) {
return;
}
}
entity.remove();
event.setCancelled(true);
return;
}
PlotPlayer<?> pp = BukkitUtil.adapt((Player) shooter);
if (plot == null) {
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED)) {