diff --git a/Bukkit/src/main/java/com/intellectualcrafters/plot/api/PlotAPI.java b/Bukkit/src/main/java/com/intellectualcrafters/plot/api/PlotAPI.java
index d6c6b3b91..76d130ed1 100644
--- a/Bukkit/src/main/java/com/intellectualcrafters/plot/api/PlotAPI.java
+++ b/Bukkit/src/main/java/com/intellectualcrafters/plot/api/PlotAPI.java
@@ -39,19 +39,20 @@ import com.intellectualcrafters.plot.util.SetQueue;
import com.intellectualcrafters.plot.util.UUIDHandler;
import com.intellectualcrafters.plot.uuid.UUIDWrapper;
import com.plotsquared.bukkit.util.BukkitUtil;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.UUID;
import org.bukkit.Location;
import org.bukkit.OfflinePlayer;
import org.bukkit.World;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.UUID;
+
/**
- * PlotSquared API
+ * PlotSquared API.
*
* @version API 3.3.1
*
@@ -95,7 +96,7 @@ public class PlotAPI {
}
/**
- * Get all plots
+ * Get all plots.
*
* @return all plots
*
@@ -106,7 +107,7 @@ public class PlotAPI {
}
/**
- * Return all plots for a player
+ * Return all plots for a player.
*
* @param player Player, whose plots to search for
*
@@ -117,7 +118,7 @@ public class PlotAPI {
}
/**
- * Add a plot world
+ * Add a plot world.
*
* @param plotArea Plot World Object
* @see PS#addPlotArea(PlotArea)
@@ -491,7 +492,7 @@ public class PlotAPI {
*/
@Deprecated
public boolean hasPlot(World world, Player player) {
- return getPlots(world, player, true) != null && getPlots(world, player, true).length > 0;
+ return getPlots(world, player, true).length > 0;
}
/**
@@ -510,10 +511,8 @@ public class PlotAPI {
if (plot.hasOwner() && plot.isOwner(uuid)) {
pPlots.add(plot);
}
- } else {
- if (plot.isAdded(uuid)) {
- pPlots.add(plot);
- }
+ } else if (plot.isAdded(uuid)) {
+ pPlots.add(plot);
}
}
return pPlots.toArray(new Plot[pPlots.size()]);
diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/chat/JsonString.java b/Bukkit/src/main/java/com/plotsquared/bukkit/chat/JsonString.java
index 6fe69b265..823511bb1 100644
--- a/Bukkit/src/main/java/com/plotsquared/bukkit/chat/JsonString.java
+++ b/Bukkit/src/main/java/com/plotsquared/bukkit/chat/JsonString.java
@@ -14,10 +14,10 @@ import java.util.Map;
*/
final class JsonString implements JsonRepresentedObject, ConfigurationSerializable {
- private final String _value;
+ private final String value;
public JsonString(CharSequence value) {
- this._value = value == null ? null : value.toString();
+ this.value = value == null ? null : value.toString();
}
public static JsonString deserialize(Map map) {
@@ -30,18 +30,18 @@ final class JsonString implements JsonRepresentedObject, ConfigurationSerializab
}
public String getValue() {
- return this._value;
+ return this.value;
}
@Override
public Map serialize() {
HashMap theSingleValue = new HashMap<>();
- theSingleValue.put("stringValue", this._value);
+ theSingleValue.put("stringValue", this.value);
return theSingleValue;
}
@Override
public String toString() {
- return this._value;
+ return this.value;
}
}
diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java
index 4e6e3deaf..8dcda91da 100644
--- a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java
+++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java
@@ -835,14 +835,14 @@ public class PlayerEvents extends PlotListener implements Listener {
public void onChange(BlockFromToEvent e) {
Block from = e.getBlock();
Block to = e.getToBlock();
- Location tloc = BukkitUtil.getLocation(to.getLocation());
- PlotArea area = tloc.getPlotArea();
+ Location tLocation = BukkitUtil.getLocation(to.getLocation());
+ PlotArea area = tLocation.getPlotArea();
if (area == null) {
return;
}
- Plot plot = area.getOwnedPlot(tloc);
- Location floc = BukkitUtil.getLocation(from.getLocation());
- if (!area.contains(floc.getX(), floc.getZ()) || !Objects.equals(plot, area.getOwnedPlot(floc)) || (plot != null && FlagManager
+ Plot plot = area.getOwnedPlot(tLocation);
+ Location fLocation = BukkitUtil.getLocation(from.getLocation());
+ if (!area.contains(fLocation.getX(), fLocation.getZ()) || !Objects.equals(plot, area.getOwnedPlot(fLocation)) || (plot != null && FlagManager
.isPlotFlagTrue(plot, "disable-physics"))) {
e.setCancelled(true);
}
diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/titles/DefaultTitleManager.java b/Bukkit/src/main/java/com/plotsquared/bukkit/titles/DefaultTitleManager.java
index 907ab7d80..4d34be9c6 100644
--- a/Bukkit/src/main/java/com/plotsquared/bukkit/titles/DefaultTitleManager.java
+++ b/Bukkit/src/main/java/com/plotsquared/bukkit/titles/DefaultTitleManager.java
@@ -40,10 +40,9 @@ public class DefaultTitleManager {
private boolean ticks = false;
/**
- * Create a new 1.8 title
+ * Create a new 1.8 title.
*
- * @param title
- * Title
+ * @param title Title
* @throws ClassNotFoundException
*/
public DefaultTitleManager(String title) throws ClassNotFoundException {
@@ -52,12 +51,10 @@ public class DefaultTitleManager {
}
/**
- * Create a new 1.8 title
+ * Create a new 1.8 title.
*
- * @param title
- * Title text
- * @param subtitle
- * Subtitle text
+ * @param title Title text
+ * @param subtitle Subtitle text
* @throws ClassNotFoundException
*/
public DefaultTitleManager(String title, String subtitle) throws ClassNotFoundException {
@@ -118,8 +115,7 @@ public class DefaultTitleManager {
}
/**
- * Load spigot and NMS classes
- * @throws ClassNotFoundException
+ * Load spigot and NMS classes.
*/
private void loadClasses() {
this.packetTitle = Reflection.getNMSClass("PacketPlayOutTitle");
@@ -129,7 +125,7 @@ public class DefaultTitleManager {
}
/**
- * Get title text
+ * Get title text.
*
* @return Title text
*/
@@ -138,17 +134,16 @@ public class DefaultTitleManager {
}
/**
- * Set title text
+ * Set title text.
*
- * @param title
- * Title
+ * @param title Title
*/
public void setTitle(String title) {
this.title = title;
}
/**
- * Get subtitle text
+ * Get subtitle text.
*
* @return Subtitle text
*/
diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/titles/DefaultTitleManager_183.java b/Bukkit/src/main/java/com/plotsquared/bukkit/titles/DefaultTitleManager_183.java
index b21df89fd..e0ee10b99 100644
--- a/Bukkit/src/main/java/com/plotsquared/bukkit/titles/DefaultTitleManager_183.java
+++ b/Bukkit/src/main/java/com/plotsquared/bukkit/titles/DefaultTitleManager_183.java
@@ -6,7 +6,6 @@ import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
@@ -53,12 +52,10 @@ public class DefaultTitleManager_183 {
}
/**
- * Create a new 1.8 title
+ * Create a new 1.8 title.
*
- * @param title
- * Title text
- * @param subtitle
- * Subtitle text
+ * @param title Title text
+ * @param subtitle Subtitle text
* @throws ClassNotFoundException
*/
public DefaultTitleManager_183(String title, String subtitle) throws ClassNotFoundException {
@@ -68,10 +65,9 @@ public class DefaultTitleManager_183 {
}
/**
- * Copy 1.8 title
+ * Copy 1.8 title.
*
- * @param title
- * Title
+ * @param title Title
* @throws ClassNotFoundException
*/
public DefaultTitleManager_183(DefaultTitleManager_183 title) throws ClassNotFoundException {
@@ -88,18 +84,13 @@ public class DefaultTitleManager_183 {
}
/**
- * Create a new 1.8 title
+ * Create a new 1.8 title.
*
- * @param title
- * Title text
- * @param subtitle
- * Subtitle text
- * @param fadeInTime
- * Fade in time
- * @param stayTime
- * Stay on screen time
- * @param fadeOutTime
- * Fade out time
+ * @param title Title text
+ * @param subtitle Subtitle text
+ * @param fadeInTime Fade in time
+ * @param stayTime Stay on screen time
+ * @param fadeOutTime Fade out time
* @throws ClassNotFoundException
*/
public DefaultTitleManager_183(String title, String subtitle, int fadeInTime, int stayTime, int fadeOutTime) throws ClassNotFoundException {
@@ -124,8 +115,7 @@ public class DefaultTitleManager_183 {
}
/**
- * Load spigot and NMS classes
- * @throws ClassNotFoundException
+ * Load spigot and NMS classes.
*/
private void loadClasses() {
this.packetTitle = Reflection.getNMSClass("PacketPlayOutTitle");
@@ -136,7 +126,7 @@ public class DefaultTitleManager_183 {
}
/**
- * Get title text
+ * Get title text.
*
* @return Title text
*/
@@ -145,17 +135,16 @@ public class DefaultTitleManager_183 {
}
/**
- * Set title text
+ * Set title text.
*
- * @param title
- * Title
+ * @param title Title
*/
public void setTitle(String title) {
this.title = title;
}
/**
- * Get subtitle text
+ * Get subtitle text.
*
* @return Subtitle text
*/
@@ -164,37 +153,34 @@ public class DefaultTitleManager_183 {
}
/**
- * Set subtitle text
+ * Set subtitle text.
*
- * @param subtitle
- * Subtitle text
+ * @param subtitle Subtitle text
*/
public void setSubtitle(String subtitle) {
this.subtitle = subtitle;
}
/**
- * Set the title color
+ * Set the title color.
*
- * @param color
- * Chat color
+ * @param color Chat color
*/
public void setTitleColor(ChatColor color) {
this.titleColor = color;
}
/**
- * Set the subtitle color
+ * Set the subtitle color.
*
- * @param color
- * Chat color
+ * @param color Chat color
*/
public void setSubtitleColor(ChatColor color) {
this.subtitleColor = color;
}
/**
- * Set title fade in time
+ * Set title fade in time.
*
* @param time
* Time
@@ -204,47 +190,42 @@ public class DefaultTitleManager_183 {
}
/**
- * Set title fade out time
+ * Set title fade out time.
*
- * @param time
- * Time
+ * @param time Time
*/
public void setFadeOutTime(int time) {
this.fadeOutTime = time;
}
/**
- * Set title stay time
+ * Set title stay time.
*
- * @param time
- * Time
+ * @param time Time
*/
public void setStayTime(int time) {
this.stayTime = time;
}
/**
- * Set timings to ticks
+ * Set timings to ticks.
*/
public void setTimingsToTicks() {
this.ticks = true;
}
/**
- * Set timings to seconds
+ * Set timings to seconds.
*/
public void setTimingsToSeconds() {
this.ticks = false;
}
/**
- * Send the title to a player
+ * Send the title to a player.
*
- * @param player
- * Player
- * @throws InvocationTargetException
- * @throws IllegalArgumentException
- * @throws IllegalAccessException
+ * @param player Player
+ * @throws Exception
*/
public void send(Player player) throws Exception {
if (this.packetTitle != null) {
@@ -258,11 +239,7 @@ public class DefaultTitleManager_183 {
Object packet = this.packetTitle
.getConstructor(this.packetActions, this.chatBaseComponent, Integer.TYPE, Integer.TYPE, Integer.TYPE)
.newInstance(actions[2], null,
-
- this.fadeInTime * (
-
- this.ticks ? 1 : 20),
-
+ this.fadeInTime * (this.ticks ? 1 : 20),
this.stayTime * (this.ticks ? 1 : 20), this.fadeOutTime * (this.ticks ? 1 : 20));
// Send if set
if ((this.fadeInTime != -1) && (this.fadeOutTime != -1) && (this.stayTime != -1)) {
@@ -285,7 +262,7 @@ public class DefaultTitleManager_183 {
}
/**
- * Broadcast the title to all players
+ * Broadcast the title to all players.
* @throws Exception
*/
public void broadcast() throws Exception {
@@ -295,12 +272,10 @@ public class DefaultTitleManager_183 {
}
/**
- * Clear the title
+ * Clear the title.
*
- * @param player
- * Player
- * @throws IllegalAccessException
- * @throws IllegalArgumentException
+ * @param player Player
+ * @throws Exception
*/
public void clearTitle(Player player) throws Exception {
// Send timings first
@@ -313,16 +288,10 @@ public class DefaultTitleManager_183 {
}
/**
- * Reset the title settings
+ * Reset the title settings.
*
- * @param player
- * Player
- * @throws SecurityException
- * @throws NoSuchMethodException
- * @throws InvocationTargetException
- * @throws IllegalArgumentException
- * @throws IllegalAccessException
- * @throws InstantiationException
+ * @param player Player
+ * @throws Exception
*/
public void resetTitle(Player player) throws Exception {
// Send timings first
diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/titles/HackTitleManager.java b/Bukkit/src/main/java/com/plotsquared/bukkit/titles/HackTitleManager.java
index 8a3f67bf7..5fd787a86 100644
--- a/Bukkit/src/main/java/com/plotsquared/bukkit/titles/HackTitleManager.java
+++ b/Bukkit/src/main/java/com/plotsquared/bukkit/titles/HackTitleManager.java
@@ -114,7 +114,6 @@ public class HackTitleManager {
/**
* Load spigot and NMS classes.
- * @throws ClassNotFoundException Spigot Error.
*/
private void loadClasses() {
this.packetTitle = getClass("org.spigotmc.ProtocolInjector$PacketTitle");
diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/util/Metrics.java b/Bukkit/src/main/java/com/plotsquared/bukkit/util/Metrics.java
index d9d304404..7b1d6dc78 100644
--- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/Metrics.java
+++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/Metrics.java
@@ -51,39 +51,39 @@ import java.util.zip.GZIPOutputStream;
public class Metrics {
/**
- * The current revision number
+ * The current revision number.
*/
private static final int REVISION = 7;
/**
- * The base url of the metrics domain
+ * The base url of the metrics domain.
*/
private static final String BASE_URL = "http://report.mcstats.org";
/**
- * The url used to report a server's status
+ * The url used to report a server's status.
*/
private static final String REPORT_URL = "/plugin/%s";
/**
- * Interval of time to ping (in minutes)
+ * Interval of time to ping (in minutes).
*/
private static final int PING_INTERVAL = 15;
/**
- * The plugin this metrics submits for
+ * The plugin this metrics submits for.
*/
private final Plugin plugin;
/**
- * All of the custom graphs to submit to metrics
+ * All of the custom graphs to submit to metrics.
*/
private final Set graphs = Collections.synchronizedSet(new HashSet());
/**
- * Unique server id
+ * Unique server id.
*/
private final String guid;
/**
- * Debug mode
+ * Debug mode.
*/
private final boolean debug;
/**
- * The scheduled task
+ * The scheduled task.
*/
private volatile BukkitTask task = null;
@@ -97,7 +97,7 @@ public class Metrics {
}
/**
- * GZip compress a string of bytes
+ * GZip compress a string of bytes.
*
* @param input
*
@@ -129,7 +129,6 @@ public class Metrics {
* @param key
* @param value
*
- * @throws UnsupportedEncodingException
*/
private static void appendJSONPair(StringBuilder json, String key, String value) {
boolean isValueNumeric = false;
diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/util/NbtFactory.java b/Bukkit/src/main/java/com/plotsquared/bukkit/util/NbtFactory.java
index 09a99dabf..d899ca8f5 100644
--- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/NbtFactory.java
+++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/NbtFactory.java
@@ -336,7 +336,7 @@ public class NbtFactory {
}
/**
- * Search for the first publically and privately defined method of the given name and parameter count.
+ * Search for the first publicly and privately defined method of the given name and parameter count.
* @param requireMod - modifiers that are required.
* @param bannedMod - modifiers that are banned.
* @param clazz - a class to start with.
@@ -366,7 +366,7 @@ public class NbtFactory {
}
/**
- * Search for the first publically and privately defined field of the given name.
+ * Search for the first publicly and privately defined field of the given name.
* @param instance - an instance of the class with the field.
* @param clazz - an optional class to start with, or NULL to deduce it from instance.
* @param fieldName - the field name.
diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/util/OfflinePlayerUtil.java b/Bukkit/src/main/java/com/plotsquared/bukkit/util/OfflinePlayerUtil.java
index 17b15e224..ae235b3b0 100644
--- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/OfflinePlayerUtil.java
+++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/OfflinePlayerUtil.java
@@ -56,7 +56,7 @@ public class OfflinePlayerUtil {
return name;
}
Constructor gameProfileConstructor = makeConstructor(gameProfileClass, UUID.class, String.class);
- if (gameProfileConstructor == null) { //Verson has string constructor
+ if (gameProfileConstructor == null) { //Version has string constructor
gameProfileConstructor = makeConstructor(gameProfileClass, String.class, String.class);
return callConstructor(gameProfileConstructor, id.toString(), name);
} else { //Version has uuid constructor
diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/util/SendChunk.java b/Bukkit/src/main/java/com/plotsquared/bukkit/util/SendChunk.java
index 362c6083a..1f446060c 100644
--- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/SendChunk.java
+++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/SendChunk.java
@@ -127,10 +127,10 @@ public class SendChunk {
}
}
- public void sendChunk(String worldname, Collection locs) {
+ public void sendChunk(String worldname, Collection chunkLocs) {
World myworld = Bukkit.getWorld(worldname);
ArrayList chunks = new ArrayList<>();
- for (ChunkLoc loc : locs) {
+ for (ChunkLoc loc : chunkLocs) {
if (myworld.isChunkLoaded(loc.x, loc.z)) {
chunks.add(myworld.getChunkAt(loc.x, loc.z));
}
diff --git a/Core/src/main/java/com/intellectualcrafters/configuration/MemorySection.java b/Core/src/main/java/com/intellectualcrafters/configuration/MemorySection.java
index b170567ac..4b69c9787 100644
--- a/Core/src/main/java/com/intellectualcrafters/configuration/MemorySection.java
+++ b/Core/src/main/java/com/intellectualcrafters/configuration/MemorySection.java
@@ -539,10 +539,6 @@ public class MemorySection implements ConfigurationSection {
public List getStringList(String path) {
List> list = getList(path);
- if (list == null) {
- return new ArrayList<>(0);
- }
-
List result = new ArrayList<>();
for (Object object : list) {
@@ -558,10 +554,6 @@ public class MemorySection implements ConfigurationSection {
public List getIntegerList(String path) {
List> list = getList(path);
- if (list == null) {
- return new ArrayList<>(0);
- }
-
List result = new ArrayList<>();
for (Object object : list) {
@@ -586,10 +578,6 @@ public class MemorySection implements ConfigurationSection {
public List getBooleanList(String path) {
List> list = getList(path);
- if (list == null) {
- return new ArrayList<>(0);
- }
-
List result = new ArrayList<>();
for (Object object : list) {
@@ -611,10 +599,6 @@ public class MemorySection implements ConfigurationSection {
public List getDoubleList(String path) {
List> list = getList(path);
- if (list == null) {
- return new ArrayList<>(0);
- }
-
List result = new ArrayList<>();
for (Object object : list) {
@@ -639,10 +623,6 @@ public class MemorySection implements ConfigurationSection {
public List getFloatList(String path) {
List> list = getList(path);
- if (list == null) {
- return new ArrayList<>(0);
- }
-
List result = new ArrayList<>();
for (Object object : list) {
@@ -667,10 +647,6 @@ public class MemorySection implements ConfigurationSection {
public List getLongList(String path) {
List> list = getList(path);
- if (list == null) {
- return new ArrayList<>(0);
- }
-
List result = new ArrayList<>();
for (Object object : list) {
@@ -695,10 +671,6 @@ public class MemorySection implements ConfigurationSection {
public List getByteList(String path) {
List> list = getList(path);
- if (list == null) {
- return new ArrayList<>(0);
- }
-
List result = new ArrayList<>();
for (Object object : list) {
@@ -723,10 +695,6 @@ public class MemorySection implements ConfigurationSection {
public List getCharacterList(String path) {
List> list = getList(path);
- if (list == null) {
- return new ArrayList<>(0);
- }
-
List result = new ArrayList<>();
for (Object object : list) {
@@ -750,10 +718,6 @@ public class MemorySection implements ConfigurationSection {
public List getShortList(String path) {
List> list = getList(path);
- if (list == null) {
- return new ArrayList<>(0);
- }
-
List result = new ArrayList<>();
for (Object object : list) {
@@ -779,10 +743,6 @@ public class MemorySection implements ConfigurationSection {
List> list = getList(path);
List