mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-25 14:46:45 +01:00
Finish up permissions
This commit is contained in:
parent
fed7f89f96
commit
81c72ee5d9
@ -187,10 +187,10 @@ public class BukkitEntityUtil {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!Permissions.hasPermission(plotPlayer, "plots.admin.destroy." + stub)) {
|
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY + "." + stub)) {
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", "plots.admin.destroy." + stub)
|
Template.of("node", Permission.PERMISSION_ADMIN_DESTROY + "." + stub)
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -199,10 +199,10 @@ public class BukkitEntityUtil {
|
|||||||
.isAdded(plotPlayer.getUUID()))) {
|
.isAdded(plotPlayer.getUUID()))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!Permissions.hasPermission(plotPlayer, "plots.admin.destroy." + stub)) {
|
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY + "." + stub)) {
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", "plots.admin.destroy." + stub)
|
Template.of("node", Permission.PERMISSION_ADMIN_DESTROY + "." + stub)
|
||||||
);
|
);
|
||||||
if (plot != null) {
|
if (plot != null) {
|
||||||
plot.debug(player.getName()
|
plot.debug(player.getName()
|
||||||
@ -220,10 +220,10 @@ public class BukkitEntityUtil {
|
|||||||
.getFlag(PveFlag.class))) {
|
.getFlag(PveFlag.class))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!Permissions.hasPermission(plotPlayer, "plots.admin.pve." + stub)) {
|
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVE + "." + stub)) {
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", "plots.admin.pve." + stub)
|
Template.of("node", Permission.PERMISSION_ADMIN_PVE + "." + stub)
|
||||||
);
|
);
|
||||||
if (plot != null) {
|
if (plot != null) {
|
||||||
plot.debug(player.getName() + " could not attack " + entityType
|
plot.debug(player.getName() + " could not attack " + entityType
|
||||||
@ -241,10 +241,10 @@ public class BukkitEntityUtil {
|
|||||||
.getFlag(PveFlag.class))) {
|
.getFlag(PveFlag.class))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!Permissions.hasPermission(plotPlayer, "plots.admin.pve." + stub)) {
|
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVE + "." + stub)) {
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", "plots.admin.pve." + stub)
|
Template.of("node", Permission.PERMISSION_ADMIN_PVE + "." + stub)
|
||||||
);
|
);
|
||||||
if (plot != null) {
|
if (plot != null) {
|
||||||
plot.debug(player.getName() + " could not attack " + entityType
|
plot.debug(player.getName() + " could not attack " + entityType
|
||||||
@ -255,10 +255,10 @@ public class BukkitEntityUtil {
|
|||||||
} else if (EntityCategories.PLAYER.contains(entityType)) {
|
} else if (EntityCategories.PLAYER.contains(entityType)) {
|
||||||
if (isPlot) {
|
if (isPlot) {
|
||||||
if (!plot.getFlag(PvpFlag.class) && !Permissions
|
if (!plot.getFlag(PvpFlag.class) && !Permissions
|
||||||
.hasPermission(plotPlayer, "plots.admin.pvp." + stub)) {
|
.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVP + "." + stub)) {
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", "plots.admin.pvp." + stub)
|
Template.of("node", Permission.PERMISSION_ADMIN_PVP + "." + stub)
|
||||||
);
|
);
|
||||||
plot.debug(player.getName() + " could not attack " + entityType
|
plot.debug(player.getName() + " could not attack " + entityType
|
||||||
+ " because pve = false");
|
+ " because pve = false");
|
||||||
@ -269,10 +269,10 @@ public class BukkitEntityUtil {
|
|||||||
} else if (roadFlags && area.getRoadFlag(PvpFlag.class)) {
|
} else if (roadFlags && area.getRoadFlag(PvpFlag.class)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!Permissions.hasPermission(plotPlayer, "plots.admin.pvp." + stub)) {
|
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVP + "." + stub)) {
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", "plots.admin.pvp." + stub)
|
Template.of("node", Permission.PERMISSION_ADMIN_PVP + "." + stub)
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -286,10 +286,10 @@ public class BukkitEntityUtil {
|
|||||||
}
|
}
|
||||||
} else if (roadFlags && (area.getRoadFlag(AnimalAttackFlag.class) || area
|
} else if (roadFlags && (area.getRoadFlag(AnimalAttackFlag.class) || area
|
||||||
.getFlag(PveFlag.class))) {
|
.getFlag(PveFlag.class))) {
|
||||||
if (!Permissions.hasPermission(plotPlayer, "plots.admin.pve." + stub)) {
|
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVE + "." + stub)) {
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", "plots.admin.pve." + stub)
|
Template.of("node", Permission.PERMISSION_ADMIN_PVE + "." + stub)
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -305,10 +305,10 @@ public class BukkitEntityUtil {
|
|||||||
} else if (roadFlags && area.getRoadFlag(PveFlag.class)) {
|
} else if (roadFlags && area.getRoadFlag(PveFlag.class)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!Permissions.hasPermission(plotPlayer, "plots.admin.pve." + stub)) {
|
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVE + "." + stub)) {
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", "plots.admin.pve." + stub)
|
Template.of("node", Permission.PERMISSION_ADMIN_PVE + "." + stub)
|
||||||
);
|
);
|
||||||
if (plot != null) {
|
if (plot != null) {
|
||||||
plot.debug(player.getName() + " could not attack " + entityType
|
plot.debug(player.getName() + " could not attack " + entityType
|
||||||
|
@ -214,7 +214,7 @@ public class Cluster extends SubCommand {
|
|||||||
if (current + cluster.getArea() > allowed) {
|
if (current + cluster.getArea() > allowed) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", "plots.cluster.size" + "." + (current + cluster.getArea()))
|
Template.of("node", Permission.PERMISSION_CLUSTER_SIZE + "." + (current + cluster.getArea()))
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -385,7 +385,7 @@ public class Cluster extends SubCommand {
|
|||||||
if (current + cluster.getArea() > allowed) {
|
if (current + cluster.getArea() > allowed) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", "plots.cluster" + "." + (current + cluster.getArea()))
|
Template.of("node", Permission.PERMISSION_CLUSTER + "." + (current + cluster.getArea()))
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -158,7 +158,7 @@ public class Merge extends SubCommand {
|
|||||||
if (!force && size - 1 > maxSize) {
|
if (!force && size - 1 > maxSize) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", "plots.merge." + (size + 1))
|
Template.of("node", Permission.PERMISSION_MERGE + "." + (size + 1))
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -50,10 +50,12 @@ public enum Permission {
|
|||||||
PERMISSION_ADMIN_VISIT_UNTRUSTED("plots.admin.visit.untrusted"),
|
PERMISSION_ADMIN_VISIT_UNTRUSTED("plots.admin.visit.untrusted"),
|
||||||
PERMISSION_ADMIN_ENTRY_FORCEFIELD("plots.admin.entry.forcefield"),
|
PERMISSION_ADMIN_ENTRY_FORCEFIELD("plots.admin.entry.forcefield"),
|
||||||
PERMISSION_ADMIN_COMMANDS_CHATSPY("plots.admin.command.chatspy"),
|
PERMISSION_ADMIN_COMMANDS_CHATSPY("plots.admin.command.chatspy"),
|
||||||
|
PERMISSION_MERGE("plots.merge"),
|
||||||
PERMISSION_MERGE_OTHER("plots.merge.other"),
|
PERMISSION_MERGE_OTHER("plots.merge.other"),
|
||||||
PERMISSION_MERGE_KEEP_ROAD("plots.merge.keeproad"),
|
PERMISSION_MERGE_KEEP_ROAD("plots.merge.keeproad"),
|
||||||
PERMISSION_ADMIN_CAPS_OTHER("plots.admin.caps.other"),
|
PERMISSION_ADMIN_CAPS_OTHER("plots.admin.caps.other"),
|
||||||
PERMISSION_ADMIN_MUSIC_OTHER("plots.admin.music.other"),
|
PERMISSION_ADMIN_MUSIC_OTHER("plots.admin.music.other"),
|
||||||
|
PERMISSION_ADMIN_DESTROY("plots.admin.destroy"),
|
||||||
PERMISSION_ADMIN_DESTROY_UNOWNED("plots.admin.destroy.unowned"),
|
PERMISSION_ADMIN_DESTROY_UNOWNED("plots.admin.destroy.unowned"),
|
||||||
PERMISSION_ADMIN_DESTROY_GROUNDLEVEL("plots.admin.destroy.groundlevel"),
|
PERMISSION_ADMIN_DESTROY_GROUNDLEVEL("plots.admin.destroy.groundlevel"),
|
||||||
PERMISSION_ADMIN_DESTROY_OTHER("plots.admin.destroy.other"),
|
PERMISSION_ADMIN_DESTROY_OTHER("plots.admin.destroy.other"),
|
||||||
@ -61,6 +63,8 @@ public enum Permission {
|
|||||||
PERMISSION_ADMIN_DESTROY_VEHICLE_ROAD("plots.admin.vehicle.break.road"),
|
PERMISSION_ADMIN_DESTROY_VEHICLE_ROAD("plots.admin.vehicle.break.road"),
|
||||||
PERMISSION_ADMIN_DESTROY_VEHICLE_UNOWNED("plots.admin.vehicle.break.unowned"),
|
PERMISSION_ADMIN_DESTROY_VEHICLE_UNOWNED("plots.admin.vehicle.break.unowned"),
|
||||||
PERMISSION_ADMIN_DESTROY_VEHICLE_OTHER("plots.admin.vehicle.break.other"),
|
PERMISSION_ADMIN_DESTROY_VEHICLE_OTHER("plots.admin.vehicle.break.other"),
|
||||||
|
PERMISSION_ADMIN_PVE("plots.admin.pve"),
|
||||||
|
PERMISSION_ADMIN_PVP("plots.admin.pvp"),
|
||||||
PERMISSION_ADMIN_BUILD_ROAD("plots.admin.build.road"),
|
PERMISSION_ADMIN_BUILD_ROAD("plots.admin.build.road"),
|
||||||
PERMISSION_ADMIN_PROJECTILE_ROAD("plots.admin.projectile.road"),
|
PERMISSION_ADMIN_PROJECTILE_ROAD("plots.admin.projectile.road"),
|
||||||
PERMISSION_ADMIN_PROJECTILE_UNOWNED("plots.admin.projectile.unowned"),
|
PERMISSION_ADMIN_PROJECTILE_UNOWNED("plots.admin.projectile.unowned"),
|
||||||
|
Loading…
Reference in New Issue
Block a user