From 63c1b4ef7f336f0db16c39e977c0626247e7cdf7 Mon Sep 17 00:00:00 2001 From: Sollace Date: Sat, 6 Mar 2021 23:11:17 +0200 Subject: [PATCH] Yet more refactoring --- .../unicopia/EquinePredicates.java | 22 +++++++++++++------ .../unicopia/ability/magic/Caster.java | 22 +++++-------------- .../unicopia/ability/magic/Magical.java | 9 -------- .../ability/magic/spell/FireSpell.java | 3 +-- .../ability/magic/spell/SiphoningSpell.java | 3 ++- .../client/ModifierTooltipRenderer.java | 9 ++++---- .../unicopia/entity/Equine.java | 7 ++---- .../entity/FloatingArtefactEntity.java | 3 +-- .../unicopia/entity/PonyContainer.java | 16 +------------- .../entity/effect/RaceChangeStatusEffect.java | 2 +- .../unicopia/mixin/MixinBrain.java | 2 +- .../unicopia/mixin/MixinDamageSource.java | 11 +++------- .../unicopia/mixin/MixinMobEntity.java | 2 +- .../unicopia/mixin/MixinPlayerEntity.java | 6 ++--- .../unicopia/mixin/MixinProjectileEntity.java | 6 ++--- .../unicopia/mixin/MixinTargetPredicate.java | 2 +- .../client/MixinEntityRenderDispatcher.java | 10 +++++---- .../projectile/MagicProjectileEntity.java | 3 +-- 18 files changed, 53 insertions(+), 85 deletions(-) delete mode 100644 src/main/java/com/minelittlepony/unicopia/ability/magic/Magical.java diff --git a/src/main/java/com/minelittlepony/unicopia/EquinePredicates.java b/src/main/java/com/minelittlepony/unicopia/EquinePredicates.java index e5fcc115..7c044357 100644 --- a/src/main/java/com/minelittlepony/unicopia/EquinePredicates.java +++ b/src/main/java/com/minelittlepony/unicopia/EquinePredicates.java @@ -18,19 +18,27 @@ import net.minecraft.entity.player.PlayerEntity; public interface EquinePredicates { Predicate IS_PLAYER = e -> e instanceof PlayerEntity; - Predicate RACE_INTERACT_WITH_CLOUDS = entity -> Equine.of(entity).getSpecies().canInteractWithClouds(); + Predicate RACE_INTERACT_WITH_CLOUDS = raceMatches(Race::canInteractWithClouds); - Predicate PLAYER_EARTH = IS_PLAYER.and(entity -> Equine.of(entity).getSpecies() == Race.EARTH); - Predicate PLAYER_BAT = IS_PLAYER.and(entity -> Equine.of(entity).getSpecies() == Race.BAT); - Predicate PLAYER_UNICORN = IS_PLAYER.and(entity -> Equine.of(entity).getSpecies().canCast()); - Predicate PLAYER_CHANGELING = IS_PLAYER.and(entity -> Equine.of(entity).getSpecies() == Race.CHANGELING); - Predicate PLAYER_PEGASUS = IS_PLAYER.and(entity -> ((PlayerEntity)entity).abilities.creativeMode || RACE_INTERACT_WITH_CLOUDS.test(entity)); + Predicate PLAYER_EARTH = IS_PLAYER.and(ofRace(Race.EARTH)); + Predicate PLAYER_BAT = IS_PLAYER.and(ofRace(Race.BAT)); + Predicate PLAYER_UNICORN = IS_PLAYER.and(raceMatches(Race::canCast)); + Predicate PLAYER_CHANGELING = IS_PLAYER.and(ofRace(Race.CHANGELING)); + Predicate PLAYER_PEGASUS = IS_PLAYER.and(e -> ((PlayerEntity)e).abilities.creativeMode || RACE_INTERACT_WITH_CLOUDS.test(e)); Predicate IS_CASTER = e -> !e.removed && (e instanceof Caster || PLAYER_UNICORN.test(e)); Predicate HAS_WANT_IT_NEED_IT = e -> EnchantmentHelper.getEquipmentLevel(UEnchantments.WANT_IT_NEED_IT, e) > 0; static Predicate carryingSpell(@Nullable SpellType type) { - return IS_PLAYER.and(entity -> Pony.of((PlayerEntity)entity).getSpellSlot().get(type, false).isPresent()); + return IS_PLAYER.and(e -> Pony.of((PlayerEntity)e).getSpellSlot().get(type, false).isPresent()); + } + + static Predicate ofRace(Race race) { + return raceMatches(race::equals); + } + + static Predicate raceMatches(Predicate predicate) { + return e -> Equine.of(e).map(Equine::getSpecies).filter(predicate).isPresent(); } } diff --git a/src/main/java/com/minelittlepony/unicopia/ability/magic/Caster.java b/src/main/java/com/minelittlepony/unicopia/ability/magic/Caster.java index a136fd5b..ffb6b00d 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/magic/Caster.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/magic/Caster.java @@ -16,13 +16,12 @@ import com.minelittlepony.unicopia.util.VecHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.LivingEntity; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; /** * Interface for any magically capable entities that can cast or persist spells. */ -public interface Caster extends Owned, Levelled, Affine, Magical, ParticleSource { +public interface Caster extends Owned, Levelled, Affine, ParticleSource { Physics getPhysics(); @@ -76,15 +75,7 @@ public interface Caster extends Owned, Levelled, Affi } default Stream findAllEntitiesInRange(double radius, @Nullable Predicate test) { - return findAllEntitiesInRange(getOriginVector(), radius, test); - } - - default Stream findAllEntitiesInRange(Vec3d origin, double radius, @Nullable Predicate test) { - return VecHelper.findInRange(getEntity(), getWorld(), origin, radius, test).stream(); - } - - default Stream findAllEntitiesInRange(Vec3d origin, double radius) { - return findAllEntitiesInRange(origin, radius, null); + return VecHelper.findInRange(getEntity(), getWorld(), getOriginVector(), radius, test).stream(); } default Stream findAllEntitiesInRange(double radius) { @@ -106,10 +97,9 @@ public interface Caster extends Owned, Levelled, Affi return Optional.of((Caster)entity); } - if (entity instanceof LivingEntity && !(entity instanceof Magical)) { - return PonyContainer.of(entity).map(PonyContainer::getCaster); - } - - return Optional.empty(); + return PonyContainer.of(entity) + .map(PonyContainer::get) + .filter(c -> c instanceof Caster) + .map(c -> (Caster)c); } } diff --git a/src/main/java/com/minelittlepony/unicopia/ability/magic/Magical.java b/src/main/java/com/minelittlepony/unicopia/ability/magic/Magical.java deleted file mode 100644 index 99d8d24c..00000000 --- a/src/main/java/com/minelittlepony/unicopia/ability/magic/Magical.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.minelittlepony.unicopia.ability.magic; - -/** - * Any entities with magical abilities. - * Casters are automatically considered magic, for obvious reasons. - */ -public interface Magical { - -} diff --git a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/FireSpell.java b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/FireSpell.java index 6473ab69..ff1fc34d 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/FireSpell.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/FireSpell.java @@ -3,7 +3,6 @@ package com.minelittlepony.unicopia.ability.magic.spell; import com.minelittlepony.unicopia.EquinePredicates; import com.minelittlepony.unicopia.ability.magic.Attached; import com.minelittlepony.unicopia.ability.magic.Caster; -import com.minelittlepony.unicopia.ability.magic.Magical; import com.minelittlepony.unicopia.ability.magic.Thrown; import com.minelittlepony.unicopia.block.state.StateMaps; import com.minelittlepony.unicopia.particle.ParticleUtils; @@ -122,7 +121,7 @@ public class FireSpell extends AbstractSpell implements Thrown, Attached { protected boolean applyEntitySingle(Entity owner, World world, Entity e) { if ((!e.equals(owner) || (owner instanceof PlayerEntity && !EquinePredicates.PLAYER_UNICORN.test(owner))) && !(e instanceof ItemEntity) - && !(e instanceof Magical)) { + && !(e instanceof Caster)) { e.setOnFireFor(60); e.damage(getDamageCause(e, (LivingEntity)owner), 0.1f); playEffect(world, e.getBlockPos()); diff --git a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/SiphoningSpell.java b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/SiphoningSpell.java index ac018c3a..80741d66 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/SiphoningSpell.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/SiphoningSpell.java @@ -19,6 +19,7 @@ import net.minecraft.entity.damage.DamageSource; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.nbt.CompoundTag; import net.minecraft.particle.ParticleTypes; +import net.minecraft.predicate.entity.EntityPredicates; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; @@ -70,7 +71,7 @@ public class SiphoningSpell extends AbstractPlacedSpell { } private Stream getTargets(Caster source) { - return VecHelper.findInRange(null, source.getWorld(), source.getOriginVector(), 4 + source.getLevel().get(), e -> e instanceof LivingEntity) + return VecHelper.findInRange(null, source.getWorld(), source.getOriginVector(), 4 + source.getLevel().get(), EntityPredicates.EXCEPT_CREATIVE_SPECTATOR_OR_PEACEFUL.and(e -> e instanceof LivingEntity)) .stream() .map(e -> (LivingEntity)e); } diff --git a/src/main/java/com/minelittlepony/unicopia/client/ModifierTooltipRenderer.java b/src/main/java/com/minelittlepony/unicopia/client/ModifierTooltipRenderer.java index 450172e0..0f6aaf7e 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/ModifierTooltipRenderer.java +++ b/src/main/java/com/minelittlepony/unicopia/client/ModifierTooltipRenderer.java @@ -11,8 +11,8 @@ import javax.annotation.Nullable; import com.google.common.collect.Multimap; import com.minelittlepony.unicopia.entity.Equine; -import com.minelittlepony.unicopia.entity.Living; import com.minelittlepony.unicopia.entity.player.PlayerAttributes; +import com.minelittlepony.unicopia.entity.player.Pony; import com.minelittlepony.unicopia.item.enchantment.AttributedEnchantment; import net.fabricmc.fabric.api.client.item.v1.ItemTooltipCallback; import net.minecraft.client.MinecraftClient; @@ -45,9 +45,10 @@ public class ModifierTooltipRenderer implements ItemTooltipCallback { Map> modifiers = new HashMap<>(); - Living living = Equine.of(MinecraftClient.getInstance().player); - getEnchantments(stack).filter(p -> p.getRight() instanceof AttributedEnchantment).forEach(pair -> { - ((AttributedEnchantment)pair.getRight()).getModifiers(living, pair.getLeft(), modifiers); + Equine.of(MinecraftClient.getInstance().player).ifPresent(eq -> { + getEnchantments(stack).filter(p -> p.getRight() instanceof AttributedEnchantment).forEach(pair -> { + ((AttributedEnchantment)pair.getRight()).getModifiers(eq, pair.getLeft(), modifiers); + }); }); modifiers.forEach((slot, modifs) -> { diff --git a/src/main/java/com/minelittlepony/unicopia/entity/Equine.java b/src/main/java/com/minelittlepony/unicopia/entity/Equine.java index e859714f..95e5a1d9 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/Equine.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/Equine.java @@ -69,10 +69,7 @@ public interface Equine extends NbtSerialisable, Tickable, Pro return Optional.empty(); } - @Nullable - static > T of(Entity entity) { - return PonyContainer.of(entity) - .map(PonyContainer::get) - .orElse(null); + static > Optional of(@Nullable E entity) { + return PonyContainer.of(entity).map(PonyContainer::get); } } diff --git a/src/main/java/com/minelittlepony/unicopia/entity/FloatingArtefactEntity.java b/src/main/java/com/minelittlepony/unicopia/entity/FloatingArtefactEntity.java index f187c6c8..390fb800 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/FloatingArtefactEntity.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/FloatingArtefactEntity.java @@ -1,6 +1,5 @@ package com.minelittlepony.unicopia.entity; -import com.minelittlepony.unicopia.ability.magic.Magical; import com.minelittlepony.unicopia.item.UItems; import com.minelittlepony.unicopia.network.Channel; import com.minelittlepony.unicopia.network.MsgSpawnProjectile; @@ -20,7 +19,7 @@ import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; -public class FloatingArtefactEntity extends Entity implements Magical { +public class FloatingArtefactEntity extends Entity { private static final TrackedData ITEM = DataTracker.registerData(FloatingArtefactEntity.class, TrackedDataHandlerRegistry.ITEM_STACK); private static final TrackedData STATE = DataTracker.registerData(FloatingArtefactEntity.class, TrackedDataHandlerRegistry.BYTE); diff --git a/src/main/java/com/minelittlepony/unicopia/entity/PonyContainer.java b/src/main/java/com/minelittlepony/unicopia/entity/PonyContainer.java index 2c028e78..b0d14671 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/PonyContainer.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/PonyContainer.java @@ -4,10 +4,7 @@ import java.util.Optional; import javax.annotation.Nullable; -import com.minelittlepony.unicopia.ability.magic.Caster; - import net.minecraft.entity.Entity; -import net.minecraft.entity.LivingEntity; public interface PonyContainer> { @@ -16,18 +13,7 @@ public interface PonyContainer> { T get(); @SuppressWarnings("unchecked") - @Nullable - default Caster getCaster() { - T ientity = get(); - - if (ientity instanceof Caster) { - return (Caster)ientity; - } - return null; - } - - @SuppressWarnings("unchecked") - static > Optional> of(Entity entity) { + static > Optional> of(@Nullable Entity entity) { if (entity instanceof PonyContainer) { return Optional.of(((PonyContainer)entity)); } diff --git a/src/main/java/com/minelittlepony/unicopia/entity/effect/RaceChangeStatusEffect.java b/src/main/java/com/minelittlepony/unicopia/entity/effect/RaceChangeStatusEffect.java index eae1618b..e38d3587 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/effect/RaceChangeStatusEffect.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/effect/RaceChangeStatusEffect.java @@ -53,7 +53,7 @@ public class RaceChangeStatusEffect extends StatusEffect { return; } - Equine eq = Equine.of(entity); + Equine eq = Equine.of(entity).orElse(null); if (eq == null) { return; diff --git a/src/main/java/com/minelittlepony/unicopia/mixin/MixinBrain.java b/src/main/java/com/minelittlepony/unicopia/mixin/MixinBrain.java index a8a92c94..0006e7b3 100644 --- a/src/main/java/com/minelittlepony/unicopia/mixin/MixinBrain.java +++ b/src/main/java/com/minelittlepony/unicopia/mixin/MixinBrain.java @@ -17,7 +17,7 @@ abstract class MixinBrain { @Inject(method = "tick", at = @At("HEAD")) public void beforeTickAi(ServerWorld world, E entity, CallbackInfo into) { - Equine eq = Equine.of(entity); + Equine eq = Equine.of(entity).orElse(null); if (eq instanceof Living && eq.getPhysics().isGravityNegative()) { ((RotatedView)world).pushRotation((int)entity.getY()); diff --git a/src/main/java/com/minelittlepony/unicopia/mixin/MixinDamageSource.java b/src/main/java/com/minelittlepony/unicopia/mixin/MixinDamageSource.java index f6bd3c41..baf6b929 100644 --- a/src/main/java/com/minelittlepony/unicopia/mixin/MixinDamageSource.java +++ b/src/main/java/com/minelittlepony/unicopia/mixin/MixinDamageSource.java @@ -1,7 +1,5 @@ package com.minelittlepony.unicopia.mixin; -import javax.annotation.Nullable; - import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; @@ -19,12 +17,9 @@ import net.minecraft.text.TranslatableText; abstract class MixinDamageSource { @Inject(method = "getDeathMessage", at = @At("RETURN"), cancellable = true) private void onGetDeathMessage(LivingEntity entity, CallbackInfoReturnable info) { - Equine eq = Equine.of(entity); - @Nullable - Entity attacker = eq == null ? null : eq.getAttacker(); - DamageSource self = (DamageSource)(Object)this; + Equine.of(entity).map(Equine::getAttacker).ifPresent(attacker -> { + DamageSource self = (DamageSource)(Object)this; - if (attacker != null) { Entity prime = entity.getPrimeAdversary(); if (prime != null && !(attacker instanceof Owned && ((Owned)attacker).getMaster() == prime)) { info.setReturnValue(new TranslatableText("death.attack.generic.and_also", info.getReturnValue(), attacker.getDisplayName())); @@ -32,6 +27,6 @@ abstract class MixinDamageSource { } info.setReturnValue(new TranslatableText("death.attack." + self.getName() + ".player", entity.getDisplayName(), attacker.getDisplayName())); - } + }); } } diff --git a/src/main/java/com/minelittlepony/unicopia/mixin/MixinMobEntity.java b/src/main/java/com/minelittlepony/unicopia/mixin/MixinMobEntity.java index 6f2c947d..a64c11e6 100644 --- a/src/main/java/com/minelittlepony/unicopia/mixin/MixinMobEntity.java +++ b/src/main/java/com/minelittlepony/unicopia/mixin/MixinMobEntity.java @@ -34,7 +34,7 @@ abstract class MixinMobEntity extends LivingEntity implements PonyContainer eq = Equine.of(this); + Equine eq = Equine.of(this).orElse(null); if (eq instanceof Living && eq.getPhysics().isGravityNegative()) { ((RotatedView)world).pushRotation((int)getY()); diff --git a/src/main/java/com/minelittlepony/unicopia/mixin/MixinPlayerEntity.java b/src/main/java/com/minelittlepony/unicopia/mixin/MixinPlayerEntity.java index ed7c3cc3..692d13d0 100644 --- a/src/main/java/com/minelittlepony/unicopia/mixin/MixinPlayerEntity.java +++ b/src/main/java/com/minelittlepony/unicopia/mixin/MixinPlayerEntity.java @@ -76,9 +76,9 @@ abstract class MixinPlayerEntity extends LivingEntity implements PonyContainer

info) { - PonyContainer.of(info.getReturnValue()).ifPresent(container -> { - container.get().setSpecies(get().getSpecies()); - container.get().getPhysics().setBaseGravityModifier(get().getPhysics().getGravityModifier()); + Equine.of(info.getReturnValue()).ifPresent(eq -> { + eq.setSpecies(get().getSpecies()); + eq.getPhysics().setBaseGravityModifier(get().getPhysics().getGravityModifier()); }); } diff --git a/src/main/java/com/minelittlepony/unicopia/mixin/MixinProjectileEntity.java b/src/main/java/com/minelittlepony/unicopia/mixin/MixinProjectileEntity.java index a5241355..96e84feb 100644 --- a/src/main/java/com/minelittlepony/unicopia/mixin/MixinProjectileEntity.java +++ b/src/main/java/com/minelittlepony/unicopia/mixin/MixinProjectileEntity.java @@ -5,7 +5,7 @@ import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import com.minelittlepony.unicopia.entity.PonyContainer; +import com.minelittlepony.unicopia.entity.Equine; import net.minecraft.entity.Entity; import net.minecraft.entity.projectile.ProjectileEntity; @@ -19,8 +19,8 @@ abstract class MixinProjectileEntity extends Entity { at = @At("HEAD"), cancellable = true) private void onOnEntityHit(EntityHitResult hit, CallbackInfo info) { - PonyContainer.of(hit.getEntity()).ifPresent(container -> { - if (container.get().onProjectileImpact((ProjectileEntity)(Object)this)) { + Equine.of(hit.getEntity()).ifPresent(eq -> { + if (eq.onProjectileImpact((ProjectileEntity)(Object)this)) { info.cancel(); } }); diff --git a/src/main/java/com/minelittlepony/unicopia/mixin/MixinTargetPredicate.java b/src/main/java/com/minelittlepony/unicopia/mixin/MixinTargetPredicate.java index 7811df2e..b53fe8c1 100644 --- a/src/main/java/com/minelittlepony/unicopia/mixin/MixinTargetPredicate.java +++ b/src/main/java/com/minelittlepony/unicopia/mixin/MixinTargetPredicate.java @@ -18,7 +18,7 @@ import net.minecraft.entity.ai.TargetPredicate; abstract class MixinTargetPredicate { @Inject(method = "test", at = @At("HEAD"), cancellable = true) public void onTest(@Nullable LivingEntity baseEntity, LivingEntity targetEntity, CallbackInfoReturnable info) { - Equine eq = Equine.of(targetEntity); + Equine eq = Equine.of(targetEntity).orElse(null); if (eq instanceof Pony) { ((Pony)eq).getSpellSlot().get(SpellType.DISGUISE, true).ifPresent(spell -> { if (spell.getDisguise().getAppearance() == baseEntity) { diff --git a/src/main/java/com/minelittlepony/unicopia/mixin/client/MixinEntityRenderDispatcher.java b/src/main/java/com/minelittlepony/unicopia/mixin/client/MixinEntityRenderDispatcher.java index eabc69e2..fa620ce8 100644 --- a/src/main/java/com/minelittlepony/unicopia/mixin/client/MixinEntityRenderDispatcher.java +++ b/src/main/java/com/minelittlepony/unicopia/mixin/client/MixinEntityRenderDispatcher.java @@ -20,13 +20,15 @@ abstract class MixinEntityRenderDispatcher { @Inject(method = RENDER, at = @At("HEAD"), cancellable = true) private void beforeRender(E entity, double x, double y, double z, float yaw, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, CallbackInfo info) { - if (WorldRenderDelegate.INSTANCE.onEntityRender((EntityRenderDispatcher)(Object)this, Equine.of(entity), x, y, z, yaw, tickDelta, matrices, vertexConsumers, light)) { - info.cancel(); - } + Equine.of(entity).ifPresent(eq -> { + if (WorldRenderDelegate.INSTANCE.onEntityRender((EntityRenderDispatcher)(Object)this, eq, x, y, z, yaw, tickDelta, matrices, vertexConsumers, light)) { + info.cancel(); + } + }); } @Inject(method = RENDER, at = @At("RETURN")) private void afterRender(E entity, double x, double y, double z, float yaw, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, CallbackInfo info) { - WorldRenderDelegate.INSTANCE.afterEntityRender(Equine.of(entity), matrices); + Equine.of(entity).ifPresent(eq -> WorldRenderDelegate.INSTANCE.afterEntityRender(eq, matrices)); } } diff --git a/src/main/java/com/minelittlepony/unicopia/projectile/MagicProjectileEntity.java b/src/main/java/com/minelittlepony/unicopia/projectile/MagicProjectileEntity.java index 9b46ddd1..7713d997 100644 --- a/src/main/java/com/minelittlepony/unicopia/projectile/MagicProjectileEntity.java +++ b/src/main/java/com/minelittlepony/unicopia/projectile/MagicProjectileEntity.java @@ -5,7 +5,6 @@ import com.minelittlepony.unicopia.UEntities; import com.minelittlepony.unicopia.ability.magic.Affine; import com.minelittlepony.unicopia.ability.magic.Caster; import com.minelittlepony.unicopia.ability.magic.Levelled; -import com.minelittlepony.unicopia.ability.magic.Magical; import com.minelittlepony.unicopia.ability.magic.Spell; import com.minelittlepony.unicopia.ability.magic.SpellContainer; import com.minelittlepony.unicopia.ability.magic.spell.SpellPredicate; @@ -46,7 +45,7 @@ import net.minecraft.world.World; * * Can also carry a spell if needed. */ -public class MagicProjectileEntity extends ThrownItemEntity implements Magical, Caster { +public class MagicProjectileEntity extends ThrownItemEntity implements Caster { private static final TrackedData DAMAGE = DataTracker.registerData(MagicProjectileEntity.class, TrackedDataHandlerRegistry.FLOAT); private static final TrackedData GRAVITY = DataTracker.registerData(MagicProjectileEntity.class, TrackedDataHandlerRegistry.FLOAT);