General changes

This commit is contained in:
MattBDev
2016-04-26 10:14:22 -04:00
parent 2c16c767e7
commit 669359cd37
27 changed files with 96 additions and 106 deletions

View File

@ -245,7 +245,7 @@ class XML {
if (value.toString().equals(string)) {
return value;
}
} catch (NumberFormatException ignoreAlso) {
} catch (NumberFormatException ignored) {
}
}
return string;

View File

@ -80,7 +80,7 @@ public class DebugExec extends SubCommand {
this.engine.eval(script, this.scope);
}
}
} catch (IOException | ScriptException e) {
} catch (IOException | ScriptException ignored) {
}
}
@ -214,7 +214,7 @@ public class DebugExec extends SubCommand {
for (Plot plot : PS.get().getBasePlots()) {
Flag<?> flag1 = FlagManager.getFlag(flag);
if (plot.getFlag(flag1).isPresent()) {
FlagManager.removePlotFlag(plot, flag1);
plot.removeFlag(flag1);
}
}
return MainUtil.sendMessage(player, "Cleared flag: " + flag);

View File

@ -42,12 +42,10 @@ public class DebugFixFlags extends SubCommand {
Iterator<Entry<Flag<?>, Object>> i = flags.entrySet().iterator();
boolean changed = false;
while (i.hasNext()) {
/*
if (FlagManager.getFlag(i.next().getKey()) == null) {
if (i.next().getKey() == null) {
changed = true;
i.remove();
}
*/
}
if (changed) {
DBFunc.setFlags(plot, plot.getFlags());

View File

@ -315,7 +315,7 @@ public class ListCmd extends SubCommand {
if (uuid == null) {
try {
uuid = UUID.fromString(args[0]);
} catch (Exception e) {
} catch (Exception ignored) {
}
}
if (uuid != null) {

View File

@ -127,16 +127,16 @@ public class Load extends SubCommand {
return;
}
plr.setMeta("plot_schematics", schematics);
displaySaves(plr, 0);
displaySaves(plr);
}
});
} else {
displaySaves(plr, 0);
displaySaves(plr);
}
return true;
}
public void displaySaves(PlotPlayer player, int page) {
public void displaySaves(PlotPlayer player) {
List<String> schematics = player.getMeta("plot_schematics");
for (int i = 0; i < Math.min(schematics.size(), 32); i++) {
try {

View File

@ -34,7 +34,7 @@ public class Owner extends SetCommand {
try {
uuid = UUID.fromString(value);
name = MainUtil.getName(uuid);
} catch (Exception e) {
} catch (Exception ignored) {
}
} else {
uuid = UUIDHandler.getUUID(value, null);

View File

@ -166,7 +166,7 @@ public class Configuration {
if (result != null && result.match < 2) {
values[i] = result.best;
}
} catch (NumberFormatException e) {
} catch (NumberFormatException ignored) {
}
}
int gcd = gcd(counts);

View File

@ -951,8 +951,7 @@ public class Plot {
* @param flag
*/
public boolean removeFlag(Flag<?> flag) {
FlagManager.removePlotFlag(this, flag);
return false;
return FlagManager.removePlotFlag(this, flag);
}
/**

View File

@ -42,7 +42,7 @@ public class PlotId {
try {
x = Integer.parseInt(parts[0]);
y = Integer.parseInt(parts[1]);
} catch (Exception e) {
} catch (NumberFormatException e) {
return null;
}
return new PlotId(x, y);

View File

@ -1,7 +1,8 @@
package com.intellectualcrafters.plot.object;
public class PseudoRandom {
public static PseudoRandom random = new PseudoRandom();
public static final PseudoRandom random = new PseudoRandom();
public long state = System.nanoTime();

View File

@ -222,7 +222,7 @@ public abstract class ChunkManager {
int z = Integer.parseInt(split[2]);
ChunkLoc loc = new ChunkLoc(x, z);
chunks.add(loc);
} catch (Exception e) {
} catch (NumberFormatException ignored) {
}
}
}

View File

@ -298,7 +298,7 @@ public abstract class Command {
MainCommand.getInstance().help.execute(player, args, null, null);
return;
}
} catch (IllegalArgumentException e) {
} catch (IllegalArgumentException ignored) {
}
// Command recommendation
MainUtil.sendMessage(player, C.NOT_VALID_SUBCOMMAND);

View File

@ -1,31 +0,0 @@
package com.plotsquared.general.commands;
import java.lang.reflect.Field;
public class CommandHandlingOutput {
public static int CALLER_OF_WRONG_TYPE = -6;
public static int NOT_COMMAND = -5;
public static int NOT_FOUND = -4;
public static int NOT_PERMITTED = -3;
public static int ERROR = -2;
public static int WRONG_USAGE = -1;
public static int SUCCESS = 1;
public static String nameField(int code) {
Field[] fields = CommandHandlingOutput.class.getDeclaredFields();
for (Field field : fields) {
if (field.getGenericType() == Integer.TYPE) {
try {
if ((Integer) field.get(CommandHandlingOutput.class) == code) {
return field.getName();
}
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
}
return "null??";
}
}

View File

@ -84,7 +84,7 @@ public class WESubscriber {
if (tool instanceof BrushTool) {
hasMask = ((BrushTool) tool).getMask() != null;
}
} catch (Exception e) {
} catch (Exception ignored) {
}
}
AbstractDelegateExtent extent = (AbstractDelegateExtent) event.getExtent();