From aa36097729b727e35b84d554bcb2eb7dde071d57 Mon Sep 17 00:00:00 2001 From: xGamingDudex Date: Sun, 15 May 2016 15:58:05 +0200 Subject: [PATCH] Made Animator abstract and added final modifiers --- .../mineplex/core/common/animation/Animator.java | 14 +++++--------- .../core/common/animation/AnimatorEntity.java | 7 ++++++- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/animation/Animator.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/animation/Animator.java index 2a3e72fcc..a6a3b7b39 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/animation/Animator.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/animation/Animator.java @@ -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 _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) - { - } - } diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/animation/AnimatorEntity.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/animation/AnimatorEntity.java index 663b822bb..99b216082 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/animation/AnimatorEntity.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/animation/AnimatorEntity.java @@ -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) + { + } + }