Add HCF raidable functionality.
This will allow players to break blocks in factions that are raidable (power < claims) as well as open chests. It can also disable over claiming.
This commit is contained in:
parent
147a051fee
commit
f92d59e5c6
@ -213,6 +213,9 @@ public class FactionsBlockListener implements Listener {
|
||||
|
||||
return false;
|
||||
}
|
||||
if (P.p.getConfig().getBoolean("hcf.raidable", false) && otherFaction.getLandRounded() >= otherFaction.getPowerRounded()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Faction myFaction = me.getFaction();
|
||||
Relation rel = myFaction.getRelationTo(otherFaction);
|
||||
|
@ -244,7 +244,6 @@ public class FactionsPlayerListener implements Listener {
|
||||
|
||||
if (!playerCanUseItemHere(player, block.getLocation(), event.getMaterial(), false)) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@ -284,6 +283,10 @@ public class FactionsPlayerListener implements Listener {
|
||||
FLocation loc = new FLocation(location);
|
||||
Faction otherFaction = Board.getInstance().getFactionAt(loc);
|
||||
|
||||
if (P.p.getConfig().getBoolean("hcf.raidable", false) && otherFaction.getLandRounded() >= otherFaction.getPowerRounded()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (otherFaction.hasPlayersOnline()) {
|
||||
if (!Conf.territoryDenyUseageMaterials.contains(material)) {
|
||||
return true; // Item isn't one we're preventing for online factions.
|
||||
@ -369,6 +372,10 @@ public class FactionsPlayerListener implements Listener {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (P.p.getConfig().getBoolean("hcf.raidable", false) && otherFaction.getLandRounded() >= otherFaction.getPowerRounded()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Dupe fix.
|
||||
Faction myFaction = me.getFaction();
|
||||
Relation rel = myFaction.getRelationTo(otherFaction);
|
||||
|
@ -677,7 +677,7 @@ public abstract class MemoryFPlayer implements FPlayer {
|
||||
error = P.p.txt.parse(TL.CLAIM_SAFEZONE.toString());
|
||||
} else if (currentFaction.isWarZone()) {
|
||||
error = P.p.txt.parse(TL.CLAIM_WARZONE.toString());
|
||||
} else if (ownedLand >= forFaction.getPowerRounded()) {
|
||||
} else if (P.p.getConfig().getBoolean("hcf.overclaim", true) && ownedLand >= forFaction.getPowerRounded()) {
|
||||
error = P.p.txt.parse(TL.CLAIM_POWER.toString());
|
||||
} else if (Conf.claimedLandsMax != 0 && ownedLand >= Conf.claimedLandsMax && forFaction.isNormal()) {
|
||||
error = P.p.txt.parse(TL.CLAIM_LIMIT.toString());
|
||||
|
@ -150,7 +150,9 @@ warmups:
|
||||
# Delay for /f warp
|
||||
f-warp: 0
|
||||
|
||||
# HCF Features
|
||||
######################################################
|
||||
#################### HCF Features ####################
|
||||
######################################################
|
||||
# These features were requested as part of Hardcore Factions or something.
|
||||
# All of them are disabled by default.
|
||||
|
||||
@ -166,3 +168,15 @@ max-relations:
|
||||
truce: 10
|
||||
neutral: -1
|
||||
enemy: 10
|
||||
|
||||
# Raids
|
||||
# Allow a faction to be raided if they have more land than power.
|
||||
# This will make claimed territory lose all protections
|
||||
# allowing factions to open chests, break blocks, etc. if they
|
||||
# have claimed chunks >= power.
|
||||
hcf:
|
||||
raidable: false
|
||||
|
||||
# Should we allow Factions to over claim if they are raidable (above has no effect on this)?
|
||||
# This has always been true, allowing factions to over claim others.
|
||||
overclaim: true
|
Loading…
Reference in New Issue
Block a user