Skip to content

Commit

Permalink
Made tamed Alpha Desert wolfs behave like horses, when tamed. Closes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
GirafiStudios committed May 26, 2019
1 parent 0871ea9 commit 1caf2fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
import com.teammetallurgy.atum.entity.animal.EntityDesertWolf;
import net.minecraft.entity.ai.EntityAIFollowOwner;

public class EntityAIFollowOwnerWithoutSaddle extends EntityAIFollowOwner {
public class AIFollowOwnerWithoutSaddle extends EntityAIFollowOwner {
private final EntityDesertWolf wolf;

public EntityAIFollowOwnerWithoutSaddle(EntityDesertWolf wolf, double followSpeed, float minDist, float maxDist) {
public AIFollowOwnerWithoutSaddle(EntityDesertWolf wolf, double followSpeed, float minDist, float maxDist) {
super(wolf, followSpeed, minDist, maxDist);
this.wolf = wolf;
}

@Override
public boolean shouldExecute() {
if (wolf.isSaddled()) return false;
if (wolf.isTamed() && wolf.isAlpha()) return false;
return super.shouldExecute();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +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.ai.AIFollowOwnerWithoutSaddle;
import com.teammetallurgy.atum.entity.undead.EntityUndeadBase;
import com.teammetallurgy.atum.init.AtumBlocks;
import com.teammetallurgy.atum.init.AtumItems;
Expand Down Expand Up @@ -104,7 +104,7 @@ protected void initEntityAI() {
this.tasks.addTask(3, new EntityAIAvoidEntity<>(this, EntityCamel.class, avoid -> avoid != null && !this.isAlpha(), 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 EntityAIFollowOwnerWithoutSaddle(this, 1.0D, 10.0F, 2.0F));
this.tasks.addTask(6, new AIFollowOwnerWithoutSaddle(this, 1.0D, 10.0F, 2.0F));
this.tasks.addTask(7, new EntityAIMate(this, 1.0D));
this.tasks.addTask(8, new EntityAIWanderAvoidWater(this, 0.4D));
this.tasks.addTask(9, new AIBeg(this, 8.0F));
Expand Down

0 comments on commit 1caf2fc

Please sign in to comment.