From 29e271fa8b3119cdda5cd559c64e2f46f4aec623 Mon Sep 17 00:00:00 2001 From: TNWing Date: Wed, 31 Dec 2025 13:14:27 -0500 Subject: [PATCH 1/3] Comfort changes -Added check for natural regen game rule -Added check to prevent healing if the player can regen naturally (non-saturation related health regen) --- .../farmersdelight/common/effect/ComfortEffect.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/vectorwing/farmersdelight/common/effect/ComfortEffect.java b/src/main/java/vectorwing/farmersdelight/common/effect/ComfortEffect.java index 5312d7838..f2c3687e2 100644 --- a/src/main/java/vectorwing/farmersdelight/common/effect/ComfortEffect.java +++ b/src/main/java/vectorwing/farmersdelight/common/effect/ComfortEffect.java @@ -6,6 +6,7 @@ import net.minecraft.world.effect.MobEffects; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.player.Player; +import net.minecraft.world.level.GameRules; @SuppressWarnings("unused") public class ComfortEffect extends MobEffect @@ -21,13 +22,21 @@ public ComfortEffect() { @Override public void applyEffectTick(LivingEntity entity, int amplifier) { + boolean flag = entity.level().getGameRules().getBoolean(GameRules.RULE_NATURAL_REGENERATION); + if (!flag){ + return; + } if (entity.hasEffect(MobEffects.REGENERATION)) { return; } if (entity instanceof Player player) { + if (player.getFoodData().getFoodLevel()>=18){ + return; + } if (player.getFoodData().getSaturationLevel() > 0.0) { return; } + } if (entity.getHealth() < entity.getMaxHealth()) { entity.heal(1.0F); From 8b9d1231e5b0e586072c958a5c0118a5b0a90557 Mon Sep 17 00:00:00 2001 From: TNWing Date: Wed, 31 Dec 2025 13:22:15 -0500 Subject: [PATCH 2/3] another check for comfort effect IF the player has saturation but not enough to trigger natural regeneration or saturation healing, comfort can still heal --- .../farmersdelight/common/effect/ComfortEffect.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/vectorwing/farmersdelight/common/effect/ComfortEffect.java b/src/main/java/vectorwing/farmersdelight/common/effect/ComfortEffect.java index f2c3687e2..968659b89 100644 --- a/src/main/java/vectorwing/farmersdelight/common/effect/ComfortEffect.java +++ b/src/main/java/vectorwing/farmersdelight/common/effect/ComfortEffect.java @@ -33,8 +33,8 @@ public void applyEffectTick(LivingEntity entity, int amplifier) { if (player.getFoodData().getFoodLevel()>=18){ return; } - if (player.getFoodData().getSaturationLevel() > 0.0) { - return; + if (player.getFoodData().getSaturationLevel() > 0.0 && player.getFoodData().getFoodLevel()<18) { + return; } } From 164021a8dec5deb1ed7f999317264e91d86b1ee5 Mon Sep 17 00:00:00 2001 From: TNWing Date: Wed, 31 Dec 2025 13:28:22 -0500 Subject: [PATCH 3/3] Update ComfortEffect.java removing the saturation check to just rely on the hunger check should cover all scenarios --- .../farmersdelight/common/effect/ComfortEffect.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/main/java/vectorwing/farmersdelight/common/effect/ComfortEffect.java b/src/main/java/vectorwing/farmersdelight/common/effect/ComfortEffect.java index 968659b89..8d1ef4e3e 100644 --- a/src/main/java/vectorwing/farmersdelight/common/effect/ComfortEffect.java +++ b/src/main/java/vectorwing/farmersdelight/common/effect/ComfortEffect.java @@ -33,10 +33,6 @@ public void applyEffectTick(LivingEntity entity, int amplifier) { if (player.getFoodData().getFoodLevel()>=18){ return; } - if (player.getFoodData().getSaturationLevel() > 0.0 && player.getFoodData().getFoodLevel()<18) { - return; - } - } if (entity.getHealth() < entity.getMaxHealth()) { entity.heal(1.0F);