mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-24 11:36:11 +01:00
Fixed feed-delay flag
This commit is contained in:
parent
5856b002df
commit
944539453e
@ -167,9 +167,11 @@ private void processFeed(ApplicableRegionSet applicable, Player player,
|
|||||||
|
|
||||||
if (feedDelay <= 0) {
|
if (feedDelay <= 0) {
|
||||||
player.setFoodLevel(feedAmount > 0 ? maxHunger : minHunger);
|
player.setFoodLevel(feedAmount > 0 ? maxHunger : minHunger);
|
||||||
|
state.lastFeed = now;
|
||||||
} else if (now - state.lastFeed > feedDelay * 1000) {
|
} else if (now - state.lastFeed > feedDelay * 1000) {
|
||||||
// clamp health between minimum and maximum
|
// clamp health between minimum and maximum
|
||||||
player.setFoodLevel(Math.min(maxHunger, Math.max(minHunger, player.getFoodLevel() + feedAmount)));
|
player.setFoodLevel(Math.min(maxHunger, Math.max(minHunger, player.getFoodLevel() + feedAmount)));
|
||||||
|
state.lastFeed = now;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user