From 883f622415b258779ae59a22abdb38cca70a5128 Mon Sep 17 00:00:00 2001 From: arsenicviscera Date: Wed, 11 Mar 2026 20:36:54 -0700 Subject: [PATCH] Added Quick Regen --- Minecraft.World/Player.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/Minecraft.World/Player.cpp b/Minecraft.World/Player.cpp index 00c7148e4..0750d1110 100644 --- a/Minecraft.World/Player.cpp +++ b/Minecraft.World/Player.cpp @@ -1001,9 +1001,23 @@ void Player::aiStep() { if (jumpTriggerTime > 0) jumpTriggerTime--; - if (level->difficulty == Difficulty::PEACEFUL && getHealth() < getMaxHealth() && level->getGameRules()->getBoolean(GameRules::RULE_NATURAL_REGENERATION)) - { - if (tickCount % 20 * 12 == 0) heal(1); + if (level->getGameRules()->getBoolean(GameRules::RULE_NATURAL_REGENERATION)) { + bool health_OK = getHealth() < getMaxHealth(); + if ((tickCount % 12 == 0) && health_OK) { + + + + FoodData* fd = getFoodData(); + if ((level->difficulty == Difficulty::PEACEFUL)) { + heal(1); + } + //Quick-Regen from saturation (must have 8 1/2 hunger and have at least 3 saturation) + else if (fd->getSaturationLevel() > 3 && fd->getFoodLevel() >= 17) { + heal(1); + fd->setSaturation(fd->getSaturationLevel() - 3); + } + + }; } inventory->tick(); oBob = bob;