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);
|
||||
|
@ -51,7 +51,7 @@ public class FactionsPlayerListener implements Listener {
|
||||
private void initPlayer(Player player) {
|
||||
// Make sure that all online players do have a fplayer.
|
||||
final FPlayer me = FPlayers.getInstance().getByPlayer(player);
|
||||
((MemoryFPlayer)me).setName(player.getName());
|
||||
((MemoryFPlayer) me).setName(player.getName());
|
||||
|
||||
// Update the lastLoginTime for this fplayer
|
||||
me.setLastLoginTime(System.currentTimeMillis());
|
||||
@ -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);
|
||||
@ -510,7 +517,7 @@ public class FactionsPlayerListener implements Listener {
|
||||
return true;
|
||||
}
|
||||
|
||||
if(Board.getInstance().getFactionAt(new FLocation(me)).isWarZone() && !Conf.warzoneDenyCommands.isEmpty() && !me.isAdminBypassing() && isCommandInList(fullCmd, shortCmd, Conf.warzoneDenyCommands.iterator())) {
|
||||
if (Board.getInstance().getFactionAt(new FLocation(me)).isWarZone() && !Conf.warzoneDenyCommands.isEmpty() && !me.isAdminBypassing() && isCommandInList(fullCmd, shortCmd, Conf.warzoneDenyCommands.iterator())) {
|
||||
me.msg(TL.PLAYER_COMMAND_WARZONE, fullCmd);
|
||||
return true;
|
||||
}
|
||||
|
@ -623,7 +623,7 @@ public abstract class MemoryFPlayer implements FPlayer {
|
||||
}
|
||||
|
||||
if (Conf.logFactionLeave) {
|
||||
P.p.log(TL.LEAVE_LEFT.format(this.getName(),myFaction.getTag()));
|
||||
P.p.log(TL.LEAVE_LEFT.format(this.getName(), myFaction.getTag()));
|
||||
}
|
||||
}
|
||||
|
||||
@ -638,7 +638,7 @@ public abstract class MemoryFPlayer implements FPlayer {
|
||||
|
||||
Factions.getInstance().removeFaction(myFaction.getId());
|
||||
if (Conf.logFactionDisband) {
|
||||
P.p.log(TL.LEAVE_DISBANDEDLOG.format(myFaction.getTag(),myFaction.getId(),this.getName()));
|
||||
P.p.log(TL.LEAVE_DISBANDEDLOG.format(myFaction.getTag(), myFaction.getId(), this.getName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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());
|
||||
@ -766,7 +766,7 @@ public abstract class MemoryFPlayer implements FPlayer {
|
||||
Board.getInstance().setFactionAt(forFaction, flocation);
|
||||
|
||||
if (Conf.logLandClaims) {
|
||||
P.p.log(TL.CLAIM_CLAIMEDLOG.toString(),this.getName(),flocation.getCoordString(),forFaction.getTag());
|
||||
P.p.log(TL.CLAIM_CLAIMEDLOG.toString(), this.getName(), flocation.getCoordString(), forFaction.getTag());
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -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