mirror of
https://github.com/FatherToast/SpecialMobs.git
synced 2025-04-24 14:25:01 +00:00
melee ghast animation
This commit is contained in:
parent
e1a7b9af17
commit
77030521b3
2 changed files with 9 additions and 7 deletions
|
@ -68,17 +68,19 @@ public class SpecialGhastMeleeAttackGoal extends Goal {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// Attack the target when able
|
||||
final double rangeDiff = target.distanceToSqr( ghast ) -
|
||||
((ghast.getBbWidth() * ghast.getBbWidth() + target.getBbWidth() * target.getBbWidth()) / 4.0 + 5.0);
|
||||
if( attackTimer > 0 ) {
|
||||
attackTimer--;
|
||||
}
|
||||
else {
|
||||
final double reachSq = (ghast.getBbWidth() * ghast.getBbWidth() + target.getBbWidth() * target.getBbWidth()) / 4.0 + 5.0;
|
||||
if( target.distanceToSqr( ghast ) < reachSq ) {
|
||||
attackTimer = 20;
|
||||
ghast.doHurtTarget( target );
|
||||
}
|
||||
else if( rangeDiff <= 0 ) {
|
||||
attackTimer = 20;
|
||||
ghast.doHurtTarget( target );
|
||||
}
|
||||
|
||||
ghast.setCharging( attackTimer < 6 && rangeDiff <= 10.0 );
|
||||
}
|
||||
|
||||
private void setWantedPosition( LivingEntity target ) {
|
||||
|
|
|
@ -64,7 +64,7 @@ public class PlayerVelocityWatcher {
|
|||
}
|
||||
}
|
||||
|
||||
/** Called when the server is starts shutting down. */
|
||||
/** Called when the server starts shutting down. */
|
||||
@SubscribeEvent
|
||||
protected static void onServerStopping( FMLServerStoppingEvent event ) {
|
||||
cleanupCounter = 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue