Prevent broken tools from exposing tool classes

This commit is contained in:
Kynake Risk committed 2025-11-11 03:09:12 -03:00
1 parent c81d4cb1cc
commit 670fad7621
1 file changed
+5
@@ -99,6 +99,11 @@ public abstract class HarvestTool extends ToolCore {
Set<String> set = new HashSet<>();
if (stack != null && stack.getItem() instanceof HarvestTool) {
// Broken tools are not considered as valid for tool classes
NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool");
if (tags.getBoolean("Broken")) return set;
set.add(((HarvestTool) stack.getItem()).getHarvestType());
}