Skip to content

Commit

Permalink
Fix accidental revert to changes in ContentMaterial
Browse files Browse the repository at this point in the history
  • Loading branch information
KnightMiner committed Apr 19, 2021
1 parent 82ea993 commit a0d74a0
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -218,23 +218,22 @@ private void addDisplayItems(ArrayList<BookElement> 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);
}

int y = 10;
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;
Expand Down

0 comments on commit a0d74a0

Please sign in to comment.