mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-25 02:04:44 +02:00
Cleaning and Fix #1108
This commit is contained in:
@ -10,7 +10,6 @@ import com.intellectualcrafters.plot.util.Permissions;
|
||||
import com.intellectualcrafters.plot.util.UUIDHandler;
|
||||
import com.plotsquared.general.commands.CommandDeclaration;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
@ -27,16 +26,6 @@ import java.util.UUID;
|
||||
category = CommandCategory.TELEPORT)
|
||||
public class Visit extends SubCommand {
|
||||
|
||||
public List<Plot> getPlots(UUID uuid) {
|
||||
List<Plot> plots = new ArrayList<>();
|
||||
for (Plot p : PS.get().getPlots()) {
|
||||
if (p.hasOwner() && p.isOwner(uuid)) {
|
||||
plots.add(p);
|
||||
}
|
||||
}
|
||||
return plots;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(PlotPlayer player, String[] args) {
|
||||
if (args.length == 1 && args[0].contains(":")) {
|
||||
|
@ -5,11 +5,15 @@ import java.util.UUID;
|
||||
|
||||
public class PlotHandler {
|
||||
public static boolean sameOwners(final Plot plot1, final Plot plot2) {
|
||||
if ((plot1.owner == null) || (plot2.owner == null)) {
|
||||
if (plot1.owner == null || plot2.owner == null) {
|
||||
return false;
|
||||
}
|
||||
final Set<UUID> owners = plot1.getOwners();
|
||||
owners.retainAll(plot2.getOwners());
|
||||
return !owners.isEmpty();
|
||||
for (UUID owner : owners) {
|
||||
if (plot2.isOwner(owner)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user