Refactored EntityController.of to EntityController.getFor
This commit is contained in:
@@ -88,7 +88,7 @@ public interface EntityController<T extends Mob> {
|
||||
* @param <T> The mob type.
|
||||
* @return The entity controller.
|
||||
*/
|
||||
static <T extends Mob> EntityController<T> of(@NotNull final T entity) {
|
||||
static <T extends Mob> EntityController<T> getFor(@NotNull final T entity) {
|
||||
return Eco.getHandler().createEntityController(entity);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ public interface EntityGoal<T extends Mob> {
|
||||
* @return The entity, modified.
|
||||
*/
|
||||
default T addToEntity(@NotNull T entity, int priority) {
|
||||
return EntityController.of(entity)
|
||||
return EntityController.getFor(entity)
|
||||
.addEntityGoal(priority, this)
|
||||
.getEntity();
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ public interface TargetGoal<T extends Mob> {
|
||||
* @return The entity, modified.
|
||||
*/
|
||||
default T addToEntity(@NotNull T entity, int priority) {
|
||||
return EntityController.of(entity)
|
||||
return EntityController.getFor(entity)
|
||||
.addTargetGoal(priority, this)
|
||||
.getEntity();
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import com.willfp.eco.core.entities.ai.EntityController
|
||||
import org.bukkit.entity.Mob
|
||||
|
||||
/**
|
||||
* @see EntityController.of
|
||||
* @see EntityController.getFor
|
||||
*/
|
||||
val <T : Mob> T.controller: EntityController<T>
|
||||
get() = EntityController.of(this)
|
||||
get() = EntityController.getFor(this)
|
||||
|
||||
Reference in New Issue
Block a user