Fixes #768 (Plot clearing with given plot id)
This commit is contained in:
Jesse Boyd 2015-12-03 02:42:50 +11:00
parent 82ccca8f63
commit f102b2b448
8 changed files with 221 additions and 127 deletions

View File

@ -8,7 +8,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties> </properties>
<artifactId>PlotSquared</artifactId> <artifactId>PlotSquared</artifactId>
<version>3.2.21</version> <version>3.2.22</version>
<name>PlotSquared</name> <name>PlotSquared</name>
<packaging>jar</packaging> <packaging>jar</packaging>
<build> <build>

View File

@ -22,20 +22,17 @@ package com.intellectualcrafters.plot.commands;
import java.util.Set; import java.util.Set;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.config.Settings; import com.intellectualcrafters.plot.config.Settings;
import com.intellectualcrafters.plot.flag.FlagManager; import com.intellectualcrafters.plot.flag.FlagManager;
import com.intellectualcrafters.plot.object.Location; import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotId;
import com.intellectualcrafters.plot.object.PlotPlayer; import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.CmdConfirm; import com.intellectualcrafters.plot.util.CmdConfirm;
import com.intellectualcrafters.plot.util.MainUtil; import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.Permissions; import com.intellectualcrafters.plot.util.Permissions;
import com.intellectualcrafters.plot.util.SetBlockQueue; import com.intellectualcrafters.plot.util.SetBlockQueue;
import com.intellectualcrafters.plot.util.TaskManager; import com.intellectualcrafters.plot.util.TaskManager;
import com.intellectualcrafters.plot.util.UUIDHandler;
import com.plotsquared.general.commands.CommandDeclaration; import com.plotsquared.general.commands.CommandDeclaration;
@CommandDeclaration(command = "clear", description = "Clear a plot", permission = "plots.clear", category = CommandCategory.ACTIONS, usage = "/plot clear [id]") @CommandDeclaration(command = "clear", description = "Clear a plot", permission = "plots.clear", category = CommandCategory.ACTIONS, usage = "/plot clear [id]")
@ -45,34 +42,34 @@ public class Clear extends SubCommand {
public boolean onCommand(final PlotPlayer plr, final String... args) { public boolean onCommand(final PlotPlayer plr, final String... args) {
final Location loc = plr.getLocation(); final Location loc = plr.getLocation();
final Plot plot; final Plot plot;
if (args.length == 2) { if (args.length == 1) {
final PlotId id = PlotId.fromString(args[0]); if (args[0].equalsIgnoreCase("mine")) {
if (id == null) { Set<Plot> plots = plr.getPlots();
if (args[1].equalsIgnoreCase("mine")) { if (plots.size() > 0) {
final Set<Plot> plots = PS.get().getPlots(plr);
if (plots.size() == 0) {
MainUtil.sendMessage(plr, C.NO_PLOTS);
return false;
}
plot = plots.iterator().next(); plot = plots.iterator().next();
} else { } else {
MainUtil.sendMessage(plr, C.COMMAND_SYNTAX, "/plot clear [X;Z|mine]"); MainUtil.sendMessage(plr, C.NO_PLOTS);
return false; return false;
} }
} else { } else {
plot = MainUtil.getPlotAbs(loc.getWorld(), id); plot = MainUtil.getPlotFromString(plr, args[0], true);
}
if (plot == null) {
MainUtil.sendMessage(plr, C.COMMAND_SYNTAX, "/plot clear [X;Z|mine]");
return false;
}
} else if (args.length == 0) {
plot = MainUtil.getPlotAbs(loc);
if (plot == null) {
MainUtil.sendMessage(plr, C.COMMAND_SYNTAX, "/plot clear [X;Z|mine]");
C.NOT_IN_PLOT.send(plr);
return false;
} }
} else { } else {
plot = MainUtil.getPlotAbs(loc);
}
if (plot == null) {
MainUtil.sendMessage(plr, C.COMMAND_SYNTAX, "/plot clear [X;Z|mine]"); MainUtil.sendMessage(plr, C.COMMAND_SYNTAX, "/plot clear [X;Z|mine]");
return sendMessage(plr, C.NOT_IN_PLOT); return false;
} }
// if (!MainUtil.getTopPlot(plot).equals(MainUtil.getBottomPlot(plot))) { if ((!plot.hasOwner() || !plot.isOwner(plr.getUUID())) && !Permissions.hasPermission(plr, "plots.admin.command.clear")) {
// return sendMessage(plr, C.UNLINK_REQUIRED);
// }
if (((plot == null) || !plot.hasOwner() || !plot.isOwner(plr.getUUID())) && !Permissions.hasPermission(plr, "plots.admin.command.clear")) {
return sendMessage(plr, C.NO_PLOT_PERMS); return sendMessage(plr, C.NO_PLOT_PERMS);
} }
if (plot.getRunning() != 0) { if (plot.getRunning() != 0) {

View File

@ -26,7 +26,6 @@ import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotPlayer; import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.MainUtil; import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.Permissions; import com.intellectualcrafters.plot.util.Permissions;
import com.plotsquared.general.commands.Argument;
import com.plotsquared.general.commands.CommandDeclaration; import com.plotsquared.general.commands.CommandDeclaration;
@CommandDeclaration( @CommandDeclaration(
@ -39,10 +38,6 @@ usage = "/plot copy <X;Z>",
requiredType = RequiredType.NONE) requiredType = RequiredType.NONE)
public class Copy extends SubCommand { public class Copy extends SubCommand {
public Copy() {
requiredArguments = new Argument[] { Argument.PlotID };
}
@Override @Override
public boolean onCommand(final PlotPlayer plr, final String[] args) { public boolean onCommand(final PlotPlayer plr, final String[] args) {
final Location loc = plr.getLocation(); final Location loc = plr.getLocation();

View File

@ -26,12 +26,11 @@ import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.config.Settings; import com.intellectualcrafters.plot.config.Settings;
import com.intellectualcrafters.plot.object.ConsolePlayer; import com.intellectualcrafters.plot.object.ConsolePlayer;
import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotId;
import com.intellectualcrafters.plot.object.PlotPlayer; import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.MainUtil; import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.MathMan; import com.intellectualcrafters.plot.util.MathMan;
@ -205,65 +204,84 @@ public class MainCommand extends CommandManager<PlotPlayer> {
} }
public static boolean onCommand(final PlotPlayer player, final String cmd, String... args) { public static boolean onCommand(final PlotPlayer player, final String cmd, String... args) {
// Clear perm caching //
player.deleteMeta("perm");
////////////////////////
int help_index = -1; int help_index = -1;
String category = null; String category = null;
if (args.length == 0) { Location loc = null;
help_index = 0; switch (args.length) {
} else if (StringMan.isEqualIgnoreCaseToAny(args[0], "he", "help", "?")) { case 0: {
help_index = 0; help_index = 0;
switch (args.length) { break;
case 3: { }
category = args[1]; case 1: {
if (MathMan.isInteger(args[2])) { if (MathMan.isInteger(args[0])) {
try { try {
help_index = Integer.parseInt(args[2]); help_index = Integer.parseInt(args[args.length - 1]);
} catch (final NumberFormatException e) { } catch (final NumberFormatException e) {}
help_index = 1;
}
}
break;
}
case 2: {
if (MathMan.isInteger(args[1])) {
category = null;
try {
help_index = Integer.parseInt(args[1]);
} catch (final NumberFormatException e) {
help_index = 1;
}
} else {
help_index = 1;
category = args[1];
}
break; break;
} }
} }
} else if ((args.length == 1) && MathMan.isInteger(args[args.length - 1])) { default: {
try { switch (args[0].toLowerCase()) {
help_index = Integer.parseInt(args[args.length - 1]); case "he":
} catch (final NumberFormatException e) {} case "help":
} else if (ConsolePlayer.isConsole(player) && (args.length >= 2)) { case "?": {
final String[] split = args[0].split(";"); switch (args.length) {
String world; case 1: {
PlotId id; help_index = 0;
if (split.length == 2) { break;
world = player.getLocation().getWorld(); }
id = PlotId.fromString(split[0] + ";" + split[1]); case 2: {
} else if (split.length == 3) { if (MathMan.isInteger(args[1])) {
world = split[0]; category = null;
id = PlotId.fromString(split[1] + ";" + split[2]); try {
} else { help_index = Integer.parseInt(args[1]);
id = null; } catch (final NumberFormatException e) {
world = null; help_index = 1;
} }
if ((id != null) && PS.get().isPlotWorld(world)) { } else {
final Plot plot = MainUtil.getPlotAbs(world, id); help_index = 1;
if (plot != null) { category = args[1];
player.teleport(plot.getBottomAbs()); }
args = Arrays.copyOfRange(args, 1, args.length); break;
}
case 3: {
category = args[1];
if (MathMan.isInteger(args[2])) {
try {
help_index = Integer.parseInt(args[2]);
} catch (final NumberFormatException e) {
help_index = 1;
}
}
break;
}
default: {
C.COMMAND_SYNTAX.send(player, "/" + cmd + "? [#|<term>|category [#]]");
return true;
}
}
break;
}
default: {
if (args.length >= 2) {
String world = player.getLocation().getWorld();
Plot plot = Plot.fromString(world, args[0]);
if (plot == null) {
break;
}
if (!ConsolePlayer.isConsole(player) && (!plot.world.equals(world) || plot.isDenied(player.getUUID())) && !Permissions.hasPermission(player, C.PERMISSION_ADMIN)) {
break;
}
loc = (Location) player.getMeta("location");
player.setMeta("location", plot.getBottomAbs());
args = Arrays.copyOfRange(args, 1, args.length);
}
}
} }
} }
} }
if (help_index != -1) { if (help_index != -1) {
displayHelp(player, category, help_index, cmd); displayHelp(player, category, help_index, cmd);
@ -274,6 +292,9 @@ public class MainCommand extends CommandManager<PlotPlayer> {
} }
String fullCmd = StringMan.join(args, " "); String fullCmd = StringMan.join(args, " ");
getInstance().handle(player, cmd + " " + fullCmd); getInstance().handle(player, cmd + " " + fullCmd);
if (loc != null) {
player.setMeta("location", loc);
}
return true; return true;
} }
@ -320,9 +341,6 @@ public class MainCommand extends CommandManager<PlotPlayer> {
@Override @Override
public int handle(final PlotPlayer plr, final String input) { public int handle(final PlotPlayer plr, final String input) {
// Clear perm caching //
plr.deleteMeta("perm");
////////////////////////
final String[] parts = input.split(" "); final String[] parts = input.split(" ");
String[] args; String[] args;
String label; String label;

View File

@ -26,7 +26,6 @@ import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotPlayer; import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.MainUtil; import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.Permissions; import com.intellectualcrafters.plot.util.Permissions;
import com.plotsquared.general.commands.Argument;
import com.plotsquared.general.commands.CommandDeclaration; import com.plotsquared.general.commands.CommandDeclaration;
@CommandDeclaration( @CommandDeclaration(
@ -39,10 +38,6 @@ category = CommandCategory.ACTIONS,
requiredType = RequiredType.NONE) requiredType = RequiredType.NONE)
public class Move extends SubCommand { public class Move extends SubCommand {
public Move() {
requiredArguments = new Argument[] { Argument.PlotID };
}
@Override @Override
public boolean onCommand(final PlotPlayer plr, final String[] args) { public boolean onCommand(final PlotPlayer plr, final String[] args) {
final Location loc = plr.getLocation(); final Location loc = plr.getLocation();

View File

@ -49,7 +49,6 @@ import com.intellectualcrafters.plot.util.TaskManager;
/** /**
* The plot class * The plot class
*
*/ */
@SuppressWarnings("javadoc") @SuppressWarnings("javadoc")
public class Plot { public class Plot {
@ -74,8 +73,9 @@ public class Plot {
public UUID owner; public UUID owner;
/** /**
* Plot creation timestamp (rough) * Plot creation timestamp (not accurate if the plot was created before this was implemented)<br>
* Direct access is Deprecated: use getTimestamp() * - Milliseconds since the epoch<br>
* Direct access is Deprecated: use {@link #getTimestamp() getTimestamp}
*/ */
@Deprecated @Deprecated
public long timestamp; public long timestamp;
@ -171,6 +171,23 @@ public class Plot {
return MainUtil.getPlot(world, id); return MainUtil.getPlot(world, id);
} }
public static Plot fromString(String defaultWorld, String string) {
final String[] split = string.split(";|,");
if (split.length == 2) {
if (PS.get().isPlotWorld(defaultWorld)) {
PlotId id = PlotId.fromString(split[0] + ";" + split[1]);
return Plot.getPlot(defaultWorld, id);
}
} else if (split.length == 3) {
defaultWorld = split[0];
if (PS.get().isPlotWorld(defaultWorld)) {
PlotId id = PlotId.fromString(split[1] + ";" + split[2]);
return Plot.getPlot(defaultWorld, id);
}
}
return null;
}
/** /**
* Return a new/cached plot object at a given location * Return a new/cached plot object at a given location
* *
@ -250,7 +267,9 @@ public class Plot {
} }
/** /**
* Get the metadata for a key * Get the metadata for a key<br>
* <br>
* For persistent metadata use the flag system
* @param key * @param key
* @return * @return
*/ */
@ -275,7 +294,7 @@ public class Plot {
/** /**
* Get the cluster this plot is associated with * Get the cluster this plot is associated with
* @return * @return the PlotCluster object, or null
*/ */
public PlotCluster getCluster() { public PlotCluster getCluster() {
if (!Settings.ENABLE_CLUSTERS) { if (!Settings.ENABLE_CLUSTERS) {
@ -311,8 +330,10 @@ public class Plot {
} }
/** /**
* Efficiently get the players currently inside this plot * Efficiently get the players currently inside this plot<br>
* @return * - Will return an empty list if no players are in the plot<br>
* - Remember, you can cast a PlotPlayer to it's respective implementation (BukkitPlayer, SpongePlayer) to obtain the player object
* @return list of PlotPlayer(s) or an empty list
*/ */
public List<PlotPlayer> getPlayersInPlot() { public List<PlotPlayer> getPlayersInPlot() {
return MainUtil.getPlayersInPlot(this); return MainUtil.getPlayersInPlot(this);
@ -327,6 +348,11 @@ public class Plot {
return owner != null; return owner != null;
} }
/**
* Check if a UUID is a plot owner (merged plots may have multiple owners)
* @param uuid
* @return
*/
public boolean isOwner(final UUID uuid) { public boolean isOwner(final UUID uuid) {
return PlotHandler.isOwner(this, uuid); return PlotHandler.isOwner(this, uuid);
} }
@ -370,7 +396,7 @@ public class Plot {
/** /**
* Get the plot world object for this plot<br> * Get the plot world object for this plot<br>
* - The generic PlotWorld object can be casted to it's respective class for more control * - The generic PlotWorld object can be casted to its respective class for more control (e.g. HybridPlotWorld)
* @return PlotWorld * @return PlotWorld
*/ */
public PlotWorld getWorld() { public PlotWorld getWorld() {
@ -379,7 +405,7 @@ public class Plot {
/** /**
* Get the plot manager object for this plot<br> * Get the plot manager object for this plot<br>
* - The generic PlotManager object can be casted to it's respective class for more control * - The generic PlotManager object can be casted to its respective class for more control (e.g. HybridPlotManager)
* @return PlotManager * @return PlotManager
*/ */
public PlotManager getManager() { public PlotManager getManager() {
@ -450,7 +476,7 @@ public class Plot {
} }
/** /**
* Check if the plot is merged * Check if the plot is merged in any direction
* @return * @return
*/ */
public boolean isMerged() { public boolean isMerged() {
@ -461,7 +487,9 @@ public class Plot {
} }
/** /**
* Get the timestamp in milliseconds of when the plot was created (unreliable) * Get the timestamp of when the plot was created (unreliable)<br>
* - not accurate if the plot was created before this was implemented<br>
* - Milliseconds since the epoch<br>
* @return * @return
*/ */
public long getTimestamp() { public long getTimestamp() {
@ -472,9 +500,21 @@ public class Plot {
} }
/** /**
* Get if the plot is merged in a direction * Get if the plot is merged in a direction<br>
* ------- Actual -------<br>
* 0 = north<br>
* 1 = east<br>
* 2 = south<br>
* 3 = west<br>
* ----- Artificial -----<br>
* 4 = north-east<br>
* 5 = south-east<br>
* 6 = south-west<br>
* 7 = north-west<br>
* ----------<br>
* Note: A plot that is merged north and east will not be merged northeast if the northeast plot is not part of the same group<br>
* @param direction * @param direction
* @return * @return true if merged in that direction
*/ */
public boolean getMerged(final int direction) { public boolean getMerged(final int direction) {
if (settings == null) { if (settings == null) {
@ -536,7 +576,6 @@ public class Plot {
/** /**
* Deny someone (updates database as well) * Deny someone (updates database as well)
*
* @param uuid * @param uuid
*/ */
public void addDenied(final UUID uuid) { public void addDenied(final UUID uuid) {
@ -903,13 +942,13 @@ public class Plot {
} }
/** /**
* Returns the top and bottom connected plot.<br> * Returns the top and bottom location.<br>
* - If the plot is not connected, it will return itself for the top/bottom<br> * - If the plot is not connected, it will return its own corners<br>
* - the returned IDs will not necessarily correspond to claimed plots if the connected plots do not form a rectangular shape * - the returned locations will not necessarily correspond to claimed plots if the connected plots do not form a rectangular shape
* @deprecated as merged plots no longer need to be rectangular * @deprecated as merged plots no longer need to be rectangular
* @param plot * @param plot
* @return new PlotId[] { bottom, top } * @return new Location[] { bottom, top }
* @see MainUtil#getCornerIds(Plot) * @see MainUtil#getCorners(Plot)
*/ */
@Deprecated @Deprecated
public Location[] getCorners() { public Location[] getCorners() {
@ -917,7 +956,21 @@ public class Plot {
} }
/** /**
* @deprecated in favor of getCorners()[0]; * Returns the top and bottom plot id.<br>
* - If the plot is not connected, it will return itself for the top/bottom<br>
* - the returned ids will not necessarily correspond to claimed plots if the connected plots do not form a rectangular shape
* @deprecated as merged plots no longer need to be rectangular
* @param plot
* @return new Plot[] { bottom, top }
* @see MainUtil#getCornerIds(Plot)
*/
@Deprecated
public PlotId[] getCornerIds() {
return MainUtil.getCornerIds(this);
}
/**
* @deprecated in favor of getCorners()[0];<br>
* @return * @return
*/ */
@Deprecated @Deprecated
@ -945,8 +998,9 @@ public class Plot {
} }
/** /**
* This will combine each plot into effective rectangular regions * This will combine each plot into effective rectangular regions<br>
* - This result is cached globally * - This result is cached globally<br>
* - Useful for handling non rectangular shapes
* @see MainUtil#getRegions(Plot) * @see MainUtil#getRegions(Plot)
* @return * @return
*/ */
@ -1005,8 +1059,8 @@ public class Plot {
} }
/** /**
* Remove a denied player (use DBFunc as well) * Remove a denied player (use DBFunc as well)<br>
* * Using the * uuid will remove all users
* @param uuid * @param uuid
*/ */
public boolean removeDenied(final UUID uuid) { public boolean removeDenied(final UUID uuid) {
@ -1021,8 +1075,8 @@ public class Plot {
} }
/** /**
* Remove a helper (use DBFunc as well) * Remove a helper (use DBFunc as well)<br>
* * Using the * uuid will remove all users
* @param uuid * @param uuid
*/ */
public boolean removeTrusted(final UUID uuid) { public boolean removeTrusted(final UUID uuid) {
@ -1037,8 +1091,8 @@ public class Plot {
} }
/** /**
* Remove a trusted user (use DBFunc as well) * Remove a trusted user (use DBFunc as well)<br>
* * Using the * uuid will remove all users
* @param uuid * @param uuid
*/ */
public boolean removeMember(final UUID uuid) { public boolean removeMember(final UUID uuid) {
@ -1098,7 +1152,7 @@ public class Plot {
} }
/** /**
* Upload the plot to the configured web interface * Upload the plot as a schematic to the configured web interface
* @param whenDone value will be null if uploading fails * @param whenDone value will be null if uploading fails
*/ */
public void upload(final RunnableVal<URL> whenDone) { public void upload(final RunnableVal<URL> whenDone) {
@ -1147,6 +1201,11 @@ public class Plot {
return id.hashCode(); return id.hashCode();
} }
/**
* Get the flags specific to this plot<br>
* - Does not take default flags into account<br>
* @return
*/
public HashMap<String, Flag> getFlags() { public HashMap<String, Flag> getFlags() {
if (settings == null) { if (settings == null) {
return new HashMap<>(0); return new HashMap<>(0);
@ -1154,6 +1213,11 @@ public class Plot {
return settings.flags; return settings.flags;
} }
/**
* Get the plot Alias<br>
* - Returns an empty string if no alias is set
* @return
*/
public String getAlias() { public String getAlias() {
if (settings == null) { if (settings == null) {
return ""; return "";
@ -1163,8 +1227,16 @@ public class Plot {
/** /**
* Set the raw merge data<br> * Set the raw merge data<br>
* - Updates DB * - Updates DB<br>
* - Does not modify terrain * - Does not modify terrain<br>
* Get if the plot is merged in a direction<br>
* ----------<br>
* 0 = north<br>
* 1 = east<br>
* 2 = south<br>
* 3 = west<br>
* ----------<br>
* Note: Diagonal merging (4-7) must be done by merging the corresponding plots.
* @param merged * @param merged
*/ */
public void setMerged(boolean[] merged) { public void setMerged(boolean[] merged) {
@ -1180,8 +1252,14 @@ public class Plot {
/** /**
* Set the raw merge data<br> * Set the raw merge data<br>
* - Updates DB * - Updates DB<br>
* - Does not modify terrain * - Does not modify terrain<br>
* ----------<br>
* 0 = north<br>
* 1 = east<br>
* 2 = south<br>
* 3 = west<br>
* ----------<br>
* @param merged * @param merged
*/ */
public void setMerged(int direction, boolean value) { public void setMerged(int direction, boolean value) {
@ -1208,6 +1286,10 @@ public class Plot {
} }
} }
/**
* Get the merged array
* @return boolean [ north, east, south, west ]
*/
public boolean[] getMerged() { public boolean[] getMerged() {
if (settings == null) { if (settings == null) {
return new boolean[] {false, false, false, false }; return new boolean[] {false, false, false, false };
@ -1215,6 +1297,13 @@ public class Plot {
return settings.getMerged(); return settings.getMerged();
} }
/**
* Get the set home location or 0,0,0 if no location is set<br>
* - Does not take the default home location into account
* @see MainUtil#getPlotHome(Plot)
* @see #getHome()
* @return
*/
public BlockLoc getPosition() { public BlockLoc getPosition() {
if (settings == null) { if (settings == null) {
return new BlockLoc(0, 0, 0); return new BlockLoc(0, 0, 0);

View File

@ -17,8 +17,8 @@ import com.plotsquared.general.commands.CommandCaller;
import com.plotsquared.listener.PlotListener; import com.plotsquared.listener.PlotListener;
/** /**
* Created 2015-02-20 for PlotSquared * The PlotPlayer class<br>
* * - Can cast to: BukkitPlayer / SpongePlayer, which are the current implementations<br>
*/ */
public abstract class PlotPlayer implements CommandCaller { public abstract class PlotPlayer implements CommandCaller {
@ -28,7 +28,7 @@ public abstract class PlotPlayer implements CommandCaller {
private ConcurrentHashMap<String, Object> meta; private ConcurrentHashMap<String, Object> meta;
/** /**
* Efficiently wrap a Player object to get a PlotPlayer (or fetch if it's already cached)<br> * Efficiently wrap a Player, or OfflinePlayer object to get a PlotPlayer (or fetch if it's already cached)<br>
* - Accepts sponge/bukkit Player (online) * - Accepts sponge/bukkit Player (online)
* - Accepts player name (online) * - Accepts player name (online)
* - Accepts UUID * - Accepts UUID
@ -42,7 +42,7 @@ public abstract class PlotPlayer implements CommandCaller {
/** /**
* Get the cached PlotPlayer from a username<br> * Get the cached PlotPlayer from a username<br>
* - This will return null if the player has just logged in or is not online * - This will return null if the player has not finished logging in or is not online
* @param name * @param name
* @return * @return
*/ */

Binary file not shown.