This commit is contained in:
dordsor21
2019-02-13 17:13:57 +00:00
parent 11c4a90cc9
commit 477e698f7e
14 changed files with 47 additions and 49 deletions

View File

@ -1,5 +1,3 @@
import org.ajoberstar.grgit.Grgit
dependencies {
testCompile 'junit:junit:4.12'
compile 'org.yaml:snakeyaml:1.23'

File diff suppressed because one or more lines are too long

View File

@ -11,7 +11,9 @@ import com.github.intellectualsites.plotsquared.plot.util.*;
import javax.annotation.Nullable;
import java.util.Set;
@CommandDeclaration(command = "auto", permission = "plots.auto", category = CommandCategory.CLAIMING, requiredType = RequiredType.NONE, description = "Claim the nearest plot", aliases = "a", usage = "/plot auto [length,width]")
@CommandDeclaration(command = "auto", permission = "plots.auto",
category = CommandCategory.CLAIMING, requiredType = RequiredType.NONE,
description = "Claim the nearest plot", aliases = "a", usage = "/plot auto [length,width]")
public class Auto extends SubCommand {
@Deprecated public static PlotId getNextPlotId(PlotId id, int step) {

View File

@ -10,7 +10,9 @@ import com.github.intellectualsites.plotsquared.plot.util.EconHandler;
import com.github.intellectualsites.plotsquared.plot.util.Permissions;
import com.github.intellectualsites.plotsquared.plot.util.TaskManager;
@CommandDeclaration(command = "claim", aliases = "c", description = "Claim the current plot you're standing on", category = CommandCategory.CLAIMING, requiredType = RequiredType.NONE, permission = "plots.claim", usage = "/plot claim")
@CommandDeclaration(command = "claim", aliases = "c",
description = "Claim the current plot you're standing on", category = CommandCategory.CLAIMING,
requiredType = RequiredType.NONE, permission = "plots.claim", usage = "/plot claim")
public class Claim extends SubCommand {
@Override public boolean onCommand(final PlotPlayer player, String[] args) {

View File

@ -13,8 +13,10 @@ import com.github.intellectualsites.plotsquared.plot.util.StringMan;
import java.util.List;
@CommandDeclaration(command = "inbox", description = "Review the comments for a plot", usage = "/plot inbox [inbox] [delete <index>|clear|page]", permission = "plots.inbox", category = CommandCategory.CHAT, requiredType = RequiredType.NONE)
public class Inbox extends SubCommand {
@CommandDeclaration(command = "inbox", description = "Review the comments for a plot",
usage = "/plot inbox [inbox] [delete <index>|clear|page]", permission = "plots.inbox",
category = CommandCategory.CHAT, requiredType = RequiredType.NONE) public class Inbox
extends SubCommand {
public void displayComments(PlotPlayer player, List<PlotComment> oldComments, int page) {
if (oldComments == null || oldComments.isEmpty()) {

View File

@ -18,8 +18,11 @@ import java.util.HashSet;
import java.util.Map.Entry;
import java.util.UUID;
@CommandDeclaration(usage = "/plot purge world:<world> area:<area> id:<id> owner:<owner> shared:<shared> unknown:[true|false]", command = "purge", permission = "plots.admin", description = "Purge all plots for a world", category = CommandCategory.ADMINISTRATION, requiredType = RequiredType.CONSOLE, confirmation = true)
public class Purge extends SubCommand {
@CommandDeclaration(
usage = "/plot purge world:<world> area:<area> id:<id> owner:<owner> shared:<shared> unknown:[true|false]",
command = "purge", permission = "plots.admin", description = "Purge all plots for a world",
category = CommandCategory.ADMINISTRATION, requiredType = RequiredType.CONSOLE,
confirmation = true) public class Purge extends SubCommand {
@Override public boolean onCommand(final PlotPlayer player, String[] args) {
if (args.length == 0) {

View File

@ -10,8 +10,10 @@ import com.github.intellectualsites.plotsquared.plot.flag.Flags;
import com.github.intellectualsites.plotsquared.plot.object.*;
import com.github.intellectualsites.plotsquared.plot.util.*;
import java.util.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map.Entry;
import java.util.UUID;
@CommandDeclaration(command = "rate", permission = "plots.rate", description = "Rate the plot",
usage = "/plot rate [#|next|purge]", aliases = "rt", category = CommandCategory.INFO,

View File

@ -27,22 +27,19 @@ public class PlotSettings {
* @deprecated Raw access
*/
@Deprecated public String alias = "";
private List<PlotComment> comments = null;
/**
* The ratings for a plot.
*
* @deprecated Raw access
*/
@Deprecated public HashMap<UUID, Integer> ratings;
/**
* Flags.
*
* @deprecated Raw access
*/
@Deprecated public HashMap<Flag<?>, Object> flags = new HashMap<>();
private List<PlotComment> comments = null;
/**
* Home Position.
*

View File

@ -240,8 +240,8 @@ public abstract class ChunkManager {
TaskManager.runTaskAsync(() -> {
for (ChunkLoc loc : chunks) {
String directory =
world + File.separator + "region" + File.separator + "r." + loc.x + "."
+ loc.z + ".mca";
world + File.separator + "region" + File.separator + "r." + loc.x + "." + loc.z
+ ".mca";
File file = new File(PlotSquared.get().IMP.getWorldContainer(), directory);
PlotSquared.log("&6 - Deleting file: " + file.getName() + " (max 1024 chunks)");
if (file.exists()) {

View File

@ -31,8 +31,7 @@ public class CommentManager {
if (value != null) {
int num = 0;
for (PlotComment comment : value) {
if (comment.timestamp > getTimestamp(player,
inbox.toString())) {
if (comment.timestamp > getTimestamp(player, inbox.toString())) {
num++;
}
}

View File

@ -15,12 +15,11 @@ import java.util.concurrent.ConcurrentHashMap;
public abstract class UUIDHandlerImplementation {
private final ConcurrentHashMap<String, PlotPlayer> players;
public final HashSet<UUID> unknown = new HashSet<>();
private final ConcurrentHashMap<String, PlotPlayer> players;
protected UUIDWrapper uuidWrapper;
private boolean cached = false;
private BiMap<StringWrapper, UUID> uuidMap =
HashBiMap.create(new HashMap<>());
private BiMap<StringWrapper, UUID> uuidMap = HashBiMap.create(new HashMap<>());
// private BiMap<UUID, StringWrapper> nameMap = uuidMap.inverse();
public UUIDHandlerImplementation(UUIDWrapper wrapper) {
@ -138,8 +137,8 @@ public abstract class UUIDHandlerImplementation {
TaskManager.runTaskAsync(() -> {
UUID offlineUpper = UUID.nameUUIDFromBytes(
("OfflinePlayer:" + name.value).getBytes(Charsets.UTF_8));
if (UUIDHandlerImplementation.this.unknown.contains(offlineUpper)
&& !offlineUpper.equals(uuid)) {
if (UUIDHandlerImplementation.this.unknown.contains(offlineUpper) && !offlineUpper
.equals(uuid)) {
UUIDHandlerImplementation.this.unknown.remove(offlineUpper);
Set<Plot> plots = PlotSquared.get().getPlotsAbs(offlineUpper);
if (!plots.isEmpty()) {