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:
Ursprung
82f5eca7ef
Commit
23ab9b720e
@ -305,12 +305,12 @@ public class AxiomPaper extends JavaPlugin implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasAxiomPermission(Player player) {
|
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()) {
|
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)) {
|
} else if (permission != null && !player.hasPermission(permission)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -318,11 +318,15 @@ public class AxiomPaper extends JavaPlugin implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean canUseAxiom(Player player) {
|
public boolean canUseAxiom(Player player) {
|
||||||
return canUseAxiom(player, null);
|
return canUseAxiom(player, null, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canUseAxiom(Player player, String permission) {
|
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) {
|
public @Nullable RateLimiter getBlockBufferRateLimiter(UUID uuid) {
|
||||||
|
@ -35,7 +35,7 @@ public class DeleteEntityPacketListener implements PluginMessageListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void process(Player player, byte[] message) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ public class ManipulateEntityPacketListener implements PluginMessageListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void process(Player player, byte[] message) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ public class MarkerNbtRequestPacketListener implements PluginMessageListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void process(Player player, byte[] message) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ public class SpawnEntityPacketListener implements PluginMessageListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void process(Player player, byte[] message) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,9 +10,11 @@ softdepend:
|
|||||||
- WorldGuard
|
- WorldGuard
|
||||||
- PlotSquared
|
- PlotSquared
|
||||||
permissions:
|
permissions:
|
||||||
axiom.*:
|
axiom.all:
|
||||||
description: Allows use of all default Axiom features
|
description: Allows use of all default Axiom features
|
||||||
default: op
|
default: op
|
||||||
|
children:
|
||||||
|
axiom.*: true
|
||||||
axiom.use:
|
axiom.use:
|
||||||
description: Allows basic use of axiom
|
description: Allows basic use of axiom
|
||||||
default: op
|
default: op
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren