summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins/Core/oncraftingnorecipe.lua
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-01-13 12:10:26 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-01-13 12:10:26 +0100
commit752057fb1b3a71058b5391bde9b0e21d87196539 (patch)
treecfeb16a291ce13dc8408a82459224f029f56cd2f /MCServer/Plugins/Core/oncraftingnorecipe.lua
parentMerged branch "branches/hooks" into "trunk". (diff)
downloadcuberite-752057fb1b3a71058b5391bde9b0e21d87196539.tar
cuberite-752057fb1b3a71058b5391bde9b0e21d87196539.tar.gz
cuberite-752057fb1b3a71058b5391bde9b0e21d87196539.tar.bz2
cuberite-752057fb1b3a71058b5391bde9b0e21d87196539.tar.lz
cuberite-752057fb1b3a71058b5391bde9b0e21d87196539.tar.xz
cuberite-752057fb1b3a71058b5391bde9b0e21d87196539.tar.zst
cuberite-752057fb1b3a71058b5391bde9b0e21d87196539.zip
Diffstat (limited to 'MCServer/Plugins/Core/oncraftingnorecipe.lua')
-rw-r--r--MCServer/Plugins/Core/oncraftingnorecipe.lua14
1 files changed, 7 insertions, 7 deletions
diff --git a/MCServer/Plugins/Core/oncraftingnorecipe.lua b/MCServer/Plugins/Core/oncraftingnorecipe.lua
index 2006e410f..b6909d672 100644
--- a/MCServer/Plugins/Core/oncraftingnorecipe.lua
+++ b/MCServer/Plugins/Core/oncraftingnorecipe.lua
@@ -16,7 +16,7 @@ function OnCraftingNoRecipe(Player, Grid, Recipe)
for x = 0, Grid:GetWidth() - 1 do
for y = 0, Grid:GetHeight() - 1 do
local Item = Grid:GetItem(x, y)
- if (Item.m_ItemID ~= E_ITEM_EMPTY) then
+ if (Item.m_ItemType ~= E_ITEM_EMPTY) then
table.insert(Items, Item)
end
end
@@ -27,23 +27,23 @@ function OnCraftingNoRecipe(Player, Grid, Recipe)
return false
end
- if (Items[1].m_ItemID ~= Items[2].m_ItemID) then
+ if (Items[1].m_ItemType ~= Items[2].m_ItemType) then
-- Only items of the same type may be fixed
return false
end
if (
- (Items[1].m_ItemHealth == 0) or
- (Items[2].m_ItemHealth == 0)
+ (Items[1].m_ItemDamage == 0) or
+ (Items[2].m_ItemDamage == 0)
)
then
-- Only damaged items may be fixed
return false
end
- local _ID = Items[1].m_ItemID
- local _least_hp = math.max(Items[1].m_ItemHealth, Items[2].m_ItemHealth)
- local _most_hp = math.min(Items[1].m_ItemHealth, Items[2].m_ItemHealth)
+ local _ID = Items[1].m_ItemType
+ local _least_hp = math.max(Items[1].m_ItemDamage, Items[2].m_ItemDamage)
+ local _most_hp = math.min(Items[1].m_ItemDamage, Items[2].m_ItemDamage)
local _item_hp = 0
-- TODO: This could be refactored into better code, using an _ID-indexed table for _item_hp