mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 07:06:44 +01:00
ignored exception
This commit is contained in:
parent
8af30667e4
commit
13b7a798e6
@ -13,7 +13,7 @@ public class HackTitle extends AbstractTitle {
|
|||||||
try {
|
try {
|
||||||
HackTitleManager title = new HackTitleManager(head, sub, in, delay, out);
|
HackTitleManager title = new HackTitleManager(head, sub, in, delay, out);
|
||||||
title.send(((BukkitPlayer) player).player);
|
title.send(((BukkitPlayer) player).player);
|
||||||
} catch (Exception e) {
|
} catch (Exception ignored) {
|
||||||
PS.debug("&cYour server version does not support titles!");
|
PS.debug("&cYour server version does not support titles!");
|
||||||
Settings.TITLES = false;
|
Settings.TITLES = false;
|
||||||
AbstractTitle.TITLE_CLASS = null;
|
AbstractTitle.TITLE_CLASS = null;
|
||||||
|
@ -37,7 +37,7 @@ public class Help extends Command {
|
|||||||
if (MathMan.isInteger(args[0])) {
|
if (MathMan.isInteger(args[0])) {
|
||||||
try {
|
try {
|
||||||
displayHelp(player, null, Integer.parseInt(args[0]));
|
displayHelp(player, null, Integer.parseInt(args[0]));
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException ignored) {
|
||||||
displayHelp(player, null, 1);
|
displayHelp(player, null, 1);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -48,7 +48,7 @@ public class Help extends Command {
|
|||||||
if (MathMan.isInteger(args[1])) {
|
if (MathMan.isInteger(args[1])) {
|
||||||
try {
|
try {
|
||||||
displayHelp(player, args[1], Integer.parseInt(args[1]));
|
displayHelp(player, args[1], Integer.parseInt(args[1]));
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException ignored) {
|
||||||
displayHelp(player, args[1], 1);
|
displayHelp(player, args[1], 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,14 +20,14 @@ public class IntervalFlag extends Flag<Integer[]> {
|
|||||||
seconds = 1;
|
seconds = 1;
|
||||||
try {
|
try {
|
||||||
amount = Integer.parseInt(values[0]);
|
amount = Integer.parseInt(values[0]);
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException ignored) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
} else if (values.length == 2) {
|
} else if (values.length == 2) {
|
||||||
try {
|
try {
|
||||||
amount = Integer.parseInt(values[0]);
|
amount = Integer.parseInt(values[0]);
|
||||||
seconds = Integer.parseInt(values[1]);
|
seconds = Integer.parseInt(values[1]);
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException ignored) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -19,6 +19,7 @@ import com.intellectualcrafters.plot.object.PlotPlayer;
|
|||||||
import com.intellectualcrafters.plot.object.PseudoRandom;
|
import com.intellectualcrafters.plot.object.PseudoRandom;
|
||||||
import com.intellectualcrafters.plot.object.RegionWrapper;
|
import com.intellectualcrafters.plot.object.RegionWrapper;
|
||||||
import com.intellectualcrafters.plot.object.RunnableVal;
|
import com.intellectualcrafters.plot.object.RunnableVal;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@ -709,7 +710,7 @@ public class MainUtil {
|
|||||||
try {
|
try {
|
||||||
result.add(UUID.fromString(name));
|
result.add(UUID.fromString(name));
|
||||||
continue;
|
continue;
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException ignored) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,13 @@ package com.plotsquared.sponge.util;
|
|||||||
|
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import com.intellectualcrafters.plot.PS;
|
import com.intellectualcrafters.plot.PS;
|
||||||
|
import ninja.leaping.configurate.commented.CommentedConfigurationNode;
|
||||||
|
import ninja.leaping.configurate.hocon.HoconConfigurationLoader;
|
||||||
|
import ninja.leaping.configurate.loader.ConfigurationLoader;
|
||||||
|
import org.spongepowered.api.Game;
|
||||||
|
import org.spongepowered.api.plugin.PluginContainer;
|
||||||
|
import org.spongepowered.api.scheduler.Task;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@ -44,12 +51,6 @@ import java.net.URLEncoder;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.zip.GZIPOutputStream;
|
import java.util.zip.GZIPOutputStream;
|
||||||
import ninja.leaping.configurate.commented.CommentedConfigurationNode;
|
|
||||||
import ninja.leaping.configurate.hocon.HoconConfigurationLoader;
|
|
||||||
import ninja.leaping.configurate.loader.ConfigurationLoader;
|
|
||||||
import org.spongepowered.api.Game;
|
|
||||||
import org.spongepowered.api.plugin.PluginContainer;
|
|
||||||
import org.spongepowered.api.scheduler.Task;
|
|
||||||
|
|
||||||
public class SpongeMetrics {
|
public class SpongeMetrics {
|
||||||
|
|
||||||
@ -112,7 +113,7 @@ public class SpongeMetrics {
|
|||||||
private volatile Task task = null;
|
private volatile Task task = null;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public SpongeMetrics(final Game game, final PluginContainer plugin) throws IOException {
|
public SpongeMetrics(final Game game, final PluginContainer plugin) {
|
||||||
if (plugin == null) {
|
if (plugin == null) {
|
||||||
throw new IllegalArgumentException("Plugin cannot be null");
|
throw new IllegalArgumentException("Plugin cannot be null");
|
||||||
}
|
}
|
||||||
@ -156,9 +157,9 @@ public class SpongeMetrics {
|
|||||||
* @param json
|
* @param json
|
||||||
* @param key
|
* @param key
|
||||||
* @param value
|
* @param value
|
||||||
* @throws java.io.UnsupportedEncodingException
|
* @throws UnsupportedEncodingException
|
||||||
*/
|
*/
|
||||||
private static void appendJSONPair(final StringBuilder json, final String key, final String value) throws UnsupportedEncodingException {
|
private static void appendJSONPair(final StringBuilder json, final String key, final String value) {
|
||||||
boolean isValueNumeric = false;
|
boolean isValueNumeric = false;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -166,7 +167,7 @@ public class SpongeMetrics {
|
|||||||
Double.parseDouble(value);
|
Double.parseDouble(value);
|
||||||
isValueNumeric = true;
|
isValueNumeric = true;
|
||||||
}
|
}
|
||||||
} catch (final NumberFormatException e) {
|
} catch (final NumberFormatException ignored) {
|
||||||
isValueNumeric = false;
|
isValueNumeric = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -341,7 +342,7 @@ public class SpongeMetrics {
|
|||||||
/**
|
/**
|
||||||
* Enables metrics for the server by setting "opt-out" to false in the config file and starting the metrics task.
|
* Enables metrics for the server by setting "opt-out" to false in the config file and starting the metrics task.
|
||||||
*
|
*
|
||||||
* @throws java.io.IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public void enable() throws IOException {
|
public void enable() throws IOException {
|
||||||
// This has to be synchronized or it can collide with the check in the task.
|
// This has to be synchronized or it can collide with the check in the task.
|
||||||
@ -362,7 +363,7 @@ public class SpongeMetrics {
|
|||||||
/**
|
/**
|
||||||
* Disables metrics for the server by setting "opt-out" to true in the config file and canceling the metrics task.
|
* Disables metrics for the server by setting "opt-out" to true in the config file and canceling the metrics task.
|
||||||
*
|
*
|
||||||
* @throws java.io.IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public void disable() throws IOException {
|
public void disable() throws IOException {
|
||||||
// This has to be synchronized or it can collide with the check in the task.
|
// This has to be synchronized or it can collide with the check in the task.
|
||||||
@ -510,7 +511,7 @@ public class SpongeMetrics {
|
|||||||
try {
|
try {
|
||||||
Class.forName("mineshafter.MineServer");
|
Class.forName("mineshafter.MineServer");
|
||||||
return true;
|
return true;
|
||||||
} catch (final Exception e) {
|
} catch (final Exception ignored) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user