mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-25 02:04:44 +02:00
Add Plot flag for projectiles (#3581)
* feature: add flag for projectiles * build: add License to ProjectilesFlag.java Co-authored-by: Alexander Brandes <mc.cache@web.de>
This commit is contained in:
@ -44,6 +44,7 @@ import com.plotsquared.core.player.PlotPlayer;
|
||||
import com.plotsquared.core.plot.Plot;
|
||||
import com.plotsquared.core.plot.PlotArea;
|
||||
import com.plotsquared.core.plot.flag.implementations.DoneFlag;
|
||||
import com.plotsquared.core.plot.flag.implementations.ProjectilesFlag;
|
||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||
import com.plotsquared.core.util.Permissions;
|
||||
import net.kyori.adventure.text.minimessage.Template;
|
||||
@ -352,13 +353,15 @@ public class PaperListener implements Listener {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
} else if (!plot.isAdded(pp.getUUID())) {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER))
|
||||
);
|
||||
entity.remove();
|
||||
event.setCancelled(true);
|
||||
if (!plot.getFlag(ProjectilesFlag.class)) {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER))
|
||||
);
|
||||
entity.remove();
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -35,6 +35,7 @@ import com.plotsquared.core.player.PlotPlayer;
|
||||
import com.plotsquared.core.plot.Plot;
|
||||
import com.plotsquared.core.plot.PlotArea;
|
||||
import com.plotsquared.core.plot.PlotHandler;
|
||||
import com.plotsquared.core.plot.flag.implementations.ProjectilesFlag;
|
||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||
import com.plotsquared.core.util.Permissions;
|
||||
import net.kyori.adventure.text.minimessage.Template;
|
||||
@ -128,13 +129,15 @@ public class ProjectileEventListener implements Listener {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
} else if (!plot.isAdded(pp.getUUID())) {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER))
|
||||
);
|
||||
entity.remove();
|
||||
event.setCancelled(true);
|
||||
if (!plot.getFlag(ProjectilesFlag.class)) {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER))
|
||||
);
|
||||
entity.remove();
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -162,7 +165,7 @@ public class ProjectileEventListener implements Listener {
|
||||
return;
|
||||
}
|
||||
if (plot.isAdded(pp.getUUID()) || Permissions
|
||||
.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) {
|
||||
.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_OTHER) || plot.getFlag(ProjectilesFlag.class)) {
|
||||
return;
|
||||
}
|
||||
entity.remove();
|
||||
|
Reference in New Issue
Block a user