3
0
Mirror von https://github.com/Moulberry/AxiomPaperPlugin.git synchronisiert 2024-11-08 17:40:04 +01:00

Fix backwards compatibility

Dieser Commit ist enthalten in:
Rubenicos 2024-05-19 11:40:47 -06:00 committet von Moulberry
Ursprung 38d5ee334d
Commit 472c85652a
6 geänderte Dateien mit 16 neuen und 10 gelöschten Zeilen

Datei anzeigen

@ -304,12 +304,12 @@ public class AxiomPaper extends JavaPlugin implements Listener {
}
public boolean hasAxiomPermission(Player player) {
return hasAxiomPermission(player, null);
return hasAxiomPermission(player, null, false);
}
public boolean hasAxiomPermission(Player player, String permission) {
public boolean hasAxiomPermission(Player player, String permission, boolean strict) {
if (player.hasPermission("axiom.*") || player.isOp()) {
return true;
return !strict || permission == null || player.hasPermission("axiom.all") || player.hasPermission(permission);
} else if (permission != null && !player.hasPermission(permission)) {
return false;
}
@ -317,11 +317,15 @@ public class AxiomPaper extends JavaPlugin implements Listener {
}
public boolean canUseAxiom(Player player) {
return canUseAxiom(player, null);
return canUseAxiom(player, null, false);
}
public boolean canUseAxiom(Player player, String permission) {
return activeAxiomPlayers.contains(player.getUniqueId()) && hasAxiomPermission(player, permission);
return canUseAxiom(player, permission, false);
}
public boolean canUseAxiom(Player player, String permission, boolean strict) {
return activeAxiomPlayers.contains(player.getUniqueId()) && hasAxiomPermission(player, permission, strict);
}
public @Nullable RateLimiter getBlockBufferRateLimiter(UUID uuid) {

Datei anzeigen

@ -35,7 +35,7 @@ public class DeleteEntityPacketListener implements PluginMessageListener {
}
private void process(Player player, byte[] message) {
if (!this.plugin.canUseAxiom(player, "axiom.entity.delete")) {
if (!this.plugin.canUseAxiom(player, "axiom.entity.delete", true)) {
return;
}

Datei anzeigen

@ -90,7 +90,7 @@ public class ManipulateEntityPacketListener implements PluginMessageListener {
}
private void process(Player player, byte[] message) {
if (!this.plugin.canUseAxiom(player, "axiom.entity.manipulate")) {
if (!this.plugin.canUseAxiom(player, "axiom.entity.manipulate", true)) {
return;
}

Datei anzeigen

@ -33,7 +33,7 @@ public class MarkerNbtRequestPacketListener implements PluginMessageListener {
}
private void process(Player player, byte[] message) {
if (!this.plugin.canUseAxiom(player, "axiom.entity.manipulate")) {
if (!this.plugin.canUseAxiom(player, "axiom.entity.manipulate", true)) {
return;
}

Datei anzeigen

@ -55,7 +55,7 @@ public class SpawnEntityPacketListener implements PluginMessageListener {
}
private void process(Player player, byte[] message) {
if (!this.plugin.canUseAxiom(player, "axiom.entity.spawn")) {
if (!this.plugin.canUseAxiom(player, "axiom.entity.spawn", true)) {
return;
}

Datei anzeigen

@ -10,9 +10,11 @@ softdepend:
- WorldGuard
- PlotSquared
permissions:
axiom.*:
axiom.all:
description: Allows use of all default Axiom features
default: op
children:
axiom.*: true
axiom.use:
description: Allows basic use of axiom
default: op