Various fixes and tweaks.

This commit is contained in:
MattBDev
2016-06-01 16:50:35 -04:00
parent 042d8950ee
commit f21d159911
14 changed files with 149 additions and 127 deletions

View File

@ -35,7 +35,7 @@ import java.util.UUID;
/**
* PlotSquared API.
*
* <p>Useful classes:</p>
* <p>Useful classes:
* <ul>
* <li>{@link BukkitUtil}</li>
* <li>{@link PlotPlayer}</li>
@ -655,7 +655,7 @@ public class PlotAPI {
/**
* Get the numbers of plots, which the player is able to build in.
*
* @param player Player, for whom we're getting the plots
* @param player player, for whom we're getting the plots
*
* @return the number of allowed plots
*
@ -671,8 +671,8 @@ public class PlotAPI {
*
* @see PlotPlayer#wrap(Object)
*
* @param player The player to wrap
* @return A PlotPlayer
* @param player the player to wrap
* @return a {@code PlotPlayer}
*/
public PlotPlayer wrapPlayer(Player player) {
return PlotPlayer.wrap(player);
@ -682,12 +682,12 @@ public class PlotAPI {
* Get the PlotPlayer for a UUID.
*
* <p><i>Please note that PlotSquared can be configured to provide
* different UUIDs than bukkit</i></p>
* different UUIDs than bukkit</i>
*
* @see PlotPlayer#wrap(Object)
*
* @param uuid The uuid of the player to wrap
* @return A PlotPlayer
* @param uuid the uuid of the player to wrap
* @return a {@code PlotPlayer}
*/
public PlotPlayer wrapPlayer(UUID uuid) {
return PlotPlayer.wrap(uuid);
@ -698,8 +698,8 @@ public class PlotAPI {
*
* @see PlotPlayer#wrap(Object)
*
* @param player The player to wrap
* @return The PlotPlayer
* @param player the player to wrap
* @return a {@code PlotPlayer}
*/
public PlotPlayer wrapPlayer(String player) {
return PlotPlayer.wrap(player);
@ -707,13 +707,14 @@ public class PlotAPI {
/**
* Get the PlotPlayer for an offline player.
*
* <p>Note that this will work if the player is offline, however not all
* functionality will work</p>
* functionality will work.
*
* @see PlotPlayer#wrap(Object)
*
* @param player The player to wrap
* @return The PlotPlayer
* @param player the player to wrap
* @return a {@code PlotPlayer}
*/
public PlotPlayer wrapPlayer(OfflinePlayer player) {
return PlotPlayer.wrap(player);

View File

@ -70,7 +70,7 @@ import com.plotsquared.bukkit.uuid.FileUUIDHandler;
import com.plotsquared.bukkit.uuid.LowerOfflineUUIDWrapper;
import com.plotsquared.bukkit.uuid.OfflineUUIDWrapper;
import com.plotsquared.bukkit.uuid.SQLUUIDHandler;
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
import com.sk89q.worldedit.WorldEdit;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Chunk;
@ -95,7 +95,7 @@ import java.util.UUID;
public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
public static WorldEditPlugin worldEdit;
public static WorldEdit worldEdit;
private int[] version;
@ -385,7 +385,7 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain
@Override
public boolean initWorldEdit() {
if (getServer().getPluginManager().getPlugin("WorldEdit") != null) {
worldEdit = (WorldEditPlugin) getServer().getPluginManager().getPlugin("WorldEdit");
worldEdit = WorldEdit.getInstance();
return true;
}
return false;

View File

@ -9,9 +9,9 @@ import java.util.Collection;
/**
* Represents a wrapper around an array class of an arbitrary reference type,
* which properly implements "value" hash code and equality functions.
* <p>
* This class is intended for use as a key to a map.
* </p>
*
* <p>This class is intended for use as a key to a map.
*
* @author Glen Husman
* @param <E> The type of elements in the array.
* @see Arrays

View File

@ -109,6 +109,7 @@ import org.bukkit.plugin.Plugin;
import org.bukkit.projectiles.BlockProjectileSource;
import org.bukkit.projectiles.ProjectileSource;
import org.bukkit.util.Vector;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
@ -303,7 +304,6 @@ public class PlayerEvents extends PlotListener implements Listener {
return true;
}
Plot plot = area.getPlotAbs(loc);
//
ProjectileSource shooter = entity.getShooter();
if (shooter instanceof Player) {
PlotPlayer pp = BukkitUtil.getPlayer((Player) shooter);
@ -780,7 +780,6 @@ public class PlayerEvents extends PlotListener implements Listener {
return;
}
Plot plot = area.getOwnedPlot(location);
Optional<Boolean> flag;
switch (block.getType()) {
case GRASS:
if (Flags.GRASS_GROW.isFalse(plot)) {

View File

@ -10,8 +10,8 @@ public class BukkitOfflinePlayer implements OfflinePlotPlayer {
public final OfflinePlayer player;
/**
* <p>Please do not use this method. Instead use BukkitUtil.getPlayer(Player),
* as it caches player objects.</p>
* Please do not use this method. Instead use BukkitUtil.getPlayer(Player),
* as it caches player objects.
*
* @param player
*/