Unicopia/src/main/java/com/minelittlepony/unicopia/projectile/Projectile.java

39 lines
1,013 B
Java
Raw Normal View History

package com.minelittlepony.unicopia.projectile;
2020-01-16 12:35:46 +01:00
import com.minelittlepony.unicopia.ability.magic.ThrowableSpell;
2020-01-16 12:35:46 +01:00
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
2020-06-26 11:44:47 +02:00
import net.minecraft.entity.projectile.ProjectileEntity;
2020-01-16 12:35:46 +01:00
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
2020-06-26 11:44:47 +02:00
public interface Projectile {
2020-01-16 12:35:46 +01:00
void setGravity(boolean gravity);
void setItem(ItemStack stack);
void setOwner(LivingEntity owner);
2020-05-28 18:27:30 +02:00
void setEffect(ThrowableSpell effect);
2020-01-16 12:35:46 +01:00
void setThrowDamage(float damage);
float getThrowDamage();
void setHydrophobic();
boolean getHydrophobic();
void launch(Entity entityThrower, float pitch, float yaw, float offset, float velocity, float inaccuracy);
default void spawn(World world) {
world.spawnEntity((Entity)this);
}
default void launch(double x, double y, double z, float velocity, float inaccuracy) {
2020-06-26 11:44:47 +02:00
((ProjectileEntity)this).setVelocity(x, y, z, velocity, inaccuracy);
2020-01-16 12:35:46 +01:00
}
}