This commit is contained in:
boy0001 2015-03-20 15:11:02 +11:00
parent fbaca34218
commit 0d75622196
23 changed files with 73 additions and 73 deletions

View File

@ -474,7 +474,7 @@ import com.intellectualcrafters.plot.uuid.UUIDWrapper;
final ArrayList<Plot> pPlots = new ArrayList<>(); final ArrayList<Plot> pPlots = new ArrayList<>();
for (final Plot plot : PlotSquared.getPlots(world.getName()).values()) { for (final Plot plot : PlotSquared.getPlots(world.getName()).values()) {
if (just_owner) { if (just_owner) {
if ((plot.owner_ != null) && (plot.owner_ == UUIDHandler.getUUID(BukkitUtil.getPlayer(plr)))) { if ((plot.owner != null) && (plot.owner == UUIDHandler.getUUID(BukkitUtil.getPlayer(plr)))) {
pPlots.add(plot); pPlots.add(plot);
} }
} else { } else {

View File

@ -193,7 +193,7 @@ public class Auto extends SubCommand {
if ((size_x == 1) && (size_z == 1)) { if ((size_x == 1) && (size_z == 1)) {
while (!br) { while (!br) {
final Plot plot = MainUtil.getPlot(worldname, getLastPlot(worldname)); final Plot plot = MainUtil.getPlot(worldname, getLastPlot(worldname));
if ((plot.owner_ == null)) { if ((plot.owner == null)) {
Claim.claimPlot(plr, plot, true, true); Claim.claimPlot(plr, plot, true, true);
br = true; br = true;
} }
@ -207,7 +207,7 @@ public class Auto extends SubCommand {
MainUtil.lastPlot.put(worldname, start); MainUtil.lastPlot.put(worldname, start);
if (lastPlot) { if (lastPlot) {
} }
if ((PlotSquared.getPlots(worldname).get(start) != null) && (PlotSquared.getPlots(worldname).get(start).owner_ != null)) { if ((PlotSquared.getPlots(worldname).get(start) != null) && (PlotSquared.getPlots(worldname).get(start).owner != null)) {
continue; continue;
} else { } else {
lastPlot = false; lastPlot = false;

View File

@ -98,8 +98,8 @@ public class Buy extends SubCommand {
} }
EconHandler.withdrawPlayer(plr, price); EconHandler.withdrawPlayer(plr, price);
sendMessage(plr, C.REMOVED_BALANCE, price + ""); sendMessage(plr, C.REMOVED_BALANCE, price + "");
EconHandler.depositPlayer(UUIDHandler.uuidWrapper.getOfflinePlayer(plot.owner_), initPrice); EconHandler.depositPlayer(UUIDHandler.uuidWrapper.getOfflinePlayer(plot.owner), initPrice);
final PlotPlayer owner = UUIDHandler.getPlayer(plot.owner_); final PlotPlayer owner = UUIDHandler.getPlayer(plot.owner);
if (owner != null) { if (owner != null) {
sendMessage(plr, C.PLOT_SOLD, plot.id + "", plr.getName(), initPrice + ""); sendMessage(plr, C.PLOT_SOLD, plot.id + "", plr.getName(), initPrice + "");
} }
@ -109,8 +109,8 @@ public class Buy extends SubCommand {
for (PlotId myId : MainUtil.getPlotSelectionIds(plot.id, top.id)) { for (PlotId myId : MainUtil.getPlotSelectionIds(plot.id, top.id)) {
Plot myPlot = MainUtil.getPlot(plot.world, myId); Plot myPlot = MainUtil.getPlot(plot.world, myId);
myPlot.owner_ = plr.getUUID(); myPlot.owner = plr.getUUID();
DBFunc.setOwner(plot, myPlot.owner_); DBFunc.setOwner(plot, myPlot.owner);
} }
MainUtil.sendMessage(plr, C.CLAIMED); MainUtil.sendMessage(plr, C.CLAIMED);
return true; return true;

View File

@ -62,7 +62,7 @@ public class Clear extends SubCommand {
Runnable runnable = new Runnable() { Runnable runnable = new Runnable() {
@Override @Override
public void run() { public void run() {
MainUtil.clear(world, plot, plot.owner_ == null, null); MainUtil.clear(world, plot, plot.owner == null, null);
PlotSquared.log("Plot " + plot.getId().toString() + " cleared."); PlotSquared.log("Plot " + plot.getId().toString() + " cleared.");
} }
}; };
@ -122,7 +122,7 @@ public class Clear extends SubCommand {
@Override @Override
public void run() { public void run() {
final long start = System.currentTimeMillis(); final long start = System.currentTimeMillis();
final boolean result = MainUtil.clearAsPlayer(plot, plot.owner_ == null, new Runnable() { final boolean result = MainUtil.clearAsPlayer(plot, plot.owner == null, new Runnable() {
@Override @Override
public void run() { public void run() {
MainUtil.sendMessage(plr, C.CLEARING_DONE, "" + (System.currentTimeMillis() - start)); MainUtil.sendMessage(plr, C.CLEARING_DONE, "" + (System.currentTimeMillis() - start));

View File

@ -129,9 +129,9 @@ public class Cluster extends SubCommand {
// Add any existing plots to the current cluster // Add any existing plots to the current cluster
for (final Plot plot : PlotSquared.getPlots(plr.getLocation().getWorld()).values()) { for (final Plot plot : PlotSquared.getPlots(plr.getLocation().getWorld()).values()) {
final PlotCluster current = ClusterManager.getCluster(plot); final PlotCluster current = ClusterManager.getCluster(plot);
if (cluster.equals(current) && !cluster.hasRights(plot.owner_)) { if (cluster.equals(current) && !cluster.hasRights(plot.owner)) {
cluster.invited.add(plot.owner_); cluster.invited.add(plot.owner);
DBFunc.setInvited(world, cluster, plot.owner_); DBFunc.setInvited(world, cluster, plot.owner);
} }
} }
if (!PlotSquared.isPlotWorld(world)) { if (!PlotSquared.isPlotWorld(world)) {

View File

@ -123,7 +123,7 @@ public class DebugClaimTest extends SubCommand {
} }
if (uuid != null) { if (uuid != null) {
MainUtil.sendMessage(null, " - &aFound plot: " + plot.id + " : " + line); MainUtil.sendMessage(null, " - &aFound plot: " + plot.id + " : " + line);
plot.owner_ = uuid; plot.owner = uuid;
plot.hasChanged = true; plot.hasChanged = true;
plots.add(plot); plots.add(plot);
} else { } else {

View File

@ -97,7 +97,7 @@ public class DebugExec extends SubCommand {
for (final Entry<Plot, Long> entry : ExpireManager.expiredPlots.get(args[1]).entrySet()) { for (final Entry<Plot, Long> entry : ExpireManager.expiredPlots.get(args[1]).entrySet()) {
final Plot plot = entry.getKey(); final Plot plot = entry.getKey();
final Long stamp = entry.getValue(); final Long stamp = entry.getValue();
MainUtil.sendMessage(null, " - " + plot.world + ";" + plot.id.x + ";" + plot.id.y + ";" + UUIDHandler.getName(plot.owner_) + " : " + stamp); MainUtil.sendMessage(null, " - " + plot.world + ";" + plot.id.x + ";" + plot.id.y + ";" + UUIDHandler.getName(plot.owner) + " : " + stamp);
} }
return true; return true;
} }

View File

@ -113,7 +113,7 @@ public class Info extends SubCommand {
return true; return true;
} }
String owner = "none"; String owner = "none";
if (plot.owner_ == null) { if (plot.owner == null) {
owner = "unowned"; owner = "unowned";
} }
else { else {
@ -173,7 +173,7 @@ public class Info extends SubCommand {
final String flags = "&6" + (StringUtils.join(FlagManager.getPlotFlags(plot), "").length() > 0 ? StringUtils.join(FlagManager.getPlotFlags(plot), "&7, &6") : "none"); final String flags = "&6" + (StringUtils.join(FlagManager.getPlotFlags(plot), "").length() > 0 ? StringUtils.join(FlagManager.getPlotFlags(plot), "&7, &6") : "none");
final boolean build = (player == null) || plot.isAdded(player.getUUID()); final boolean build = (player == null) || plot.isAdded(player.getUUID());
String owner = "none"; String owner = "none";
if (plot.owner_ == null) { if (plot.owner == null) {
owner = "unowned"; owner = "unowned";
} }
else { else {

View File

@ -138,10 +138,10 @@ public class Merge extends SubCommand {
boolean multiMerge = false; boolean multiMerge = false;
final HashSet<UUID> multiUUID = new HashSet<UUID>(); final HashSet<UUID> multiUUID = new HashSet<UUID>();
HashSet<PlotId> multiPlots = new HashSet<>(); HashSet<PlotId> multiPlots = new HashSet<>();
final UUID u1 = plot.owner_; final UUID u1 = plot.owner;
for (final PlotId myid : plots) { for (final PlotId myid : plots) {
final Plot myplot = PlotSquared.getPlots(world).get(myid); final Plot myplot = PlotSquared.getPlots(world).get(myid);
UUID u2 = myplot.owner_; UUID u2 = myplot.owner;
if (myplot == null || u2 == null) { if (myplot == null || u2 == null) {
MainUtil.sendMessage(plr, C.NO_PERM_MERGE.s().replaceAll("%plot%", myid.toString())); MainUtil.sendMessage(plr, C.NO_PERM_MERGE.s().replaceAll("%plot%", myid.toString()));
return false; return false;
@ -190,7 +190,7 @@ public class Merge extends SubCommand {
} }
MainUtil.sendMessage(plr, C.SUCCESS_MERGE); MainUtil.sendMessage(plr, C.SUCCESS_MERGE);
MainUtil.mergePlots(world, plots, true); MainUtil.mergePlots(world, plots, true);
MainUtil.setSign(UUIDHandler.getName(plot.owner_), plot); MainUtil.setSign(UUIDHandler.getName(plot.owner), plot);
MainUtil.update(loc); MainUtil.update(loc);
} }
MainUtil.sendMessage(accepter, C.MERGE_ACCEPTED); MainUtil.sendMessage(accepter, C.MERGE_ACCEPTED);
@ -219,7 +219,7 @@ public class Merge extends SubCommand {
} }
MainUtil.sendMessage(plr, C.SUCCESS_MERGE); MainUtil.sendMessage(plr, C.SUCCESS_MERGE);
MainUtil.mergePlots(world, plots, true); MainUtil.mergePlots(world, plots, true);
MainUtil.setSign(UUIDHandler.getName(plot.owner_), plot); MainUtil.setSign(UUIDHandler.getName(plot.owner), plot);
MainUtil.update(loc); MainUtil.update(loc);
return true; return true;
} }

View File

@ -120,8 +120,8 @@ public class Purge extends SubCommand {
final Collection<Plot> plots = PlotSquared.getPlots(worldname).values(); final Collection<Plot> plots = PlotSquared.getPlots(worldname).values();
final Set<PlotId> ids = new HashSet<>(); final Set<PlotId> ids = new HashSet<>();
for (final Plot plot : plots) { for (final Plot plot : plots) {
if (plot.owner_ != null) { if (plot.owner != null) {
final String name = UUIDHandler.getName(plot.owner_); final String name = UUIDHandler.getName(plot.owner);
if (name == null) { if (name == null) {
ids.add(plot.id); ids.add(plot.id);
} }
@ -138,7 +138,7 @@ public class Purge extends SubCommand {
final Collection<Plot> plots = PlotSquared.getPlots(worldname).values(); final Collection<Plot> plots = PlotSquared.getPlots(worldname).values();
final Set<PlotId> ids = new HashSet<>(); final Set<PlotId> ids = new HashSet<>();
for (final Plot plot : plots) { for (final Plot plot : plots) {
if (plot.owner_ == null) { if (plot.owner == null) {
ids.add(plot.id); ids.add(plot.id);
} }
} }

View File

@ -222,7 +222,7 @@ public class SchematicCmd extends SubCommand {
} }
final Plot plot = SchematicCmd.this.plots[SchematicCmd.this.counter]; final Plot plot = SchematicCmd.this.plots[SchematicCmd.this.counter];
final CompoundTag sch = SchematicHandler.manager.getCompoundTag(worldname, plot.id); final CompoundTag sch = SchematicHandler.manager.getCompoundTag(worldname, plot.id);
final String o = UUIDHandler.getName(plot.owner_); final String o = UUIDHandler.getName(plot.owner);
final String owner = o == null ? "unknown" : o; final String owner = o == null ? "unknown" : o;
if (sch == null) { if (sch == null) {
MainUtil.sendMessage(null, "&7 - Skipped plot &c" + plot.id); MainUtil.sendMessage(null, "&7 - Skipped plot &c" + plot.id);
@ -303,7 +303,7 @@ public class SchematicCmd extends SubCommand {
} }
final Plot plot = SchematicCmd.this.plots[SchematicCmd.this.counter]; final Plot plot = SchematicCmd.this.plots[SchematicCmd.this.counter];
final CompoundTag sch = SchematicHandler.manager.getCompoundTag(world, plot.id); final CompoundTag sch = SchematicHandler.manager.getCompoundTag(world, plot.id);
final String o = UUIDHandler.getName(plot.owner_); final String o = UUIDHandler.getName(plot.owner);
final String owner = o == null ? "unknown" : o; final String owner = o == null ? "unknown" : o;
if (sch == null) { if (sch == null) {
MainUtil.sendMessage(plr, "&7 - Skipped plot &c" + plot.id); MainUtil.sendMessage(plr, "&7 - Skipped plot &c" + plot.id);

View File

@ -52,7 +52,7 @@ public class SetOwner extends SubCommand {
public boolean execute(final PlotPlayer plr, final String... args) { public boolean execute(final PlotPlayer plr, final String... args) {
final Location loc = plr.getLocation(); final Location loc = plr.getLocation();
final Plot plot = MainUtil.getPlot(loc); final Plot plot = MainUtil.getPlot(loc);
if ((plot == null) || (plot.owner_ == null)) { if ((plot == null) || (plot.owner == null)) {
MainUtil.sendMessage(plr, C.NOT_IN_PLOT); MainUtil.sendMessage(plr, C.NOT_IN_PLOT);
return false; return false;
} }
@ -75,9 +75,9 @@ public class SetOwner extends SubCommand {
MainUtil.sendMessage(plr, C.INVALID_PLAYER, args[0]); MainUtil.sendMessage(plr, C.INVALID_PLAYER, args[0]);
return false; return false;
} }
current.owner_ = uuid; current.owner = uuid;
PlotSquared.updatePlot(current); PlotSquared.updatePlot(current);
DBFunc.setOwner(current, current.owner_); DBFunc.setOwner(current, current.owner);
} }
MainUtil.setSign(args[0], plot); MainUtil.setSign(args[0], plot);
MainUtil.sendMessage(plr, C.SET_OWNER); MainUtil.sendMessage(plr, C.SET_OWNER);

View File

@ -66,7 +66,7 @@ public class Swap extends SubCommand {
try { try {
plotid = new PlotId(Integer.parseInt(id.split(";")[0]), Integer.parseInt(id.split(";")[1])); plotid = new PlotId(Integer.parseInt(id.split(";")[0]), Integer.parseInt(id.split(";")[1]));
final Plot plot2 = PlotSquared.getPlots(world).get(plotid); final Plot plot2 = PlotSquared.getPlots(world).get(plotid);
if (((plot2 == null) || !plot2.hasOwner() || !(plot2.owner_.equals(plr.getUUID()))) && !Permissions.hasPermission(plr, "plots.admin.command.swap")) { if (((plot2 == null) || !plot2.hasOwner() || !(plot2.owner.equals(plr.getUUID()))) && !Permissions.hasPermission(plr, "plots.admin.command.swap")) {
MainUtil.sendMessage(plr, C.NO_PERM_MERGE, plotid.toString()); MainUtil.sendMessage(plr, C.NO_PERM_MERGE, plotid.toString());
return false; return false;
} }

View File

@ -124,14 +124,14 @@ public class Unlink extends SubCommand {
if (ly) { if (ly) {
manager.createRoadSouth(plotworld, p); manager.createRoadSouth(plotworld, p);
} }
MainUtil.setSign(UUIDHandler.getName(plot.owner_), plot); MainUtil.setSign(UUIDHandler.getName(plot.owner), plot);
} }
} }
manager.finishPlotUnlink(plotworld, ids); manager.finishPlotUnlink(plotworld, ids);
for (final PlotId id : ids) { for (final PlotId id : ids) {
final Plot myPlot = MainUtil.getPlot(world, id); final Plot myPlot = MainUtil.getPlot(world, id);
if (plot.hasOwner()) { if (plot.hasOwner()) {
final String name = UUIDHandler.getName(myPlot.owner_); final String name = UUIDHandler.getName(myPlot.owner);
if (name != null) { if (name != null) {
MainUtil.setSign(name, myPlot); MainUtil.setSign(name, myPlot);
} }

View File

@ -151,7 +151,7 @@ public class list extends SubCommand {
case "unowned": { case "unowned": {
plots = new HashSet<>(); plots = new HashSet<>();
for (Plot plot : PlotSquared.getPlots()) { for (Plot plot : PlotSquared.getPlots()) {
if (plot.owner_ == null) { if (plot.owner == null) {
plots.add(plot); plots.add(plot);
} }
} }
@ -160,10 +160,10 @@ public class list extends SubCommand {
case "unknown": { case "unknown": {
plots = new HashSet<>(); plots = new HashSet<>();
for (Plot plot : PlotSquared.getPlots()) { for (Plot plot : PlotSquared.getPlots()) {
if (plot.owner_ == null) { if (plot.owner == null) {
continue; continue;
} }
if (UUIDHandler.getName(plot.owner_) == null) { if (UUIDHandler.getName(plot.owner) == null) {
plots.add(plot); plots.add(plot);
} }
} }
@ -219,7 +219,7 @@ public class list extends SubCommand {
// This might work xD // This might work xD
for (int x = (page * 12); x < max; x++) { for (int x = (page * 12); x < max; x++) {
p = (Plot) plots.toArray()[x]; p = (Plot) plots.toArray()[x];
string.append(C.PLOT_LIST_ITEM_ORDERED.s().replaceAll("%in", x + 1 + "").replaceAll("%id", p.id.toString()).replaceAll("%world", p.world).replaceAll("%owner", getName(p.owner_))).append("\n"); string.append(C.PLOT_LIST_ITEM_ORDERED.s().replaceAll("%in", x + 1 + "").replaceAll("%id", p.id.toString()).replaceAll("%world", p.world).replaceAll("%owner", getName(p.owner))).append("\n");
} }
string.append(C.PLOT_LIST_FOOTER.s().replaceAll("%word%", "There is").replaceAll("%num%", plots.size() + "").replaceAll("%plot%", plots.size() == 1 ? "plot" : "plots")); string.append(C.PLOT_LIST_FOOTER.s().replaceAll("%word%", "There is").replaceAll("%num%", plots.size() + "").replaceAll("%plot%", plots.size() == 1 ? "plot" : "plots"));
MainUtil.sendMessage(player, string.toString()); MainUtil.sendMessage(player, string.toString());

View File

@ -263,7 +263,7 @@ public class SQLManager implements AbstractDB {
stmt.setInt((i * 4) + 1, plot.id.x); stmt.setInt((i * 4) + 1, plot.id.x);
stmt.setInt((i * 4) + 2, plot.id.y); stmt.setInt((i * 4) + 2, plot.id.y);
try { try {
stmt.setString((i * 4) + 3, plot.owner_.toString()); stmt.setString((i * 4) + 3, plot.owner.toString());
} catch (final Exception e) { } catch (final Exception e) {
stmt.setString((i * 4) + 3, DBFunc.everyone.toString()); stmt.setString((i * 4) + 3, DBFunc.everyone.toString());
} }
@ -299,7 +299,7 @@ public class SQLManager implements AbstractDB {
stmt.setInt((i * 6) + 2, plot.id.x); stmt.setInt((i * 6) + 2, plot.id.x);
stmt.setInt((i * 6) + 3, plot.id.y); stmt.setInt((i * 6) + 3, plot.id.y);
try { try {
stmt.setString((i * 6) + 4, plot.owner_.toString()); stmt.setString((i * 6) + 4, plot.owner.toString());
} catch (final Exception e1) { } catch (final Exception e1) {
stmt.setString((i * 6) + 4, DBFunc.everyone.toString()); stmt.setString((i * 6) + 4, DBFunc.everyone.toString());
} }
@ -344,7 +344,7 @@ public class SQLManager implements AbstractDB {
stmt = SQLManager.this.connection.prepareStatement(SQLManager.this.CREATE_PLOT); stmt = SQLManager.this.connection.prepareStatement(SQLManager.this.CREATE_PLOT);
stmt.setInt(1, plot.id.x); stmt.setInt(1, plot.id.x);
stmt.setInt(2, plot.id.y); stmt.setInt(2, plot.id.y);
stmt.setString(3, plot.owner_.toString()); stmt.setString(3, plot.owner.toString());
stmt.setString(4, plot.world); stmt.setString(4, plot.world);
stmt.executeUpdate(); stmt.executeUpdate();
stmt.close(); stmt.close();
@ -366,7 +366,7 @@ public class SQLManager implements AbstractDB {
stmt = SQLManager.this.connection.prepareStatement(SQLManager.this.CREATE_PLOT); stmt = SQLManager.this.connection.prepareStatement(SQLManager.this.CREATE_PLOT);
stmt.setInt(1, plot.id.x); stmt.setInt(1, plot.id.x);
stmt.setInt(2, plot.id.y); stmt.setInt(2, plot.id.y);
stmt.setString(3, plot.owner_.toString()); stmt.setString(3, plot.owner.toString());
stmt.setString(4, plot.world); stmt.setString(4, plot.world);
stmt.executeUpdate(); stmt.executeUpdate();
stmt.close(); stmt.close();

View File

@ -180,7 +180,7 @@ public class PlotListener {
} }
if ((booleanFlag(plot, "titles", Settings.TITLES)) && (C.TITLE_ENTERED_PLOT.s().length() > 2)) { if ((booleanFlag(plot, "titles", Settings.TITLES)) && (C.TITLE_ENTERED_PLOT.s().length() > 2)) {
final String sTitleMain = C.TITLE_ENTERED_PLOT.s().replaceAll("%x%", plot.id.x + "").replaceAll("%z%", plot.id.y + "").replaceAll("%world%", plot.world + ""); final String sTitleMain = C.TITLE_ENTERED_PLOT.s().replaceAll("%x%", plot.id.x + "").replaceAll("%z%", plot.id.y + "").replaceAll("%world%", plot.world + "");
final String sTitleSub = C.TITLE_ENTERED_PLOT_SUB.s().replaceFirst("%s", getName(plot.owner_)); final String sTitleSub = C.TITLE_ENTERED_PLOT_SUB.s().replaceFirst("%s", getName(plot.owner));
if (AbstractTitle.TITLE_CLASS != null) { if (AbstractTitle.TITLE_CLASS != null) {
AbstractTitle.TITLE_CLASS.sendTitle(player, sTitleMain, sTitleSub, ChatColor.valueOf(C.TITLE_ENTERED_PLOT_COLOR.s()), ChatColor.valueOf(C.TITLE_ENTERED_PLOT_SUB_COLOR.s())); AbstractTitle.TITLE_CLASS.sendTitle(player, sTitleMain, sTitleSub, ChatColor.valueOf(C.TITLE_ENTERED_PLOT_COLOR.s()), ChatColor.valueOf(C.TITLE_ENTERED_PLOT_SUB_COLOR.s()));
} }

View File

@ -43,7 +43,7 @@ public class InfoInventory implements InventoryHolder {
} }
public String getName(final UUID uuid) { public String getName(final UUID uuid) {
final String name = UUIDHandler.getName(this.plot.owner_); final String name = UUIDHandler.getName(this.plot.owner);
if (name == null) { if (name == null) {
return "unknown"; return "unknown";
} }
@ -52,7 +52,7 @@ public class InfoInventory implements InventoryHolder {
public InfoInventory build() { public InfoInventory build() {
final UUID uuid = UUIDHandler.getUUID(BukkitUtil.getPlayer(this.player)); final UUID uuid = UUIDHandler.getUUID(BukkitUtil.getPlayer(this.player));
final ItemStack generalInfo = getItem(Material.EMERALD, "&cPlot Info", "&cID: &6" + this.plot.getId().toString(), "&cOwner: &6" + getName(this.plot.owner_), "&cAlias: &6" + this.plot.settings.getAlias(), "&cBiome: &6" + this.plot.settings.getBiome().toString().replaceAll("_", "").toLowerCase(), "&cCan Build: &6" + this.plot.isAdded(uuid), "&cIs Denied: &6" + this.plot.isDenied(uuid)); final ItemStack generalInfo = getItem(Material.EMERALD, "&cPlot Info", "&cID: &6" + this.plot.getId().toString(), "&cOwner: &6" + getName(this.plot.owner), "&cAlias: &6" + this.plot.settings.getAlias(), "&cBiome: &6" + this.plot.settings.getBiome().toString().replaceAll("_", "").toLowerCase(), "&cCan Build: &6" + this.plot.isAdded(uuid), "&cIs Denied: &6" + this.plot.isDenied(uuid));
final ItemStack helpers = getItem(Material.EMERALD, "&cHelpers", "&cAmount: &6" + this.plot.helpers.size(), "&8Click to view a list of the plot helpers"); final ItemStack helpers = getItem(Material.EMERALD, "&cHelpers", "&cAmount: &6" + this.plot.helpers.size(), "&8Click to view a list of the plot helpers");
final ItemStack trusted = getItem(Material.EMERALD, "&cTrusted", "&cAmount: &6" + this.plot.trusted.size(), "&8Click to view a list of trusted players"); final ItemStack trusted = getItem(Material.EMERALD, "&cTrusted", "&cAmount: &6" + this.plot.trusted.size(), "&8Click to view a list of trusted players");
final ItemStack denied = getItem(Material.EMERALD, "&cDenied", "&cAmount: &6" + this.plot.denied.size(), "&8Click to view a list of denied players"); final ItemStack denied = getItem(Material.EMERALD, "&cDenied", "&cAmount: &6" + this.plot.denied.size(), "&8Click to view a list of denied players");

View File

@ -48,7 +48,7 @@ public class Plot implements Cloneable {
/** /**
* plot owner * plot owner
*/ */
public UUID owner_; public UUID owner;
/** /**
* Deny Entry * Deny Entry
*/ */
@ -90,8 +90,8 @@ public class Plot implements Cloneable {
public Plot(final PlotId id, final UUID owner, final ArrayList<UUID> helpers, final ArrayList<UUID> denied, final String world) { public Plot(final PlotId id, final UUID owner, final ArrayList<UUID> helpers, final ArrayList<UUID> denied, final String world) {
this.id = id; this.id = id;
this.settings = new PlotSettings(this); this.settings = new PlotSettings(this);
this.owner_ = owner; this.owner = owner;
this.deny_entry = this.owner_ == null; this.deny_entry = this.owner == null;
this.helpers = helpers; this.helpers = helpers;
this.denied = denied; this.denied = denied;
this.trusted = new ArrayList<>(); this.trusted = new ArrayList<>();
@ -113,8 +113,8 @@ public class Plot implements Cloneable {
public Plot(final PlotId id, final UUID owner, final ArrayList<UUID> helpers, final ArrayList<UUID> trusted, final ArrayList<UUID> denied, final String alias, final BlockLoc position, final Set<Flag> flags, final String world, final boolean[] merged) { public Plot(final PlotId id, final UUID owner, final ArrayList<UUID> helpers, final ArrayList<UUID> trusted, final ArrayList<UUID> denied, final String alias, final BlockLoc position, final Set<Flag> flags, final String world, final boolean[] merged) {
this.id = id; this.id = id;
this.settings = new PlotSettings(this); this.settings = new PlotSettings(this);
this.owner_ = owner; this.owner = owner;
this.deny_entry = this.owner_ != null; this.deny_entry = this.owner != null;
this.trusted = trusted; this.trusted = trusted;
this.helpers = helpers; this.helpers = helpers;
this.denied = denied; this.denied = denied;
@ -136,7 +136,7 @@ public class Plot implements Cloneable {
* @return false if there is no owner * @return false if there is no owner
*/ */
public boolean hasOwner() { public boolean hasOwner() {
return this.owner_ != null; return this.owner != null;
} }
public boolean isOwner(UUID uuid) { public boolean isOwner(UUID uuid) {
@ -205,7 +205,7 @@ public class Plot implements Cloneable {
public Object clone() throws CloneNotSupportedException { public Object clone() throws CloneNotSupportedException {
final Plot p = (Plot) super.clone(); final Plot p = (Plot) super.clone();
if (!p.equals(this) || (p != this)) { if (!p.equals(this) || (p != this)) {
return new Plot(this.id, this.owner_, this.helpers, this.trusted, this.denied, this.settings.getAlias(), this.settings.getPosition(), this.settings.flags, this.world, this.settings.getMerged()); return new Plot(this.id, this.owner, this.helpers, this.trusted, this.denied, this.settings.getAlias(), this.settings.getPosition(), this.settings.flags, this.world, this.settings.getMerged());
} }
return p; return p;
} }

View File

@ -11,7 +11,7 @@ import com.intellectualcrafters.plot.util.bukkit.UUIDHandler;
public class PlotHandler { public class PlotHandler {
public static HashSet<UUID> getOwners(Plot plot) { public static HashSet<UUID> getOwners(Plot plot) {
if (plot.owner_ == null) { if (plot.owner == null) {
return new HashSet<UUID>(); return new HashSet<UUID>();
} }
if (plot.settings.isMerged()) { if (plot.settings.isMerged()) {
@ -19,42 +19,42 @@ public class PlotHandler {
Plot top = MainUtil.getTopPlot(plot); Plot top = MainUtil.getTopPlot(plot);
ArrayList<PlotId> ids = MainUtil.getPlotSelectionIds(plot.id, top.id); ArrayList<PlotId> ids = MainUtil.getPlotSelectionIds(plot.id, top.id);
for (PlotId id : ids) { for (PlotId id : ids) {
UUID owner = MainUtil.getPlot(plot.world, id).owner_; UUID owner = MainUtil.getPlot(plot.world, id).owner;
if (owner != null) { if (owner != null) {
owners.add(owner); owners.add(owner);
} }
} }
return owners; return owners;
} }
return new HashSet<>(Arrays.asList(plot.owner_)); return new HashSet<>(Arrays.asList(plot.owner));
} }
public static boolean isOwner(Plot plot, UUID uuid) { public static boolean isOwner(Plot plot, UUID uuid) {
if (plot.owner_ == null) { if (plot.owner == null) {
return false; return false;
} }
if (plot.settings.isMerged()) { if (plot.settings.isMerged()) {
Plot top = MainUtil.getTopPlot(plot); Plot top = MainUtil.getTopPlot(plot);
ArrayList<PlotId> ids = MainUtil.getPlotSelectionIds(plot.id, top.id); ArrayList<PlotId> ids = MainUtil.getPlotSelectionIds(plot.id, top.id);
for (PlotId id : ids) { for (PlotId id : ids) {
UUID owner = MainUtil.getPlot(plot.world, id).owner_; UUID owner = MainUtil.getPlot(plot.world, id).owner;
if (owner != null && owner.equals(uuid)) { if (owner != null && owner.equals(uuid)) {
return true; return true;
} }
} }
} }
return plot.owner_.equals(uuid); return plot.owner.equals(uuid);
} }
public static boolean isOnline(Plot plot) { public static boolean isOnline(Plot plot) {
if (plot.owner_ == null) { if (plot.owner == null) {
return false; return false;
} }
if (plot.settings.isMerged()) { if (plot.settings.isMerged()) {
Plot top = MainUtil.getTopPlot(plot); Plot top = MainUtil.getTopPlot(plot);
ArrayList<PlotId> ids = MainUtil.getPlotSelectionIds(plot.id, top.id); ArrayList<PlotId> ids = MainUtil.getPlotSelectionIds(plot.id, top.id);
for (PlotId id : ids) { for (PlotId id : ids) {
UUID owner = MainUtil.getPlot(plot.world, id).owner_; UUID owner = MainUtil.getPlot(plot.world, id).owner;
if (owner != null) { if (owner != null) {
if (UUIDHandler.getPlayer(owner) != null) { if (UUIDHandler.getPlayer(owner) != null) {
return true; return true;
@ -63,11 +63,11 @@ public class PlotHandler {
} }
return false; return false;
} }
return UUIDHandler.getPlayer(plot.owner_) != null; return UUIDHandler.getPlayer(plot.owner) != null;
} }
public static boolean sameOwners(Plot plot1, Plot plot2) { public static boolean sameOwners(Plot plot1, Plot plot2) {
if (plot1.owner_ == null || plot2.owner_ == null) { if (plot1.owner == null || plot2.owner == null) {
return false; return false;
} }
HashSet<UUID> owners = getOwners(plot1); HashSet<UUID> owners = getOwners(plot1);
@ -76,7 +76,7 @@ public class PlotHandler {
} }
public static boolean isAdded(Plot plot, final UUID uuid) { public static boolean isAdded(Plot plot, final UUID uuid) {
if (plot.owner_ == null) { if (plot.owner == null) {
return false; return false;
} }
if (plot.denied.contains(uuid)) { if (plot.denied.contains(uuid)) {

View File

@ -116,7 +116,7 @@ public class ExpireManager {
PlotSquared.log("&cDeleted expired plot: " + plot.id); PlotSquared.log("&cDeleted expired plot: " + plot.id);
PlotSquared.log("&3 - World: " + plot.world); PlotSquared.log("&3 - World: " + plot.world);
if (plot.hasOwner()) { if (plot.hasOwner()) {
PlotSquared.log("&3 - Owner: " + UUIDHandler.getName(plot.owner_)); PlotSquared.log("&3 - Owner: " + UUIDHandler.getName(plot.owner));
} else { } else {
PlotSquared.log("&3 - Owner: Unowned"); PlotSquared.log("&3 - Owner: Unowned");
} }
@ -159,7 +159,7 @@ public class ExpireManager {
final HashMap<UUID, Long> remove = new HashMap<>(); final HashMap<UUID, Long> remove = new HashMap<>();
final Set<UUID> keep = new HashSet<>(); final Set<UUID> keep = new HashSet<>();
for (final Plot plot : plots) { for (final Plot plot : plots) {
final UUID uuid = plot.owner_; final UUID uuid = plot.owner;
if ((uuid == null) || remove.containsKey(uuid)) { if ((uuid == null) || remove.containsKey(uuid)) {
Long stamp; Long stamp;
if (uuid == null) { if (uuid == null) {

View File

@ -90,7 +90,7 @@ public class MainUtil {
final UUID uuid = plr.getUUID(); final UUID uuid = plr.getUUID();
int count = 0; int count = 0;
for (final Plot plot : PlotSquared.getPlots(world).values()) { for (final Plot plot : PlotSquared.getPlots(world).values()) {
if (plot.hasOwner() && plot.owner_.equals(uuid) && plot.countsTowardsMax) { if (plot.hasOwner() && plot.owner.equals(uuid) && plot.countsTowardsMax) {
count++; count++;
} }
} }
@ -369,10 +369,10 @@ public class MainUtil {
if (plot == null) { if (plot == null) {
return; return;
} }
if (plot.owner_ == null) { if (plot.owner == null) {
return; return;
} }
if (!plot.owner_.equals(uuid)) { if (!plot.owner.equals(uuid)) {
return; return;
} }
ArrayList<PlotId> plots; ArrayList<PlotId> plots;
@ -427,7 +427,7 @@ public class MainUtil {
final PlotId id_max = plots.get(plots.size() - 1); final PlotId id_max = plots.get(plots.size() - 1);
for (final PlotId myid : plots) { for (final PlotId myid : plots) {
final Plot myplot = PlotSquared.getPlots(world).get(myid); final Plot myplot = PlotSquared.getPlots(world).get(myid);
if ((myplot == null) || myplot.owner_ == null || !(myplot.owner_.equals(uuid))) { if ((myplot == null) || myplot.owner == null || !(myplot.owner.equals(uuid))) {
return false; return false;
} }
final PlotId top = getTopPlot(myplot).id; final PlotId top = getTopPlot(myplot).id;
@ -770,7 +770,7 @@ public class MainUtil {
for (int y = pos1.y; y <= pos2.y; y++) { for (int y = pos1.y; y <= pos2.y; y++) {
final PlotId id = new PlotId(x, y); final PlotId id = new PlotId(x, y);
if (PlotSquared.getPlots(world).get(id) != null) { if (PlotSquared.getPlots(world).get(id) != null) {
if (PlotSquared.getPlots(world).get(id).owner_ != null) { if (PlotSquared.getPlots(world).get(id).owner != null) {
return false; return false;
} }
} }
@ -782,7 +782,7 @@ public class MainUtil {
public static boolean swap(final String world, final PlotId current, final PlotId newPlot, final Runnable whenDone) { public static boolean swap(final String world, final PlotId current, final PlotId newPlot, final Runnable whenDone) {
Plot p1 = PlotSquared.getPlots(world).get(current); Plot p1 = PlotSquared.getPlots(world).get(current);
Plot p2 = PlotSquared.getPlots(world).get(newPlot); Plot p2 = PlotSquared.getPlots(world).get(newPlot);
if (p1==null || p2 == null || p1.owner_ == null || !p1.owner_.equals(p2.owner_)) { if (p1==null || p2 == null || p1.owner == null || !p1.owner.equals(p2.owner)) {
return false; return false;
} }
// Swap blocks // Swap blocks
@ -807,7 +807,7 @@ public class MainUtil {
final com.intellectualcrafters.plot.object.Location bot2 = MainUtil.getPlotBottomLoc(world, newPlot); final com.intellectualcrafters.plot.object.Location bot2 = MainUtil.getPlotBottomLoc(world, newPlot);
final Location top = MainUtil.getPlotTopLoc(world, current); final Location top = MainUtil.getPlotTopLoc(world, current);
final Plot currentPlot = MainUtil.getPlot(world, current); final Plot currentPlot = MainUtil.getPlot(world, current);
if (currentPlot.owner_ == null) { if (currentPlot.owner == null) {
TaskManager.runTaskLater(whenDone, 1); TaskManager.runTaskLater(whenDone, 1);
return false; return false;
} }
@ -845,7 +845,7 @@ public class MainUtil {
final com.intellectualcrafters.plot.object.Location bot2 = MainUtil.getPlotBottomLoc(world, newPlot); final com.intellectualcrafters.plot.object.Location bot2 = MainUtil.getPlotBottomLoc(world, newPlot);
final Location top = MainUtil.getPlotTopLoc(world, current); final Location top = MainUtil.getPlotTopLoc(world, current);
final Plot currentPlot = MainUtil.getPlot(world, current); final Plot currentPlot = MainUtil.getPlot(world, current);
if (currentPlot.owner_ == null) { if (currentPlot.owner == null) {
TaskManager.runTaskLater(whenDone, 1); TaskManager.runTaskLater(whenDone, 1);
return false; return false;
} }
@ -862,7 +862,7 @@ public class MainUtil {
for (final PlotId id : selection) { for (final PlotId id : selection) {
int x = id.x + offset_x; int x = id.x + offset_x;
int y = id.y + offset_y; int y = id.y + offset_y;
Plot plot = createPlotAbs(currentPlot.owner_, getPlot(world, new PlotId(x, y))); Plot plot = createPlotAbs(currentPlot.owner, getPlot(world, new PlotId(x, y)));
if (currentPlot.settings.flags != null && currentPlot.settings.flags.size() > 0) { if (currentPlot.settings.flags != null && currentPlot.settings.flags.size() > 0) {
plot.settings.flags = currentPlot.settings.flags; plot.settings.flags = currentPlot.settings.flags;
DBFunc.setFlags(world, plot, currentPlot.settings.flags); DBFunc.setFlags(world, plot, currentPlot.settings.flags);

View File

@ -115,12 +115,12 @@ public class BukkitChunkManager extends ChunkManager {
final Location bot = new Location(world, x1, 0, z1); final Location bot = new Location(world, x1, 0, z1);
Plot plot; Plot plot;
plot = MainUtil.getPlot(bot); plot = MainUtil.getPlot(bot);
if ((plot != null) && (plot.owner_ != null)) { if ((plot != null) && (plot.owner != null)) {
return plot; return plot;
} }
final Location top = new Location(world, x2, 0, z2); final Location top = new Location(world, x2, 0, z2);
plot = MainUtil.getPlot(top); plot = MainUtil.getPlot(top);
if ((plot != null) && (plot.owner_ != null)) { if ((plot != null) && (plot.owner != null)) {
return plot; return plot;
} }
return null; return null;