Made Animator abstract and added final modifiers

This commit is contained in:
xGamingDudex 2016-05-15 15:58:05 +02:00
parent 22e54557d8
commit aa36097729
2 changed files with 11 additions and 10 deletions

View File

@ -13,9 +13,9 @@ import org.bukkit.util.Vector;
* Self sufficient animator to animate task with steps using local vector logic
*/
public class Animator
public abstract class Animator
{
private Plugin _plugin;
private final Plugin _plugin;
private TreeSet<AnimationPoint> _points = new TreeSet<>((a, b) -> Integer.compare(a.getTick(), b.getTick()));
@ -147,12 +147,8 @@ public class Animator
_repeat = repeat;
}
protected void tick(Location loc)
{
}
protected abstract void tick(Location loc);
protected abstract void finish(Location loc);
protected void finish(Location loc)
{
}
}

View File

@ -13,7 +13,7 @@ import org.bukkit.util.Vector;
public class AnimatorEntity extends Animator
{
private Entity _ent;
private final Entity _ent;
public AnimatorEntity(Plugin plugin, Entity ent)
{
@ -33,4 +33,9 @@ public class AnimatorEntity extends Animator
_ent.teleport(loc);
}
@Override
protected void finish(Location loc)
{
}
}