diff --git a/nukkit/src/main/java/me/lucko/luckperms/nukkit/inject/dummy/DummyPermissibleBase.java b/nukkit/src/main/java/me/lucko/luckperms/nukkit/inject/dummy/DummyPermissibleBase.java index f9c3c4b44..c9be8cc0d 100644 --- a/nukkit/src/main/java/me/lucko/luckperms/nukkit/inject/dummy/DummyPermissibleBase.java +++ b/nukkit/src/main/java/me/lucko/luckperms/nukkit/inject/dummy/DummyPermissibleBase.java @@ -25,8 +25,6 @@ package me.lucko.luckperms.nukkit.inject.dummy; -import org.checkerframework.checker.nullness.qual.NonNull; - import cn.nukkit.permission.PermissibleBase; import cn.nukkit.permission.Permission; import cn.nukkit.permission.PermissionAttachment; @@ -34,14 +32,11 @@ import cn.nukkit.permission.PermissionAttachmentInfo; import cn.nukkit.plugin.Plugin; import java.lang.reflect.Field; -import java.util.AbstractList; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashMap; -import java.util.List; import java.util.Map; -import java.util.RandomAccess; import java.util.function.BiFunction; import java.util.function.Function; @@ -119,31 +114,4 @@ public class DummyPermissibleBase extends PermissibleBase { @Override public void clearPermissions() {} @Override public Map getEffectivePermissions() { return Collections.emptyMap(); } - // empty list impl that doesn't throw an exception on calls to #add - private static final List EMPTY_LIST = new EmptyList<>(); - private static class EmptyList extends AbstractList implements RandomAccess { - - @Override - public boolean add(E e) { - // do nothing, but don't throw an exception - return true; - } - - @Override - public boolean addAll(@NonNull Collection c) { - // do nothing - return true; - } - - @Override - public E get(int index) { - throw new IndexOutOfBoundsException(); - } - - @Override - public int size() { - return 0; - } - } - }