(courtesy of patrickfreed) LWC Chest Protection Integration

When a claimed territory is captured by another Faction, all LWC chests that are not occupied by members of the person who is claiming the territory's faction lose their protection.
This commit is contained in:
Brettflan
2012-01-15 12:41:33 -06:00
parent c19f3405bf
commit de14985d1e
7 changed files with 118 additions and 2 deletions

View File

@ -14,6 +14,7 @@ import org.bukkit.Location;
import org.bukkit.block.Block;
import com.google.gson.reflect.TypeToken;
import com.massivecraft.factions.integration.LWCFeatures;
import com.massivecraft.factions.iface.RelationParticipator;
import com.massivecraft.factions.util.AsciiCompass;
import com.massivecraft.factions.zcore.util.DiscUtil;
@ -67,6 +68,9 @@ public class Board
public static void removeAt(FLocation flocation)
{
if(Conf.onUnclaimResetLwcLocks && LWCFeatures.getEnabled())
LWCFeatures.clearAllChests(flocation);
flocationIds.remove(flocation);
}
@ -78,6 +82,9 @@ public class Board
Entry<FLocation, String> entry = iter.next();
if (entry.getValue().equals(factionId))
{
if(Conf.onUnclaimResetLwcLocks && LWCFeatures.getEnabled())
LWCFeatures.clearAllChests(entry.getKey());
iter.remove();
}
}
@ -117,6 +124,9 @@ public class Board
Entry<FLocation, String> entry = iter.next();
if ( ! Factions.i.exists(entry.getValue()))
{
if(Conf.onUnclaimResetLwcLocks && LWCFeatures.getEnabled())
LWCFeatures.clearAllChests(entry.getKey());
P.p.log("Board cleaner removed "+entry.getValue()+" from "+entry.getKey());
iter.remove();
}