11 lines
309 B
Java
11 lines
309 B
Java
package net.minecraft.world.entity.ai.control;
|
|
|
|
import net.minecraft.util.Mth;
|
|
|
|
public interface Control {
|
|
default float rotateTowards(float current, float wanted, float maxSpeed) {
|
|
float f = Mth.degreesDifference(current, wanted);
|
|
float g = Mth.clamp(f, -maxSpeed, maxSpeed);
|
|
return current + g;
|
|
}
|
|
}
|