mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-30 12:44:45 +02:00
Update code style
This commit is contained in:
@ -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();
|
||||
|
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user