MCPcopy Create free account
hub / github.com/cuberite/cuberite / Feed

Method Feed

src/Entities/Player.cpp:536–548  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

534
535
536bool cPlayer::Feed(int a_Food, double a_Saturation)
537{
538 if (m_FoodLevel >= MAX_FOOD_LEVEL)
539 {
540 return false;
541 }
542
543 m_FoodLevel = std::min(a_Food + m_FoodLevel, (int)MAX_FOOD_LEVEL);
544 m_FoodSaturationLevel = std::min(m_FoodSaturationLevel + a_Saturation, (double)m_FoodLevel);
545
546 SendHealth();
547 return true;
548}
549
550
551

Callers 2

OnUseMethod · 0.80
EatItemMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected