From 850adc48856f30fb720d8aa43d7bdf4cb81e787e Mon Sep 17 00:00:00 2001 From: Hannes Greule Date: Tue, 3 Jan 2023 14:42:58 +0100 Subject: [PATCH] Fix operator precedence bug (#8756) --- patches/server/Entity-Activation-Range-2.0.patch | 4 ++-- patches/server/Fix-items-not-falling-correctly.patch | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/patches/server/Entity-Activation-Range-2.0.patch b/patches/server/Entity-Activation-Range-2.0.patch index e1fea538dc..00669dead3 100644 --- a/patches/server/Entity-Activation-Range-2.0.patch +++ b/patches/server/Entity-Activation-Range-2.0.patch @@ -740,8 +740,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } // Add a little performance juice to active entities. Skip 1/4 if not immune. -- } else if ( !entity.defaultActivationState && entity.tickCount + entity.getId() + 1 % 4 == 0 && !ActivationRange.checkEntityImmunities( entity ) ) // Paper - Ensure checking item movement is offset from Spigot's entity activation range check -+ } else if ( entity.tickCount + entity.getId() + 1 % 4 == 0 && ActivationRange.checkEntityImmunities( entity ) < 0 ) // Paper +- } else if ( !entity.defaultActivationState && (entity.tickCount + entity.getId()) % 4 == 3 && !ActivationRange.checkEntityImmunities( entity ) ) // Paper - Ensure checking item movement is offset from Spigot's entity activation range check ++ } else if ( (entity.tickCount + entity.getId()) % 4 == 3 && ActivationRange.checkEntityImmunities( entity ) < 0 ) // Paper { isActive = false; } diff --git a/patches/server/Fix-items-not-falling-correctly.patch b/patches/server/Fix-items-not-falling-correctly.patch index 47f5cc9a66..21b4e239e8 100644 --- a/patches/server/Fix-items-not-falling-correctly.patch +++ b/patches/server/Fix-items-not-falling-correctly.patch @@ -36,7 +36,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } // Add a little performance juice to active entities. Skip 1/4 if not immune. - } else if ( !entity.defaultActivationState && entity.tickCount % 4 == 0 && !ActivationRange.checkEntityImmunities( entity ) ) -+ } else if ( !entity.defaultActivationState && entity.tickCount + entity.getId() + 1 % 4 == 0 && !ActivationRange.checkEntityImmunities( entity ) ) // Paper - Ensure checking item movement is offset from Spigot's entity activation range check ++ } else if ( !entity.defaultActivationState && (entity.tickCount + entity.getId()) % 4 == 3 && !ActivationRange.checkEntityImmunities( entity ) ) // Paper - Ensure checking item movement is offset from Spigot's entity activation range check { isActive = false; }