Fix: Prevent broken tools from being able to create EFR stripped logs or dirt paths (#226)

This commit is contained in:
Pedro Ortiz Bledow authored and GitHub committed 2025-11-19 04:27:16 +00:00
1 parent 19118d7c26
commit 17a8936da7
1 file changed
+6 -1
@@ -98,7 +98,12 @@ public abstract class HarvestTool extends ToolCore {
public Set<String> getToolClasses(ItemStack stack) {
Set<String> set = new HashSet<>();
if (stack != null && stack.getItem() instanceof HarvestTool) {
if (stack != null && stack.hasTagCompound() && stack.getItem() instanceof HarvestTool) {
// Broken tools are not considered as valid for tool classes
NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool");
if (tags == null || tags.getBoolean("Broken")) return set;
set.add(((HarvestTool) stack.getItem()).getHarvestType());
}