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

66 lines
1.4 KiB
Java
Raw Normal View History

2018-09-12 01:29:49 +02:00
package com.minelittlepony.unicopia.spell;
import com.minelittlepony.unicopia.InbtSerialisable;
/**
2018-09-24 21:37:16 +02:00
* Interface for a magic spells
2018-09-12 01:29:49 +02:00
*/
2018-09-24 21:37:16 +02:00
public interface IMagicEffect extends InbtSerialisable, ILevelled {
2018-09-12 01:29:49 +02:00
String getName();
/**
* Sets this effect as dead.
*/
void setDead();
/**
* Returns true if this spell is dead, and must be cleaned up.
*/
boolean getDead();
/**
* Called every tick when attached to a player.
*
* @param source The entity we are currently attached to.
* @return true to keep alive
*/
2018-09-24 21:37:16 +02:00
boolean update(ICaster<?> caster);
2018-09-12 01:29:49 +02:00
/**
2018-09-24 21:37:16 +02:00
* Called every tick when attached to a gem.
2018-09-12 01:29:49 +02:00
*
2018-09-24 21:37:16 +02:00
* @param source The entity we are currently attached to.
* @param level Current active spell level
2018-09-12 01:29:49 +02:00
*/
2018-09-24 21:37:16 +02:00
boolean update(ICaster<?> source, int level);
2018-09-12 01:29:49 +02:00
2018-09-24 21:37:16 +02:00
/**
* Called every tick when attached to a player. Used to apply particle effects.
* Is only called on the client side.
*
* @param source The entity we are currently attached to.
*/
default void render(ICaster<?> source) {
2018-09-12 01:29:49 +02:00
2018-09-24 21:37:16 +02:00
}
2018-09-12 01:29:49 +02:00
/**
* Called every tick when attached to an entity to produce particle effects.
* Is only called on the client side.
*
* @param source The entity we are attached to.
* @param level Current spell level
*/
2018-09-24 21:37:16 +02:00
default void render(ICaster<?> source, int level) {
2018-09-12 01:29:49 +02:00
}
/**
* Return true to allow the gem update and move.
*/
default boolean allowAI() {
return false;
}
}