Fix codestyle, add test

This commit is contained in:
Gabriele C
2017-11-29 08:38:34 +01:00
parent c7c8e673f0
commit 610fed3c7b
5 changed files with 26 additions and 10 deletions
@@ -41,7 +41,7 @@ public class ServerListener implements Listener {
pluginHookService.unhookEssentials();
ConsoleLogger.info("Essentials has been disabled: unhooking");
} else if ("CMI".equalsIgnoreCase(pluginName)) {
pluginHookService.unhookCMI();
pluginHookService.unhookCmi();
spawnLoader.unloadCMISpawn();
ConsoleLogger.info("CMI has been disabled: unhooking");
} else if ("Multiverse-Core".equalsIgnoreCase(pluginName)) {
@@ -75,7 +75,7 @@ public class ServerListener implements Listener {
} else if ("EssentialsSpawn".equalsIgnoreCase(pluginName)) {
spawnLoader.loadEssentialsSpawn();
} else if ("CMI".equalsIgnoreCase(pluginName)) {
pluginHookService.tryHookToCMI();
pluginHookService.tryHookToCmi();
spawnLoader.loadCMISpawn();
} else if ("ProtocolLib".equalsIgnoreCase(pluginName)) {
protocolLibService.setup();
@@ -34,7 +34,7 @@ public class PluginHookService {
public PluginHookService(PluginManager pluginManager) {
this.pluginManager = pluginManager;
tryHookToEssentials();
tryHookToCMI();
tryHookToCmi();
tryHookToMultiverse();
}
@@ -67,7 +67,7 @@ public class PluginHookService {
*
* @return The CMI data folder, or null if unavailable
*/
public File getCMIDataFolder() {
public File getCmiDataFolder() {
Plugin plugin = pluginManager.getPlugin("CMI");
if(plugin == null) {
return null;
@@ -105,7 +105,7 @@ public class PluginHookService {
/**
* @return true if we have a hook to CMI, false otherwise
*/
public boolean isCMIAvailable() {
public boolean isCmiAvailable() {
return cmi != null;
}
@@ -134,7 +134,7 @@ public class PluginHookService {
/**
* Attempts to create a hook into CMI.
*/
public void tryHookToCMI() {
public void tryHookToCmi() {
try {
cmi = getPlugin(pluginManager, "CMI", Plugin.class);
} catch (Exception | NoClassDefFoundError ignored) {
@@ -167,7 +167,7 @@ public class PluginHookService {
/**
* Unhooks from CMI.
*/
public void unhookCMI() {
public void unhookCmi() {
cmi = null;
}
@@ -135,7 +135,7 @@ public class SpawnLoader implements Reloadable {
* Load the spawn point defined in CMI.
*/
public void loadCMISpawn() {
File cmiFolder = pluginHookService.getCMIDataFolder();
File cmiFolder = pluginHookService.getCmiDataFolder();
if (cmiFolder == null) {
return;
}