Bugfix: It was possible to add more than <maxamount> to redstone/lapis/... modifiers if they were exactly at a lvlup threshold

This commit is contained in:
Bernhard Bonigl committed 2014-07-30 13:31:13 +02:00
1 parent f6877b55cb
commit 527934d277
7 files changed
+22 -1

No files matched your search

@@ -28,14 +28,17 @@ public class ModRedstone extends ItemModTypeFilter
if (!validType(toolItem))
return false;
if(matchingAmount(input) > max)
return false;
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
if (!tags.hasKey(key))
return tags.getInteger("Modifiers") > 0 && matchingAmount(input) <= max;
int keyPair[] = tags.getIntArray(key);
if (keyPair[0] + matchingAmount(input) <= keyPair[1])
return true;
else if (keyPair[0] == keyPair[1])
return tags.getInteger("Modifiers") > 0;
}