Build the tool correctly for rendering in the book.
@@ -35,6 +35,7 @@ import slimeknights.tconstruct.library.materials.stats.MaterialStatsId;
import slimeknights.tconstruct.library.modifiers.Modifier;
import slimeknights.tconstruct.library.modifiers.ModifierEntry;
import slimeknights.tconstruct.library.tools.IToolPart;
+import slimeknights.tconstruct.library.tools.ToolBuildHandler;
import slimeknights.tconstruct.library.tools.item.ToolCore;
import slimeknights.tconstruct.library.tools.nbt.MaterialIdNBT;
import slimeknights.tconstruct.smeltery.TinkerSmeltery;
@@ -223,15 +224,15 @@ public class ContentMaterial extends TinkerPage {
for (Item tool : TinkerTags.Items.MULTIPART_TOOL.getAllElements()) {
if (tool instanceof ToolCore) {
List<IToolPart> requirements = ((ToolCore) tool).getToolDefinition().getRequiredComponents();
- int size = requirements.size();
- List<MaterialId> toolMaterials = new ArrayList<>(size);
+ List<IMaterial> materials = new ArrayList<>(requirements.size());
for (int i = 0; i < requirements.size(); i++) {
- toolMaterials.add(i, materialId);
+ materials.add(i, MaterialRegistry.getInstance().getMaterial(materialId));
}
- ItemStack stack = new MaterialIdNBT(toolMaterials).updateStack(new ItemStack(tool));
- displayTools.add(new TinkerItemElement(stack));
+ ItemStack display = ToolBuildHandler.buildItemFromMaterials((ToolCore) tool, materials);
+
+ displayTools.add(new TinkerItemElement(display));
if (displayTools.size() == 9) {
break;
