Modular Machinery

Modular Machinery

12M Downloads

[Suggestion] Tooltip Array

Opened this issue ยท 2 comments

commented

I know the localizedname are the first line tooltip but for some people like me, i want to give some hint like what it required to work before looting it via jei but, if i use the crafttweaker addTooltip with this command:

var item = <modularmachinery:itemblueprint>.withTag({
	dynamicmachine: {
		modularmachinery:new_machine_with_name
	}
});

item.addTooltip("Single " + format.green("Input/Output"));
item.addTooltip("Require: " + format.red("Lava"));

it just throw nullpointerexception, so i think you add the nbt at the very end of loading (after crafttweaker so :x )
adding a Tooltip Array (with maybe a color value ?) would be great :)
an example:

"registryname": "new_machine_with_name",
"localizedname": "Test Machine",
"requires-blueprint": true,
"color": "FFFFFF",
"tooltip": [
      "first_line",
      "second_line",
      "etc.."
],

or with color:

"tooltip": [
      {
            "text": "first_line",
            "format": "green"
      },
      {
            "text": "second_line",
            "format": "red"
      }
],

thank for your great mods, i hope you will accept this new feature :)
PS: I tested without withTag and it give the tooltip to all blueprint :'(

commented

Hi HellFirePvP,
I wanted to contribute to this repository instead of waiting since i want to create a modpack, there the result:
tooltip_color
in the same session without jei script:
tooltip_array
another blueprint (without tooltip array):
tooltip_normal
the json:
tooltip_json
there the code: Tooltip Array Git
i'm not that skilled in java optimisation so if you have some think you want me to fix, you can send a message here with the lign to fix and... the fix xD

PS: i will maybe add a {} in the text to set the color only in that, add a "sameLign": true and "localizedname_rarity": "TextFormattingColorHere" before pushing a pullrequest :)

commented

Added @ Delimiter, an Example:
tooltip_with@delimiter
test 3 have this:
tooltip_with@delimiter_json
Only one @ is allowed, if you can upgrade it to something more advanced, im opened to suggestion :)