mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-08-20 09:57:09 +00:00
Added Quick Regen
This commit is contained in:
parent
1036b7368e
commit
883f622415
|
|
@ -1001,9 +1001,23 @@ void Player::aiStep()
|
||||||
{
|
{
|
||||||
if (jumpTriggerTime > 0) jumpTriggerTime--;
|
if (jumpTriggerTime > 0) jumpTriggerTime--;
|
||||||
|
|
||||||
if (level->difficulty == Difficulty::PEACEFUL && getHealth() < getMaxHealth() && level->getGameRules()->getBoolean(GameRules::RULE_NATURAL_REGENERATION))
|
if (level->getGameRules()->getBoolean(GameRules::RULE_NATURAL_REGENERATION)) {
|
||||||
{
|
bool health_OK = getHealth() < getMaxHealth();
|
||||||
if (tickCount % 20 * 12 == 0) heal(1);
|
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();
|
inventory->tick();
|
||||||
oBob = bob;
|
oBob = bob;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue