Make the Friendship Bracelet work for the Pegasus Rainboom Ability

This commit is contained in:
JCM 2023-06-30 21:48:53 +02:00 committed by Sollace
parent 53984c3346
commit e03fa2f564
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB
2 changed files with 6 additions and 2 deletions

View file

@ -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 -> {

View file

@ -39,7 +39,8 @@ public class FriendshipBraceletItem extends WearableItem implements DyeableItem,
public TypedActionResult<ItemStack> 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();