mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-19 03:49:29 +00:00
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:
1 parent
f6877b55cb
commit
527934d277
7 files changed
+22
-1
No files matched your search
@@ -24,6 +24,9 @@ public class ModAntiSpider extends ItemModTypeFilter
|
||||
if (!tags.hasKey(key))
|
||||
return tags.getInteger("Modifiers") > 0 && matchingAmount(input) <= max;
|
||||
|
||||
if(matchingAmount(input) > max)
|
||||
return false;
|
||||
|
||||
int keyPair[] = tags.getIntArray(key);
|
||||
if (keyPair[0] + matchingAmount(input) <= keyPair[1])
|
||||
return true;
|
||||
|
||||
@@ -45,6 +45,9 @@ public class ModAttack extends ItemModTypeFilter
|
||||
if (!validType(toolItem))
|
||||
return false;
|
||||
|
||||
if(matchingAmount(input) > max)
|
||||
return false;
|
||||
|
||||
NBTTagCompound tags = tool.getTagCompound().getCompoundTag(toolItem.getBaseTagName());
|
||||
if (!tags.hasKey(key))
|
||||
return tags.getInteger("Modifiers") > 0 && matchingAmount(input) <= max;
|
||||
|
||||
@@ -28,6 +28,9 @@ public class ModBlaze 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;
|
||||
|
||||
@@ -33,6 +33,9 @@ public class ModLapis extends ItemModTypeFilter
|
||||
if (!validType(toolItem))
|
||||
return false;
|
||||
|
||||
if(matchingAmount(input) > max)
|
||||
return false;
|
||||
|
||||
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
|
||||
|
||||
if (tags.getBoolean("Silk Touch"))
|
||||
|
||||
@@ -29,6 +29,9 @@ public class ModPiston 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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,9 @@ public class ModSmite extends ItemModTypeFilter
|
||||
@Override
|
||||
protected boolean canModify (ItemStack tool, ItemStack[] input)
|
||||
{
|
||||
if(matchingAmount(input) > max)
|
||||
return false;
|
||||
|
||||
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
|
||||
if (!tags.hasKey(key))
|
||||
return tags.getInteger("Modifiers") > 0 && matchingAmount(input) <= max;
|
||||
|
||||
Reference in new issue
Block a user