mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-08 14:36:44 +01:00
Fix some issues with spells
This commit is contained in:
parent
859458baa6
commit
b9fa4b072d
2 changed files with 5 additions and 11 deletions
|
@ -59,7 +59,7 @@ public class AttractiveSpell extends ShieldSpell implements Thrown {
|
||||||
protected void applyRadialEffect(Caster<?> source, Entity target, double distance, double radius) {
|
protected void applyRadialEffect(Caster<?> source, Entity target, double distance, double radius) {
|
||||||
Vec3d pos = homingPos == null ? source.getOriginVector() : Vec3d.of(homingPos);
|
Vec3d pos = homingPos == null ? source.getOriginVector() : Vec3d.of(homingPos);
|
||||||
|
|
||||||
double force = 2.5F / distance;
|
double force = 2.5F * distance;
|
||||||
|
|
||||||
if (source.getAffinity() != Affinity.BAD && target instanceof PlayerEntity) {
|
if (source.getAffinity() != Affinity.BAD && target instanceof PlayerEntity) {
|
||||||
force *= calculateAdjustedForce(Pony.of((PlayerEntity)target));
|
force *= calculateAdjustedForce(Pony.of((PlayerEntity)target));
|
||||||
|
|
|
@ -6,8 +6,6 @@ import java.util.List;
|
||||||
import com.minelittlepony.unicopia.ability.magic.Caster;
|
import com.minelittlepony.unicopia.ability.magic.Caster;
|
||||||
import com.minelittlepony.unicopia.ability.magic.Thrown;
|
import com.minelittlepony.unicopia.ability.magic.Thrown;
|
||||||
import com.minelittlepony.unicopia.util.shape.Sphere;
|
import com.minelittlepony.unicopia.util.shape.Sphere;
|
||||||
import com.mojang.brigadier.StringReader;
|
|
||||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
|
||||||
|
|
||||||
import net.minecraft.particle.ParticleEffect;
|
import net.minecraft.particle.ParticleEffect;
|
||||||
import net.minecraft.particle.ParticleType;
|
import net.minecraft.particle.ParticleType;
|
||||||
|
@ -36,15 +34,11 @@ public class AwkwardSpell extends AbstractSpell implements Thrown {
|
||||||
|
|
||||||
int index = (int)MathHelper.nextDouble(source.getWorld().random, 0, names.size());
|
int index = (int)MathHelper.nextDouble(source.getWorld().random, 0, names.size());
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
Identifier id = names.get(index);
|
||||||
ParticleType<ParticleEffect> type = (ParticleType<ParticleEffect>)Registry.PARTICLE_TYPE.get(names.get(index));
|
ParticleType<?> type = Registry.PARTICLE_TYPE.get(id);
|
||||||
|
|
||||||
if (shouldSpawnParticle(type)) {
|
if (type instanceof ParticleEffect && shouldSpawnParticle(type)) {
|
||||||
try {
|
source.addParticle((ParticleEffect)type, pos, Vec3d.ZERO);
|
||||||
source.addParticle(type.getParametersFactory().read(type, new StringReader("0 0 0")), pos, Vec3d.ZERO);
|
|
||||||
} catch (CommandSyntaxException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue