This commit is contained in:
boy0001 2014-10-25 00:08:21 +11:00
parent c367dfa510
commit eb35ba5fb0
5 changed files with 19 additions and 4 deletions

View File

@ -182,7 +182,14 @@ public class PlayerFunctions {
* @return
*/
public static int getPlayerPlotCount(World world, Player plr) {
return getPlayerPlots(world, plr).size();
UUID uuid = plr.getUniqueId();
int count = 0;
for (Plot plot: PlotMain.getPlots(world).values()) {
if (plot.hasOwner() && plot.owner.equals(uuid) && plot.countsTowardsMax) {
count++;
}
}
return count;
}
/**

View File

@ -65,6 +65,7 @@ public class Plot implements Cloneable {
* Has the plot changed since the last save cycle?
*/
public boolean hasChanged = false;
public boolean countsTowardsMax = false;
/**
* Primary constructor

View File

@ -10,6 +10,8 @@ package com.intellectualcrafters.plot;
import org.bukkit.block.Biome;
import com.intellectualcrafters.plot.database.DBFunc;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;

View File

@ -97,7 +97,7 @@ public class Info extends SubCommand {
// Unclaimed?
if (!hasOwner && !containsEveryone && !trustedEveryone) {
PlayerFunctions.sendMessage(player, C.PLOT_INFO_UNCLAIMED, plot.id.x + ";" + plot.id.y);
PlayerFunctions.sendMessage(player, C.PLOT_INFO_UNCLAIMED, (plot.id.x + ";" + plot.id.y));
return true;
}
@ -162,7 +162,7 @@ public class Info extends SubCommand {
String trusted = getPlayerList(plot.trusted);
String denied = getPlayerList(plot.denied);
String rating = String.format("%.1f", DBFunc.getRatings(plot));
String flags = StringUtils.join(plot.settings.getFlags(), "").length() > 0 ? StringUtils.join(plot.settings.getFlags(), ",") : "none";
String flags = "&3"+ (StringUtils.join(plot.settings.getFlags(), "").length() > 0 ? StringUtils.join(plot.settings.getFlags(), "&7, &3") : "none");
boolean build = player==null ? true : plot.hasRights(player);
String owner = "none";

View File

@ -435,8 +435,13 @@ public class SQLManager extends AbstractDB {
for (int i = 0; i < flags.length; i++) {
if (flags_string[i].contains(":")) {
String[] split = flags_string[i].split(":");
try {
flags[i] = new Flag(FlagManager.getFlag(split[0], true), split[1]);
}
catch (Exception e) {
// invalid flag... ignoring it for now.
}
}
else {
flags[i] = new Flag(FlagManager.getFlag(flags_string[i], true), "");
}