Fix for "territoryEnemyProtectMaterials" and "territoryAllyProtectMaterials" not working correctly, and wrong protection message being sent to neutral players. Re-jiggered the related code a bit which handles such things based on enemy/ally/member/neutral status.
This commit is contained in:
parent
8e074fb5ac
commit
60abb61cb9
@ -206,8 +206,7 @@ public class FactionsBlockListener extends BlockListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Also cancel and/or cause pain if player doesn't have ownership rights for this claim
|
// Also cancel and/or cause pain if player doesn't have ownership rights for this claim
|
||||||
if (ownershipFail && !Factions.hasPermOwnershipBypass(player)
|
else if (rel.isMember() && ownershipFail && !Factions.hasPermOwnershipBypass(player)) {
|
||||||
) {
|
|
||||||
if (Conf.ownedAreaPainBuild){
|
if (Conf.ownedAreaPainBuild){
|
||||||
player.damage(Conf.actionDeniedPainAmount);
|
player.damage(Conf.actionDeniedPainAmount);
|
||||||
if (!Conf.ownedAreaDenyBuild) {
|
if (!Conf.ownedAreaDenyBuild) {
|
||||||
|
@ -384,7 +384,7 @@ public class FactionsEntityListener extends EntityListener {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Also cancel if player doesn't have ownership rights for this claim
|
// Also cancel if player doesn't have ownership rights for this claim
|
||||||
else if (ownershipFail && (!rel.isMember() || !Factions.hasPermOwnershipBypass(player))) {
|
else if (rel.isMember() && ownershipFail && !Factions.hasPermOwnershipBypass(player)) {
|
||||||
me.sendMessage("You can't "+action+" paintings in this territory, it is owned by: "+otherFaction.getOwnerListString(loc));
|
me.sendMessage("You can't "+action+" paintings in this territory, it is owned by: "+otherFaction.getOwnerListString(loc));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -332,7 +332,7 @@ public class FactionsPlayerListener extends PlayerListener{
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Also cancel if player doesn't have ownership rights for this claim
|
// Also cancel if player doesn't have ownership rights for this claim
|
||||||
else if (ownershipFail && (!rel.isMember() || !Factions.hasPermOwnershipBypass(player))) {
|
else if (rel.isMember() && ownershipFail && !Factions.hasPermOwnershipBypass(player)) {
|
||||||
me.sendMessage("You can't use "+TextUtil.getMaterialName(material)+" in this territory, it is owned by: "+myFaction.getOwnerListString(loc));
|
me.sendMessage("You can't use "+TextUtil.getMaterialName(material)+" in this territory, it is owned by: "+myFaction.getOwnerListString(loc));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -372,12 +372,12 @@ public class FactionsPlayerListener extends PlayerListener{
|
|||||||
boolean ownershipFail = Conf.ownedAreasEnabled && Conf.ownedAreaProtectMaterials && !otherFaction.playerHasOwnershipRights(me, loc);
|
boolean ownershipFail = Conf.ownedAreasEnabled && Conf.ownedAreaProtectMaterials && !otherFaction.playerHasOwnershipRights(me, loc);
|
||||||
|
|
||||||
// You may use any block unless it is another faction's territory...
|
// You may use any block unless it is another faction's territory...
|
||||||
if ((rel.isEnemy() && Conf.territoryEnemyProtectMaterials) || (rel.isAlly() && Conf.territoryAllyProtectMaterials)) {
|
if (rel.isNeutral() || (rel.isEnemy() && Conf.territoryEnemyProtectMaterials) || (rel.isAlly() && Conf.territoryAllyProtectMaterials)) {
|
||||||
me.sendMessage("You can't use "+TextUtil.getMaterialName(material)+" in the territory of "+otherFaction.getTag(myFaction));
|
me.sendMessage("You can't use "+TextUtil.getMaterialName(material)+" in the territory of "+otherFaction.getTag(myFaction));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Also cancel if player doesn't have ownership rights for this claim
|
// Also cancel if player doesn't have ownership rights for this claim
|
||||||
else if (ownershipFail && (!rel.isMember() || !Factions.hasPermOwnershipBypass(player))) {
|
else if (rel.isMember() && ownershipFail && !Factions.hasPermOwnershipBypass(player)) {
|
||||||
me.sendMessage("You can't use "+TextUtil.getMaterialName(material)+" in this territory, it is owned by: "+myFaction.getOwnerListString(loc));
|
me.sendMessage("You can't use "+TextUtil.getMaterialName(material)+" in this territory, it is owned by: "+myFaction.getOwnerListString(loc));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user