Rename Conf --> ConfServer.

This commit is contained in:
Olof Larsson
2013-04-09 13:15:25 +02:00
parent c8870d10d4
commit 1b0c0a4b72
58 changed files with 335 additions and 335 deletions

View File

@ -7,7 +7,7 @@ import java.util.logging.Level;
import org.bukkit.Bukkit;
import org.bukkit.plugin.RegisteredServiceProvider;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.ConfServer;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.FactionColl;
@ -28,7 +28,7 @@ public class Econ
{
if (isSetup()) return;
String integrationFail = "Economy integration is "+(Conf.econEnabled ? "enabled, but" : "disabled, and")+" the plugin \"Vault\" ";
String integrationFail = "Economy integration is "+(ConfServer.econEnabled ? "enabled, but" : "disabled, and")+" the plugin \"Vault\" ";
if (Bukkit.getServer().getPluginManager().getPlugin("Vault") == null)
{
@ -46,7 +46,7 @@ public class Econ
Factions.get().log("Economy integration through Vault plugin successful.");
if ( ! Conf.econEnabled)
if ( ! ConfServer.econEnabled)
Factions.get().log("NOTE: Economy is disabled. You can enable it with the command: f config econEnabled true");
oldMoneyDoTransfer();
@ -54,7 +54,7 @@ public class Econ
public static boolean shouldBeUsed()
{
return Conf.econEnabled && econ != null && econ.isEnabled();
return ConfServer.econEnabled && econ != null && econ.isEnabled();
}
public static boolean isSetup()
@ -67,11 +67,11 @@ public class Econ
{
if (!shouldBeUsed()) return;
if (Conf.econUniverseAccount == null) return;
if (Conf.econUniverseAccount.length() == 0) return;
if ( ! econ.hasAccount(Conf.econUniverseAccount)) return;
if (ConfServer.econUniverseAccount == null) return;
if (ConfServer.econUniverseAccount.length() == 0) return;
if ( ! econ.hasAccount(ConfServer.econUniverseAccount)) return;
modifyBalance(Conf.econUniverseAccount, delta);
modifyBalance(ConfServer.econUniverseAccount, delta);
}
public static void sendBalanceInfo(FPlayer to, EconomyParticipator about)
@ -318,15 +318,15 @@ public class Econ
}
// basic claim cost, plus land inflation cost, minus the potential bonus given for claiming from another faction
return Conf.econCostClaimWilderness
+ (Conf.econCostClaimWilderness * Conf.econClaimAdditionalMultiplier * ownedLand)
- (takingFromAnotherFaction ? Conf.econCostClaimFromFactionBonus: 0);
return ConfServer.econCostClaimWilderness
+ (ConfServer.econCostClaimWilderness * ConfServer.econClaimAdditionalMultiplier * ownedLand)
- (takingFromAnotherFaction ? ConfServer.econCostClaimFromFactionBonus: 0);
}
// calculate refund amount for unclaiming land
public static double calculateClaimRefund(int ownedLand)
{
return calculateClaimCost(ownedLand - 1, false) * Conf.econClaimRefundMultiplier;
return calculateClaimCost(ownedLand - 1, false) * ConfServer.econClaimRefundMultiplier;
}
// calculate value of all owned land
@ -342,7 +342,7 @@ public class Econ
// calculate refund amount for all owned land
public static double calculateTotalLandRefund(int ownedLand)
{
return calculateTotalLandValue(ownedLand) * Conf.econClaimRefundMultiplier;
return calculateTotalLandValue(ownedLand) * ConfServer.econClaimRefundMultiplier;
}

View File

