Skip to content

Commit

Permalink
Attempt to fix tools from addon materials (GregTechCEu#2585)
Browse files Browse the repository at this point in the history
  • Loading branch information
ALongStringOfNumbers authored Sep 19, 2024
1 parent e62a382 commit 11f752a
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/main/java/gregtech/api/items/toolitem/ToolHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@
import gregtech.tools.enchants.EnchantmentHardHammer;

import net.minecraft.advancements.CriteriaTriggers;
import net.minecraft.block.*;
import net.minecraft.block.Block;
import net.minecraft.block.BlockCommandBlock;
import net.minecraft.block.BlockLiquid;
import net.minecraft.block.BlockPane;
import net.minecraft.block.BlockRailBase;
import net.minecraft.block.BlockStructure;
import net.minecraft.block.BlockWeb;
import net.minecraft.block.state.IBlockState;
import net.minecraft.enchantment.EnchantmentDurability;
import net.minecraft.enchantment.EnchantmentHelper;
Expand Down Expand Up @@ -57,7 +63,11 @@
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.reflect.Method;
import java.util.*;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
import java.util.Set;
import java.util.function.Supplier;

import static gregtech.api.GTValues.LV;
Expand Down Expand Up @@ -196,7 +206,7 @@ public static ItemStack getAndSetToolData(IGTTool tool, Material material, int m
ItemStack stack = tool.getRaw();
GTUtility.getOrCreateNbtCompound(stack).setInteger(HIDE_FLAGS, 2);
NBTTagCompound toolTag = getToolTag(stack);
toolTag.setString(MATERIAL_KEY, material.toString());
toolTag.setString(MATERIAL_KEY, material.getRegistryName());
toolTag.setInteger(MAX_DURABILITY_KEY, maxDurability);
toolTag.setInteger(HARVEST_LEVEL_KEY, harvestLevel);
toolTag.setFloat(TOOL_SPEED_KEY, toolSpeed);
Expand Down

0 comments on commit 11f752a

Please sign in to comment.