mirror of
https://github.com/FatherToast/SpecialMobs.git
synced 2025-04-24 22:34:58 +00:00
Merge branch '1.16.5' of https://github.com/FatherToast/SpecialMobs into 1.16.5
This commit is contained in:
commit
c054269861
2 changed files with 9 additions and 7 deletions
|
@ -68,17 +68,19 @@ public class SpecialGhastMeleeAttackGoal extends Goal {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Attack the target when able
|
// 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 ) {
|
if( attackTimer > 0 ) {
|
||||||
attackTimer--;
|
attackTimer--;
|
||||||
}
|
}
|
||||||
else {
|
else if( rangeDiff <= 0 ) {
|
||||||
final double reachSq = (ghast.getBbWidth() * ghast.getBbWidth() + target.getBbWidth() * target.getBbWidth()) / 4.0 + 5.0;
|
|
||||||
if( target.distanceToSqr( ghast ) < reachSq ) {
|
|
||||||
attackTimer = 20;
|
attackTimer = 20;
|
||||||
ghast.doHurtTarget( target );
|
ghast.doHurtTarget( target );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
ghast.setCharging( attackTimer < 6 && rangeDiff <= 10.0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setWantedPosition( LivingEntity target ) {
|
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
|
@SubscribeEvent
|
||||||
protected static void onServerStopping( FMLServerStoppingEvent event ) {
|
protected static void onServerStopping( FMLServerStoppingEvent event ) {
|
||||||
cleanupCounter = 0;
|
cleanupCounter = 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue