diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 5ee7353ab..a077bf067 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -13,10 +13,9 @@
-
-
-
-
+
+
+
@@ -39,157 +38,38 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -212,7 +92,6 @@
-
@@ -227,15 +106,17 @@
-
-
+
+
+
+
@@ -276,7 +157,6 @@
-
@@ -375,8 +255,87 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -588,7 +547,10 @@
-
+
+
+
+
1411382351159
@@ -670,11 +632,15 @@
1412264311328
1412264311328
-
+
+ 1412599888665
+ 1412599888665
+
+
-
+
@@ -708,22 +674,22 @@
-
+
-
-
+
+
@@ -760,7 +726,8 @@
-
+
+
@@ -772,30 +739,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -895,13 +838,6 @@
-
-
-
-
-
-
-
@@ -1000,13 +936,6 @@
-
-
-
-
-
-
-
@@ -1025,14 +954,6 @@
-
-
-
-
-
-
-
-
@@ -1040,7 +961,6 @@
-
@@ -1048,7 +968,6 @@
-
@@ -1056,7 +975,6 @@
-
@@ -1096,28 +1014,17 @@
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
@@ -1128,71 +1035,82 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
diff --git a/PlotSquared/src/com/intellectualcrafters/plot/UUIDHandler.java b/PlotSquared/src/com/intellectualcrafters/plot/UUIDHandler.java
index 77ec1eaab..e11ab4819 100644
--- a/PlotSquared/src/com/intellectualcrafters/plot/UUIDHandler.java
+++ b/PlotSquared/src/com/intellectualcrafters/plot/UUIDHandler.java
@@ -10,9 +10,6 @@ import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
-/**
- * Created by Citymonstret on 2014-10-06.
- */
public class UUIDHandler {
private static ConcurrentHashMap uuidMap = new ConcurrentHashMap<>();
@@ -29,6 +26,10 @@ public class UUIDHandler {
uuidMap.put(name, uuid);
}
+ /**
+ *
+ * @param plugin
+ */
public static void startFetch(JavaPlugin plugin) {
plugin.getServer().getScheduler().runTaskAsynchronously(plugin, new Runnable() {
@Override
@@ -53,6 +54,11 @@ public class UUIDHandler {
});
}
+ /**
+ *
+ * @param name
+ * @return
+ */
public static UUID getUUID(String name) {
if (nameExists(name)) {
return uuidMap.get(name);
@@ -72,6 +78,11 @@ public class UUIDHandler {
return null;
}
+ /**
+ *
+ * @param uuid
+ * @return
+ */
private static String loopSearch(UUID uuid) {
for(Map.Entry entry : uuidMap.entrySet()) {
if(entry.getValue().equals(uuid)) {
@@ -81,6 +92,11 @@ public class UUIDHandler {
return "";
}
+ /**
+ *
+ * @param uuid
+ * @return
+ */
public static String getName(UUID uuid) {
if(uuidExists(uuid)) {
return loopSearch(uuid);
@@ -95,12 +111,22 @@ public class UUIDHandler {
return null;
}
+ /**
+ *
+ * @param name
+ * @return
+ */
private static UUID getUuidOfflineMode(String name) {
UUID uuid = UUID.nameUUIDFromBytes(("OfflinePlayer:" + name).getBytes(Charsets.UTF_8));
add(name, uuid);
return uuid;
}
+ /**
+ *
+ * @param uuid
+ * @return
+ */
private static String getNameOnlinePlayer(UUID uuid) {
Player player = Bukkit.getPlayer(uuid);
if(player == null || !player.isOnline()) {
@@ -111,6 +137,11 @@ public class UUIDHandler {
return name;
}
+ /**
+ *
+ * @param uuid
+ * @return
+ */
private static String getNameOfflinePlayer(UUID uuid) {
OfflinePlayer player = Bukkit.getOfflinePlayer(uuid);
if (player == null || !player.hasPlayedBefore()) {
@@ -121,6 +152,11 @@ public class UUIDHandler {
return name;
}
+ /**
+ *
+ * @param name
+ * @return
+ */
private static UUID getUuidOnlinePlayer(String name) {
Player player = Bukkit.getPlayer(name);
if (player == null || !player.isOnline()) {
@@ -131,6 +167,11 @@ public class UUIDHandler {
return uuid;
}
+ /**
+ *
+ * @param name
+ * @return
+ */
private static UUID getUuidOfflinePlayer(String name) {
OfflinePlayer player = Bukkit.getOfflinePlayer(name);
if (player == null || !player.hasPlayedBefore()) {
diff --git a/PlotSquared/src/com/intellectualcrafters/plot/commands/Auto.java b/PlotSquared/src/com/intellectualcrafters/plot/commands/Auto.java
index dd3069c34..ab55f1426 100644
--- a/PlotSquared/src/com/intellectualcrafters/plot/commands/Auto.java
+++ b/PlotSquared/src/com/intellectualcrafters/plot/commands/Auto.java
@@ -8,17 +8,12 @@
*/
package com.intellectualcrafters.plot.commands;
+import com.intellectualcrafters.plot.*;
+import net.milkbowl.vault.economy.Economy;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.entity.Player;
-import com.intellectualcrafters.plot.C;
-import com.intellectualcrafters.plot.PlayerFunctions;
-import com.intellectualcrafters.plot.Plot;
-import com.intellectualcrafters.plot.PlotHelper;
-import com.intellectualcrafters.plot.PlotId;
-import com.intellectualcrafters.plot.PlotMain;
-
@SuppressWarnings("deprecation")
public class Auto extends SubCommand {
public Auto() {
@@ -31,6 +26,7 @@ public class Auto extends SubCommand {
World world;
int size_x = 1;
int size_z = 1;
+ String schematic = "";
if (PlotMain.getPlotWorlds().length == 1) {
world = Bukkit.getWorld(PlotMain.getPlotWorlds()[0]);
} else {
@@ -41,7 +37,7 @@ public class Auto extends SubCommand {
return false;
}
}
- if (args.length == 1) {
+ if (args.length > 0) {
if (PlotMain.hasPermission(plr, "plots.auto.mega")) {
try {
String[] split = args[0].split(",");
@@ -53,19 +49,49 @@ public class Auto extends SubCommand {
if ((size_x > 4) || (size_z > 4)) {
PlayerFunctions.sendMessage(plr, "&cError: size>4");
}
+ if(args.length > 1) {
+ schematic = args[1];
+ }
} catch (Exception e) {
- PlayerFunctions.sendMessage(plr, "&cError: Invalid size (X,Y)");
- return false;
+ schematic = args[0];
+ //PlayerFunctions.sendMessage(plr, "&cError: Invalid size (X,Y)");
+ //return false;
}
} else {
- PlayerFunctions.sendMessage(plr, C.NO_PERMISSION);
- return false;
+ schematic = args[0];
+ //PlayerFunctions.sendMessage(plr, C.NO_PERMISSION);
+ //return false;
}
}
if (PlayerFunctions.getPlayerPlotCount(world, plr) >= PlayerFunctions.getAllowedPlots(plr)) {
PlayerFunctions.sendMessage(plr, C.CANT_CLAIM_MORE_PLOTS);
return false;
}
+ PlotWorld pWorld = PlotMain.getWorldSettings(world);
+ if(PlotMain.useEconomy && pWorld.USE_ECONOMY) {
+ double cost = pWorld.PLOT_PRICE;
+ if (cost > 0d) {
+ Economy economy = PlotMain.economy;
+ if (economy.getBalance(plr) < cost) {
+ sendMessage(plr, C.CANNOT_AFFORD_PLOT, "" + cost);
+ return true;
+ }
+ economy.withdrawPlayer(plr, cost);
+ sendMessage(plr, C.REMOVED_BALANCE, cost + "");
+ }
+ }
+ if(!schematic.equals("")) {
+ if (pWorld.SCHEMATIC_CLAIM_SPECIFY) {
+ if(pWorld.SCHEMATICS.contains(schematic.toLowerCase())) {
+ sendMessage(plr, C.SCHEMATIC_INVALID, "non-existent: " + schematic);
+ return true;
+ }
+ if (!plr.hasPermission("plots.claim." + schematic) && !plr.hasPermission("plots.admin")) {
+ PlayerFunctions.sendMessage(plr, C.NO_SCHEMATIC_PERMISSION, schematic);
+ return true;
+ }
+ }
+ }
boolean br = false;
int x = 0, z = 0, q = 100;
PlotId id;
diff --git a/PlotSquared/src/com/intellectualcrafters/plot/commands/Claim.java b/PlotSquared/src/com/intellectualcrafters/plot/commands/Claim.java
index ca0570474..35c1524e7 100644
--- a/PlotSquared/src/com/intellectualcrafters/plot/commands/Claim.java
+++ b/PlotSquared/src/com/intellectualcrafters/plot/commands/Claim.java
@@ -69,7 +69,7 @@ public class Claim extends SubCommand {
if (!schematic.equals("")) {
if (world.SCHEMATIC_CLAIM_SPECIFY) {
if (!world.SCHEMATICS.contains(schematic.toLowerCase())) {
- sendMessage(plr, C.SCHEMATIC_INVALID, "non-existent");
+ sendMessage(plr, C.SCHEMATIC_INVALID, "non-existent: " + schematic);
return true;
}
if (!plr.hasPermission("plots.claim." + schematic) && !plr.hasPermission("plots.admin")) {