Remove commented out things

This commit is contained in:
2022-04-05 13:14:53 -05:00
parent 08bdeaac48
commit f5a89384a0
7 changed files with 70 additions and 168 deletions

View File

@ -76,11 +76,13 @@ public class PlexUtils extends PlexBase
if (Plex.get().getStorageType() == StorageType.MARIADB)
{
PlexLog.log("Successfully enabled MySQL!");
} else if (Plex.get().getStorageType() == StorageType.SQLITE)
}
else if (Plex.get().getStorageType() == StorageType.SQLITE)
{
PlexLog.log("Successfully enabled SQLite!");
}
} catch (SQLException e)
}
catch (SQLException e)
{
if (Plex.get().getMongoConnection().getDatastore() != null)
{
@ -191,10 +193,12 @@ public class PlexUtils extends PlexBase
if (config.getString(path) == null)
{
color = def;
} else if (ChatColor.getByChar(config.getString(path)) == null)
}
else if (ChatColor.getByChar(config.getString(path)) == null)
{
color = def;
} else
}
else
{
color = ChatColor.getByChar(config.getString(path));
}
@ -240,13 +244,14 @@ public class PlexUtils extends PlexBase
private static <T> void readGameRules(World world, String s)
{
String gameRule = s.split(";")[0];
T value = (T) s.split(";")[1];
GameRule<T> rule = (GameRule<T>) GameRule.getByName(gameRule);
T value = (T)s.split(";")[1];
GameRule<T> rule = (GameRule<T>)GameRule.getByName(gameRule);
if (rule != null && check(value).getClass().equals(rule.getType()))
{
world.setGameRule(rule, value);
PlexLog.debug("Setting game rule " + gameRule + " for world " + world.getName() + " with value " + value);
} else
}
else
{
PlexLog.error(String.format("Failed to set game rule %s for world %s with value %s!", gameRule, world.getName().toLowerCase(Locale.ROOT), value));
}
@ -286,7 +291,7 @@ public class PlexUtils extends PlexBase
try
{
URL u = new URL(url);
HttpURLConnection connection = (HttpURLConnection) u.openConnection();
HttpURLConnection connection = (HttpURLConnection)u.openConnection();
connection.setRequestMethod("GET");
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String line;
@ -298,7 +303,8 @@ public class PlexUtils extends PlexBase
in.close();
connection.disconnect();
return new JSONParser().parse(content.toString());
} catch (IOException | ParseException ex)
}
catch (IOException | ParseException ex)
{
return null;
}
@ -307,13 +313,13 @@ public class PlexUtils extends PlexBase
public static UUID getFromName(String name)
{
JSONObject profile;
profile = (JSONObject) simpleGET("https://api.ashcon.app/mojang/v2/user/" + name);
profile = (JSONObject)simpleGET("https://api.ashcon.app/mojang/v2/user/" + name);
if (profile == null)
{
PlexLog.error("Profile from Ashcon API returned null!");
return null;
}
String uuidString = (String) profile.get("uuid");
String uuidString = (String)profile.get("uuid");
return UUID.fromString(uuidString);
}
@ -331,12 +337,14 @@ public class PlexUtils extends PlexBase
{
Class<?> clazz = Class.forName(info.getName());
classes.add(clazz);
} catch (ClassNotFoundException ex)
}
catch (ClassNotFoundException ex)
{
PlexLog.error("Unable to find class " + info.getName() + " in " + packageName);
}
});
} catch (IOException ex)
}
catch (IOException ex)
{
PlexLog.error("Something went wrong while fetching classes from " + packageName);
throw new RuntimeException(ex);
@ -353,7 +361,7 @@ public class PlexUtils extends PlexBase
{
if (clazz.getSuperclass() == subType || Arrays.asList(clazz.getInterfaces()).contains(subType))
{
classes.add((Class<? extends T>) clazz);
classes.add((Class<? extends T>)clazz);
}
});
return Collections.unmodifiableSet(classes);