Display a helpful message stating the outputs for legacy patterns

This commit is contained in:
Raoul Van den Berge
2016-09-03 17:19:50 +02:00
parent 43f33ad3d9
commit 647b5ea163

View File

@@ -50,6 +50,27 @@ public class ItemPattern extends ItemBase implements ICraftingPatternProvider {
combineItems(tooltip, true, Iterables.toArray(pattern.getOutputs(), ItemStack.class)); combineItems(tooltip, true, Iterables.toArray(pattern.getOutputs(), ItemStack.class));
} else { } else {
tooltip.add(TextFormatting.RED + I18n.format("misc.refinedstorage:pattern.invalid") + TextFormatting.RESET); tooltip.add(TextFormatting.RED + I18n.format("misc.refinedstorage:pattern.invalid") + TextFormatting.RESET);
// Display a helpful message stating the outputs if this is a legacy pattern
if (stack.hasTagCompound() && stack.getTagCompound().hasKey("Inputs") && stack.getTagCompound().hasKey("Outputs")) {
tooltip.add(TextFormatting.WHITE + "This pattern is a legacy pattern made before RS 1.0, please re-make!" + TextFormatting.RESET);
tooltip.add("This pattern used to output:");
NBTTagList outputsTag = stack.getTagCompound().getTagList("Outputs", Constants.NBT.TAG_COMPOUND);
ItemStack[] outputs = new ItemStack[outputsTag.tagCount()];
for (int i = 0; i < outputsTag.tagCount(); ++i) {
outputs[i] = ItemStack.loadItemStackFromNBT(outputsTag.getCompoundTagAt(i));
}
combineItems(tooltip, true, outputs);
if (stack.getTagCompound().hasKey("Processing") && stack.getTagCompound().getBoolean("Processing")) {
tooltip.add(TextFormatting.GREEN + "This pattern was a processing pattern!" + TextFormatting.RESET);
}
}
} }
} }