From de462d2385894b3e78339f3da8bed462313faaaf Mon Sep 17 00:00:00 2001 From: Luck Date: Tue, 4 Oct 2016 16:58:54 +0100 Subject: [PATCH] Merge dummy implementations --- .../calculators/DefaultsProvider.java | 68 +------------------ .../inject/DummyPermissibleBase.java | 3 +- 2 files changed, 4 insertions(+), 67 deletions(-) diff --git a/bukkit/src/main/java/me/lucko/luckperms/calculators/DefaultsProvider.java b/bukkit/src/main/java/me/lucko/luckperms/calculators/DefaultsProvider.java index 5eb49e37..4c9d91d0 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/calculators/DefaultsProvider.java +++ b/bukkit/src/main/java/me/lucko/luckperms/calculators/DefaultsProvider.java @@ -24,14 +24,10 @@ package me.lucko.luckperms.calculators; import lombok.AllArgsConstructor; import me.lucko.luckperms.api.Tristate; +import me.lucko.luckperms.inject.DummyPermissibleBase; import org.bukkit.Bukkit; -import org.bukkit.permissions.Permissible; import org.bukkit.permissions.Permission; -import org.bukkit.permissions.PermissionAttachment; -import org.bukkit.permissions.PermissionAttachmentInfo; -import org.bukkit.plugin.Plugin; -import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.Set; @@ -105,73 +101,13 @@ public class DefaultsProvider { } @AllArgsConstructor - private static class DummyPermissible implements Permissible { + private static class DummyPermissible extends DummyPermissibleBase { private final Runnable onRefresh; @Override public void recalculatePermissions() { onRefresh.run(); } - - @Override - public Set getEffectivePermissions() { - return Collections.emptySet(); - } - - @Override - public boolean isPermissionSet(String name) { - return false; - } - - @Override - public boolean isPermissionSet(Permission perm) { - return false; - } - - @Override - public boolean hasPermission(String name) { - return false; - } - - @Override - public boolean hasPermission(Permission perm) { - return false; - } - - @Override - public PermissionAttachment addAttachment(Plugin plugin, String name, boolean value) { - return null; - } - - @Override - public PermissionAttachment addAttachment(Plugin plugin) { - return null; - } - - @Override - public PermissionAttachment addAttachment(Plugin plugin, String name, boolean value, int ticks) { - return null; - } - - @Override - public PermissionAttachment addAttachment(Plugin plugin, int ticks) { - return null; - } - - @Override - public void removeAttachment(PermissionAttachment attachment) { - - } - - @Override - public boolean isOp() { - return false; - } - - @Override - public void setOp(boolean value) { - - } } } diff --git a/bukkit/src/main/java/me/lucko/luckperms/inject/DummyPermissibleBase.java b/bukkit/src/main/java/me/lucko/luckperms/inject/DummyPermissibleBase.java index 11f8e249..a1a1c99e 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/inject/DummyPermissibleBase.java +++ b/bukkit/src/main/java/me/lucko/luckperms/inject/DummyPermissibleBase.java @@ -28,6 +28,7 @@ import org.bukkit.permissions.PermissionAttachment; import org.bukkit.permissions.PermissionAttachmentInfo; import org.bukkit.plugin.Plugin; +import java.util.Collections; import java.util.Set; public class DummyPermissibleBase extends PermissibleBase { @@ -102,6 +103,6 @@ public class DummyPermissibleBase extends PermissibleBase { @Override public Set getEffectivePermissions() { - return null; + return Collections.emptySet(); } }