Skip to content

Commit

Permalink
Undid last commit & added null check for target in AssassinMeleeAttac…
Browse files Browse the repository at this point in the history
…kGoal
  • Loading branch information
GirafiStudios committed Dec 2, 2020
1 parent 4de1f21 commit 1605a00
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 28 deletions.

This file was deleted.

@@ -1,13 +1,11 @@
package com.teammetallurgy.atum.entity.bandit;

import com.teammetallurgy.atum.entity.ai.controller.AssassinLookController;
import com.teammetallurgy.atum.entity.ai.goal.OpenAnyDoorGoal;
import com.teammetallurgy.atum.entity.ai.pathfinding.ClimberGroundPathNavigator;
import com.teammetallurgy.atum.entity.undead.UndeadBaseEntity;
import com.teammetallurgy.atum.init.AtumItems;
import net.minecraft.block.BlockState;
import net.minecraft.entity.*;
import net.minecraft.entity.ai.controller.LookController;
import net.minecraft.entity.ai.goal.HurtByTargetGoal;
import net.minecraft.entity.ai.goal.MeleeAttackGoal;
import net.minecraft.entity.ai.goal.NearestAttackableTargetGoal;
Expand Down Expand Up @@ -57,13 +55,7 @@ protected void registerGoals() {
super.registerGoals();
this.goalSelector.addGoal(1, new MarkedForDeathGoal(this, this.markedTarget));
this.goalSelector.addGoal(3, new OpenAnyDoorGoal(this, false));
this.goalSelector.addGoal(4, new MeleeAttackGoal(this, 1.2D, true));
}

@Override
@Nonnull
public LookController getLookController() {
return new AssassinLookController(this);
this.goalSelector.addGoal(4, new AssassinMeleeAttackGoal(this, 1.2D, true));
}

@Override
Expand Down Expand Up @@ -236,4 +228,19 @@ public void resetTask() {
((AssassinEntity) this.goalOwner).markedTarget = null;
}
}


public static class AssassinMeleeAttackGoal extends MeleeAttackGoal {

public AssassinMeleeAttackGoal(CreatureEntity creature, double speedIn, boolean useLongMemory) {
super(creature, speedIn, useLongMemory);
}

@Override
public void tick() {
if (this.attacker != null && this.attacker.getAttackTarget() != null) {
super.tick();
}
}
}
}

0 comments on commit 1605a00

Please sign in to comment.