From e03fa2f5644c33c4396920d7ffcba57feb19c934 Mon Sep 17 00:00:00 2001 From: JCM Date: Fri, 30 Jun 2023 21:48:53 +0200 Subject: [PATCH] Make the Friendship Bracelet work for the Pegasus Rainboom Ability --- .../unicopia/ability/magic/spell/RainboomAbilitySpell.java | 5 ++++- .../minelittlepony/unicopia/item/FriendshipBraceletItem.java | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/RainboomAbilitySpell.java b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/RainboomAbilitySpell.java index 05ce028a..1c76b216 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/RainboomAbilitySpell.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/RainboomAbilitySpell.java @@ -9,6 +9,7 @@ import com.minelittlepony.unicopia.ability.magic.Caster; import com.minelittlepony.unicopia.ability.magic.spell.effect.*; import com.minelittlepony.unicopia.entity.damage.UDamageTypes; import com.minelittlepony.unicopia.entity.player.Pony; +import com.minelittlepony.unicopia.item.FriendshipBraceletItem; import com.minelittlepony.unicopia.particle.OrientedBillboardParticleEffect; import com.minelittlepony.unicopia.particle.ParticleSpawner; import com.minelittlepony.unicopia.particle.TargetBoundParticleEffect; @@ -59,7 +60,9 @@ public class RainboomAbilitySpell extends AbstractSpell { } } - source.findAllEntitiesInRange(RADIUS).forEach(e -> { + source.findAllEntitiesInRange(RADIUS) + .filter(e -> !FriendshipBraceletItem.isComrade(source, e)) + .forEach(e -> { e.damage(source.damageOf(UDamageTypes.RAINBOOM, source), 6); }); EFFECT_RANGE.translate(source.getOrigin()).getBlockPositions().forEach(pos -> { diff --git a/src/main/java/com/minelittlepony/unicopia/item/FriendshipBraceletItem.java b/src/main/java/com/minelittlepony/unicopia/item/FriendshipBraceletItem.java index f48e9867..8a9c2416 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/FriendshipBraceletItem.java +++ b/src/main/java/com/minelittlepony/unicopia/item/FriendshipBraceletItem.java @@ -39,7 +39,8 @@ public class FriendshipBraceletItem extends WearableItem implements DyeableItem, public TypedActionResult use(World world, PlayerEntity player, Hand hand) { ItemStack stack = player.getStackInHand(hand); - if (!isSigned(stack) && (EquinePredicates.PLAYER_UNICORN.test(player) || AmuletSelectors.PEARL_NECKLACE.test(player))) { + if (!isSigned(stack) && (EquinePredicates.PLAYER_UNICORN.test(player) || EquinePredicates.PLAYER_PEGASUS.test(player) + || AmuletSelectors.PEARL_NECKLACE.test(player))) { player.setCurrentHand(hand); ItemStack result = stack.copy();