GoalUtils.java 533 Bytes
Newer Older
1 2
package com.owlmaddie.goals;

3
import com.owlmaddie.mixin.MixinMobEntityAccessor;
4 5 6 7 8 9 10 11 12 13
import net.minecraft.entity.ai.goal.GoalSelector;
import net.minecraft.entity.mob.MobEntity;

/**
 * The {@code GoalUtils} class uses reflection to extend the MobEntity class
 * and add a public GoalSelector method.
 */
public class GoalUtils {

    public static GoalSelector getGoalSelector(MobEntity mobEntity) {
14
        MixinMobEntityAccessor mixingEntity = (MixinMobEntityAccessor)mobEntity;
15
        return mixingEntity.getGoalSelector();
16 17
    }
}