clean up if/else formatting

This commit is contained in:
nossr50
2024-05-19 14:09:00 -07:00
parent 7266563ca9
commit d0ab2bdb2f
107 changed files with 526 additions and 1038 deletions

View File

@@ -25,8 +25,7 @@ public class WorldGuardManager {
return instance;
}
public boolean hasMainFlag(Player player)
{
public boolean hasMainFlag(Player player) {
if (player == null)
return false;
@@ -41,8 +40,7 @@ public class WorldGuardManager {
return query.testState(loc, WorldGuardPlugin.inst().wrapPlayer(player), WorldGuardFlags.MCMMO_ENABLE_WG_FLAG);
}
public boolean hasXPFlag(Player player)
{
public boolean hasXPFlag(Player player) {
if (player == null)
return false;
@@ -57,8 +55,7 @@ public class WorldGuardManager {
return query.testState(loc, WorldGuardPlugin.inst().wrapPlayer(player), WorldGuardFlags.MCMMO_XP_WG_FLAG);
}
public boolean hasHardcoreFlag(Player player)
{
public boolean hasHardcoreFlag(Player player) {
if (player == null)
return false;
@@ -85,8 +82,7 @@ public class WorldGuardManager {
return worldGuardPluginRef;
}
public void registerFlags()
{
public void registerFlags() {
try {
FlagRegistry registry = WorldGuard.getInstance().getFlagRegistry();

View File

@@ -41,8 +41,7 @@ public class WorldGuardUtils {
WGClassList.add("com.sk89q.worldguard.protection.regions.RegionQuery");
}
public static boolean isWorldGuardLoaded()
{
public static boolean isWorldGuardLoaded() {
if (detectedIncompatibleWG)
return false;
@@ -56,8 +55,7 @@ public class WorldGuardUtils {
* Results are cached
* @return the instance of WG plugin, null if its not compatible or isn't present
*/
private static WorldGuardPlugin getWorldGuard()
{
private static WorldGuardPlugin getWorldGuard() {
//WG plugin reference is already cached so just return it
if (isLoaded)
return worldGuardPluginRef;
@@ -71,10 +69,8 @@ public class WorldGuardUtils {
LogUtils.debug(mcMMO.p.getLogger(), "WorldGuard was not detected.");
} else {
//Check that its actually of class WorldGuardPlugin
if (plugin instanceof WorldGuardPlugin)
{
if (isCompatibleVersion(plugin))
{
if (plugin instanceof WorldGuardPlugin) {
if (isCompatibleVersion(plugin)) {
worldGuardPluginRef = (WorldGuardPlugin) plugin;
isLoaded = true;
}