itemdb potion hack

This commit is contained in:
kepler155c
2018-11-14 14:22:43 -05:00
parent 1328fc233a
commit a460bc31f3

View File

@@ -115,25 +115,31 @@ function itemDB:add(baseItem)
nItem.maxCount = baseItem.maxCount nItem.maxCount = baseItem.maxCount
nItem.maxDamage = baseItem.maxDamage nItem.maxDamage = baseItem.maxDamage
for k,item in pairs(self.data) do -- potions can have the same damage, diff nbts, but same names
if nItem.name == item.name and -- ie. potion of healing, potion of healing II
nItem.displayName == item.displayName then -- both show as "Potion of Healing"
if nItem.nbtHash ~= item.nbtHash and nItem.damage ~= item.damage then if nItem.name ~= 'minecraft:potion' --[[ HACK ]] then
nItem.damage = '*' for k,item in pairs(self.data) do
nItem.nbtHash = nil if nItem.name == item.name and
nItem.ignoreNBT = true nItem.displayName == item.displayName then
self.data[k] = nil
break if nItem.nbtHash ~= item.nbtHash and nItem.damage ~= item.damage then
elseif nItem.damage ~= item.damage then nItem.damage = '*'
nItem.damage = '*' nItem.nbtHash = nil
self.data[k] = nil nItem.ignoreNBT = true
break self.data[k] = nil
elseif nItem.nbtHash ~= item.nbtHash then break
nItem.nbtHash = nil elseif nItem.damage ~= item.damage then
nItem.ignoreNBT = true nItem.damage = '*'
self.data[k] = nil self.data[k] = nil
break break
elseif nItem.nbtHash ~= item.nbtHash then
nItem.nbtHash = nil
nItem.ignoreNBT = true
self.data[k] = nil
break
end
end end
end end
end end