mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 05:06:44 +01:00
fixes
This commit is contained in:
parent
c367dfa510
commit
eb35ba5fb0
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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";
|
||||
|
@ -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), "");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user