Make EntityInstantAnimation returns a CompletableFuture
This commit is contained in:
@@ -7,6 +7,8 @@ import com.bartlomiejpluta.base.api.move.Movable;
|
||||
import com.bartlomiejpluta.base.internal.logic.Updatable;
|
||||
import com.bartlomiejpluta.base.internal.render.Renderable;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public interface Entity extends Movable, Animated, Renderable, Updatable {
|
||||
|
||||
Direction getFaceDirection();
|
||||
@@ -35,5 +37,7 @@ public interface Entity extends Movable, Animated, Renderable, Updatable {
|
||||
|
||||
void setZIndex(int zIndex);
|
||||
|
||||
void performInstantAnimation(Direction targetFaceDirection, Runnable onFinish);
|
||||
CompletableFuture<Void> performInstantAnimation();
|
||||
|
||||
CompletableFuture<Void> performInstantAnimation(Direction targetFaceDirection);
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@ import org.joml.Matrix4fc;
|
||||
import org.joml.Vector2fc;
|
||||
import org.joml.Vector2ic;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public abstract class EntityDelegate implements Entity {
|
||||
protected final Entity entity;
|
||||
|
||||
@@ -266,8 +268,13 @@ public abstract class EntityDelegate implements Entity {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void performInstantAnimation(Direction targetFaceDirection, Runnable onFinish) {
|
||||
entity.performInstantAnimation(targetFaceDirection, onFinish);
|
||||
public CompletableFuture<Void> performInstantAnimation() {
|
||||
return entity.performInstantAnimation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletableFuture<Void> performInstantAnimation(Direction targetFaceDirection) {
|
||||
return entity.performInstantAnimation(targetFaceDirection);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user