mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-25 22:56:45 +01:00
fixes
This commit is contained in:
parent
c367dfa510
commit
eb35ba5fb0
@ -182,7 +182,14 @@ public class PlayerFunctions {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static int getPlayerPlotCount(World world, Player plr) {
|
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?
|
* Has the plot changed since the last save cycle?
|
||||||
*/
|
*/
|
||||||
public boolean hasChanged = false;
|
public boolean hasChanged = false;
|
||||||
|
public boolean countsTowardsMax = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Primary constructor
|
* Primary constructor
|
||||||
|
@ -10,6 +10,8 @@ package com.intellectualcrafters.plot;
|
|||||||
|
|
||||||
import org.bukkit.block.Biome;
|
import org.bukkit.block.Biome;
|
||||||
|
|
||||||
|
import com.intellectualcrafters.plot.database.DBFunc;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
@ -97,7 +97,7 @@ public class Info extends SubCommand {
|
|||||||
|
|
||||||
// Unclaimed?
|
// Unclaimed?
|
||||||
if (!hasOwner && !containsEveryone && !trustedEveryone) {
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -162,7 +162,7 @@ public class Info extends SubCommand {
|
|||||||
String trusted = getPlayerList(plot.trusted);
|
String trusted = getPlayerList(plot.trusted);
|
||||||
String denied = getPlayerList(plot.denied);
|
String denied = getPlayerList(plot.denied);
|
||||||
String rating = String.format("%.1f", DBFunc.getRatings(plot));
|
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);
|
boolean build = player==null ? true : plot.hasRights(player);
|
||||||
|
|
||||||
String owner = "none";
|
String owner = "none";
|
||||||
|
@ -435,8 +435,13 @@ public class SQLManager extends AbstractDB {
|
|||||||
for (int i = 0; i < flags.length; i++) {
|
for (int i = 0; i < flags.length; i++) {
|
||||||
if (flags_string[i].contains(":")) {
|
if (flags_string[i].contains(":")) {
|
||||||
String[] split = flags_string[i].split(":");
|
String[] split = flags_string[i].split(":");
|
||||||
|
try {
|
||||||
flags[i] = new Flag(FlagManager.getFlag(split[0], true), split[1]);
|
flags[i] = new Flag(FlagManager.getFlag(split[0], true), split[1]);
|
||||||
}
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
// invalid flag... ignoring it for now.
|
||||||
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
flags[i] = new Flag(FlagManager.getFlag(flags_string[i], true), "");
|
flags[i] = new Flag(FlagManager.getFlag(flags_string[i], true), "");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user