diff --git a/Minecraft.Client/Gui.cpp b/Minecraft.Client/Gui.cpp index bda47430..7c681d0d 100644 --- a/Minecraft.Client/Gui.cpp +++ b/Minecraft.Client/Gui.cpp @@ -353,7 +353,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) if (minecraft->player->invulnerableTime < 10) blink = false; int iHealth = minecraft->player->getHealth(); int iLastHealth = minecraft->player->lastHealth; - random->setSeed(tickCount * 312871); + //random->setSeed(tickCount * 312871); if (EnderDragonRenderer::bossInstance != NULL) { diff --git a/Minecraft.World/CakeTile.cpp b/Minecraft.World/CakeTile.cpp index 1254e10e..c15f9fa1 100644 --- a/Minecraft.World/CakeTile.cpp +++ b/Minecraft.World/CakeTile.cpp @@ -98,20 +98,7 @@ void CakeTile::attack(Level *level, int x, int y, int z, shared_ptr play void CakeTile::eat(Level *level, int x, int y, int z, shared_ptr player) { - if (player->canEat(false)) - { - player->getFoodData()->eat(2, FoodConstants::FOOD_SATURATION_POOR); - - int d = level->getData(x, y, z) + 1; - if (d >= 6) - { - level->setTile(x, y, z, 0); - } else - { - level->setData(x, y, z, d); - level->setTileDirty(x, y, z); - } - } + player->heal(1.5); } bool CakeTile::mayPlace(Level *level, int x, int y, int z) diff --git a/Minecraft.World/FoodData.cpp b/Minecraft.World/FoodData.cpp index 79ef0fc1..1f0921ac 100644 --- a/Minecraft.World/FoodData.cpp +++ b/Minecraft.World/FoodData.cpp @@ -24,9 +24,36 @@ void FoodData::eat(int food, float saturationModifier) saturationLevel = min(saturationLevel + (float) food * saturationModifier * 2.0f, (float)foodLevel); } -void FoodData::eat(FoodItem *item) +void FoodData::eat(FoodItem *item, shared_ptr player) { - eat(item->getNutrition(), item->getSaturationModifier()); + if(item->apple_gold) + { + player->heal(10); + } + else if(item->mushroomStew) + { + player->heal(5); + } + else if (item->porkChop_cooked) + { + player->heal(4); + } + else if(item->bread || item->fish_cooked) + { + player->heal(2.5); + } + else if(item->porkChop_raw) + { + player->heal(1.5); + } + else if(item->fish_raw) + { + player->heal(1); + } + else if(item->cookie) + { + player->heal(0.5); + } } void FoodData::tick(shared_ptr player) diff --git a/Minecraft.World/FoodData.h b/Minecraft.World/FoodData.h index 3416a44a..17f807df 100644 --- a/Minecraft.World/FoodData.h +++ b/Minecraft.World/FoodData.h @@ -18,7 +18,7 @@ public: FoodData(); void eat(int food, float saturationModifier); - void eat(FoodItem *item); + void eat(FoodItem *item, shared_ptr player); void tick(shared_ptr player); void readAdditionalSaveData(CompoundTag *entityTag); void addAdditonalSaveData(CompoundTag *entityTag); diff --git a/Minecraft.World/FoodItem.cpp b/Minecraft.World/FoodItem.cpp index f5304cb9..e516bdaa 100644 --- a/Minecraft.World/FoodItem.cpp +++ b/Minecraft.World/FoodItem.cpp @@ -36,7 +36,7 @@ FoodItem::FoodItem(int id, int nutrition, bool isMeat) shared_ptr FoodItem::useTimeDepleted(shared_ptr instance, Level *level, shared_ptr player) { instance->count--; - player->getFoodData()->eat(this); + player->getFoodData()->eat(this, player); // 4J - new sound brought forward from 1.2.3 level->playSound(player, eSoundType_RANDOM_BURP, 0.5f, level->random->nextFloat() * 0.1f + 0.9f); diff --git a/Minecraft.World/Player.cpp b/Minecraft.World/Player.cpp index e5aa7765..59b60a91 100644 --- a/Minecraft.World/Player.cpp +++ b/Minecraft.World/Player.cpp @@ -2345,7 +2345,8 @@ FoodData *Player::getFoodData() bool Player::canEat(bool magicalItem) { - return (magicalItem || foodData.needsFood()) && !abilities.invulnerable && !hasInvulnerablePrivilege(); + //return (magicalItem || foodData.needsFood()) && !abilities.invulnerable && !hasInvulnerablePrivilege(); + return true; } bool Player::isHurt() diff --git a/README.md b/README.md index a6703e4c..fa15daf2 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Bringing the October 10th 2014 Source Leak back down to TU0 - [ ] Trading ## Added Features -- [ ] Eat to Instantly Heal +- [x] Eat to Heal - [x] Punching Sheep for wool ## Removed Structures