summaryrefslogtreecommitdiffstats
path: root/src/UI/SlotArea.cpp
diff options
context:
space:
mode:
authorLane Kolbly <lane@rscheme.org>2017-07-28 19:00:20 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2017-07-28 19:00:20 +0200
commit790e15f2e64badf62d9ba62421776c4ba0e771ed (patch)
treeb0e9c8a6100ae0b06847b7cbfaddf94586a4490e /src/UI/SlotArea.cpp
parentCheck for intersection between placed blocks and entities. (#3850) (diff)
downloadcuberite-790e15f2e64badf62d9ba62421776c4ba0e771ed.tar
cuberite-790e15f2e64badf62d9ba62421776c4ba0e771ed.tar.gz
cuberite-790e15f2e64badf62d9ba62421776c4ba0e771ed.tar.bz2
cuberite-790e15f2e64badf62d9ba62421776c4ba0e771ed.tar.lz
cuberite-790e15f2e64badf62d9ba62421776c4ba0e771ed.tar.xz
cuberite-790e15f2e64badf62d9ba62421776c4ba0e771ed.tar.zst
cuberite-790e15f2e64badf62d9ba62421776c4ba0e771ed.zip
Diffstat (limited to 'src/UI/SlotArea.cpp')
-rw-r--r--src/UI/SlotArea.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/UI/SlotArea.cpp b/src/UI/SlotArea.cpp
index 24c9bfb03..3729e8dc3 100644
--- a/src/UI/SlotArea.cpp
+++ b/src/UI/SlotArea.cpp
@@ -730,7 +730,6 @@ void cSlotAreaCrafting::UpdateRecipe(cPlayer & a_Player)
cCraftingRecipe & Recipe = GetRecipeForPlayer(a_Player);
cRoot::Get()->GetCraftingRecipes()->GetRecipe(a_Player, Grid, Recipe);
SetSlot(0, a_Player, Recipe.GetResult());
- m_ParentWindow.SendSlot(a_Player, this, 0);
}
@@ -1136,7 +1135,9 @@ void cSlotAreaAnvil::UpdateResult(cPlayer & a_Player)
}
}
- // TODO: Add enchantments.
+ // Add the enchantments from the sacrifice to the target
+ int EnchantmentCost = Input.AddEnchantmentsFromItem(SecondInput);
+ NeedExp += EnchantmentCost;
}
}
@@ -1166,8 +1167,6 @@ void cSlotAreaAnvil::UpdateResult(cPlayer & a_Player)
Input.m_CustomName = RepairedItemName;
}
- // TODO: Add enchantment exp cost.
-
m_MaximumCost = RepairCost + NeedExp;
if (NeedExp < 0)
@@ -2522,6 +2521,8 @@ void cSlotAreaTemporary::SetSlot(int a_SlotNum, cPlayer & a_Player, const cItem
}
itr->second[static_cast<size_t>(a_SlotNum)] = a_Item;
+
+ m_ParentWindow.SendSlot(a_Player, this, a_SlotNum);
}