Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Commit

Permalink
remove meleeattackOverride
Browse files Browse the repository at this point in the history
  • Loading branch information
Boy0000 committed Nov 29, 2023
1 parent f0d3522 commit dac960e
Showing 1 changed file with 1 addition and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package com.mineinabyss.mobzy.pathfinding.bindings.goals

import com.mineinabyss.idofront.nms.aliases.toNMS
import com.mineinabyss.mobzy.modelengine.animation.playAnimation
import com.mineinabyss.mobzy.pathfinding.components.PathfinderComponent
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.entity.PathfinderMob
import org.bukkit.entity.Mob
import net.minecraft.world.entity.ai.goal.MeleeAttackGoal as NMSMeleeAttackGoal
Expand All @@ -22,14 +20,6 @@ class MeleeAttackBehavior(
inner class MeleeAttackGoal(
private val entity: Mob
) : NMSMeleeAttackGoal(entity.toNMS<PathfinderMob>(), attackSpeed, seeThroughWalls) {
override fun checkAndPerformAttack(target: LivingEntity/*, squaredDistance: Double*/) {
val width = mob.bbWidth
val d = (1 + width) * (1 + width) + target.bbWidth
if (/*squaredDistance <= d && */ticksUntilNextAttack <= 0) {
entity.playAnimation("attack", 0.0, 0.0, 1.0, false)
resetAttackCooldown()
mob.doHurtTarget(target)
}
}

}
}

0 comments on commit dac960e

Please sign in to comment.