Unicopia/src/main/java/com/minelittlepony/unicopia/spell/ICaster.java

34 lines
795 B
Java
Raw Normal View History

2018-09-12 01:29:49 +02:00
package com.minelittlepony.unicopia.spell;
import com.minelittlepony.unicopia.player.IOwned;
2018-09-12 01:29:49 +02:00
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
2018-09-24 21:37:16 +02:00
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
2018-09-12 01:29:49 +02:00
public interface ICaster<E extends EntityLivingBase> extends IOwned<E>, ILevelled {
2018-09-12 01:29:49 +02:00
void setEffect(IMagicEffect effect);
IMagicEffect getEffect();
default boolean hasEffect() {
return getEffect() != null;
}
/**
* Gets the entity directly responsible for casting.
*/
2018-09-12 01:29:49 +02:00
default Entity getEntity() {
return getOwner();
}
2018-09-24 21:37:16 +02:00
default World getWorld() {
return getEntity().getEntityWorld();
}
default BlockPos getOrigin() {
return getEntity().getPosition();
}
2018-09-12 01:29:49 +02:00
}