Update code style

This commit is contained in:
nossr50
2019-04-24 22:52:53 -07:00
parent dc758a6dfc
commit 02a69cbb05
334 changed files with 4660 additions and 5158 deletions

View File

@ -17,21 +17,19 @@ public class WorldGuardManager {
private static WorldGuardManager instance;
private WorldGuardPlugin worldGuardPluginRef;
public WorldGuardManager() {
}
public static WorldGuardManager getInstance() {
if(instance == null)
if (instance == null)
instance = new WorldGuardManager();
return instance;
}
public WorldGuardManager()
{
}
public boolean hasMainFlag(Player player)
{
if(player == null)
public boolean hasMainFlag(Player player) {
if (player == null)
return false;
BukkitPlayer localPlayer = BukkitAdapter.adapt(player);
@ -47,9 +45,8 @@ public class WorldGuardManager {
return query.testState(loc, WorldGuardPlugin.inst().wrapPlayer(player), WorldGuardFlags.MCMMO_ENABLE_WG_FLAG);
}
public boolean hasXPFlag(Player player)
{
if(player == null)
public boolean hasXPFlag(Player player) {
if (player == null)
return false;
BukkitPlayer localPlayer = BukkitAdapter.adapt(player);
@ -76,9 +73,8 @@ public class WorldGuardManager {
return worldGuardPluginRef;
}
public void registerFlags()
{
if(getWorldGuard() == null)
public void registerFlags() {
if (getWorldGuard() == null)
return;
FlagRegistry registry = WorldGuard.getInstance().getFlagRegistry();

View File

@ -11,8 +11,7 @@ public class WorldGuardUtils {
private static boolean isLoaded = false;
private static boolean hasWarned = false;
public static boolean isWorldGuardLoaded()
{
public static boolean isWorldGuardLoaded() {
WorldGuardPlugin plugin = getWorldGuard();
try {
@ -31,25 +30,21 @@ public class WorldGuardUtils {
return true;
}
private static WorldGuardPlugin getWorldGuard()
{
if(isLoaded)
private static WorldGuardPlugin getWorldGuard() {
if (isLoaded)
return worldGuardPluginRef;
Plugin plugin = getServer().getPluginManager().getPlugin("WorldGuard");
if(plugin instanceof WorldGuardPlugin)
{
if(plugin.getDescription().getVersion().startsWith("7"))
{
if (plugin instanceof WorldGuardPlugin) {
if (plugin.getDescription().getVersion().startsWith("7")) {
worldGuardPluginRef = (WorldGuardPlugin) plugin;
if(worldGuardPluginRef != null)
if (worldGuardPluginRef != null)
isLoaded = true;
} else {
if(!hasWarned)
{
if (!hasWarned) {
mcMMO.p.getLogger().severe("mcMMO only supports WorldGuard version 7! Make sure you have WG 7! This warning will not appear again.");
hasWarned = true;
}