Use the already casted attacker when possible. Add a line break.
This commit is contained in:
parent
2d9daa517e
commit
06df4dc499
@ -49,4 +49,4 @@ public class FactionsEventPvpDisallowed extends FactionsEventAbstract
|
|||||||
this.event = event;
|
this.event = event;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -344,7 +344,7 @@ public class FactionsListenerMain implements Listener
|
|||||||
// NOTE: This check is probably not that important but we could keep it anyways.
|
// NOTE: This check is probably not that important but we could keep it anyways.
|
||||||
if (attackerPsFaction.getFlag(FFlag.PVP) == false)
|
if (attackerPsFaction.getFlag(FFlag.PVP) == false)
|
||||||
{
|
{
|
||||||
ret = falseUnlessDisallowedPvpEventCancelled((Player)eattacker, defender, event);
|
ret = falseUnlessDisallowedPvpEventCancelled(attacker, defender, event);
|
||||||
if (!ret && notify) uattacker.msg("<i>PVP is disabled in %s.", attackerPsFaction.describeTo(uattacker));
|
if (!ret && notify) uattacker.msg("<i>PVP is disabled in %s.", attackerPsFaction.describeTo(uattacker));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -358,7 +358,7 @@ public class FactionsListenerMain implements Listener
|
|||||||
|
|
||||||
if (attackFaction.isNone() && uconf.disablePVPForFactionlessPlayers)
|
if (attackFaction.isNone() && uconf.disablePVPForFactionlessPlayers)
|
||||||
{
|
{
|
||||||
ret = falseUnlessDisallowedPvpEventCancelled((Player)eattacker, defender, event);
|
ret = falseUnlessDisallowedPvpEventCancelled(attacker, defender, event);
|
||||||
if (!ret && notify) uattacker.msg("<i>You can't hurt other players until you join a faction.");
|
if (!ret && notify) uattacker.msg("<i>You can't hurt other players until you join a faction.");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -371,7 +371,7 @@ public class FactionsListenerMain implements Listener
|
|||||||
}
|
}
|
||||||
else if (uconf.disablePVPForFactionlessPlayers)
|
else if (uconf.disablePVPForFactionlessPlayers)
|
||||||
{
|
{
|
||||||
ret = falseUnlessDisallowedPvpEventCancelled((Player)eattacker, defender, event);
|
ret = falseUnlessDisallowedPvpEventCancelled(attacker, defender, event);
|
||||||
if (!ret && notify) uattacker.msg("<i>You can't hurt players who are not currently in a faction.");
|
if (!ret && notify) uattacker.msg("<i>You can't hurt players who are not currently in a faction.");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -382,7 +382,7 @@ public class FactionsListenerMain implements Listener
|
|||||||
// Check the relation
|
// Check the relation
|
||||||
if (udefender.hasFaction() && relation.isFriend() && defenderPsFaction.getFlag(FFlag.FRIENDLYFIRE) == false)
|
if (udefender.hasFaction() && relation.isFriend() && defenderPsFaction.getFlag(FFlag.FRIENDLYFIRE) == false)
|
||||||
{
|
{
|
||||||
ret = falseUnlessDisallowedPvpEventCancelled((Player)eattacker, defender, event);
|
ret = falseUnlessDisallowedPvpEventCancelled(attacker, defender, event);
|
||||||
if (!ret && notify) uattacker.msg("<i>You can't hurt %s<i>.", relation.getDescPlayerMany());
|
if (!ret && notify) uattacker.msg("<i>You can't hurt %s<i>.", relation.getDescPlayerMany());
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -392,7 +392,7 @@ public class FactionsListenerMain implements Listener
|
|||||||
|
|
||||||
if (udefender.hasFaction() && ownTerritory && relation == Rel.NEUTRAL)
|
if (udefender.hasFaction() && ownTerritory && relation == Rel.NEUTRAL)
|
||||||
{
|
{
|
||||||
ret = falseUnlessDisallowedPvpEventCancelled((Player)eattacker, defender, event);
|
ret = falseUnlessDisallowedPvpEventCancelled(attacker, defender, event);
|
||||||
if (!ret && notify)
|
if (!ret && notify)
|
||||||
{
|
{
|
||||||
uattacker.msg("<i>You can't hurt %s<i> in their own territory unless you declare them as an enemy.", udefender.describeTo(uattacker));
|
uattacker.msg("<i>You can't hurt %s<i> in their own territory unless you declare them as an enemy.", udefender.describeTo(uattacker));
|
||||||
|
Loading…
Reference in New Issue
Block a user