fix: fixed diamond socketed tools being able to do all block interactions
@@ -37,6 +37,7 @@ import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.common.ForgeMod;
import net.minecraftforge.common.ToolType;
import net.minecraftforge.event.entity.player.CriticalHitEvent;
+import se.mickelus.tetra.module.data.ToolData;
import se.mickelus.tetra.properties.AttributeHelper;
import se.mickelus.tetra.util.NBTHelper;
import se.mickelus.tetra.ToolTypes;
@@ -203,7 +204,9 @@ public class ItemModularHandheld extends ModularItem {
boolean canChannel = getUseDuration(itemStack) > 0;
if (!canChannel || player.isCrouching()) {
- for (ToolType tool: getToolDataCached(itemStack).getValues()) {
+ ToolData toolData = getToolDataCached(itemStack);
+ for (ToolType tool: toolData.getValues()) {
+ if (toolData.getLevel(tool) > 0) {
BlockState block = blockState.getToolModifiedState(world, pos, context.getPlayer(), context.getItem(), tool);
if (block != null) {
SoundEvent sound = Optional.ofNullable(getUseSound(tool))
@@ -219,6 +222,7 @@ public class ItemModularHandheld extends ModularItem {
return ActionResultType.func_233537_a_(world.isRemote);
}
}
+ }
int denailingLevel = getEffectLevel(itemStack, ItemEffect.denailing);
if (denailingLevel > 0 && player.getCooledAttackStrength(0) > 0.9) {
