@@ -616,10 +616,10 @@ index 0000000000000000000000000000000000000000..020368da69b9a492155f6de6297f7473
616616+ }
617617diff --git a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
618618new file mode 100644
619- index 0000000000000000000000000000000000000000..3d4bb28fe686a9ad2e4c0f75f21e6289c2ea5cf9
619+ index 0000000000000000000000000000000000000000..95d1a8a5b349f7849c040026bfa3469d03d92bfd
620620--- /dev/null
621621+++ b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
622- @@ -0,0 +1,296 @@
622+ @@ -0,0 +1,295 @@
623623+ package gg.pufferfish.pufferfish;
624624+
625625+ import gg.pufferfish.pufferfish.simd.SIMDDetection;
@@ -904,7 +904,6 @@ index 0000000000000000000000000000000000000000..3d4bb28fe686a9ad2e4c0f75f21e6289
904904+ "the ender dragon whenever a player places an end crystal.");
905905+ }
906906+
907- +
908907+ public static boolean disableMethodProfiler;
909908+ public static boolean disableOutOfOrderChat;
910909+ public static boolean suppressNullIdDisconnections;
@@ -2135,7 +2134,7 @@ index 9afc81ccb237c3655d64cdbe8a0db9a4d7791043..aa5cec6d56d7a8e80861aa4c9b4a74ca
21352134 private String descriptionId;
21362135 @Nullable
21372136diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
2138- index e11d7283662834047b2ff81a2fd25a4263792deb..e9a31314424d9db911cd9806741222397c3072d7 100644
2137+ index e11d7283662834047b2ff81a2fd25a4263792deb..e07140ef2f4c5b0019550eb3100c724699e7a05c 100644
21392138--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
21402139+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
21412140@@ -142,7 +142,6 @@ import org.bukkit.event.entity.EntityTeleportEvent;
@@ -2151,11 +2150,11 @@ index e11d7283662834047b2ff81a2fd25a4263792deb..e9a31314424d9db911cd980674122239
21512150
21522151 if (!this.level().isClientSide) {
21532152- if (this.isInWall()) {
2154- + if ((!gg.pufferfish.pufferfish.PufferfishConfig.enableSuffocationOptimization || (tickCount % 10 == 0 && couldPossiblyBeHurt(1.0F)) ) && this.isInWall()) { // Pufferfish - optimize suffocation
2153+ + if (shouldCheckForSuffocation( ) && this.isInWall()) { // Pufferfish - optimize suffocation
21552154 this.hurt(this.damageSources().inWall(), 1.0F);
21562155 } else if (flag && !this.level().getWorldBorder().isWithinBounds(this.getBoundingBox())) {
21572156 double d0 = this.level().getWorldBorder().getDistanceToBorder(this) + this.level().getWorldBorder().getDamageSafeZone();
2158- @@ -1369,6 +1368,15 @@ public abstract class LivingEntity extends Entity implements Attackable {
2157+ @@ -1369,6 +1368,19 @@ public abstract class LivingEntity extends Entity implements Attackable {
21592158 return this.getHealth() <= 0.0F;
21602159 }
21612160
@@ -2166,12 +2165,16 @@ index e11d7283662834047b2ff81a2fd25a4263792deb..e9a31314424d9db911cd980674122239
21662165+ }
21672166+ return true;
21682167+ }
2168+ +
2169+ + public boolean shouldCheckForSuffocation() {
2170+ + return !gg.pufferfish.pufferfish.PufferfishConfig.enableSuffocationOptimization || (tickCount % 10 == 0 && couldPossiblyBeHurt(1.0F));
2171+ + }
21692172+ // Pufferfish end
21702173+
21712174 @Override
21722175 public boolean hurt(DamageSource source, float amount) {
21732176 if (this.isInvulnerableTo(source)) {
2174- @@ -1965,6 +1973 ,20 @@ public abstract class LivingEntity extends Entity implements Attackable {
2177+ @@ -1965,6 +1977 ,20 @@ public abstract class LivingEntity extends Entity implements Attackable {
21752178 return this.lastClimbablePos;
21762179 }
21772180
@@ -2192,7 +2195,7 @@ index e11d7283662834047b2ff81a2fd25a4263792deb..e9a31314424d9db911cd980674122239
21922195 public boolean onClimbable() {
21932196 if (this.isSpectator()) {
21942197 return false;
2195- @@ -3651,7 +3673 ,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
2198+ @@ -3651,7 +3677 ,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
21962199 Vec3 vec3d1 = new Vec3(entity.getX(), entity.getEyeY(), entity.getZ());
21972200
21982201 // Paper - diff on change - used in CraftLivingEntity#hasLineOfSight(Location) and CraftWorld#lineOfSightExists
@@ -2471,6 +2474,24 @@ index 247aca0b612f5079a0596350e8311c385df8ab1c..7f21d1d400c8a5615ed1a787dcb06803
24712474 this.getBrain().tick((ServerLevel) this.level(), this);
24722475 this.level().getProfiler().pop();
24732476 this.level().getProfiler().push("goatActivityUpdate");
2477+ diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
2478+ index 1e07febcf7a3dfb281728cc5e3e4f15dd776d7e0..c65ab566c6241dd6a44bd11a449ef0c4b2f6dc65 100644
2479+ --- a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
2480+ +++ b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
2481+ @@ -150,6 +150,13 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
2482+ this.bossEvent.setName(this.getDisplayName());
2483+ }
2484+
2485+ + // Pufferfish start - optimize suffocation
2486+ + @Override
2487+ + public boolean shouldCheckForSuffocation() {
2488+ + return true;
2489+ + }
2490+ + // Pufferfish end
2491+ +
2492+ @Override
2493+ protected SoundEvent getAmbientSound() {
2494+ return SoundEvents.WITHER_AMBIENT;
24742495diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
24752496index 52196431a6538872755344859a0454a0e50c3b6e..80fc7918cb294b0d88a293bd6a920441cb55c3ad 100644
24762497--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
0 commit comments