Use PS instead of FLocation in a few places.
This commit is contained in:
@ -5,7 +5,6 @@ import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
@ -14,7 +13,6 @@ import org.bukkit.block.BlockState;
|
||||
import com.griefcraft.lwc.LWC;
|
||||
import com.griefcraft.lwc.LWCPlugin;
|
||||
import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.FLocation;
|
||||
import com.massivecraft.factions.FPlayerColl;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.Factions;
|
||||
@ -38,11 +36,18 @@ public class LWCFeatures
|
||||
return ConfServer.lwcIntegration && lwc != null;
|
||||
}
|
||||
|
||||
public static void clearOtherChests(FLocation flocation, Faction faction)
|
||||
public static void clearOtherChests(PS ps, Faction faction)
|
||||
{
|
||||
Location location = new Location(Bukkit.getWorld(flocation.getWorldName()), flocation.getX() * 16, 5, flocation.getZ() * 16);
|
||||
if (location.getWorld() == null) return; // world not loaded or something? cancel out to prevent error
|
||||
Chunk chunk = location.getChunk();
|
||||
Chunk chunk = null;
|
||||
try
|
||||
{
|
||||
chunk = ps.asBukkitChunk(true);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
BlockState[] blocks = chunk.getTileEntities();
|
||||
List<Block> chests = new LinkedList<Block>();
|
||||
|
||||
|
@ -8,7 +8,6 @@ import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.FPlayerColl;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.FLocation;
|
||||
import com.massivecraft.factions.Factions;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
@ -17,6 +16,7 @@ import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.massivecraft.factions.util.HealthBarUtil;
|
||||
import com.massivecraft.mcore.ps.PS;
|
||||
|
||||
import org.getspout.spoutapi.player.SpoutPlayer;
|
||||
import org.getspout.spoutapi.SpoutManager;
|
||||
@ -246,7 +246,7 @@ public class SpoutFeatures
|
||||
// -------------------------------------------- //
|
||||
|
||||
// update displayed current territory for all players inside a specified chunk; if specified chunk is null, then simply update everyone online
|
||||
public static void updateTerritoryDisplayLoc(FLocation fLoc)
|
||||
public static void updateTerritoryDisplayLoc(PS chunk)
|
||||
{
|
||||
if ( ! isEnabled()) return;
|
||||
|
||||
@ -254,10 +254,14 @@ public class SpoutFeatures
|
||||
|
||||
for (FPlayer player : players)
|
||||
{
|
||||
if (fLoc == null)
|
||||
if (chunk == null)
|
||||
{
|
||||
mainListener.updateTerritoryDisplay(player, false);
|
||||
else if (player.getLastStoodAt().equals(fLoc))
|
||||
}
|
||||
else if (player.getLastStoodAt().equals(chunk))
|
||||
{
|
||||
mainListener.updateTerritoryDisplay(player, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -269,15 +273,17 @@ public class SpoutFeatures
|
||||
}
|
||||
|
||||
// update access info for all players inside a specified chunk; if specified chunk is null, then simply update everyone online
|
||||
public static void updateAccessInfoLoc(FLocation fLoc)
|
||||
public static void updateAccessInfoLoc(PS chunk)
|
||||
{
|
||||
if ( ! isEnabled()) return;
|
||||
|
||||
chunk = chunk.getChunk(true);
|
||||
|
||||
Set<FPlayer> players = FPlayerColl.i.getOnline();
|
||||
|
||||
for (FPlayer player : players)
|
||||
{
|
||||
if (fLoc == null || player.getLastStoodAt().equals(fLoc))
|
||||
if (chunk == null || player.getLastStoodAt().equals(chunk))
|
||||
mainListener.updateAccessInfo(player);
|
||||
}
|
||||
}
|
||||
|
@ -8,14 +8,14 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
import com.massivecraft.factions.BoardOld;
|
||||
import com.massivecraft.factions.BoardColl;
|
||||
import com.massivecraft.factions.ConfServer;
|
||||
import com.massivecraft.factions.FLocation;
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.FPlayerColl;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.TerritoryAccess;
|
||||
import com.massivecraft.mcore.ps.PS;
|
||||
|
||||
import org.getspout.spoutapi.event.spout.SpoutCraftEnableEvent;
|
||||
import org.getspout.spoutapi.gui.Color;
|
||||
@ -72,9 +72,9 @@ public class SpoutMainListener implements Listener
|
||||
if (!sPlayer.isSpoutCraftEnabled() || (ConfServer.spoutTerritoryDisplaySize <= 0 && ! ConfServer.spoutTerritoryNoticeShow))
|
||||
return false;
|
||||
|
||||
FLocation here = player.getLastStoodAt();
|
||||
PS here = player.getLastStoodAt();
|
||||
|
||||
doAccessInfo(player, sPlayer, here);
|
||||
this.doAccessInfo(player, sPlayer, here);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -89,8 +89,8 @@ public class SpoutMainListener implements Listener
|
||||
|
||||
private void doLabels(FPlayer player, SpoutPlayer sPlayer, boolean notify)
|
||||
{
|
||||
FLocation here = player.getLastStoodAt();
|
||||
Faction factionHere = BoardOld.getFactionAt(here);
|
||||
PS here = player.getLastStoodAt();
|
||||
Faction factionHere = BoardColl.get().getFactionAt(here);
|
||||
String tag = factionHere.getColorTo(player).toString() + factionHere.getTag();
|
||||
|
||||
// ----------------------
|
||||
@ -156,7 +156,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, FLocation here)
|
||||
private void doAccessInfo(FPlayer player, SpoutPlayer sPlayer, PS here)
|
||||
{
|
||||
if (ConfServer.spoutTerritoryDisplayPosition <= 0 || ConfServer.spoutTerritoryDisplaySize <= 0 || ! ConfServer.spoutTerritoryAccessShow) return;
|
||||
|
||||
@ -177,7 +177,7 @@ public class SpoutMainListener implements Listener
|
||||
}
|
||||
|
||||
String msg = "";
|
||||
TerritoryAccess access = BoardOld.getTerritoryAccessAt(here);
|
||||
TerritoryAccess access = BoardColl.get().getTerritoryAccessAt(here);
|
||||
|
||||
if ( ! access.isDefault())
|
||||
{
|
||||
|
Reference in New Issue
Block a user