mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-08-04 05:25:28 +02:00
clean up if/else formatting
This commit is contained in:
@@ -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();
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user