From ebbfe7868bdccef4d2eeee69bc3a79111e72743e Mon Sep 17 00:00:00 2001 From: TheMode Date: Sat, 10 Apr 2021 06:11:43 +0200 Subject: [PATCH] Prevent implicit cast from int to double --- .../server/entity/ai/goal/MeleeAttackGoal.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/minestom/server/entity/ai/goal/MeleeAttackGoal.java b/src/main/java/net/minestom/server/entity/ai/goal/MeleeAttackGoal.java index a4e45c3e0..dec9fc85b 100644 --- a/src/main/java/net/minestom/server/entity/ai/goal/MeleeAttackGoal.java +++ b/src/main/java/net/minestom/server/entity/ai/goal/MeleeAttackGoal.java @@ -20,27 +20,27 @@ public class MeleeAttackGoal extends GoalSelector { private final Cooldown cooldown = new Cooldown(new UpdateOption(5, TimeUnit.TICK)); private long lastHit; + private final double range; private final int delay; private final TimeUnit timeUnit; - private final int range; private boolean stop; private Entity cachedTarget; /** * @param entityCreature the entity to add the goal to - * @param delay the delay between each attacks * @param range the allowed range the entity can attack others. + * @param delay the delay between each attacks * @param timeUnit the unit of the delay */ - public MeleeAttackGoal(@NotNull EntityCreature entityCreature, int delay, int range, @NotNull TimeUnit timeUnit) { + public MeleeAttackGoal(@NotNull EntityCreature entityCreature, double range, int delay, @NotNull TimeUnit timeUnit) { super(entityCreature); - this.delay = delay; this.range = range; + this.delay = delay; this.timeUnit = timeUnit; } - public Cooldown getCooldown() { + public @NotNull Cooldown getCooldown() { return this.cooldown; }