Skip to content

Commit

Permalink
Made Desert Wolfs only follow owner while unsaddled (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
noobanidus authored and GirafiStudios committed Feb 5, 2019
1 parent 05599c2 commit a89b66f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.teammetallurgy.atum.entity.ai;

import com.teammetallurgy.atum.entity.animal.EntityDesertWolf;
import net.minecraft.entity.ai.EntityAIFollowOwner;

public class EntityAIFollowOwnerWithoutSaddle extends EntityAIFollowOwner {
private final EntityDesertWolf wolf;

public EntityAIFollowOwnerWithoutSaddle(EntityDesertWolf tameableIn, double followSpeedIn, float minDistIn, float maxDistIn) {
super(tameableIn, followSpeedIn, minDistIn, maxDistIn);
this.wolf = tameableIn;
}

@Override
public boolean shouldExecute() {
if (wolf.isSaddled()) return false;
return super.shouldExecute();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.teammetallurgy.atum.Atum;
import com.teammetallurgy.atum.entity.ai.AIBeg;
import com.teammetallurgy.atum.entity.ai.AISitWithCheck;
import com.teammetallurgy.atum.entity.ai.EntityAIFollowOwnerWithoutSaddle;
import com.teammetallurgy.atum.entity.undead.EntityUndeadBase;
import com.teammetallurgy.atum.init.AtumBlocks;
import com.teammetallurgy.atum.init.AtumItems;
Expand Down Expand Up @@ -102,7 +103,7 @@ protected void initEntityAI() {
this.tasks.addTask(3, new EntityAIAvoidEntity<>(this, EntityCamel.class, 24.0F, 0.6D, 1.2D));
this.tasks.addTask(4, new EntityAILeapAtTarget(this, 0.4F));
this.tasks.addTask(5, new EntityAIAttackMelee(this, 1.0D, true));
this.tasks.addTask(6, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F));
this.tasks.addTask(6, new EntityAIFollowOwnerWithoutSaddle(this, 1.0D, 10.0F, 2.0F));
this.tasks.addTask(7, new EntityAIMate(this, 1.0D));
this.tasks.addTask(8, new EntityAIWanderAvoidWater(this, 1.0D));
this.tasks.addTask(9, new AIBeg(this, 8.0F));
Expand Down

0 comments on commit a89b66f

Please sign in to comment.