mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-17 12:54:43 +02:00
Fixes
Progress towards #515 Fixes #512 Fixes #514 Fixes (possibly) #529 Fixes #535 Update to latest sponge
This commit is contained in:
@ -51,8 +51,7 @@ public class Home extends SubCommand {
|
||||
|
||||
@Override
|
||||
public boolean onCommand(final PlotPlayer plr, String[] args) {
|
||||
|
||||
final ArrayList<Plot> plots = PS.get().sortPlots(PS.get().getPlots(plr), SortType.CREATION_DATE, null);
|
||||
final ArrayList<Plot> plots = PS.get().sortPlotsByTemp(PS.get().getPlots(plr));//PS.get().sortPlots(PS.get().getPlots(plr), SortType.CREATION_DATE, null);
|
||||
if (plots.size() == 1) {
|
||||
MainUtil.teleportPlayer(plr, plr.getLocation(), plots.get(0));
|
||||
return true;
|
||||
|
@ -23,6 +23,7 @@ package com.intellectualcrafters.plot.commands;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.UUID;
|
||||
|
||||
@ -147,14 +148,17 @@ public class Rate extends SubCommand {
|
||||
}
|
||||
};
|
||||
if (plot.getSettings().ratings == null) {
|
||||
TaskManager.runTaskAsync(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
plot.getSettings().ratings = DBFunc.getRatings(plot);
|
||||
run.run();
|
||||
}
|
||||
});
|
||||
return true;
|
||||
if (!Settings.CACHE_RATINGS) {
|
||||
TaskManager.runTaskAsync(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
plot.getSettings().ratings = DBFunc.getRatings(plot);
|
||||
run.run();
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
plot.getSettings().ratings = new HashMap<UUID, Integer>();
|
||||
}
|
||||
run.run();
|
||||
return true;
|
||||
@ -196,14 +200,17 @@ public class Rate extends SubCommand {
|
||||
}
|
||||
};
|
||||
if (plot.getSettings().ratings == null) {
|
||||
TaskManager.runTaskAsync(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
plot.getSettings().ratings = DBFunc.getRatings(plot);
|
||||
run.run();
|
||||
}
|
||||
});
|
||||
return true;
|
||||
if (!Settings.CACHE_RATINGS) {
|
||||
TaskManager.runTaskAsync(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
plot.getSettings().ratings = DBFunc.getRatings(plot);
|
||||
run.run();
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
plot.getSettings().ratings = new HashMap<UUID, Integer>();
|
||||
}
|
||||
run.run();
|
||||
return true;
|
||||
|
@ -68,10 +68,10 @@ public class Visit extends SubCommand {
|
||||
UUID user = UUIDHandler.getCachedUUID(args[0], null);
|
||||
if (user != null ) {
|
||||
// do plots by username
|
||||
plots = PS.get().sortPlots(PS.get().getPlots(user), SortType.CREATION_DATE, null);
|
||||
plots = PS.get().sortPlotsByTemp(PS.get().getPlots(user));
|
||||
} else if (PS.get().isPlotWorld(args[0])) {
|
||||
// do plots by world
|
||||
plots = PS.get().sortPlots(PS.get().getPlotsInWorld(args[0]), SortType.CREATION_DATE, null);
|
||||
plots = PS.get().sortPlots(PS.get().getPlotsInWorld(args[0]), SortType.DISTANCE_FROM_ORIGIN, null);
|
||||
}
|
||||
else {
|
||||
Plot plot = MainUtil.getPlotFromString(plr, args[0], true);
|
||||
|
@ -138,7 +138,8 @@ public class list extends SubCommand {
|
||||
MainUtil.sendMessage(plr, C.NO_PERMISSION, "plots.list.mine");
|
||||
return false;
|
||||
}
|
||||
plots = new ArrayList<>(PS.get().getPlots(plr));
|
||||
sort = false;
|
||||
plots = PS.get().sortPlotsByTemp(PS.get().getPlots(plr));
|
||||
break;
|
||||
}
|
||||
case "shared": {
|
||||
@ -283,7 +284,8 @@ public class list extends SubCommand {
|
||||
MainUtil.sendMessage(plr, C.NO_PERMISSION, "plots.list.player");
|
||||
return false;
|
||||
}
|
||||
plots = new ArrayList<>(PS.get().getPlots(uuid));
|
||||
sort = false;
|
||||
plots = PS.get().sortPlotsByTemp(PS.get().getPlots(uuid));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user