diff --git a/pom.xml b/pom.xml
index a9966f278..a59023deb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -8,7 +8,7 @@
UTF-8
PlotSquared
- 3.2.17
+ 3.2.18
PlotSquared
jar
diff --git a/src/main/java/com/intellectualcrafters/plot/object/PlotWorld.java b/src/main/java/com/intellectualcrafters/plot/object/PlotWorld.java
index d5f4e58b7..fa51bca3a 100644
--- a/src/main/java/com/intellectualcrafters/plot/object/PlotWorld.java
+++ b/src/main/java/com/intellectualcrafters/plot/object/PlotWorld.java
@@ -275,6 +275,9 @@ public abstract class PlotWorld {
config.set(option, options.get(option));
}
}
+ if (!config.contains("flags")) {
+ config.set("flags.use", "63,64,68,69,71,77,96,143,167,193,194,195,196,197,77,143,69,70,72,147,148,107,183,184,185,186,187,132");
+ }
}
/**
diff --git a/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java b/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java
index eba0004d1..92fec7310 100644
--- a/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java
+++ b/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java
@@ -128,7 +128,7 @@ import com.plotsquared.bukkit.util.BukkitUtil;
* Player Events involving plots
*
*/
-@SuppressWarnings({ "unused", "deprecation", "unchecked" })
+@SuppressWarnings({ "deprecation", "unchecked" })
public class PlayerEvents extends com.plotsquared.listener.PlotListener implements Listener {
private boolean pistonBlocks = true;
@@ -315,11 +315,11 @@ public class PlayerEvents extends com.plotsquared.listener.PlotListener implemen
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST)
public void PlayerCommand(final PlayerCommandPreprocessEvent event) {
- final String message = event.getMessage().toLowerCase().replaceAll("/", "").trim();
- if (message.length() == 0) {
+ String msg = event.getMessage().toLowerCase().replaceAll("/", "").trim();
+ if (msg.length() == 0) {
return;
}
- final String[] split = message.split(" ");
+ final String[] split = msg.split(" ");
final PluginCommand cmd = Bukkit.getServer().getPluginCommand(split[0]);
if (cmd == null) {
if (split[0].equals("plotme") || split[0].equals("ap")) {
@@ -330,78 +330,65 @@ public class PlayerEvents extends com.plotsquared.listener.PlotListener implemen
MainUtil.sendMessage(BukkitUtil.getPlayer(player), C.NOT_USING_PLOTME);
}
event.setCancelled(true);
+ return;
}
}
-
final Player player = event.getPlayer();
final PlotPlayer pp = BukkitUtil.getPlayer(player);
- pp.getLocation();
- if (!PS.get().isPlotWorld(BukkitUtil.getWorld(player))) {
- return;
- }
-
- final Plot plot = MainUtil.getPlot(BukkitUtil.getLocation(player));
+ Plot plot = pp.getCurrentPlot();
if (plot == null) {
return;
}
-
- Flag flag;
- if (((flag = FlagManager.getPlotFlagRaw(plot, "blocked-cmds")) != null) && !Permissions.hasPermission(pp, C.PERMISSION_ADMIN_INTERACT_BLOCKED_CMDS)) {
- final List v = (List) flag.getValue();
-
- String msg = event.getMessage().toLowerCase().replaceFirst("/", "");
-
- final String[] parts = msg.split(" ");
- String c = parts[0];
- if (parts[0].contains(":")) {
- c = parts[0].split(":")[1];
- msg = msg.replace(parts[0].split(":")[0] + ":", "");
+ Flag flag = FlagManager.getPlotFlagRaw(plot, "blocked-cmds");
+ if (flag == null || Permissions.hasPermission(pp, C.PERMISSION_ADMIN_INTERACT_BLOCKED_CMDS)) {
+ return;
+ }
+ final List v = (List) flag.getValue();
+ final String[] parts = msg.split(" ");
+ String c = parts[0];
+ if (parts[0].contains(":")) {
+ c = parts[0].split(":")[1];
+ msg = msg.replace(parts[0].split(":")[0] + ":", "");
+ }
+ final String l = c;
+ final List aliases = new ArrayList<>();
+ for (final HelpTopic cmdLabel : Bukkit.getServer().getHelpMap().getHelpTopics()) {
+ if (c.equals(cmdLabel.getName())) {
+ break;
}
-
- final String l = c;
-
- final List aliases = new ArrayList<>();
-
- for (final HelpTopic cmdLabel : Bukkit.getServer().getHelpMap().getHelpTopics()) {
- if (c.equals(cmdLabel.getName())) {
- break;
- }
- PluginCommand p;
- final String label = cmdLabel.getName().replaceFirst("/", "");
- if (aliases.contains(label)) {
- continue;
- }
- if ((p = Bukkit.getPluginCommand(label)) != null) {
- for (String a : p.getAliases()) {
- if (aliases.contains(a)) {
- continue;
- }
- aliases.add(a);
- a = a.replaceFirst("/", "");
- if (!a.equals(label) && a.equals(c)) {
- c = label;
- break;
- }
+ PluginCommand p;
+ final String label = cmdLabel.getName().replaceFirst("/", "");
+ if (aliases.contains(label)) {
+ continue;
+ }
+ if ((p = Bukkit.getPluginCommand(label)) != null) {
+ for (String a : p.getAliases()) {
+ if (aliases.contains(a)) {
+ continue;
+ }
+ aliases.add(a);
+ a = a.replaceFirst("/", "");
+ if (!a.equals(label) && a.equals(c)) {
+ c = label;
+ break;
}
}
}
-
- if (!l.equals(c)) {
- msg = msg.replace(l, c);
+ }
+ if (!l.equals(c)) {
+ msg = msg.replace(l, c);
+ }
+ for (final String s : v) {
+ Pattern pattern;
+ if (!RegExUtil.compiledPatterns.containsKey(s)) {
+ RegExUtil.compiledPatterns.put(s, ((pattern = Pattern.compile(s))));
+ } else {
+ pattern = RegExUtil.compiledPatterns.get(s);
}
-
- for (final String s : v) {
- Pattern pattern;
- if (!RegExUtil.compiledPatterns.containsKey(s)) {
- RegExUtil.compiledPatterns.put(s, ((pattern = Pattern.compile(s))));
- } else {
- pattern = RegExUtil.compiledPatterns.get(s);
- }
- if (pattern.matcher(msg).matches()) {
- MainUtil.sendMessage(pp, C.COMMAND_BLOCKED);
- event.setCancelled(true);
- return;
- }
+ if (pattern.matcher(msg).matches()) {
+ MainUtil.sendMessage(pp, C.COMMAND_BLOCKED);
+ event.setCancelled(true);
+ return;
}
}
}
diff --git a/src/main/java/com/plotsquared/listener/PlotListener.java b/src/main/java/com/plotsquared/listener/PlotListener.java
index d84f29e2c..5dad76cc0 100644
--- a/src/main/java/com/plotsquared/listener/PlotListener.java
+++ b/src/main/java/com/plotsquared/listener/PlotListener.java
@@ -227,9 +227,7 @@ public class PlotListener {
pp.setFlight(false);
}
}
- System.out.print("CHECKING TIME");
if (FlagManager.getPlotFlagRaw(plot, "time") != null) {
- System.out.print("RESETTING TIEM");
pp.setTime(Long.MAX_VALUE);
}
if (FlagManager.getPlotFlagRaw(plot, "weather") != null) {
diff --git a/target/PlotSquared-Bukkit.jar b/target/PlotSquared-Bukkit.jar
index 7bcea868f..e530ba5c1 100644
Binary files a/target/PlotSquared-Bukkit.jar and b/target/PlotSquared-Bukkit.jar differ