Starting to rename fplayer --> uplayer since we will need an mplayer.
This commit is contained in:
@ -8,7 +8,7 @@ import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.EconomyParticipator;
|
||||
import com.massivecraft.factions.FPerm;
|
||||
import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.entity.FPlayer;
|
||||
import com.massivecraft.factions.entity.UPlayer;
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.factions.util.RelationUtil;
|
||||
import com.massivecraft.mcore.money.Money;
|
||||
@ -30,7 +30,7 @@ public class Econ
|
||||
// UTIL
|
||||
// -------------------------------------------- //
|
||||
|
||||
public static boolean payForAction(double cost, FPlayer fsender, String actionDescription)
|
||||
public static boolean payForAction(double cost, UPlayer fsender, String actionDescription)
|
||||
{
|
||||
if (!isEnabled(fsender)) return true;
|
||||
if (cost == 0D) return true;
|
||||
@ -64,7 +64,7 @@ public class Econ
|
||||
Money.add(universe, ConfServer.econUniverseAccount, delta);
|
||||
}
|
||||
|
||||
public static void sendBalanceInfo(FPlayer to, EconomyParticipator about)
|
||||
public static void sendBalanceInfo(UPlayer to, EconomyParticipator about)
|
||||
{
|
||||
if (!isEnabled(to))
|
||||
{
|
||||
@ -84,7 +84,7 @@ public class Econ
|
||||
if (fI == null) return true;
|
||||
|
||||
// Bypassing players can do any kind of transaction
|
||||
if (i instanceof FPlayer && ((FPlayer)i).isUsingAdminMode()) return true;
|
||||
if (i instanceof UPlayer && ((UPlayer)i).isUsingAdminMode()) return true;
|
||||
|
||||
// You can deposit to anywhere you feel like. It's your loss if you can't withdraw it again.
|
||||
if (i == you) return true;
|
||||
@ -167,21 +167,21 @@ public class Econ
|
||||
return false;
|
||||
}
|
||||
|
||||
public static Set<FPlayer> getFplayers(EconomyParticipator ep)
|
||||
public static Set<UPlayer> getFplayers(EconomyParticipator ep)
|
||||
{
|
||||
Set<FPlayer> fplayers = new HashSet<FPlayer>();
|
||||
Set<UPlayer> fplayers = new HashSet<UPlayer>();
|
||||
|
||||
if (ep == null)
|
||||
{
|
||||
// Add nothing
|
||||
}
|
||||
else if (ep instanceof FPlayer)
|
||||
else if (ep instanceof UPlayer)
|
||||
{
|
||||
fplayers.add((FPlayer)ep);
|
||||
fplayers.add((UPlayer)ep);
|
||||
}
|
||||
else if (ep instanceof Faction)
|
||||
{
|
||||
fplayers.addAll(((Faction)ep).getFPlayers());
|
||||
fplayers.addAll(((Faction)ep).getUPlayers());
|
||||
}
|
||||
|
||||
return fplayers;
|
||||
@ -189,35 +189,35 @@ public class Econ
|
||||
|
||||
public static void sendTransferInfo(EconomyParticipator invoker, EconomyParticipator from, EconomyParticipator to, double amount)
|
||||
{
|
||||
Set<FPlayer> recipients = new HashSet<FPlayer>();
|
||||
Set<UPlayer> recipients = new HashSet<UPlayer>();
|
||||
recipients.addAll(getFplayers(invoker));
|
||||
recipients.addAll(getFplayers(from));
|
||||
recipients.addAll(getFplayers(to));
|
||||
|
||||
if (invoker == null)
|
||||
{
|
||||
for (FPlayer recipient : recipients)
|
||||
for (UPlayer recipient : recipients)
|
||||
{
|
||||
recipient.msg("<h>%s<i> was transfered from <h>%s<i> to <h>%s<i>.", Money.format(from, amount), from.describeTo(recipient), to.describeTo(recipient));
|
||||
}
|
||||
}
|
||||
else if (invoker == from)
|
||||
{
|
||||
for (FPlayer recipient : recipients)
|
||||
for (UPlayer recipient : recipients)
|
||||
{
|
||||
recipient.msg("<h>%s<i> <h>gave %s<i> to <h>%s<i>.", from.describeTo(recipient, true), Money.format(from, amount), to.describeTo(recipient));
|
||||
}
|
||||
}
|
||||
else if (invoker == to)
|
||||
{
|
||||
for (FPlayer recipient : recipients)
|
||||
for (UPlayer recipient : recipients)
|
||||
{
|
||||
recipient.msg("<h>%s<i> <h>took %s<i> from <h>%s<i>.", to.describeTo(recipient, true), Money.format(from, amount), from.describeTo(recipient));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (FPlayer recipient : recipients)
|
||||
for (UPlayer recipient : recipients)
|
||||
{
|
||||
recipient.msg("<h>%s<i> transfered <h>%s<i> from <h>%s<i> to <h>%s<i>.", invoker.describeTo(recipient, true), Money.format(from, amount), from.describeTo(recipient), to.describeTo(recipient));
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ import com.griefcraft.lwc.LWC;
|
||||
import com.griefcraft.lwc.LWCPlugin;
|
||||
import com.griefcraft.model.Protection;
|
||||
import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.entity.FPlayer;
|
||||
import com.massivecraft.factions.entity.UPlayer;
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.mcore.ps.PS;
|
||||
|
||||
@ -48,8 +48,8 @@ public class LWCFeatures
|
||||
{
|
||||
for (Protection protection : getProtectionsInChunk(chunkPs))
|
||||
{
|
||||
FPlayer owner = FPlayer.get(protection.getOwner());
|
||||
if (faction.getFPlayers().contains(owner)) continue;
|
||||
UPlayer owner = UPlayer.get(protection.getOwner());
|
||||
if (faction.getUPlayers().contains(owner)) continue;
|
||||
protection.remove();
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ import org.bukkit.ChatColor;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.massivecraft.factions.entity.FPlayer;
|
||||
import com.massivecraft.factions.entity.UPlayer;
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.factions.util.HealthBarUtil;
|
||||
import com.massivecraft.mcore.ps.PS;
|
||||
@ -72,7 +72,7 @@ public class SpoutFeatures
|
||||
|
||||
for (Player player : fromPlayers)
|
||||
{
|
||||
FPlayer fplayer = FPlayer.get(player);
|
||||
UPlayer fplayer = UPlayer.get(player);
|
||||
SpoutPlayer splayer = SpoutManager.getPlayer(player);
|
||||
Faction faction = fplayer.getFaction();
|
||||
|
||||
@ -137,13 +137,13 @@ public class SpoutFeatures
|
||||
|
||||
for (Player player : fromPlayers)
|
||||
{
|
||||
FPlayer fplayer = FPlayer.get(player);
|
||||
UPlayer fplayer = UPlayer.get(player);
|
||||
SpoutPlayer splayer = SpoutManager.getPlayer(player);
|
||||
Faction faction = fplayer.getFaction();
|
||||
|
||||
for (Player playerTo : toPlayers)
|
||||
{
|
||||
FPlayer fplayerTo = FPlayer.get(playerTo);
|
||||
UPlayer fplayerTo = UPlayer.get(playerTo);
|
||||
SpoutPlayer splayerTo = SpoutManager.getPlayer(playerTo);
|
||||
Faction factionTo = fplayerTo.getFaction();
|
||||
|
||||
@ -178,7 +178,7 @@ public class SpoutFeatures
|
||||
}, 5);
|
||||
}
|
||||
|
||||
public static String generateTitle(Player player, FPlayer fplayer, Faction faction, ChatColor relationColor)
|
||||
public static String generateTitle(Player player, UPlayer fplayer, Faction faction, ChatColor relationColor)
|
||||
{
|
||||
String ret = null;
|
||||
|
||||
@ -220,9 +220,9 @@ public class SpoutFeatures
|
||||
{
|
||||
ret.add((Player)o);
|
||||
}
|
||||
else if (o instanceof FPlayer)
|
||||
else if (o instanceof UPlayer)
|
||||
{
|
||||
FPlayer fplayer = (FPlayer)o;
|
||||
UPlayer fplayer = (UPlayer)o;
|
||||
Player player = fplayer.getPlayer();
|
||||
if (player != null)
|
||||
{
|
||||
@ -252,7 +252,7 @@ public class SpoutFeatures
|
||||
|
||||
for (Player player : Bukkit.getOnlinePlayers())
|
||||
{
|
||||
FPlayer fplayer = FPlayer.get(player);
|
||||
UPlayer fplayer = UPlayer.get(player);
|
||||
if (chunk == null)
|
||||
{
|
||||
mainListener.updateTerritoryDisplay(fplayer, false);
|
||||
@ -265,7 +265,7 @@ public class SpoutFeatures
|
||||
}
|
||||
|
||||
// update displayed current territory for specified player; returns false if unsuccessful
|
||||
public static boolean updateTerritoryDisplay(FPlayer player)
|
||||
public static boolean updateTerritoryDisplay(UPlayer player)
|
||||
{
|
||||
if ( ! isEnabled()) return false;
|
||||
return mainListener.updateTerritoryDisplay(player, true);
|
||||
@ -280,7 +280,7 @@ public class SpoutFeatures
|
||||
|
||||
for (Player player : Bukkit.getOnlinePlayers())
|
||||
{
|
||||
FPlayer fplayer = FPlayer.get(player);
|
||||
UPlayer fplayer = UPlayer.get(player);
|
||||
if (chunk == null || fplayer.getCurrentChunk().equals(chunk))
|
||||
{
|
||||
mainListener.updateAccessInfo(fplayer);
|
||||
@ -289,13 +289,13 @@ public class SpoutFeatures
|
||||
}
|
||||
|
||||
// update owner list for specified player
|
||||
public static boolean updateAccessInfo(FPlayer player)
|
||||
public static boolean updateAccessInfo(UPlayer player)
|
||||
{
|
||||
if ( ! isEnabled()) return false;
|
||||
return mainListener.updateAccessInfo(player);
|
||||
}
|
||||
|
||||
public static void playerDisconnect(FPlayer player)
|
||||
public static void playerDisconnect(UPlayer player)
|
||||
{
|
||||
if ( ! isEnabled()) return;
|
||||
mainListener.removeTerritoryLabels(player.getName());
|
||||
|
@ -12,7 +12,7 @@ import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.TerritoryAccess;
|
||||
import com.massivecraft.factions.entity.BoardColls;
|
||||
import com.massivecraft.factions.entity.FPlayer;
|
||||
import com.massivecraft.factions.entity.UPlayer;
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.mcore.ps.PS;
|
||||
|
||||
@ -28,7 +28,7 @@ public class SpoutMainListener implements Listener
|
||||
@EventHandler(priority = EventPriority.NORMAL)
|
||||
public void onSpoutCraftEnable(SpoutCraftEnableEvent event)
|
||||
{
|
||||
final FPlayer me = FPlayer.get(event.getPlayer());
|
||||
final UPlayer me = UPlayer.get(event.getPlayer());
|
||||
|
||||
SpoutFeatures.updateTitle(me, null);
|
||||
SpoutFeatures.updateTitle(null, me);
|
||||
@ -46,7 +46,7 @@ public class SpoutMainListener implements Listener
|
||||
// private final static int SCREEN_HEIGHT = 240;
|
||||
|
||||
|
||||
public boolean updateTerritoryDisplay(FPlayer player, boolean notify)
|
||||
public boolean updateTerritoryDisplay(UPlayer player, boolean notify)
|
||||
{
|
||||
Player p = player.getPlayer();
|
||||
if (p == null)
|
||||
@ -61,7 +61,7 @@ public class SpoutMainListener implements Listener
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean updateAccessInfo(FPlayer player)
|
||||
public boolean updateAccessInfo(UPlayer player)
|
||||
{
|
||||
Player p = player.getPlayer();
|
||||
if (p == null)
|
||||
@ -86,7 +86,7 @@ public class SpoutMainListener implements Listener
|
||||
}
|
||||
|
||||
|
||||
private void doLabels(FPlayer player, SpoutPlayer sPlayer, boolean notify)
|
||||
private void doLabels(UPlayer player, SpoutPlayer sPlayer, boolean notify)
|
||||
{
|
||||
PS here = player.getCurrentChunk();
|
||||
Faction factionHere = BoardColls.get().getFactionAt(here);
|
||||
@ -159,7 +159,7 @@ public class SpoutMainListener implements Listener
|
||||
|
||||
private static final Color accessGrantedColor = new Color(0.2f, 1.0f, 0.2f);
|
||||
private static final Color accessDeniedColor = new Color(1.0f, 0.2f, 0.2f);
|
||||
private void doAccessInfo(FPlayer player, SpoutPlayer sPlayer, PS here)
|
||||
private void doAccessInfo(UPlayer player, SpoutPlayer sPlayer, PS here)
|
||||
{
|
||||
if (ConfServer.spoutTerritoryDisplayPosition <= 0 || ConfServer.spoutTerritoryDisplaySize <= 0 || ! ConfServer.spoutTerritoryAccessShow) return;
|
||||
|
||||
|
@ -23,7 +23,7 @@ import com.dthielke.herochat.MessageFormatSupplier;
|
||||
import com.dthielke.herochat.MessageNotFoundException;
|
||||
import com.dthielke.herochat.util.Messaging;
|
||||
import com.massivecraft.factions.Rel;
|
||||
import com.massivecraft.factions.entity.FPlayer;
|
||||
import com.massivecraft.factions.entity.UPlayer;
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
|
||||
public abstract class FactionsChannelAbstract implements Channel
|
||||
@ -211,13 +211,13 @@ public abstract class FactionsChannelAbstract implements Channel
|
||||
{
|
||||
Set<Player> ret = new HashSet<Player>();
|
||||
|
||||
FPlayer fpsender = FPlayer.get(sender);
|
||||
UPlayer fpsender = UPlayer.get(sender);
|
||||
Faction faction = fpsender.getFaction();
|
||||
String universe = fpsender.getUniverse();
|
||||
|
||||
for (Player player : Bukkit.getOnlinePlayers())
|
||||
{
|
||||
FPlayer frecipient = FPlayer.get(player);
|
||||
UPlayer frecipient = UPlayer.get(player);
|
||||
if (!frecipient.getUniverse().equals(universe)) continue;
|
||||
if (!this.getTargetRelations().contains(faction.getRelationTo(frecipient))) continue;
|
||||
ret.add(player);
|
||||
|
@ -10,7 +10,7 @@ import com.dthielke.herochat.ChannelChatEvent;
|
||||
import com.dthielke.herochat.Herochat;
|
||||
import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.chat.ChatFormatter;
|
||||
import com.massivecraft.factions.entity.FPlayer;
|
||||
import com.massivecraft.factions.entity.UPlayer;
|
||||
import com.massivecraft.factions.entity.MConf;
|
||||
|
||||
|
||||
@ -54,7 +54,7 @@ public class HerochatEngine implements Listener
|
||||
String format = event.getFormat();
|
||||
format = format.replaceAll("&r", "§r");
|
||||
|
||||
format = ChatFormatter.format(format, FPlayer.get(event.getSender().getPlayer()), null);
|
||||
format = ChatFormatter.format(format, UPlayer.get(event.getSender().getPlayer()), null);
|
||||
event.setFormat(format);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user