mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-12-26 02:28:03 +01:00
Fix splash potions not properly affecting the player that threw them.
This commit is contained in:
parent
083a89c1a3
commit
d9aad67ca5
@ -108,15 +108,23 @@ public class EntityListener implements Listener {
|
|||||||
if (defender instanceof Player) {
|
if (defender instanceof Player) {
|
||||||
Player defendingPlayer = (Player) defender;
|
Player defendingPlayer = (Player) defender;
|
||||||
|
|
||||||
|
// TODO: Is this even possible?
|
||||||
if (!defendingPlayer.isOnline()) {
|
if (!defendingPlayer.isOnline()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (attacker instanceof Player && PartyManager.inSameParty(defendingPlayer, (Player) attacker)) {
|
if (attacker instanceof Player) {
|
||||||
if (!(Permissions.friendlyFire((Player) attacker) && Permissions.friendlyFire(defendingPlayer))) {
|
Player attackingPlayer = (Player) attacker;
|
||||||
event.setCancelled(true);
|
|
||||||
|
if (defendingPlayer == attackingPlayer) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
else if (PartyManager.inSameParty(defendingPlayer, attackingPlayer)) {
|
||||||
|
if (!(Permissions.friendlyFire(attackingPlayer) && Permissions.friendlyFire(defendingPlayer))) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -223,9 +223,7 @@ public final class CombatTools {
|
|||||||
tamingManager.gore(event);
|
tamingManager.gore(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target != master) {
|
startGainXp(mcMMOPlayer, target, SkillType.TAMING);
|
||||||
startGainXp(mcMMOPlayer, target, SkillType.TAMING);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -322,10 +320,8 @@ public final class CombatTools {
|
|||||||
archeryManager.trackArrows(target);
|
archeryManager.trackArrows(target);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target != shooter) {
|
archeryManager.distanceXpBonus(target);
|
||||||
archeryManager.distanceXpBonus(target);
|
startGainXp(mcMMOPlayer, target, SkillType.ARCHERY);
|
||||||
startGainXp(mcMMOPlayer, target, SkillType.ARCHERY);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -402,7 +398,7 @@ public final class CombatTools {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (Entity entity : target.getNearbyEntities(2.5, 2.5, 2.5)) {
|
for (Entity entity : target.getNearbyEntities(2.5, 2.5, 2.5)) {
|
||||||
if ((entity instanceof Player && Misc.isNPCPlayer((Player) entity)) || !(entity instanceof LivingEntity) || !shouldBeAffected(attacker, entity)) {
|
if (Misc.isNPCEntity(entity) || !(entity instanceof LivingEntity) || !shouldBeAffected(attacker, entity)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user