@ -9,7 +9,7 @@ import org.bukkit.event.Listener;
import org.bukkit.Location;
import org.bukkit.plugin.Plugin;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.ConfServer;
import com.massivecraft.factions.Factions;
import com.massivecraft.factions.listeners.FactionsChatListener;
@ -71,10 +71,10 @@ public class EssentialsFeatures
// return false if feature is disabled or Essentials isn't available
public static boolean handleTeleport(Player player, Location loc)
{
if ( ! Conf.homesTeleportCommandEssentialsIntegration || essentials == null) return false;
if ( ! ConfServer.homesTeleportCommandEssentialsIntegration || essentials == null) return false;
Teleport teleport = (Teleport) essentials.getUser(player).getTeleport();
Trade trade = new Trade(Conf.econCostHome, essentials);
Trade trade = new Trade(ConfServer.econCostHome, essentials);
try
{
teleport.teleport(loc, trade);

View File

@ -13,7 +13,7 @@ import org.bukkit.block.BlockState;
import com.griefcraft.lwc.LWC;
import com.griefcraft.lwc.LWCPlugin;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.ConfServer;
import com.massivecraft.factions.FLocation;
import com.massivecraft.factions.FPlayers;
import com.massivecraft.factions.Faction;
@ -29,12 +29,12 @@ public class LWCFeatures
if(test == null || !test.isEnabled()) return;
lwc = ((LWCPlugin)test).getLWC();
Factions.get().log("Successfully hooked into LWC!"+(Conf.lwcIntegration ? "" : " Integration is currently disabled, though (\"lwcIntegration\")."));
Factions.get().log("Successfully hooked into LWC!"+(ConfServer.lwcIntegration ? "" : " Integration is currently disabled, though (\"lwcIntegration\")."));
}
public static boolean getEnabled()
{
return Conf.lwcIntegration && lwc != null;
return ConfServer.lwcIntegration && lwc != null;
}
public static void clearOtherChests(FLocation flocation, Faction faction)

View File

@ -4,7 +4,7 @@ import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.ConfServer;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.FPlayers;
import com.massivecraft.factions.Faction;
@ -66,7 +66,7 @@ public class SpoutFeatures
{
// Enabled and non-null?
if ( ! isEnabled()) return;
if ( ! Conf.spoutCapes) return;
if ( ! ConfServer.spoutCapes) return;
Set<Player> fromPlayers = getPlayersFromObject(ofrom);
Set<Player> toPlayers = getPlayersFromObject(oto);
@ -130,7 +130,7 @@ public class SpoutFeatures
{
// Enabled and non-null?
if ( ! isEnabled()) return;
if ( ! (Conf.spoutFactionTagsOverNames || Conf.spoutFactionTitlesOverNames || Conf.spoutHealthBarUnderNames)) return;
if ( ! (ConfServer.spoutFactionTagsOverNames || ConfServer.spoutFactionTitlesOverNames || ConfServer.spoutHealthBarUnderNames)) return;
Set<Player> fromPlayers = getPlayersFromObject(ofrom);
Set<Player> toPlayers = getPlayersFromObject(oto);
@ -187,12 +187,12 @@ public class SpoutFeatures
if (faction.isNormal())
{
String addTag = "";
if (Conf.spoutFactionTagsOverNames)
if (ConfServer.spoutFactionTagsOverNames)
{
addTag += relationColor.toString() + fplayer.getRole().getPrefix() + faction.getTag();
}
if (Conf.spoutFactionTitlesOverNames && ! fplayer.getTitle().isEmpty())
if (ConfServer.spoutFactionTitlesOverNames && ! fplayer.getTitle().isEmpty())
{
addTag += (addTag.isEmpty() ? "" : " ") + fplayer.getTitle();
}
@ -200,7 +200,7 @@ public class SpoutFeatures
ret = addTag + "\n" + ret;
}
if (Conf.spoutHealthBarUnderNames)
if (ConfServer.spoutHealthBarUnderNames)
{
ret += "\n";
ret += HealthBarUtil.getHealthbar(player.getHealth() / 20d);

View File

@ -9,7 +9,7 @@ import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import com.massivecraft.factions.Board;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.ConfServer;
import com.massivecraft.factions.FLocation;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.FPlayers;
@ -54,7 +54,7 @@ public class SpoutMainListener implements Listener
return false;
SpoutPlayer sPlayer = SpoutManager.getPlayer(p);
if (!sPlayer.isSpoutCraftEnabled() || (Conf.spoutTerritoryDisplaySize <= 0 && ! Conf.spoutTerritoryNoticeShow))
if (!sPlayer.isSpoutCraftEnabled() || (ConfServer.spoutTerritoryDisplaySize <= 0 && ! ConfServer.spoutTerritoryNoticeShow))
return false;
doLabels(player, sPlayer, notify);
@ -69,7 +69,7 @@ public class SpoutMainListener implements Listener
return false;
SpoutPlayer sPlayer = SpoutManager.getPlayer(p);
if (!sPlayer.isSpoutCraftEnabled() || (Conf.spoutTerritoryDisplaySize <= 0 && ! Conf.spoutTerritoryNoticeShow))
if (!sPlayer.isSpoutCraftEnabled() || (ConfServer.spoutTerritoryDisplaySize <= 0 && ! ConfServer.spoutTerritoryNoticeShow))
return false;
FLocation here = player.getLastStoodAt();
@ -96,7 +96,7 @@ public class SpoutMainListener implements Listener
// ----------------------
// Main territory display
// ----------------------
if (Conf.spoutTerritoryDisplayPosition > 0 && Conf.spoutTerritoryDisplaySize > 0)
if (ConfServer.spoutTerritoryDisplayPosition > 0 && ConfServer.spoutTerritoryDisplaySize > 0)
{
GenericLabel label;
if (territoryLabels.containsKey(player.getName()))
@ -105,7 +105,7 @@ public class SpoutMainListener implements Listener
{
label = new GenericLabel();
label.setWidth(1).setHeight(1); // prevent Spout's questionable new "no default size" warning
label.setScale(Conf.spoutTerritoryDisplaySize);
label.setScale(ConfServer.spoutTerritoryDisplaySize);
sPlayer.getMainScreen().attachWidget(Factions.get(), label);
territoryLabels.put(player.getName(), label);
@ -113,7 +113,7 @@ public class SpoutMainListener implements Listener
String msg = tag;
if (Conf.spoutTerritoryDisplayShowDescription && !factionHere.getDescription().isEmpty())
if (ConfServer.spoutTerritoryDisplayShowDescription && !factionHere.getDescription().isEmpty())
msg += " - " + factionHere.getDescription();
label.setText(msg);
@ -124,24 +124,24 @@ public class SpoutMainListener implements Listener
// -----------------------
// Fading territory notice
// -----------------------
if (notify && Conf.spoutTerritoryNoticeShow && Conf.spoutTerritoryNoticeSize > 0)
if (notify && ConfServer.spoutTerritoryNoticeShow && ConfServer.spoutTerritoryNoticeSize > 0)
{
NoticeLabel label;
if (territoryChangeLabels.containsKey(player.getName()))
label = territoryChangeLabels.get(player.getName());
else
{
label = new NoticeLabel(Conf.spoutTerritoryNoticeLeaveAfterSeconds);
label = new NoticeLabel(ConfServer.spoutTerritoryNoticeLeaveAfterSeconds);
label.setWidth(1).setHeight(1); // prevent Spout's questionable new "no default size" warning
label.setScale(Conf.spoutTerritoryNoticeSize);
label.setY(Conf.spoutTerritoryNoticeTop);
label.setScale(ConfServer.spoutTerritoryNoticeSize);
label.setY(ConfServer.spoutTerritoryNoticeTop);
sPlayer.getMainScreen().attachWidget(Factions.get(), label);
territoryChangeLabels.put(player.getName(), label);
}
String msg = tag;
if (Conf.spoutTerritoryNoticeShowDescription && !factionHere.getDescription().isEmpty())
if (ConfServer.spoutTerritoryNoticeShowDescription && !factionHere.getDescription().isEmpty())
msg += " - " + factionHere.getDescription();
label.setText(msg);
@ -158,7 +158,7 @@ public class SpoutMainListener implements Listener
private static final Color accessDeniedColor = new Color(1.0f, 0.2f, 0.2f);
private void doAccessInfo(FPlayer player, SpoutPlayer sPlayer, FLocation here)
{
if (Conf.spoutTerritoryDisplayPosition <= 0 || Conf.spoutTerritoryDisplaySize <= 0 || ! Conf.spoutTerritoryAccessShow) return;
if (ConfServer.spoutTerritoryDisplayPosition <= 0 || ConfServer.spoutTerritoryDisplaySize <= 0 || ! ConfServer.spoutTerritoryAccessShow) return;
// -----------
// Access Info
@ -170,8 +170,8 @@ public class SpoutMainListener implements Listener
{
label = new GenericLabel();
label.setWidth(1).setHeight(1); // prevent Spout's questionable new "no default size" warning
label.setScale(Conf.spoutTerritoryDisplaySize);
label.setY((int)(10 * Conf.spoutTerritoryDisplaySize));
label.setScale(ConfServer.spoutTerritoryDisplaySize);
label.setY((int)(10 * ConfServer.spoutTerritoryDisplaySize));
sPlayer.getMainScreen().attachWidget(Factions.get(), label);
accessLabels.put(player.getName(), label);
}
@ -201,11 +201,11 @@ public class SpoutMainListener implements Listener
// this is only necessary because Spout text size scaling is currently bugged and breaks their built-in alignment methods
public void alignLabel(GenericLabel label, String text)
{
alignLabel(label, text, Conf.spoutTerritoryDisplayPosition);
alignLabel(label, text, ConfServer.spoutTerritoryDisplayPosition);
}
public void alignLabel(GenericLabel label, String text, int alignment)
{
int labelWidth = (int)((float)GenericLabel.getStringWidth(text) * Conf.spoutTerritoryDisplaySize);
int labelWidth = (int)((float)GenericLabel.getStringWidth(text) * ConfServer.spoutTerritoryDisplaySize);
if (labelWidth > SCREEN_WIDTH)
{
label.setX(0);

View File

@ -5,7 +5,7 @@ import java.util.Set;
import org.bukkit.ChatColor;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.ConfServer;
import com.massivecraft.factions.struct.Rel;
public class AlliesChannel extends FactionsChannelAbstract
@ -13,30 +13,30 @@ public class AlliesChannel extends FactionsChannelAbstract
public static final Set<Rel> targetRelations = EnumSet.of(Rel.MEMBER, Rel.ALLY);
@Override public Set<Rel> getTargetRelations() { return targetRelations; }
@Override public String getName() { return Conf.herochatAlliesName; }
@Override public String getName() { return ConfServer.herochatAlliesName; }
@Override public String getNick() { return Conf.herochatAlliesNick; }
@Override public void setNick(String nick) { Conf.herochatAlliesNick = nick; }
@Override public String getNick() { return ConfServer.herochatAlliesNick; }
@Override public void setNick(String nick) { ConfServer.herochatAlliesNick = nick; }
@Override public String getFormat() { return Conf.herochatAlliesFormat; }
@Override public void setFormat(String format) { Conf.herochatAlliesFormat = format; }
@Override public String getFormat() { return ConfServer.herochatAlliesFormat; }
@Override public void setFormat(String format) { ConfServer.herochatAlliesFormat = format; }
@Override public ChatColor getColor() { return Conf.herochatAlliesColor; }
@Override public void setColor(ChatColor color) { Conf.herochatAlliesColor = color; }
@Override public ChatColor getColor() { return ConfServer.herochatAlliesColor; }
@Override public void setColor(ChatColor color) { ConfServer.herochatAlliesColor = color; }
@Override public int getDistance() { return Conf.herochatAlliesDistance; }
@Override public void setDistance(int distance) { Conf.herochatAlliesDistance = distance; }
@Override public int getDistance() { return ConfServer.herochatAlliesDistance; }
@Override public void setDistance(int distance) { ConfServer.herochatAlliesDistance = distance; }
@Override public void addWorld(String world) { Conf.herochatAlliesWorlds.add(world); }
@Override public Set<String> getWorlds() { return Conf.herochatAlliesWorlds; }
@Override public void setWorlds(Set<String> worlds) { Conf.herochatAlliesWorlds = worlds; }
@Override public void addWorld(String world) { ConfServer.herochatAlliesWorlds.add(world); }
@Override public Set<String> getWorlds() { return ConfServer.herochatAlliesWorlds; }
@Override public void setWorlds(Set<String> worlds) { ConfServer.herochatAlliesWorlds = worlds; }
@Override public boolean isShortcutAllowed() { return Conf.herochatAlliesIsShortcutAllowed; }
@Override public void setShortcutAllowed(boolean shortcutAllowed) { Conf.herochatAlliesIsShortcutAllowed = shortcutAllowed; }
@Override public boolean isShortcutAllowed() { return ConfServer.herochatAlliesIsShortcutAllowed; }
@Override public void setShortcutAllowed(boolean shortcutAllowed) { ConfServer.herochatAlliesIsShortcutAllowed = shortcutAllowed; }
@Override public boolean isCrossWorld() { return Conf.herochatAlliesCrossWorld; }
@Override public void setCrossWorld(boolean crossWorld) { Conf.herochatAlliesCrossWorld = crossWorld; }
@Override public boolean isCrossWorld() { return ConfServer.herochatAlliesCrossWorld; }
@Override public void setCrossWorld(boolean crossWorld) { ConfServer.herochatAlliesCrossWorld = crossWorld; }
@Override public boolean isMuted() { return Conf.herochatAlliesMuted; }
@Override public void setMuted(boolean value) { Conf.herochatAlliesMuted = value; }
@Override public boolean isMuted() { return ConfServer.herochatAlliesMuted; }
@Override public void setMuted(boolean value) { ConfServer.herochatAlliesMuted = value; }
}

View File

@ -6,7 +6,7 @@ import java.util.Set;
import org.bukkit.ChatColor;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.ConfServer;
import com.massivecraft.factions.struct.Rel;
public class FactionChannel extends FactionsChannelAbstract
@ -14,30 +14,30 @@ public class FactionChannel extends FactionsChannelAbstract
public static final Set<Rel> targetRelations = EnumSet.of(Rel.MEMBER);
@Override public Set<Rel> getTargetRelations() { return targetRelations; }
@Override public String getName() { return Conf.herochatFactionName; }
@Override public String getName() { return ConfServer.herochatFactionName; }
@Override public String getNick() { return Conf.herochatFactionNick; }
@Override public void setNick(String nick) { Conf.herochatFactionNick = nick; }
@Override public String getNick() { return ConfServer.herochatFactionNick; }
@Override public void setNick(String nick) { ConfServer.herochatFactionNick = nick; }
@Override public String getFormat() { return Conf.herochatFactionFormat; }
@Override public void setFormat(String format) { Conf.herochatFactionFormat = format; }
@Override public String getFormat() { return ConfServer.herochatFactionFormat; }
@Override public void setFormat(String format) { ConfServer.herochatFactionFormat = format; }
@Override public ChatColor getColor() { return Conf.herochatFactionColor; }
@Override public void setColor(ChatColor color) { Conf.herochatFactionColor = color; }
@Override public ChatColor getColor() { return ConfServer.herochatFactionColor; }
@Override public void setColor(ChatColor color) { ConfServer.herochatFactionColor = color; }
@Override public int getDistance() { return Conf.herochatFactionDistance; }
@Override public void setDistance(int distance) { Conf.herochatFactionDistance = distance; }
@Override public int getDistance() { return ConfServer.herochatFactionDistance; }
@Override public void setDistance(int distance) { ConfServer.herochatFactionDistance = distance; }
@Override public void addWorld(String world) { Conf.herochatFactionWorlds.add(world); }
@Override public Set<String> getWorlds() { return new HashSet<String>(Conf.herochatFactionWorlds); }
@Override public void setWorlds(Set<String> worlds) { Conf.herochatFactionWorlds = worlds; }
@Override public void addWorld(String world) { ConfServer.herochatFactionWorlds.add(world); }
@Override public Set<String> getWorlds() { return new HashSet<String>(ConfServer.herochatFactionWorlds); }
@Override public void setWorlds(Set<String> worlds) { ConfServer.herochatFactionWorlds = worlds; }
@Override public boolean isShortcutAllowed() { return Conf.herochatFactionIsShortcutAllowed; }
@Override public void setShortcutAllowed(boolean shortcutAllowed) { Conf.herochatFactionIsShortcutAllowed = shortcutAllowed; }
@Override public boolean isShortcutAllowed() { return ConfServer.herochatFactionIsShortcutAllowed; }
@Override public void setShortcutAllowed(boolean shortcutAllowed) { ConfServer.herochatFactionIsShortcutAllowed = shortcutAllowed; }
@Override public boolean isCrossWorld() { return Conf.herochatFactionCrossWorld; }
@Override public void setCrossWorld(boolean crossWorld) { Conf.herochatFactionCrossWorld = crossWorld; }
@Override public boolean isCrossWorld() { return ConfServer.herochatFactionCrossWorld; }
@Override public void setCrossWorld(boolean crossWorld) { ConfServer.herochatFactionCrossWorld = crossWorld; }
@Override public boolean isMuted() { return Conf.herochatFactionMuted; }
@Override public void setMuted(boolean value) { Conf.herochatFactionMuted = value; }
@Override public boolean isMuted() { return ConfServer.herochatFactionMuted; }
@Override public void setMuted(boolean value) { ConfServer.herochatFactionMuted = value; }
}

View File

@ -7,7 +7,7 @@ import org.bukkit.event.Listener;
import com.dthielke.herochat.ChannelChatEvent;
import com.dthielke.herochat.Herochat;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.ConfServer;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.FPlayers;
import com.massivecraft.factions.Factions;
@ -30,8 +30,8 @@ public class HerochatListener implements Listener
public void onChannelChatEvent(ChannelChatEvent event)
{
// Should we even parse?
if ( ! Conf.chatParseTags) return;
if (Conf.chatTagHandledByAnotherPlugin) return;
if ( ! ConfServer.chatParseTags) return;
if (ConfServer.chatTagHandledByAnotherPlugin) return;
Player from = event.getSender().getPlayer();
FPlayer fpfrom = FPlayers.i.get(from);