(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:
@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user