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 6d0b3eeaf..62cd84868 100644
--- a/Bukkit/src/main/java/com/intellectualcrafters/plot/api/PlotAPI.java
+++ b/Bukkit/src/main/java/com/intellectualcrafters/plot/api/PlotAPI.java
@@ -1,4 +1,3 @@
-
package com.intellectualcrafters.plot.api;
import com.intellectualcrafters.configuration.file.YamlConfiguration;
@@ -43,32 +42,40 @@ import java.util.UUID;
* @see com.intellectualcrafters.plot.object.Location
* @see PlotArea
* @see PS
+ * @version 3.3.1
+>>>>>>> origin/master
*/
public class PlotAPI {
/**
- * Permission that allows for admin access, this permission node will allow the player to use any part of the
- * plugin, without limitations.
+ * Permission that allows for admin access, this permission node will allow
+ * the player to use any part of the plugin, without limitations.
* @deprecated Use C.PERMISSION_ADMIN instead
*/
@Deprecated
public static final String ADMIN_PERMISSION = C.PERMISSION_ADMIN.s();
/**
- * @deprecated Use new PlotAPI() instead
+ * Deprecated, does nothing.
+ * @param plugin not needed
+ * @deprecated Not needed
*/
@Deprecated
public PlotAPI(JavaPlugin plugin) {
}
/**
- * @see PS
- *
- * @deprecated Use this class if you just want to do a few simple things.
- * - It will remain stable for future versions of the plugin
- * - The PlotPlayer and Plot class should be considered relatively safe
- * - For more advanced/intensive tasks you should consider using other classes
+ * Default Constructor that does nothing.
*
+ * @deprecated Use this class if you just want to do a few simple things
+ *
+ *
It will remain stable for future versions
+ * of the plugin
+ *
The PlotPlayer and Plot class should be considered
+ * relatively safe
+ *
For more advanced/intensive tasks you should consider
+ * using other classes
+ *
*
*/
@Deprecated
@@ -108,6 +115,7 @@ public class PlotAPI {
}
/**
+ * Returns the PlotSquared configurations file.
* @return main configuration
*
* @see PS#config
@@ -117,6 +125,7 @@ public class PlotAPI {
}
/**
+ * Get the PlotSquared storage file.
* @return storage configuration
*
* @see PS#storage
@@ -126,8 +135,7 @@ public class PlotAPI {
}
/**
- * Get the main class for this plugin - Contains a lot of fields and methods - not very well organized
- * Only use this if you really need it
+ * Get the main class for this plugin. Only use this if you really need it.
*
* @return PlotSquared PlotSquared Main Class
*
@@ -138,12 +146,14 @@ public class PlotAPI {
}
/**
- * ChunkManager class contains several useful methods
- * - Chunk deletion
- * - Moving or copying regions
- * - plot swapping
- * - Entity tracking
- * - region regeneration
+ * ChunkManager class contains several useful methods.
+ *
+ *
Chunk deletion
+ *
Moving or copying regions
+ *
Plot swapping
+ *
Entity Tracking
+ *
Region Regeneration
+ *
*
* @return ChunkManager
*
@@ -162,7 +172,8 @@ public class PlotAPI {
}
/**
- * UUIDWrapper class has basic methods for getting UUIDS (it's recommended to use the UUIDHandler class instead)
+ * UUIDWrapper class has basic methods for getting UUIDS. It's recommended
+ * to use the UUIDHandler class instead.
*
* @return UUIDWrapper
*
@@ -178,7 +189,7 @@ public class PlotAPI {
*
* @return FlagManager
*
- * @see com.intellectualcrafters.plot.flag.FlagManager
+ * @deprecated Use {@link FlagManager} directly
*/
@Deprecated
public FlagManager getFlagManager() {
@@ -187,11 +198,9 @@ public class PlotAPI {
/**
* Do not use this. Instead use MainUtil.[method] in your code.
- * - Basic plot management stuff
*
* @return MainUtil
- *
- * @see MainUtil
+ * @deprecated Use {@link MainUtil} directly
*/
@Deprecated
public MainUtil getMainUtil() {
@@ -200,11 +209,11 @@ public class PlotAPI {
/**
* Do not use this. Instead use C.PERMISSION_[method] in your code.
- * - Basic permission management stuff
*
* @return Array of strings
*
* @see com.intellectualcrafters.plot.util.Permissions
+ * @deprecated Use {@link C} to list all the permissions
*/
@Deprecated
public String[] getPermissions() {
@@ -218,7 +227,8 @@ public class PlotAPI {
}
/**
- * SchematicHandler class contains methods related to pasting, reading and writing schematics
+ * SchematicHandler class contains methods related to pasting, reading
+ * and writing schematics.
*
* @return SchematicHandler
*
@@ -232,8 +242,7 @@ public class PlotAPI {
* Use C.[caption] instead
*
* @return C
- *
- * @see com.intellectualcrafters.plot.config.C
+ * @deprecated Use {@link C}
*/
@Deprecated
public C[] getCaptions() {
@@ -241,7 +250,8 @@ public class PlotAPI {
}
/**
- * Get the plot manager for a world. - Most of these methods can be accessed through the MainUtil
+ * Get the plot manager for a world. Most of these methods can be accessed
+ * through the MainUtil.
*
* @param world Which manager to get
*
@@ -258,6 +268,11 @@ public class PlotAPI {
return getPlotManager(world.getName());
}
+ /**
+ * Get a list of PlotAreas in the world.
+ * @param world The world to check for plot areas
+ * @return A set of PlotAreas
+ */
public Set getPlotAreas(World world) {
if (world == null) {
return new HashSet<>();
@@ -266,10 +281,10 @@ public class PlotAPI {
}
/**
- * Get the plot manager for a world. - Contains useful low level methods for plot merging, clearing, and
- * tessellation
+ * Get the plot manager for a world. Contains useful low level methods for
+ * plot merging, clearing, and tessellation.
*
- * @param world
+ * @param world The world
*
* @return PlotManager
*
@@ -291,12 +306,13 @@ public class PlotAPI {
}
/**
- * Get the settings for a world (settings bundled in PlotArea class) - You will need to downcast for the specific
- * settings a Generator has. e.g. DefaultPlotWorld class implements PlotArea
+ * Get the settings for a world (settings bundled in PlotArea class). You
+ * will need to downcast for the specific settings a Generator has. e.g.
+ * DefaultPlotWorld class implements PlotArea
*
- * @param world (to get settings of)
+ * @param world The World
*
- * @return PlotArea class for that world ! will return null if not a plot world world
+ * @return The {@link PlotArea} for the world or null if not in plotworld
*
* @see #getPlotAreas(World)
* @see com.intellectualcrafters.plot.object.PlotArea
@@ -310,11 +326,11 @@ public class PlotAPI {
}
/**
- * Get the settings for a world (settings bundled in PlotArea class)
+ * Get the settings for a world.
*
- * @param world (to get settings of)
+ * @param world The world
*
- * @return PlotArea class for that world ! will return null if not a plot world world
+ * @return The {@link PlotArea} for the world or null if not in plotworld
*
* @see PS#getPlotArea(String, String)
* @see com.intellectualcrafters.plot.object.PlotArea
@@ -340,17 +356,16 @@ public class PlotAPI {
* Send a message to a player.
*
* @param player Player that will receive the message
- * @param c (Caption)
+ * @param caption Caption
*
* @see MainUtil#sendMessage(PlotPlayer, C, String...)
- * com.intellectualcrafters.plot.config.C, String...)
*/
- public void sendMessage(Player player, C c) {
- MainUtil.sendMessage(BukkitUtil.getPlayer(player), c);
+ public void sendMessage(Player player, C caption) {
+ MainUtil.sendMessage(BukkitUtil.getPlayer(player), caption);
}
/**
- * Send a message to a player. - Supports color codes
+ * Send a message to a player. Supports color codes.
*
* @param player Player that will receive the message
* @param string The message
@@ -362,30 +377,30 @@ public class PlotAPI {
}
/**
- * Send a message to the console. - Supports color codes
+ * Send a message to the console. Supports color codes.
*
- * @param msg Message that should be sent to the console
+ * @param message Message that should be sent to the console
*
* @see MainUtil#sendConsoleMessage(C, String...)
*/
- public void sendConsoleMessage(String msg) {
- PS.log(msg);
+ public void sendConsoleMessage(String message) {
+ PS.log(message);
}
/**
- * Send a message to the console
+ * Send a message to the console.
*
- * @param c (Caption)
+ * @param caption The caption
*
* @see #sendConsoleMessage(String)
* @see com.intellectualcrafters.plot.config.C
*/
- public void sendConsoleMessage(C c) {
- sendConsoleMessage(c.s());
+ public void sendConsoleMessage(C caption) {
+ sendConsoleMessage(caption.s());
}
/**
- * Register a flag for use in plots
+ * Register a flag for use in plots.
*
* @param flag Flag that should be registered
*
@@ -397,7 +412,7 @@ public class PlotAPI {
}
/**
- * get all the currently registered flags
+ * get all the currently registered flags.
*
* @return array of Flag[]
*
@@ -412,8 +427,8 @@ public class PlotAPI {
* Get a plot based on the ID.
*
* @param world World in which the plot is located
- * @param x Plot Location X Co-ord
- * @param z Plot Location Z Co-ord
+ * @param x The PlotID x coordinate
+ * @param z The PlotID y coordinate
*
* @return plot, null if ID is wrong
*
@@ -434,17 +449,17 @@ public class PlotAPI {
/**
* Get a plot based on the location.
*
- * @param l The location that you want to to retrieve the plot from
+ * @param location The location to retrieve the plot from
*
- * @return plot if found, otherwise it creates a temporary plot-
+ * @return plot if found, otherwise it creates a temporary plot
*
* @see Plot
*/
- public Plot getPlot(Location l) {
- if (l == null) {
+ public Plot getPlot(Location location) {
+ if (location == null) {
return null;
}
- return BukkitUtil.getLocation(l).getPlot();
+ return BukkitUtil.getLocation(location).getPlot();
}
/**
@@ -465,7 +480,7 @@ public class PlotAPI {
* Check whether or not a player has a plot.
*
* @param player Player that you want to check for
- *
+ * @param world The world to check
* @return true if player has a plot, false if not.
*
* @see #getPlots(World, Player, boolean)
@@ -478,9 +493,10 @@ public class PlotAPI {
/**
* Get all plots for the player.
*
- * @param world
+ * @param world The world to retrieve plots from
* @param player The player to search for
* @param justOwner should we just search for owner? Or with rights?
+ * @return An array of plots for the player
*/
@Deprecated
public Plot[] getPlots(World world, Player player, boolean justOwner) {
@@ -530,9 +546,9 @@ public class PlotAPI {
}
/**
- * Get if plot world
+ * Get if plotworld.
*
- * @param world (to check if plot world)
+ * @param world The world to check
*
* @return boolean (if plot world or not)
*
@@ -544,9 +560,9 @@ public class PlotAPI {
}
/**
- * Get plot locations
+ * Get plot locations.
*
- * @param p Plot that you want to get the locations for
+ * @param plot Plot to get the locations for
*
* @return [0] = bottomLc, [1] = topLoc, [2] = home
*
@@ -555,27 +571,30 @@ public class PlotAPI {
* @see Plot
*/
@Deprecated
- public Location[] getLocations(Plot p) {
- return new Location[]{BukkitUtil.getLocation(p.getBottom()), BukkitUtil.getLocation(p.getTop()), BukkitUtil.getLocation(p.getHome())};
+ public Location[] getLocations(Plot plot) {
+ Location bukkitBottom = BukkitUtil.getLocation(plot.getCorners()[0]);
+ Location bukkitTop = BukkitUtil.getLocation(plot.getCorners()[1]);
+ Location bukkitHome = BukkitUtil.getLocation(plot.getHome());
+ return new Location[]{bukkitBottom, bukkitTop, bukkitHome};
}
/**
- * Get home location
+ * Get home location.
*
- * @param p Plot that you want to get the location for
+ * @param plot Plot that you want to get the location for
*
* @return plot bottom location
*
* @see Plot
*/
- public Location getHomeLocation(Plot p) {
- return BukkitUtil.getLocation(p.getHome());
+ public Location getHomeLocation(Plot plot) {
+ return BukkitUtil.getLocation(plot.getHome());
}
/**
- * Get Bottom Location (min, min, min)
+ * Get Bottom Location (min, min, min).
*
- * @param p Plot that you want to get the location for
+ * @param plot Plot that you want to get the location for
*
* @return plot bottom location
*
@@ -584,14 +603,14 @@ public class PlotAPI {
* @see Plot
*/
@Deprecated
- public Location getBottomLocation(Plot p) {
- return BukkitUtil.getLocation(p.getBottom());
+ public Location getBottomLocation(Plot plot) {
+ return BukkitUtil.getLocation(plot.getBottom());
}
/**
- * Get Top Location (max, max, max)
+ * Get Top Location (max, max, max).
*
- * @param p Plot that you want to get the location for
+ * @param plot Plot that you want to get the location for
*
* @return plot top location
*
@@ -600,12 +619,12 @@ public class PlotAPI {
* @see Plot
*/
@Deprecated
- public Location getTopLocation(Plot p) {
- return BukkitUtil.getLocation(p.getTop());
+ public Location getTopLocation(Plot plot) {
+ return BukkitUtil.getLocation(plot.getTop());
}
/**
- * Check whether or not a player is in a plot
+ * Check whether or not a player is in a plot.
*
* @param player who we're checking for
*
@@ -617,7 +636,7 @@ public class PlotAPI {
}
/**
- * Register a subcommand
+ * Register a subcommand.
* @deprecated Command registration is done on object creation
* @param c SubCommand, that we want to register
* @see com.intellectualcrafters.plot.commands.SubCommand
@@ -628,7 +647,7 @@ public class PlotAPI {
}
/**
- * Get the PlotSquared class
+ * Get the PlotSquared class.
*
* @return PlotSquared Class
*
@@ -639,7 +658,7 @@ public class PlotAPI {
}
/**
- * Get the player plot count
+ * Get the player plot count.
*
* @param world Specify the world we want to select the plots from
* @param player Player, for whom we're getting the plot count
@@ -655,7 +674,7 @@ public class PlotAPI {
}
/**
- * Get a collection containing the players plots
+ * Get a collection containing the players plots.
*
* @param world Specify the world we want to select the plots from
* @param player Player, for whom we're getting the plots
@@ -674,9 +693,9 @@ public class PlotAPI {
}
/**
- * Get the numbers of plots, which the player is able to build in
+ * Get the numbers of plots, which the player is able to build in.
*
- * @param player Player, for whom we're getting the plots (trusted, member and owner)
+ * @param player Player, for whom we're getting the plots
*
* @return the number of allowed plots
*
@@ -687,50 +706,54 @@ public class PlotAPI {
}
/**
- * Get the PlotPlayer for a player
- * - The PlotPlayer is usually cached and will provide useful functions relating to players
+ * Get the PlotPlayer for a player. The PlotPlayer is usually cached and
+ * will provide useful functions relating to players.
*
* @see PlotPlayer#wrap(Object)
*
- * @param player
- * @return
+ * @param player The player to wrap
+ * @return A PlotPlayer
*/
public PlotPlayer wrapPlayer(Player player) {
return PlotPlayer.wrap(player);
}
/**
- * Get the PlotPlayer for a UUID (Please note that PlotSquared can be configured to provide different UUIDs than bukkit)
+ * Get the PlotPlayer for a UUID.
+ *
+ *
Please note that PlotSquared can be configured to provide
+ * different UUIDs than bukkit
*
* @see PlotPlayer#wrap(Object)
*
- * @param uuid
- * @return
+ * @param uuid The uuid of the player to wrap
+ * @return A PlotPlayer
*/
public PlotPlayer wrapPlayer(UUID uuid) {
return PlotPlayer.wrap(uuid);
}
/**
- * Get the PlotPlayer for a username
+ * Get the PlotPlayer for a username.
*
* @see PlotPlayer#wrap(Object)
*
- * @param player
- * @return
+ * @param player The player to wrap
+ * @return The PlotPlayer
*/
public PlotPlayer wrapPlayer(String player) {
return PlotPlayer.wrap(player);
}
/**
- * Get the PlotPlayer for an offline player
- * Note that this will work if the player is offline, however not all functionality will work
+ * Get the PlotPlayer for an offline player.
+ *
Note that this will work if the player is offline, however not all
+ * functionality will work
*
* @see PlotPlayer#wrap(Object)
*
- * @param player
- * @return
+ * @param player The player to wrap
+ * @return The PlotPlayer
*/
public PlotPlayer wrapPlayer(OfflinePlayer player) {
return PlotPlayer.wrap(player);
diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitMain.java b/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitMain.java
index 740a46939..de98b99d5 100644
--- a/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitMain.java
+++ b/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitMain.java
@@ -123,7 +123,7 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
@Override
public void onEnable() {
- THIS = this;
+ BukkitMain.THIS = this;
new PS(this, "Bukkit");
}
@@ -131,12 +131,12 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
public void onDisable() {
PS.get().disable();
Bukkit.getScheduler().cancelTasks(this);
- THIS = null;
+ BukkitMain.THIS = null;
}
@Override
public void log(String message) {
- if (THIS != null) {
+ if (BukkitMain.THIS != null) {
try {
message = C.color(message);
if (!Settings.CONSOLE_COLOR) {
@@ -153,7 +153,7 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
@Override
public void disable() {
- if (THIS != null) {
+ if (BukkitMain.THIS != null) {
onDisable();
}
}
@@ -170,11 +170,11 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
@Override
public void registerCommands() {
- BukkitCommand bcmd = new BukkitCommand();
+ BukkitCommand bukkitCommand = new BukkitCommand();
PluginCommand plotCommand = getCommand("plots");
- plotCommand.setExecutor(bcmd);
+ plotCommand.setExecutor(bukkitCommand);
plotCommand.setAliases(Arrays.asList("p", "ps", "plotme", "plot"));
- plotCommand.setTabCompleter(bcmd);
+ plotCommand.setTabCompleter(bukkitCommand);
}
@Override
@@ -224,10 +224,9 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
case LIGHTNING:
case WITHER_SKULL:
case UNKNOWN:
- case PLAYER: {
- // non moving / unremovable
+ case PLAYER:
+ // non moving / unmovable
continue;
- }
case THROWN_EXP_BOTTLE:
case SPLASH_POTION:
case SNOWBALL:
@@ -235,15 +234,13 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
case SPECTRAL_ARROW:
case TIPPED_ARROW:
case ENDER_PEARL:
- case ARROW: {
+ case ARROW:
// managed elsewhere | projectile
continue;
- }
case ARMOR_STAND:
case ITEM_FRAME:
- case PAINTING: {
+ case PAINTING:
// TEMPORARILY CLASSIFY AS VEHICLE
- }
case MINECART:
case MINECART_CHEST:
case MINECART_COMMAND:
@@ -278,15 +275,13 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
case SMALL_FIREBALL:
case FIREBALL:
case DRAGON_FIREBALL:
- case DROPPED_ITEM: {
+ case DROPPED_ITEM:
// dropped item
continue;
- }
case PRIMED_TNT:
- case FALLING_BLOCK: {
+ case FALLING_BLOCK:
// managed elsewhere
continue;
- }
case BAT:
case BLAZE:
case CAVE_SPIDER:
@@ -320,7 +315,7 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
case WOLF:
case ZOMBIE:
case SHULKER:
- default: {
+ default:
if (!Settings.KILL_ROAD_MOBS) {
continue;
}
@@ -332,7 +327,6 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
entity.remove();
}
}
- }
}
}
} catch (Throwable e) {
@@ -383,7 +377,7 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
@Override
public boolean initWorldEdit() {
if (getServer().getPluginManager().getPlugin("WorldEdit") != null) {
- BukkitMain.worldEdit = (WorldEditPlugin) getServer().getPluginManager().getPlugin("WorldEdit");
+ worldEdit = (WorldEditPlugin) getServer().getPluginManager().getPlugin("WorldEdit");
getServer().getPluginManager().registerEvents(new WEListener(), this);
return true;
}
diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/commands/DebugUUID.java b/Bukkit/src/main/java/com/plotsquared/bukkit/commands/DebugUUID.java
index c5ca44622..bdf5ae099 100644
--- a/Bukkit/src/main/java/com/plotsquared/bukkit/commands/DebugUUID.java
+++ b/Bukkit/src/main/java/com/plotsquared/bukkit/commands/DebugUUID.java
@@ -107,9 +107,9 @@ public class DebugUUID extends SubCommand {
worlds.add("world");
HashSet uuids = new HashSet<>();
HashSet names = new HashSet<>();
- for (String worldname : worlds) {
- File playerdataFolder = new File(worldname + File.separator + "playerdata");
- String[] dat = playerdataFolder.list(new FilenameFilter() {
+ for (String worldName : worlds) {
+ File playerDataFolder = new File(worldName + File.separator + "playerdata");
+ String[] dat = playerDataFolder.list(new FilenameFilter() {
@Override
public boolean accept(File f, String s) {
return s.endsWith(".dat");
@@ -126,7 +126,7 @@ public class DebugUUID extends SubCommand {
}
}
}
- File playersFolder = new File(worldname + File.separator + "players");
+ File playersFolder = new File(worldName + File.separator + "players");
dat = playersFolder.list(new FilenameFilter() {
@Override
public boolean accept(File f, String s) {
@@ -286,7 +286,7 @@ public class DebugUUID extends SubCommand {
try {
PS.get().config.save(PS.get().configFile);
} catch (IOException e) {
- MainUtil.sendMessage(player, "Could not save configuration. It will need to be manuall set!");
+ MainUtil.sendMessage(player, "Could not save configuration. It will need to be manual set!");
}
MainUtil.sendMessage(player, "&7 - Populating tables");
diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/database/plotme/APlotMeConnector.java b/Bukkit/src/main/java/com/plotsquared/bukkit/database/plotme/APlotMeConnector.java
index 48e5b5d76..f91507157 100644
--- a/Bukkit/src/main/java/com/plotsquared/bukkit/database/plotme/APlotMeConnector.java
+++ b/Bukkit/src/main/java/com/plotsquared/bukkit/database/plotme/APlotMeConnector.java
@@ -55,16 +55,16 @@ abstract class APlotMeConnector {
public Location getPlotTopLocAbs(int path, int plot, PlotId plotid) {
int px = plotid.x;
int pz = plotid.y;
- int x = (px * (path + plot)) - (int) Math.floor(path / 2) - 1;
- int z = (pz * (path + plot)) - (int) Math.floor(path / 2) - 1;
+ int x = px * (path + plot) - (int) Math.floor(path / 2) - 1;
+ int z = pz * (path + plot) - (int) Math.floor(path / 2) - 1;
return new Location(null, x, 256, z);
}
public Location getPlotBottomLocAbs(int path, int plot, PlotId plotid) {
int px = plotid.x;
int pz = plotid.y;
- int x = (px * (path + plot)) - plot - (int) Math.floor(path / 2) - 1;
- int z = (pz * (path + plot)) - plot - (int) Math.floor(path / 2) - 1;
+ int x = px * (path + plot) - plot - (int) Math.floor(path / 2) - 1;
+ int z = pz * (path + plot) - plot - (int) Math.floor(path / 2) - 1;
return new Location(null, x, 1, z);
}
diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/database/plotme/ClassicPlotMeConnector.java b/Bukkit/src/main/java/com/plotsquared/bukkit/database/plotme/ClassicPlotMeConnector.java
index fa988839b..1890af663 100644
--- a/Bukkit/src/main/java/com/plotsquared/bukkit/database/plotme/ClassicPlotMeConnector.java
+++ b/Bukkit/src/main/java/com/plotsquared/bukkit/database/plotme/ClassicPlotMeConnector.java
@@ -154,8 +154,8 @@ public class ClassicPlotMeConnector extends APlotMeConnector {
for (Entry> entry : merges.entrySet()) {
String world = entry.getKey();
for (Entry entry2 : entry.getValue().entrySet()) {
- HashMap newplots = plots.get(world);
- Plot plot = newplots.get(entry2.getKey());
+ HashMap newPlots = plots.get(world);
+ Plot plot = newPlots.get(entry2.getKey());
if (plot != null) {
plot.setMerged(entry2.getValue());
}
diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/database/plotme/LikePlotMeConverter.java b/Bukkit/src/main/java/com/plotsquared/bukkit/database/plotme/LikePlotMeConverter.java
index a0a18bc4a..803f24177 100644
--- a/Bukkit/src/main/java/com/plotsquared/bukkit/database/plotme/LikePlotMeConverter.java
+++ b/Bukkit/src/main/java/com/plotsquared/bukkit/database/plotme/LikePlotMeConverter.java
@@ -45,9 +45,9 @@ public class LikePlotMeConverter {
}
public static String getWorld(String world) {
- for (World newworld : Bukkit.getWorlds()) {
- if (newworld.getName().equalsIgnoreCase(world)) {
- return newworld.getName();
+ for (World newWorld : Bukkit.getWorlds()) {
+ if (newWorld.getName().equalsIgnoreCase(world)) {
+ return newWorld.getName();
}
}
return world;
@@ -205,11 +205,11 @@ public class LikePlotMeConverter {
PS.get().config.set("worlds." + world + ".road.height", pathheight);
PS.get().config.set("worlds." + world + ".wall.height", pathheight);
PS.get().config.set("worlds." + world + ".plot.height", pathheight);
- Integer plotsize = plotmeDgYml.getInt("worlds." + plotMeWorldName + ".PlotSize"); //
- if (plotsize == 0) {
- plotsize = 32;
+ Integer plotSize = plotmeDgYml.getInt("worlds." + plotMeWorldName + ".PlotSize"); //
+ if (plotSize == 0) {
+ plotSize = 32;
}
- PS.get().config.set("worlds." + world + ".plot.size", plotsize);
+ PS.get().config.set("worlds." + world + ".plot.size", plotSize);
String wallblock = plotmeDgYml.getString("worlds." + plotMeWorldName + ".WallBlock", "44"); //
PS.get().config.set("worlds." + world + ".wall.block", wallblock);
String floor = plotmeDgYml.getString("worlds." + plotMeWorldName + ".PlotFloorBlock", "2"); //
@@ -310,10 +310,10 @@ public class LikePlotMeConverter {
.isEnabled()) {
mw = true;
}
- for (String worldname : worlds) {
- World world = Bukkit.getWorld(getWorld(worldname));
+ for (String worldName : worlds) {
+ World world = Bukkit.getWorld(getWorld(worldName));
if (world == null) {
- sendMessage("&cInvalid world in PlotMe configuration: " + worldname);
+ sendMessage("&cInvalid world in PlotMe configuration: " + worldName);
}
String actualWorldName = world.getName();
sendMessage("Reloading generator for world: '" + actualWorldName + "'...");
@@ -344,8 +344,8 @@ public class LikePlotMeConverter {
// Load using Bukkit API
// - User must set generator manually
Bukkit.getServer().unloadWorld(world, true);
- World myworld = WorldCreator.name(actualWorldName).generator(new BukkitPlotGenerator(new HybridGen())).createWorld();
- myworld.save();
+ World myWorld = WorldCreator.name(actualWorldName).generator(new BukkitPlotGenerator(new HybridGen())).createWorld();
+ myWorld.save();
}
}
} catch (CommandException e) {
diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/ChunkListener.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/ChunkListener.java
index eea32b5cb..8a1db2547 100644
--- a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/ChunkListener.java
+++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/ChunkListener.java
@@ -111,8 +111,8 @@ public class ChunkListener implements Listener {
if (!PS.get().hasPlotArea(name)) {
continue;
}
- boolean autosave = world.isAutoSave();
- if (autosave) {
+ boolean autoSave = world.isAutoSave();
+ if (autoSave) {
world.setAutoSave(false);
}
HashMap map = players.get(name);
@@ -142,7 +142,7 @@ public class ChunkListener implements Listener {
time = 1;
}
}
- if (!Settings.CHUNK_PROCESSOR_TRIM_ON_SAVE && autosave) {
+ if (!Settings.CHUNK_PROCESSOR_TRIM_ON_SAVE && autoSave) {
world.setAutoSave(true);
}
}
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 8dcda91da..bf7f88fc6 100644
--- a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java
+++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java
@@ -636,22 +636,22 @@ public class PlayerEvents extends PlotListener implements Listener {
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onBigBoom(EntityExplodeEvent event) {
- Location loc = BukkitUtil.getLocation(event.getLocation());
- PlotArea area = loc.getPlotArea();
+ Location location = BukkitUtil.getLocation(event.getLocation());
+ PlotArea area = location.getPlotArea();
if (area == null) {
- if (!PS.get().hasPlotArea(loc.getWorld())) {
+ if (!PS.get().hasPlotArea(location.getWorld())) {
return;
}
- Iterator iter = event.blockList().iterator();
- while (iter.hasNext()) {
- iter.next();
- if (loc.getPlotArea() != null) {
- iter.remove();
+ Iterator iterator = event.blockList().iterator();
+ while (iterator.hasNext()) {
+ iterator.next();
+ if (location.getPlotArea() != null) {
+ iterator.remove();
}
}
return;
}
- Plot plot = area.getOwnedPlot(loc);
+ Plot plot = area.getOwnedPlot(location);
if (plot != null) {
if (FlagManager.isPlotFlagTrue(plot, "explosion")) {
List meta = event.getEntity().getMetadata("plot");
@@ -672,12 +672,12 @@ public class PlayerEvents extends PlotListener implements Listener {
}
this.lastRadius = 0;
}
- Iterator iter = event.blockList().iterator();
- while (iter.hasNext()) {
- Block b = iter.next();
- loc = BukkitUtil.getLocation(b.getLocation());
- if (!area.contains(loc.getX(), loc.getZ()) || !origin.equals(area.getOwnedPlot(loc))) {
- iter.remove();
+ Iterator iterator = event.blockList().iterator();
+ while (iterator.hasNext()) {
+ Block block = iterator.next();
+ location = BukkitUtil.getLocation(block.getLocation());
+ if (!area.contains(location.getX(), location.getZ()) || !origin.equals(area.getOwnedPlot(location))) {
+ iterator.remove();
}
}
return;
@@ -1267,8 +1267,8 @@ public class PlayerEvents extends PlotListener implements Listener {
}
Block block = event.getBlock();
World world = block.getWorld();
- String worldname = world.getName();
- if (!PS.get().hasPlotArea(worldname)) {
+ String worldName = world.getName();
+ if (!PS.get().hasPlotArea(worldName)) {
return;
}
Location loc = BukkitUtil.getLocation(block.getLocation());
@@ -1382,7 +1382,7 @@ public class PlayerEvents extends PlotListener implements Listener {
case LIGHTNING:
case WITHER_SKULL:
case UNKNOWN:
- // non moving / unremovable
+ // non moving / unmovable
return checkEntity(plot, "entity-cap");
case ITEM_FRAME:
case PAINTING:
@@ -1540,17 +1540,17 @@ public class PlayerEvents extends PlotListener implements Listener {
}
} else if (event.getIgnitingBlock() != null) {
- Block igniter = event.getIgnitingBlock();
+ Block ignitingBlock = event.getIgnitingBlock();
if (igniteCause == BlockIgniteEvent.IgniteCause.FLINT_AND_STEEL) {
if (plot == null || !FlagManager.isPlotFlagTrue(plot, "block-ignition")) {
event.setCancelled(true);
return;
}
- if (BukkitUtil.getLocation(igniter.getLocation()).getPlot() == null) {
+ if (BukkitUtil.getLocation(ignitingBlock.getLocation()).getPlot() == null) {
event.setCancelled(true);
return;
}
- if (!BukkitUtil.getLocation(igniter.getLocation()).getPlot().equals(plot)) {
+ if (!BukkitUtil.getLocation(ignitingBlock.getLocation()).getPlot().equals(plot)) {
event.setCancelled(true);
return;
}
@@ -1560,11 +1560,11 @@ public class PlayerEvents extends PlotListener implements Listener {
event.setCancelled(true);
return;
}
- if (BukkitUtil.getLocation(igniter.getLocation()).getPlot() == null) {
+ if (BukkitUtil.getLocation(ignitingBlock.getLocation()).getPlot() == null) {
event.setCancelled(true);
return;
}
- if (!BukkitUtil.getLocation(igniter.getLocation()).getPlot().equals(plot)) {
+ if (!BukkitUtil.getLocation(ignitingBlock.getLocation()).getPlot().equals(plot)) {
event.setCancelled(true);
return;
}
diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents183.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents183.java
index 7739678aa..605f981dc 100644
--- a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents183.java
+++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents183.java
@@ -25,11 +25,11 @@ public class PlayerEvents183 implements Listener {
}
PlotArea area = loc.getPlotArea();
if (area == null) {
- Iterator iter = event.blockList().iterator();
- while (iter.hasNext()) {
- loc = BukkitUtil.getLocation(iter.next().getLocation());
+ Iterator iterator = event.blockList().iterator();
+ while (iterator.hasNext()) {
+ loc = BukkitUtil.getLocation(iterator.next().getLocation());
if (loc.getPlotArea() != null) {
- iter.remove();
+ iterator.remove();
}
}
return;
@@ -38,11 +38,11 @@ public class PlayerEvents183 implements Listener {
if (plot == null || !FlagManager.isPlotFlagTrue(plot, "explosion")) {
event.setCancelled(true);
}
- Iterator iter = event.blockList().iterator();
- while (iter.hasNext()) {
- Block b = iter.next();
+ Iterator iterator = event.blockList().iterator();
+ while (iterator.hasNext()) {
+ Block b = iterator.next();
if (!plot.equals(area.getOwnedPlot(BukkitUtil.getLocation(b.getLocation())))) {
- iter.remove();
+ iterator.remove();
}
}
}
diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlotPlusListener.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlotPlusListener.java
index eb7b3ac66..c2c2ab6b0 100644
--- a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlotPlusListener.java
+++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlotPlusListener.java
@@ -8,10 +8,6 @@ import com.plotsquared.bukkit.events.PlayerEnterPlotEvent;
import com.plotsquared.bukkit.events.PlayerLeavePlotEvent;
import com.plotsquared.bukkit.util.BukkitUtil;
import com.plotsquared.listener.PlotListener;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map.Entry;
-import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.GameMode;
import org.bukkit.entity.EntityType;
@@ -26,6 +22,11 @@ import org.bukkit.event.player.PlayerPickupItemEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.plugin.java.JavaPlugin;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map.Entry;
+import java.util.UUID;
+
public class PlotPlusListener extends PlotListener implements Listener {
private static final HashMap feedRunnable = new HashMap<>();
@@ -36,15 +37,15 @@ public class PlotPlusListener extends PlotListener implements Listener {
@Override
public void run() {
if (!healRunnable.isEmpty()) {
- for (Iterator> iter = healRunnable.entrySet().iterator(); iter.hasNext(); ) {
- Entry entry = iter.next();
+ for (Iterator> iterator = healRunnable.entrySet().iterator(); iterator.hasNext(); ) {
+ Entry entry = iterator.next();
Interval value = entry.getValue();
++value.count;
if (value.count == value.interval) {
value.count = 0;
Player player = Bukkit.getPlayer(entry.getKey());
if (player == null) {
- iter.remove();
+ iterator.remove();
continue;
}
double level = player.getHealth();
@@ -55,15 +56,15 @@ public class PlotPlusListener extends PlotListener implements Listener {
}
}
if (!feedRunnable.isEmpty()) {
- for (Iterator> iter = feedRunnable.entrySet().iterator(); iter.hasNext(); ) {
- Entry entry = iter.next();
+ for (Iterator> iterator = feedRunnable.entrySet().iterator(); iterator.hasNext(); ) {
+ Entry entry = iterator.next();
Interval value = entry.getValue();
++value.count;
if (value.count == value.interval) {
value.count = 0;
Player player = Bukkit.getPlayer(entry.getKey());
if (player == null) {
- iter.remove();
+ iterator.remove();
continue;
}
int level = player.getFoodLevel();
diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/object/entity/EntityWrapper.java b/Bukkit/src/main/java/com/plotsquared/bukkit/object/entity/EntityWrapper.java
index 4e72a8040..157372840 100644
--- a/Bukkit/src/main/java/com/plotsquared/bukkit/object/entity/EntityWrapper.java
+++ b/Bukkit/src/main/java/com/plotsquared/bukkit/object/entity/EntityWrapper.java
@@ -56,7 +56,7 @@ public class EntityWrapper {
private ArmorStandStats stand;
@SuppressWarnings("deprecation")
- public EntityWrapper(org.bukkit.entity.Entity entity, short depth) {
+ public EntityWrapper(Entity entity, short depth) {
this.hash = entity.getEntityId();
this.depth = depth;
Location loc = entity.getLocation();
@@ -113,21 +113,24 @@ public class EntityWrapper {
case THROWN_EXP_BOTTLE:
case WEATHER:
case WITHER_SKULL:
- case UNKNOWN: {
+ case UNKNOWN:
+ case TIPPED_ARROW:
+ case SPECTRAL_ARROW:
+ case SHULKER_BULLET:
+ case DRAGON_FIREBALL:
+ case LINGERING_POTION:
+ case AREA_EFFECT_CLOUD:
// Do this stuff later
return;
- }
- default: {
+ default:
PS.debug("&cCOULD NOT IDENTIFY ENTITY: " + entity.getType());
return;
- }
// MISC //
- case DROPPED_ITEM: {
+ case DROPPED_ITEM:
Item item = (Item) entity;
this.stack = item.getItemStack();
return;
- }
- case ITEM_FRAME: {
+ case ITEM_FRAME:
ItemFrame itemframe = (ItemFrame) entity;
this.x = Math.floor(this.x);
this.y = Math.floor(this.y);
@@ -135,8 +138,7 @@ public class EntityWrapper {
this.dataByte = getOrdinal(Rotation.values(), itemframe.getRotation());
this.stack = itemframe.getItem().clone();
return;
- }
- case PAINTING: {
+ case PAINTING:
Painting painting = (Painting) entity;
this.x = Math.floor(this.x);
this.y = Math.floor(this.y);
@@ -144,23 +146,21 @@ public class EntityWrapper {
Art a = painting.getArt();
this.dataByte = getOrdinal(BlockFace.values(), painting.getFacing());
int h = a.getBlockHeight();
- if ((h % 2) == 0) {
+ if (h % 2 == 0) {
this.y -= 1;
}
this.dataString = a.name();
return;
- }
// END MISC //
// INVENTORY HOLDER //
case MINECART_CHEST:
- case MINECART_HOPPER: {
+ case MINECART_HOPPER:
storeInventory((InventoryHolder) entity);
return;
- }
// START LIVING ENTITY //
// START AGEABLE //
// START TAMEABLE //
- case HORSE: {
+ case HORSE:
Horse horse = (Horse) entity;
this.horse = new HorseStats();
this.horse.jump = horse.getJumpStrength();
@@ -173,52 +173,45 @@ public class EntityWrapper {
storeLiving((LivingEntity) entity);
storeInventory((InventoryHolder) entity);
return;
- }
// END INVENTORY HOLDER //
case WOLF:
- case OCELOT: {
+ case OCELOT:
storeTameable((Tameable) entity);
storeAgeable((Ageable) entity);
storeLiving((LivingEntity) entity);
return;
- }
- // END AMEABLE //
- case SHEEP: {
+ // END TAMEABLE //
+ case SHEEP:
Sheep sheep = (Sheep) entity;
this.dataByte = (byte) (sheep.isSheared() ? 1 : 0);
this.dataByte2 = sheep.getColor().getDyeData();
storeAgeable((Ageable) entity);
storeLiving((LivingEntity) entity);
return;
- }
case VILLAGER:
case CHICKEN:
case COW:
case MUSHROOM_COW:
- case PIG: {
+ case PIG:
storeAgeable((Ageable) entity);
storeLiving((LivingEntity) entity);
return;
- }
- // END AGEABLE //
- case RABBIT: { // NEW
+ case RABBIT: // NEW
this.dataByte = getOrdinal(Type.values(), ((Rabbit) entity).getRabbitType());
storeAgeable((Ageable) entity);
storeLiving((LivingEntity) entity);
return;
- }
- case GUARDIAN: { // NEW
+ // END AGEABLE //
+ case GUARDIAN: // NEW
this.dataByte = (byte) (((Guardian) entity).isElder() ? 1 : 0);
storeLiving((LivingEntity) entity);
return;
- }
- case SKELETON: { // NEW
+ case SKELETON: // NEW
this.dataByte = (byte) ((Skeleton) entity).getSkeletonType().getId();
storeLiving((LivingEntity) entity);
return;
- }
- case ARMOR_STAND: { // NEW
- // CHECK positions
+ case ARMOR_STAND: // NEW
+ // CHECK positions
ArmorStand stand = (ArmorStand) entity;
this.inventory = new ItemStack[]{stand.getItemInHand().clone(), stand.getHelmet().clone(), stand.getChestplate().clone(),
stand.getLeggings().clone(), stand.getBoots().clone()};
@@ -271,7 +264,6 @@ public class EntityWrapper {
this.stand.small = true;
}
return;
- }
case ENDERMITE: // NEW
case BAT:
case ENDER_DRAGON:
@@ -289,12 +281,11 @@ public class EntityWrapper {
case ENDERMAN:
case CREEPER:
case BLAZE:
+ case SHULKER:
case SNOWMAN:
- case IRON_GOLEM: {
+ case IRON_GOLEM:
storeLiving((LivingEntity) entity);
- return;
- }
- // END LIVING //
+ // END LIVING //
}
}
@@ -318,7 +309,7 @@ public class EntityWrapper {
entity.setCustomName(this.lived.name);
entity.setCustomNameVisible(this.lived.visible);
}
- if ((this.lived.potions != null) && !this.lived.potions.isEmpty()) {
+ if (this.lived.potions != null && !this.lived.potions.isEmpty()) {
entity.addPotionEffects(this.lived.potions);
}
entity.setRemainingAir(this.lived.air);
@@ -413,21 +404,17 @@ public class EntityWrapper {
}
Entity entity;
switch (this.type) {
- case DROPPED_ITEM: {
+ case DROPPED_ITEM:
return world.dropItem(loc, this.stack);
- }
case PLAYER:
- case LEASH_HITCH: {
+ case LEASH_HITCH:
return null;
- }
- case ITEM_FRAME: {
+ case ITEM_FRAME:
entity = world.spawn(loc, ItemFrame.class);
break;
- }
- case PAINTING: {
+ case PAINTING:
entity = world.spawn(loc, Painting.class);
break;
- }
default:
entity = world.spawnEntity(loc, this.type);
break;
@@ -483,38 +470,33 @@ public class EntityWrapper {
case WEATHER:
case WITHER_SKULL:
case MINECART_FURNACE:
- case UNKNOWN: {
+ case UNKNOWN:
// Do this stuff later
return entity;
- }
- default: {
+ default:
PS.debug("&cCOULD NOT IDENTIFY ENTITY: " + entity.getType());
return entity;
- }
// MISC //
- case ITEM_FRAME: {
+ case ITEM_FRAME:
ItemFrame itemframe = (ItemFrame) entity;
itemframe.setRotation(Rotation.values()[this.dataByte]);
itemframe.setItem(this.stack);
return entity;
- }
- case PAINTING: {
+ case PAINTING:
Painting painting = (Painting) entity;
painting.setFacingDirection(BlockFace.values()[this.dataByte], true);
painting.setArt(Art.getByName(this.dataString), true);
return entity;
- }
// END MISC //
// INVENTORY HOLDER //
case MINECART_CHEST:
- case MINECART_HOPPER: {
+ case MINECART_HOPPER:
restoreInventory((InventoryHolder) entity);
return entity;
- }
// START LIVING ENTITY //
// START AGEABLE //
// START TAMEABLE //
- case HORSE: {
+ case HORSE:
Horse horse = (Horse) entity;
horse.setJumpStrength(this.horse.jump);
horse.setCarryingChest(this.horse.chest);
@@ -526,17 +508,15 @@ public class EntityWrapper {
restoreLiving((LivingEntity) entity);
restoreInventory((InventoryHolder) entity);
return entity;
- }
// END INVENTORY HOLDER //
case WOLF:
- case OCELOT: {
+ case OCELOT:
restoreTameable((Tameable) entity);
restoreAgeable((Ageable) entity);
restoreLiving((LivingEntity) entity);
return entity;
- }
// END AGEABLE //
- case SHEEP: {
+ case SHEEP:
Sheep sheep = (Sheep) entity;
if (this.dataByte == 1) {
sheep.setSheared(true);
@@ -547,41 +527,36 @@ public class EntityWrapper {
restoreAgeable((Ageable) entity);
restoreLiving((LivingEntity) entity);
return entity;
- }
case VILLAGER:
case CHICKEN:
case COW:
case MUSHROOM_COW:
- case PIG: {
+ case PIG:
restoreAgeable((Ageable) entity);
restoreLiving((LivingEntity) entity);
return entity;
- }
// END AGEABLE //
- case RABBIT: { // NEW
+ case RABBIT: // NEW
if (this.dataByte != 0) {
((Rabbit) entity).setRabbitType(Type.values()[this.dataByte]);
}
restoreAgeable((Ageable) entity);
restoreLiving((LivingEntity) entity);
return entity;
- }
- case GUARDIAN: { // NEW
+ case GUARDIAN: // NEW
if (this.dataByte != 0) {
((Guardian) entity).setElder(true);
}
restoreLiving((LivingEntity) entity);
return entity;
- }
- case SKELETON: { // NEW
+ case SKELETON: // NEW
if (this.dataByte != 0) {
((Skeleton) entity).setSkeletonType(SkeletonType.values()[this.dataByte]);
}
storeLiving((LivingEntity) entity);
return entity;
- }
- case ARMOR_STAND: { // NEW
- // CHECK positions
+ case ARMOR_STAND: // NEW
+ // CHECK positions
ArmorStand stand = (ArmorStand) entity;
if (this.inventory[0] != null) {
stand.setItemInHand(this.inventory[0]);
@@ -598,27 +573,27 @@ public class EntityWrapper {
if (this.inventory[4] != null) {
stand.setBoots(this.inventory[4]);
}
- if ((this.stand.head[0] != 0) || (this.stand.head[1] != 0) || (this.stand.head[2] != 0)) {
+ if (this.stand.head[0] != 0 || this.stand.head[1] != 0 || this.stand.head[2] != 0) {
EulerAngle pose = new EulerAngle(this.stand.head[0], this.stand.head[1], this.stand.head[2]);
stand.setHeadPose(pose);
}
- if ((this.stand.body[0] != 0) || (this.stand.body[1] != 0) || (this.stand.body[2] != 0)) {
+ if (this.stand.body[0] != 0 || this.stand.body[1] != 0 || this.stand.body[2] != 0) {
EulerAngle pose = new EulerAngle(this.stand.body[0], this.stand.body[1], this.stand.body[2]);
stand.setBodyPose(pose);
}
- if ((this.stand.leftLeg[0] != 0) || (this.stand.leftLeg[1] != 0) || (this.stand.leftLeg[2] != 0)) {
+ if (this.stand.leftLeg[0] != 0 || this.stand.leftLeg[1] != 0 || this.stand.leftLeg[2] != 0) {
EulerAngle pose = new EulerAngle(this.stand.leftLeg[0], this.stand.leftLeg[1], this.stand.leftLeg[2]);
stand.setLeftLegPose(pose);
}
- if ((this.stand.rightLeg[0] != 0) || (this.stand.rightLeg[1] != 0) || (this.stand.rightLeg[2] != 0)) {
+ if (this.stand.rightLeg[0] != 0 || this.stand.rightLeg[1] != 0 || this.stand.rightLeg[2] != 0) {
EulerAngle pose = new EulerAngle(this.stand.rightLeg[0], this.stand.rightLeg[1], this.stand.rightLeg[2]);
stand.setRightLegPose(pose);
}
- if ((this.stand.leftArm[0] != 0) || (this.stand.leftArm[1] != 0) || (this.stand.leftArm[2] != 0)) {
+ if (this.stand.leftArm[0] != 0 || this.stand.leftArm[1] != 0 || this.stand.leftArm[2] != 0) {
EulerAngle pose = new EulerAngle(this.stand.leftArm[0], this.stand.leftArm[1], this.stand.leftArm[2]);
stand.setLeftArmPose(pose);
}
- if ((this.stand.rightArm[0] != 0) || (this.stand.rightArm[1] != 0) || (this.stand.rightArm[2] != 0)) {
+ if (this.stand.rightArm[0] != 0 || this.stand.rightArm[1] != 0 || this.stand.rightArm[2] != 0) {
EulerAngle pose = new EulerAngle(this.stand.rightArm[0], this.stand.rightArm[1], this.stand.rightArm[2]);
stand.setRightArmPose(pose);
}
@@ -639,7 +614,6 @@ public class EntityWrapper {
}
restoreLiving((LivingEntity) entity);
return entity;
- }
case ENDERMITE: // NEW
case BAT:
case ENDER_DRAGON:
@@ -658,10 +632,9 @@ public class EntityWrapper {
case CREEPER:
case BLAZE:
case SNOWMAN:
- case IRON_GOLEM: {
+ case IRON_GOLEM:
restoreLiving((LivingEntity) entity);
return entity;
- }
// END LIVING //
}
}
diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitHybridUtils.java b/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitHybridUtils.java
index 32b243224..06a02fe56 100644
--- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitHybridUtils.java
+++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitHybridUtils.java
@@ -275,9 +275,9 @@ public class BukkitHybridUtils extends HybridUtils {
}
@Override
- public int checkModified(String worldname, int x1, int x2, int y1, int y2, int z1, int z2,
+ public int checkModified(String worldName, int x1, int x2, int y1, int y2, int z1, int z2,
PlotBlock[] blocks) {
- World world = BukkitUtil.getWorld(worldname);
+ World world = BukkitUtil.getWorld(worldName);
int count = 0;
for (int y = y1; y <= y2; y++) {
for (int x = x1; x <= x2; x++) {
@@ -301,8 +301,8 @@ public class BukkitHybridUtils extends HybridUtils {
}
@Override
- public int get_ey(String worldname, int sx, int ex, int sz, int ez, int sy) {
- World world = BukkitUtil.getWorld(worldname);
+ public int get_ey(String worldName, int sx, int ex, int sz, int ez, int sy) {
+ World world = BukkitUtil.getWorld(worldName);
int maxY = world.getMaxHeight();
int ey = sy;
for (int x = sx; x <= ex; x++) {
diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitSchematicHandler.java b/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitSchematicHandler.java
index 1e48f4dc7..e55cee895 100644
--- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitSchematicHandler.java
+++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitSchematicHandler.java
@@ -26,7 +26,6 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.Map.Entry;
import java.util.Set;
/**
@@ -45,9 +44,9 @@ public class BukkitSchematicHandler extends SchematicHandler {
final Location bot = corners[0];
Location top = corners[1];
- final int width = (top.getX() - bot.getX()) + 1;
- int height = (top.getY() - bot.getY()) + 1;
- final int length = (top.getZ() - bot.getZ()) + 1;
+ final int width = top.getX() - bot.getX() + 1;
+ int height = top.getY() - bot.getY() + 1;
+ final int length = top.getZ() - bot.getZ() + 1;
// Main Schematic tag
final HashMap schematic = new HashMap<>();
schematic.put("Width", new ShortTag("Width", (short) width));
@@ -114,7 +113,7 @@ public class BukkitSchematicHandler extends SchematicHandler {
@Override
public void run() {
long start = System.currentTimeMillis();
- while (!chunks.isEmpty() && ((System.currentTimeMillis() - start) < 20)) {
+ while (!chunks.isEmpty() && System.currentTimeMillis() - start < 20) {
// save schematics
ChunkLoc chunk = chunks.remove(0);
Chunk bc = worldObj.getChunkAt(chunk.x, chunk.z);
@@ -145,7 +144,7 @@ public class BukkitSchematicHandler extends SchematicHandler {
int i1 = ry * width * length;
for (int z = zzb; z <= zzt; z++) {
int rz = z - bz;
- int i2 = i1 + (rz * width);
+ int i2 = i1 + rz * width;
for (int x = xxb; x <= xxt; x++) {
int rx = x - bx;
int index = i2 + rx;
@@ -219,9 +218,8 @@ public class BukkitSchematicHandler extends SchematicHandler {
case 189:
case 190:
case 191:
- case 192: {
+ case 192:
break;
- }
case 54:
case 130:
case 142:
@@ -256,17 +254,14 @@ public class BukkitSchematicHandler extends SchematicHandler {
case 29:
case 33:
case 151:
- case 178: {
+ case 178:
// TODO implement fully
BlockState state = block.getState();
if (state != null) {
StateWrapper wrapper = new StateWrapper(state);
CompoundTag rawTag = wrapper.getTag();
if (rawTag != null) {
- Map values = new HashMap<>();
- for (Entry entry : rawTag.getValue().entrySet()) {
- values.put(entry.getKey(), entry.getValue());
- }
+ Map values = new HashMap<>(rawTag.getValue());
values.put("id", new StringTag("id", wrapper.getId()));
values.put("x", new IntTag("x", x));
values.put("y", new IntTag("y", y));
@@ -275,10 +270,8 @@ public class BukkitSchematicHandler extends SchematicHandler {
tileEntities.add(tileEntityTag);
}
}
- }
- default: {
+ default:
blockData[index] = block.getData();
- }
}
// For optimization reasons, we are not supporting custom data types
// Especially since the most likely reason beyond this range is modded servers in which the blocks
@@ -310,7 +303,7 @@ public class BukkitSchematicHandler extends SchematicHandler {
}
@Override
- public void restoreTag(CompoundTag ct, short x, short y, short z, Schematic schem) {
- new StateWrapper(ct).restoreTag(x, y, z, schem);
+ public void restoreTag(CompoundTag ct, short x, short y, short z, Schematic schematic) {
+ new StateWrapper(ct).restoreTag(x, y, z, schematic);
}
}
diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitSetupUtils.java b/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitSetupUtils.java
index 818520af4..c9b39552b 100644
--- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitSetupUtils.java
+++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitSetupUtils.java
@@ -62,8 +62,8 @@ public class BukkitSetupUtils extends SetupUtils {
switch (type) {
case 2: {
if (object.id != null) {
- String areaname = object.id + "-" + object.min + "-" + object.max;
- String areaPath = "areas." + areaname;
+ String areaName = object.id + "-" + object.min + "-" + object.max;
+ String areaPath = "areas." + areaName;
if (!worldSection.contains(areaPath)) {
worldSection.createSection(areaPath);
}
@@ -75,7 +75,7 @@ public class BukkitSetupUtils extends SetupUtils {
options.put("generator.type", object.type);
options.put("generator.terrain", object.terrain);
options.put("generator.plugin", object.plotManager);
- if ((object.setupGenerator != null) && !object.setupGenerator.equals(object.plotManager)) {
+ if (object.setupGenerator != null && !object.setupGenerator.equals(object.plotManager)) {
options.put("generator.init", object.setupGenerator);
}
for (Entry entry : options.entrySet()) {
@@ -91,34 +91,32 @@ public class BukkitSetupUtils extends SetupUtils {
}
}
}
- GeneratorWrapper> gen = generators.get(object.setupGenerator);
- if ((gen != null) && gen.isFull()) {
+ GeneratorWrapper> gen = SetupUtils.generators.get(object.setupGenerator);
+ if (gen != null && gen.isFull()) {
object.setupGenerator = null;
}
break;
}
- case 1: {
+ case 1:
for (ConfigurationNode step : steps) {
worldSection.set(step.getConstant(), step.getValue());
}
PS.get().config.set("worlds." + world + "." + "generator.type", object.type);
PS.get().config.set("worlds." + world + "." + "generator.terrain", object.terrain);
PS.get().config.set("worlds." + world + "." + "generator.plugin", object.plotManager);
- if ((object.setupGenerator != null) && !object.setupGenerator.equals(object.plotManager)) {
+ if (object.setupGenerator != null && !object.setupGenerator.equals(object.plotManager)) {
PS.get().config.set("worlds." + world + "." + "generator.init", object.setupGenerator);
}
- GeneratorWrapper> gen = generators.get(object.setupGenerator);
- if ((gen != null) && gen.isFull()) {
+ GeneratorWrapper> gen = SetupUtils.generators.get(object.setupGenerator);
+ if (gen != null && gen.isFull()) {
object.setupGenerator = null;
}
break;
- }
- case 0: {
+ case 0:
for (ConfigurationNode step : steps) {
worldSection.set(step.getConstant(), step.getValue());
}
break;
- }
}
try {
PS.get().config.save(PS.get().configFile);
@@ -126,7 +124,7 @@ public class BukkitSetupUtils extends SetupUtils {
e.printStackTrace();
}
if (object.setupGenerator != null) {
- if ((Bukkit.getPluginManager().getPlugin("Multiverse-Core") != null) && Bukkit.getPluginManager().getPlugin("Multiverse-Core")
+ if (Bukkit.getPluginManager().getPlugin("Multiverse-Core") != null && Bukkit.getPluginManager().getPlugin("Multiverse-Core")
.isEnabled()) {
Bukkit.getServer()
.dispatchCommand(Bukkit.getServer().getConsoleSender(), "mv create " + world + " normal -g " + object.setupGenerator);
@@ -135,7 +133,7 @@ public class BukkitSetupUtils extends SetupUtils {
return world;
}
}
- if ((Bukkit.getPluginManager().getPlugin("MultiWorld") != null) && Bukkit.getPluginManager().getPlugin("MultiWorld").isEnabled()) {
+ if (Bukkit.getPluginManager().getPlugin("MultiWorld") != null && Bukkit.getPluginManager().getPlugin("MultiWorld").isEnabled()) {
Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "mw create " + world + " plugin:" + object.setupGenerator);
setGenerator(world, object.setupGenerator);
if (Bukkit.getWorld(world) != null) {
@@ -148,14 +146,14 @@ public class BukkitSetupUtils extends SetupUtils {
Bukkit.createWorld(wc);
setGenerator(world, object.setupGenerator);
} else {
- if ((Bukkit.getPluginManager().getPlugin("Multiverse-Core") != null) && Bukkit.getPluginManager().getPlugin("Multiverse-Core")
+ if (Bukkit.getPluginManager().getPlugin("Multiverse-Core") != null && Bukkit.getPluginManager().getPlugin("Multiverse-Core")
.isEnabled()) {
Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "mv create " + world + " normal");
if (Bukkit.getWorld(world) != null) {
return world;
}
}
- if ((Bukkit.getPluginManager().getPlugin("MultiWorld") != null) && Bukkit.getPluginManager().getPlugin("MultiWorld").isEnabled()) {
+ if (Bukkit.getPluginManager().getPlugin("MultiWorld") != null && Bukkit.getPluginManager().getPlugin("MultiWorld").isEnabled()) {
Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "mw create " + world);
if (Bukkit.getWorld(world) != null) {
return world;
@@ -193,7 +191,7 @@ public class BukkitSetupUtils extends SetupUtils {
if (!(generator instanceof BukkitPlotGenerator)) {
return null;
}
- for (Entry> entry : generators.entrySet()) {
+ for (Entry> entry : SetupUtils.generators.entrySet()) {
GeneratorWrapper> current = entry.getValue();
if (current.equals(generator)) {
return entry.getKey();
diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java b/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java
index da9bdd4b8..26f5b008e 100644
--- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java
+++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java
@@ -97,8 +97,8 @@ public class BukkitUtil extends WorldUtil {
return entity.getWorld().getName();
}
- public static List getEntities(String worldname) {
- return getWorld(worldname).getEntities();
+ public static List getEntities(String worldName) {
+ return getWorld(worldName).getEntities();
}
public static Location getLocation(Entity entity) {
@@ -114,8 +114,8 @@ public class BukkitUtil extends WorldUtil {
}
@Override
- public boolean isWorld(String world) {
- return getWorld(world) != null;
+ public boolean isWorld(String worldName) {
+ return getWorld(worldName) != null;
}
@Override
@@ -124,8 +124,8 @@ public class BukkitUtil extends WorldUtil {
}
@Override
- public void setSign(String worldname, int x, int y, int z, String[] lines) {
- World world = getWorld(worldname);
+ public void setSign(String worldName, int x, int y, int z, String[] lines) {
+ World world = getWorld(worldName);
Block block = world.getBlockAt(x, y, z);
// block.setType(Material.AIR);
block.setTypeIdAndData(Material.WALL_SIGN.getId(), (byte) 2, false);
@@ -172,8 +172,8 @@ public class BukkitUtil extends WorldUtil {
}
@Override
- public void saveWorld(String worldname) {
- World world = getWorld(worldname);
+ public void saveWorld(String worldName) {
+ World world = getWorld(worldName);
if (world != null) {
world.save();
}
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 756a469c6..abfb5994d 100644
--- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/Metrics.java
+++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/Metrics.java
@@ -321,7 +321,7 @@ public class Metrics {
// Construct the post data
StringBuilder json = new StringBuilder(1024);
json.append('{');
- // The plugin's description file containg all of the plugin data such as name, version, author, etc
+ // The plugin's description file containing all of the plugin data such as name, version, author, etc
appendJSONPair(json, "guid", this.guid);
appendJSONPair(json, "plugin_version", pluginVersion);
appendJSONPair(json, "server_version", serverVersion);
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 d899ca8f5..ec7764bc9 100644
--- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/NbtFactory.java
+++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/NbtFactory.java
@@ -223,7 +223,7 @@ public class NbtFactory {
/**
* Construct a new NBT wrapper from a compound.
- * @param nmsCompound - the NBT compund.
+ * @param nmsCompound - the NBT compound.
* @return The wrapper.
*/
public static NbtCompound fromCompound(Object nmsCompound) {
@@ -247,7 +247,7 @@ public class NbtFactory {
/**
* Construct a wrapper for an NBT tag stored (in memory) in an item stack. This is where
- * auxillary data such as enchanting, name and lore is stored. It does not include items
+ * auxiliary data such as enchanting, name and lore is stored. It does not include items
* material, damage value or count.
*
* The item stack must be a wrapper for a CraftItemStack.
@@ -669,7 +669,7 @@ public class NbtFactory {
super(handle, getDataMap(handle));
}
- // Simplifiying access to each value
+ // Simplifying access to each value
public Byte getByte(String key, Byte defaultValue) {
return containsKey(key) ? (Byte) get(key) : defaultValue;
}
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 1f446060c..840b149cd 100644
--- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/SendChunk.java
+++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/SendChunk.java
@@ -116,10 +116,10 @@ public class SendChunk {
try {
chunk.unload(true, false);
} catch (Throwable e) {
- String worldname = chunk.getWorld().getName();
- PS.debug("$4Could not save chunk: " + worldname + ";" + chunk.getX() + ";" + chunk.getZ());
+ String worldName = chunk.getWorld().getName();
+ PS.debug("$4Could not save chunk: " + worldName + ";" + chunk.getX() + ";" + chunk.getZ());
PS.debug("$3 - $4File may be open in another process (e.g. MCEdit)");
- PS.debug("$3 - $4" + worldname + "/level.dat or " + worldname
+ PS.debug("$3 - $4" + worldName + "/level.dat or " + worldName
+ "/level_old.dat may be corrupt (try repairing or removing these)");
}
}
@@ -127,12 +127,12 @@ public class SendChunk {
}
}
- public void sendChunk(String worldname, Collection chunkLocs) {
- World myworld = Bukkit.getWorld(worldname);
+ public void sendChunk(String worldName, Collection chunkLocations) {
+ World myWorld = Bukkit.getWorld(worldName);
ArrayList chunks = new ArrayList<>();
- for (ChunkLoc loc : chunkLocs) {
- if (myworld.isChunkLoaded(loc.x, loc.z)) {
- chunks.add(myworld.getChunkAt(loc.x, loc.z));
+ for (ChunkLoc loc : chunkLocations) {
+ if (myWorld.isChunkLoaded(loc.x, loc.z)) {
+ chunks.add(myWorld.getChunkAt(loc.x, loc.z));
}
}
sendChunk(chunks);
diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/util/SetGenCB.java b/Bukkit/src/main/java/com/plotsquared/bukkit/util/SetGenCB.java
index ac3b57ac7..f8c4ece83 100644
--- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/SetGenCB.java
+++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/SetGenCB.java
@@ -45,10 +45,10 @@ public class SetGenCB {
}
}
if (!set) {
- Iterator iter = world.getPopulators().iterator();
- while (iter.hasNext()) {
- if (iter.next() instanceof BukkitAugmentedGenerator) {
- iter.remove();
+ Iterator iterator = world.getPopulators().iterator();
+ while (iterator.hasNext()) {
+ if (iterator.next() instanceof BukkitAugmentedGenerator) {
+ iterator.remove();
}
}
}
diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/util/block/FastQueue_1_7.java b/Bukkit/src/main/java/com/plotsquared/bukkit/util/block/FastQueue_1_7.java
index 91a734ead..7db7cfef8 100644
--- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/block/FastQueue_1_7.java
+++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/block/FastQueue_1_7.java
@@ -34,8 +34,7 @@ public class FastQueue_1_7 extends SlowQueue {
private final RefMethod methodA;
private final RefMethod methodGetById;
private final RefMethod methodInitLighting;
-
- private final SendChunk chunksender;
+ private final SendChunk sendChunk;
private final HashMap toUpdate = new HashMap<>();
@@ -45,7 +44,7 @@ public class FastQueue_1_7 extends SlowQueue {
this.methodA = this.classChunk.getMethod("a", int.class, int.class, int.class, this.classBlock, int.class);
this.methodGetById = this.classBlock.getMethod("getById", int.class);
this.methodInitLighting = this.classChunk.getMethod("initLighting");
- this.chunksender = new SendChunk();
+ this.sendChunk = new SendChunk();
TaskManager.runTaskRepeat(new Runnable() {
@Override
public void run() {
@@ -82,7 +81,7 @@ public class FastQueue_1_7 extends SlowQueue {
return;
}
try {
- this.chunksender.sendChunk(chunks);
+ this.sendChunk.sendChunk(chunks);
} catch (Throwable e) {
e.printStackTrace();
MainUtil.canSendChunk = false;
@@ -175,6 +174,6 @@ public class FastQueue_1_7 extends SlowQueue {
ChunkWrapper wrapper = SetQueue.IMP.new ChunkWrapper(world, loc.x, loc.z);
this.toUpdate.remove(wrapper);
}
- this.chunksender.sendChunk(world, locations);
+ this.sendChunk.sendChunk(world, locations);
}
}
diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/util/block/FastQueue_1_8.java b/Bukkit/src/main/java/com/plotsquared/bukkit/util/block/FastQueue_1_8.java
index c391e4743..bd1c21f0e 100644
--- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/block/FastQueue_1_8.java
+++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/block/FastQueue_1_8.java
@@ -40,7 +40,7 @@ public class FastQueue_1_8 extends SlowQueue {
private final RefMethod methodA;
private final RefMethod methodGetByCombinedId;
private final RefConstructor constructorBlockPosition;
- private final SendChunk chunksender;
+ private final SendChunk sendChunk;
public FastQueue_1_8() throws RuntimeException {
this.methodInitLighting = this.classChunk.getMethod("initLighting");
@@ -49,7 +49,7 @@ public class FastQueue_1_8 extends SlowQueue {
this.methodGetHandle = this.classCraftWorld.getMethod("getHandle");
this.methodGetChunkAt = this.classWorld.getMethod("getChunkAt", int.class, int.class);
this.methodA = this.classChunk.getMethod("a", this.classBlockPosition, this.classIBlockData);
- this.chunksender = new SendChunk();
+ this.sendChunk = new SendChunk();
TaskManager.runTaskRepeat(new Runnable() {
@Override
public void run() {
@@ -59,7 +59,7 @@ public class FastQueue_1_8 extends SlowQueue {
int count = 0;
ArrayList chunks = new ArrayList();
Iterator> i = FastQueue_1_8.this.toUpdate.entrySet().iterator();
- while (i.hasNext() && (count < 128)) {
+ while (i.hasNext() && count < 128) {
chunks.add(i.next().getValue());
i.remove();
count++;
@@ -86,7 +86,7 @@ public class FastQueue_1_8 extends SlowQueue {
return;
}
try {
- this.chunksender.sendChunk(chunks);
+ this.sendChunk.sendChunk(chunks);
} catch (Throwable e) {
e.printStackTrace();
MainUtil.canSendChunk = false;
@@ -161,7 +161,7 @@ public class FastQueue_1_8 extends SlowQueue {
case 29:
case 33:
case 151:
- case 178: {
+ case 178:
Block block = world.getBlockAt(x, y, z);
if (block.getData() == newBlock.data) {
if (block.getTypeId() != newBlock.id) {
@@ -175,7 +175,6 @@ public class FastQueue_1_8 extends SlowQueue {
}
}
continue;
- }
}
// Start data value shortcut
@@ -263,9 +262,8 @@ public class FastQueue_1_8 extends SlowQueue {
case 189:
case 190:
case 191:
- case 192: {
+ case 192:
continue;
- }
}
if (block.getData() == newBlock.data) {
return;
@@ -311,14 +309,13 @@ public class FastQueue_1_8 extends SlowQueue {
case 29:
case 33:
case 151:
- case 178: {
+ case 178:
if (block.getData() == newBlock.data) {
block.setTypeId(newBlock.id, false);
} else {
block.setTypeIdAndData(newBlock.id, newBlock.data, false);
}
continue;
- }
}
// End blockstate workaround //
@@ -378,6 +375,6 @@ public class FastQueue_1_8 extends SlowQueue {
ChunkWrapper wrapper = SetQueue.IMP.new ChunkWrapper(world, loc.x, loc.z);
this.toUpdate.remove(wrapper);
}
- this.chunksender.sendChunk(world, locations);
+ this.sendChunk.sendChunk(world, locations);
}
}
diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/util/block/FastQueue_1_8_3.java b/Bukkit/src/main/java/com/plotsquared/bukkit/util/block/FastQueue_1_8_3.java
index a18bd2787..16a50885d 100644
--- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/block/FastQueue_1_8_3.java
+++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/block/FastQueue_1_8_3.java
@@ -1,5 +1,7 @@
package com.plotsquared.bukkit.util.block;
+import static com.intellectualcrafters.plot.util.ReflectionUtils.getRefClass;
+
import com.intellectualcrafters.plot.object.ChunkLoc;
import com.intellectualcrafters.plot.object.PseudoRandom;
import com.intellectualcrafters.plot.util.ChunkManager;
@@ -14,6 +16,12 @@ import com.intellectualcrafters.plot.util.SetQueue;
import com.intellectualcrafters.plot.util.SetQueue.ChunkWrapper;
import com.intellectualcrafters.plot.util.TaskManager;
import com.plotsquared.bukkit.util.SendChunk;
+import org.bukkit.Chunk;
+import org.bukkit.Material;
+import org.bukkit.World;
+import org.bukkit.World.Environment;
+import org.bukkit.block.Biome;
+
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
@@ -23,18 +31,10 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.Map.Entry;
import java.util.Set;
-import org.bukkit.Chunk;
-import org.bukkit.Material;
-import org.bukkit.World;
-import org.bukkit.World.Environment;
-import org.bukkit.block.Biome;
-
-
-import static com.intellectualcrafters.plot.util.ReflectionUtils.getRefClass;
public class FastQueue_1_8_3 extends SlowQueue {
- private final SendChunk chunksender;
+ private final SendChunk sendChunk;
private final HashMap toUpdate = new HashMap<>();
private final RefMethod methodGetHandleChunk;
private final RefMethod methodInitLighting;
@@ -65,7 +65,7 @@ public class FastQueue_1_8_3 extends SlowQueue {
this.classChunkSectionConstructor = classChunkSection.getConstructor(int.class, boolean.class, char[].class);
this.tileEntityUnload = classWorld.getField("c");
this.methodGetWorld = classChunk.getMethod("getWorld");
- this.chunksender = new SendChunk();
+ this.sendChunk = new SendChunk();
TaskManager.runTaskRepeat(new Runnable() {
@Override
public void run() {
@@ -102,7 +102,7 @@ public class FastQueue_1_8_3 extends SlowQueue {
return;
}
try {
- this.chunksender.sendChunk(chunks);
+ this.sendChunk.sendChunk(chunks);
} catch (Throwable e) {
e.printStackTrace();
MainUtil.canSendChunk = false;
@@ -129,7 +129,7 @@ public class FastQueue_1_8_3 extends SlowQueue {
// Sections
Method getHandle = chunk.getClass().getDeclaredMethod("getHandle");
Object c = getHandle.invoke(chunk);
- Object w = methodGetWorld.of(c).call();
+ Object w = this.methodGetWorld.of(c).call();
Class extends Object> clazz = c.getClass();
Field sections1 = clazz.getDeclaredField("sections");
sections1.setAccessible(true);
@@ -138,7 +138,7 @@ public class FastQueue_1_8_3 extends SlowQueue {
Object[] sections = (Object[]) sections1.get(c);
HashMap, ?> tiles = (HashMap, ?>) tileEntities.get(c);
- Collection