MCorify the MPlugin class Factions slightly.

This commit is contained in:
Olof Larsson
2013-04-09 13:12:13 +02:00
parent ecefb44d10
commit c8870d10d4
44 changed files with 139 additions and 122 deletions

View File

@ -32,22 +32,22 @@ public class Econ
if (Bukkit.getServer().getPluginManager().getPlugin("Vault") == null)
{
Factions.p.log(integrationFail+"is not installed.");
Factions.get().log(integrationFail+"is not installed.");
return;
}
RegisteredServiceProvider<Economy> rsp = Bukkit.getServer().getServicesManager().getRegistration(Economy.class);
if (rsp == null)
{
Factions.p.log(integrationFail+"is not hooked into an economy plugin.");
Factions.get().log(integrationFail+"is not hooked into an economy plugin.");
return;
}
econ = rsp.getProvider();
Factions.p.log("Economy integration through Vault plugin successful.");
Factions.get().log("Economy integration through Vault plugin successful.");
if ( ! Conf.econEnabled)
Factions.p.log("NOTE: Economy is disabled. You can enable it with the command: f config econEnabled true");
Factions.get().log("NOTE: Economy is disabled. You can enable it with the command: f config econEnabled true");
oldMoneyDoTransfer();
}
@ -78,7 +78,7 @@ public class Econ
{
if (!shouldBeUsed())
{
Factions.p.log(Level.WARNING, "Vault does not appear to be hooked into an economy plugin.");
Factions.get().log(Level.WARNING, "Vault does not appear to be hooked into an economy plugin.");
return;
}
to.msg("<a>%s's<i> balance is <h>%s<i>.", about.describeTo(to, true), Econ.moneyString(econ.getBalance(about.getAccountId())));

View File

@ -92,8 +92,8 @@ public class EssentialsFeatures
essChat = instance;
try
{
Bukkit.getServer().getPluginManager().registerEvents(new LocalChatListener(), Factions.p);
Factions.p.log("Found and will integrate chat with newer "+essChat.getDescription().getFullName());
Bukkit.getServer().getPluginManager().registerEvents(new LocalChatListener(), Factions.get());
Factions.get().log("Found and will integrate chat with newer "+essChat.getDescription().getFullName());
}
catch (NoSuchMethodError ex)
{

View File

@ -29,7 +29,7 @@ public class LWCFeatures
if(test == null || !test.isEnabled()) return;
lwc = ((LWCPlugin)test).getLWC();
Factions.p.log("Successfully hooked into LWC!"+(Conf.lwcIntegration ? "" : " Integration is currently disabled, though (\"lwcIntegration\")."));
Factions.get().log("Successfully hooked into LWC!"+(Conf.lwcIntegration ? "" : " Integration is currently disabled, though (\"lwcIntegration\")."));
}
public static boolean getEnabled()

View File

@ -50,9 +50,9 @@ public class SpoutFeatures
if (enabled == true) return true;
enabled = true;
Factions.p.log("Found and will use features of "+plugin.getDescription().getFullName());
Factions.get().log("Found and will use features of "+plugin.getDescription().getFullName());
mainListener = new SpoutMainListener();
Bukkit.getPluginManager().registerEvents(mainListener, Factions.p);
Bukkit.getPluginManager().registerEvents(mainListener, Factions.get());
return true;
}
@ -112,7 +112,7 @@ public class SpoutFeatures
public static void updateCapeShortly(final Object ofrom, final Object oto)
{
Factions.p.getServer().getScheduler().scheduleSyncDelayedTask(Factions.p, new Runnable()
Factions.get().getServer().getScheduler().scheduleSyncDelayedTask(Factions.get(), new Runnable()
{
@Override
public void run()
@ -168,7 +168,7 @@ public class SpoutFeatures
public static void updateTitleShortly(final Object ofrom, final Object oto)
{
Factions.p.getServer().getScheduler().scheduleSyncDelayedTask(Factions.p, new Runnable()
Factions.get().getServer().getScheduler().scheduleSyncDelayedTask(Factions.get(), new Runnable()
{
@Override
public void run()

View File

@ -107,7 +107,7 @@ public class SpoutMainListener implements Listener
label.setWidth(1).setHeight(1); // prevent Spout's questionable new "no default size" warning
label.setScale(Conf.spoutTerritoryDisplaySize);
sPlayer.getMainScreen().attachWidget(Factions.p, label);
sPlayer.getMainScreen().attachWidget(Factions.get(), label);
territoryLabels.put(player.getName(), label);
}
@ -135,7 +135,7 @@ public class SpoutMainListener implements Listener
label.setWidth(1).setHeight(1); // prevent Spout's questionable new "no default size" warning
label.setScale(Conf.spoutTerritoryNoticeSize);
label.setY(Conf.spoutTerritoryNoticeTop);
sPlayer.getMainScreen().attachWidget(Factions.p, label);
sPlayer.getMainScreen().attachWidget(Factions.get(), label);
territoryChangeLabels.put(player.getName(), label);
}
@ -172,7 +172,7 @@ public class SpoutMainListener implements Listener
label.setWidth(1).setHeight(1); // prevent Spout's questionable new "no default size" warning
label.setScale(Conf.spoutTerritoryDisplaySize);
label.setY((int)(10 * Conf.spoutTerritoryDisplaySize));
sPlayer.getMainScreen().attachWidget(Factions.p, label);
sPlayer.getMainScreen().attachWidget(Factions.get(), label);
accessLabels.put(player.getName(), label);
}

View File

@ -39,13 +39,13 @@ public class Worldguard
{
enabled = false;
wg = null;
Factions.p.log("Could not hook to WorldGuard. WorldGuard checks are disabled.");
Factions.get().log("Could not hook to WorldGuard. WorldGuard checks are disabled.");
}
else
{
wg = (WorldGuardPlugin) wgplug;
enabled = true;
Factions.p.log("Successfully hooked to WorldGuard.");
Factions.get().log("Successfully hooked to WorldGuard.");
}
}

View File

@ -13,7 +13,7 @@ public class HerochatFeatures implements Listener
Plugin plug = Bukkit.getServer().getPluginManager().getPlugin("Herochat");
if (plug == null) return;
if (!plug.getClass().getName().equals("com.dthielke.herochat.Herochat")) return;
Bukkit.getPluginManager().registerEvents(new HerochatListener(Factions.p), Factions.p);
Factions.p.log("Integration with Herochat successful");
Bukkit.getPluginManager().registerEvents(new HerochatListener(Factions.get()), Factions.get());
Factions.get().log("Integration with Herochat successful");
}
}