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

Fix backwards compatibility

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

Datei anzeigen

@ -307,12 +307,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;
}
@ -320,11 +320,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