Refactored EntityController.of to EntityController.getFor

This commit is contained in:
Auxilor
2022-03-02 13:10:39 +00:00
parent 61896bbddd
commit 866ba8440d
4 changed files with 5 additions and 5 deletions

View File

@@ -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);
}
}

View File

@@ -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();
}

View File

@@ -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();
}

View File

@@ -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)