mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-04-02 01:36:25 +02:00
chore: simplify OwnersIncludeFilter (don't construct owner list twice)
This commit is contained in:
parent
424806c5f4
commit
d9a46635fd
@ -23,17 +23,11 @@ import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
class OwnersIncludeFilter implements PlotFilter {
|
||||
|
||||
private final UUID owner;
|
||||
|
||||
OwnersIncludeFilter(final @NonNull UUID owner) {
|
||||
this.owner = owner;
|
||||
}
|
||||
record OwnersIncludeFilter(UUID owner) implements PlotFilter {
|
||||
|
||||
@Override
|
||||
public boolean accepts(final @NonNull Plot plot) {
|
||||
return plot.isBasePlot() && plot.getOwners().size() > 0 && plot.getOwners().contains(owner);
|
||||
return plot.isBasePlot() && plot.isOwner(owner);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user