Grant temporary immunity from EAR to moving entities (Fixes #7637) (#7644)

Co-authored-by: Peter Svensson <petersv@psv.nu>
This commit is contained in:
petersv5 2022-04-20 11:34:00 +02:00
parent 52d1a9427e
commit ee9fd9f668

View File

@ -537,7 +537,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
{
- return true;
+ return 100; // Paper
+ }
+ // Paper start
+ if ( !entity.isOnGround() || entity.getDeltaMovement().horizontalDistanceSqr() > 9.999999747378752E-6D )
+ {
+ return 100;
}
+ // Paper end
if ( !( entity instanceof AbstractArrow ) )
{
- if ( !entity.isOnGround() || !entity.passengers.isEmpty() || entity.isPassenger() )
@ -566,7 +572,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
{
- return true;
+ return 20; // Paper
+ }
}
- if ( entity instanceof Villager && ( (Villager) entity ).canBreed() )
+ // Paper start
+ if (entity instanceof Bee) {
+ Bee bee = (Bee)entity;
@ -594,8 +601,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return config.villagersWorkImmunityFor;
+ }
+ }
}
- if ( entity instanceof Villager && ( (Villager) entity ).canBreed() )
+ }
+ if ( entity instanceof Llama && ( (Llama) entity ).inCaravan() )
{
- return true;