Search in sources :

Example 1 with SitOnHeadGoal

use of nomble.beebuddy.entity.ai.goal.SitOnHeadGoal in project beebuddy by queenofthebees.

the class BeeEntityMixin method beebuddy$initTamedGoals.

@Unique
private void beebuddy$initTamedGoals() {
    BeeEntity us = (BeeEntity) (Object) this;
    this.goalSelector.add(0, new BeeSitGoal(us));
    this.goalSelector.add(1, StingGoalInvoker.beebuddy$make(us, us, 1.399999976158142D, true));
    this.goalSelector.add(2, new FollowParentGoal(us, 1.25D));
    this.goalSelector.add(3, new FollowFriendGoal(us));
    this.goalSelector.add(4, new AnimalMateGoal(us, 1.0D));
    if (pollinateGoal == null) {
        // we can be called before initGoals's body
        pollinateGoal = PollinateGoalInvoker.beebuddy$make(us);
    }
    this.goalSelector.add(5, pollinateGoal);
    if (moveToFlowerGoal == null) {
        moveToFlowerGoal = MoveToFlowerGoalInvoker.beebuddy$make(us);
    }
    this.goalSelector.add(6, moveToFlowerGoal);
    this.goalSelector.add(7, new SitOnHeadGoal(us));
    this.goalSelector.add(7, BeeWanderAroundGoalInvoker.beebuddy$make(us));
    this.goalSelector.add(8, new LookAtEntityGoal(us, PlayerEntity.class, 4.0F));
    this.goalSelector.add(8, new SwimGoal(us));
    BeeEntityMixin mix = this;
    this.targetSelector.add(1, (new RevengeGoal(this) {

        @Override
        public boolean canStart() {
            if (!super.canStart()) {
                return false;
            }
            if (us.getAttacker() != null) {
                UUID u = us.getAttacker().getUuid();
                return !u.equals(mix.beebuddy$getFriend());
            } else {
                return true;
            }
        }

        @Override
        public boolean shouldContinue() {
            return us.hasAngerTime() && super.shouldContinue();
        }
    }).setGroupRevenge(new Class[0]));
}
Also used : RevengeGoal(net.minecraft.entity.ai.goal.RevengeGoal) FollowParentGoal(net.minecraft.entity.ai.goal.FollowParentGoal) FollowFriendGoal(nomble.beebuddy.entity.ai.goal.FollowFriendGoal) LookAtEntityGoal(net.minecraft.entity.ai.goal.LookAtEntityGoal) SitOnHeadGoal(nomble.beebuddy.entity.ai.goal.SitOnHeadGoal) SwimGoal(net.minecraft.entity.ai.goal.SwimGoal) PlayerEntity(net.minecraft.entity.player.PlayerEntity) ServerPlayerEntity(net.minecraft.server.network.ServerPlayerEntity) AnimalMateGoal(net.minecraft.entity.ai.goal.AnimalMateGoal) BeeSitGoal(nomble.beebuddy.entity.ai.goal.BeeSitGoal) BeeEntity(net.minecraft.entity.passive.BeeEntity) UUID(java.util.UUID) Unique(org.spongepowered.asm.mixin.Unique)

Aggregations

UUID (java.util.UUID)1 AnimalMateGoal (net.minecraft.entity.ai.goal.AnimalMateGoal)1 FollowParentGoal (net.minecraft.entity.ai.goal.FollowParentGoal)1 LookAtEntityGoal (net.minecraft.entity.ai.goal.LookAtEntityGoal)1 RevengeGoal (net.minecraft.entity.ai.goal.RevengeGoal)1 SwimGoal (net.minecraft.entity.ai.goal.SwimGoal)1 BeeEntity (net.minecraft.entity.passive.BeeEntity)1 PlayerEntity (net.minecraft.entity.player.PlayerEntity)1 ServerPlayerEntity (net.minecraft.server.network.ServerPlayerEntity)1 BeeSitGoal (nomble.beebuddy.entity.ai.goal.BeeSitGoal)1 FollowFriendGoal (nomble.beebuddy.entity.ai.goal.FollowFriendGoal)1 SitOnHeadGoal (nomble.beebuddy.entity.ai.goal.SitOnHeadGoal)1 Unique (org.spongepowered.asm.mixin.Unique)1