From a0d74a02ab38d49a963ce3a7ffa96da35ff068f1 Mon Sep 17 00:00:00 2001 From: KnightMiner Date: Sun, 18 Apr 2021 22:20:51 -0400 Subject: [PATCH] Fix accidental revert to changes in ContentMaterial --- .../library/book/content/ContentMaterial.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/main/java/slimeknights/tconstruct/library/book/content/ContentMaterial.java b/src/main/java/slimeknights/tconstruct/library/book/content/ContentMaterial.java index 6ba23bd2578..f805ed0fc49 100644 --- a/src/main/java/slimeknights/tconstruct/library/book/content/ContentMaterial.java +++ b/src/main/java/slimeknights/tconstruct/library/book/content/ContentMaterial.java @@ -36,8 +36,8 @@ 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; import slimeknights.tconstruct.tables.TinkerTables; import slimeknights.tconstruct.tools.stats.ExtraMaterialStats; @@ -218,7 +218,7 @@ private void addDisplayItems(ArrayList list, int x, MaterialId mate ItemElement elementItem = new TinkerItemElement(0, 0, 1, stacks); String text = this.parent.translate("material.craft_casting"); Fluid fluid = material.get().getFluid(); - elementItem.tooltip = ImmutableList.of(new StringTextComponent(text).append(new TranslationTextComponent("fluid." + Objects.requireNonNull(fluid.getRegistryName()).getNamespace() + "." + Objects.requireNonNull(fluid.getRegistryName()).getPath()))); + elementItem.tooltip = ImmutableList.of(new StringTextComponent(text).appendString(" ").append(new TranslationTextComponent("fluid." + Objects.requireNonNull(fluid.getRegistryName()).getNamespace() + "." + Objects.requireNonNull(fluid.getRegistryName()).getPath()))); displayTools.add(elementItem); } @@ -226,15 +226,14 @@ private void addDisplayItems(ArrayList list, int x, MaterialId mate for (Item tool : TinkerTags.Items.MULTIPART_TOOL.getAllElements()) { if (tool instanceof ToolCore) { List requirements = ((ToolCore) tool).getToolDefinition().getRequiredComponents(); - int size = requirements.size(); - List toolMaterials = new ArrayList<>(size); + List 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;