Amethyst Imbuement

Amethyst Imbuement

2M Downloads

No support for multiple outputs

Laifsyn opened this issue ยท 17 comments

commented

You could also call it no support for polymorph
image
image

commented

the "title" in imbuing recipes actually doesn't do anything at the moment. I just didn't feel like going through every single existing recipe and deleting it. That recipe format was one of the first things I implemented, so it's definitely a little messy.

commented

Can you give formatting to title? Like Purple underlined Title

commented

Oh. I think Notepad++'s RegEx "Replace in all opened Documents" should be able to do the work.

\n.*title.*,\r
commented

On latest news, I managed to script your datapack format with CraftTweaker ๐Ÿ‘Œ

commented

image

public function amethystImbuement(recipeName as string, MainIngredient as IIngredient, Output as IItemStack, Ingredients as IIngredient[][], 
    Cost as int = 5, 
    Imbuements as IIngredient[] = [<item:minecraft:air>] ) as void {
  var LetterMap=["A","B","C","D","E","F","G","H","I"] as string[];
  var Count = 0 as int;
  var MyInputMap = {
    "type": "amethyst_imbuement:imbuing",
    "cost": Cost,
    "resultA": Output.registryName,
    "countA": Output.amount,
    "craftE":  MainIngredient
  } as MapData ;
  for index in 0 .. Ingredients.length{
      for subIndex in 0 .. Ingredients[index].length{
          if !((Ingredients[index][subIndex] as IItemStack) == <item:minecraft:air> || (Ingredients[index][subIndex] as IItemStack) == IIngredientEmpty.getInstance()){
              MyInputMap.put("craft" + LetterMap[Count], Ingredients[index][subIndex] as IData);
              // println("My Ingredient craft" + LetterMap[Count]+": " + (Ingredients[index][subIndex] as IData).asString());
              }
          Count++;
          }
      Count = (index as int * 3) + 3;
  }
  // println("First Craft Map " + MyInputMap.asString());
  // println(((Imbuements.length as int) == 1) as string);
  // println((Imbuements[0] == <item:minecraft:air>) as string);
  if !((Imbuements.length as int) == 1 && Imbuements[0] == <item:minecraft:air>){
      Count=0;
      // if Count == 0 {println("Count is indeed 0");}
      for index in 0 .. Imbuements.length{
        if !(Imbuements[index] == <item:minecraft:air>){
          MyInputMap.put("imbue" + LetterMap[Count], Imbuements[index] as IData);}
          // println("My Ingredient imbue" + LetterMap[Count]+": " + (Imbuements[index]as IData).asString());
          Count++;
      }}
  // println("Second Craft Map " + MyInputMap.asString());

  <recipetype:amethyst_imbuement:imbuing_recipe>.addJsonRecipe(recipeName , MyInputMap);
}

amethystImbuement("my_recipe_test_for_amethyst", <item:minecraft:obsidian>.withTag({Enchantments: [{id: "minecraft:sharpness" as string, lvl: 5 as short}]}), <item:minecraft:torch>*50, [[<item:minecraft:torch>],[<item:minecraft:torch>, C.air, <item:minecraft:torch>]],10,[<item:minecraft:air>,<item:minecraft:air>,<item:minecraft:coal>, <item:minecraft:torch>]);
commented

Is this support you actually need? None of the mods recipes naturally conflict. If recipes are being added via datapack or something, they can also be made to not conflict.

I don't think I can integrate with Polymorph, as the Imbuing Table isn't actually a crafting table in that way. I could make some sort of list appear in the enchanting window if there are multiple results, but that might take some time.

As to "unintuitive", I assume you mean because the button doesn't plainly spell out what the result will be? Like
image
instead of "Result: 8x Bottle-o'-enchanting"?

commented

Or we might also be able to call it unintuitive recipe output

commented

implementing a list for multiple recipes is a good idea, just will take some work. And if I'm implementing a list, I'll need to make the output clearer so you know what the difference between 8 and 20 candles is. NBT crafting is currently not supported. I assume you mean something like the concept json snip below?:
image

where the Table applies the values and keys given in that nbtA array to the result stack

commented

Yes, but calling it unintuitive might be too much.
I was expecting more possible outcomes because of the list-like display; like You will get 8 candles if you spend 3 levels, but you can get 20 candles if you spend even more(It's solved if you get to implement the list though)

commented

Btw, does output support nbt?
I was using CraftTweaker to script your recipe

commented

Actually, IIRC, most common formatting is would be like this below

"resultA" : {
    "item"  : "minecraft:diamond_sword", 
    "count" : 20, 
    "nbt"   : { "Damage":0,
                "Enchantments":[
                    {
                    "id":"minecraft:sharpness",
                    "lvl":5
                    }
                ]                    
            }
    }

But It's the format that CT is giving. I have no foolproof way to be sure that Vanilla is using this same syntax
image

Edit2: Just for reference, this is the unedited format of CraftTweaker:

{type: "crafttweaker:partial_tag" as string, item: "minecraft:diamond_sword" as string, nbt: "{Damage:0,Enchantments:[{id:\"minecraft:sharpness\",lvl:5s}]}" as string, count: 1 as int}
commented

The .html is fine for me.

commented

CraftTweaker is just using Minecrafts standard string form of NBT (like you would use with the "setblock" or similar command in-game). That would be easy enough to implement, as MC has a built-in String NBT Reader for the commands etc.

The json for that would just be one line of

"nbt": "{Damage:0,Enchantments:[{id:\"minecraft:sharpness\",lvl:5s}]}"
commented

BTW, are you building up a modpack? Seems like it with all this recipe stuff and mod conflicts and the like you've sent to me today.

commented

Public modpack, not really. But how would you like your credits be shown as? assuming that the modlist.html file that appears in the export zip wouldn't be enough for you.

I could add a ShiftTooltip to all your items(Except books cuz I want to keep it for enchantment details) where I write "By fzzyhmstrs" if I decide to publicly publish the modpack with your mod
image

commented

Progress on the issues discussed above. Working through some other issues you and others have opened, so will still be a bit, but looking pretty good in my eyes:

Enchanting works as it did:
image

Augmenting now shows the augment name:
image

And multi-recipe support is working. The next/previous recipe buttons move you through the list if there are >3 recipes (I have 4 example candle recipes here).
image

image

commented

New versions are out with the above improvement in Imbuing Table GUI applied. Closing this as multi-crafting is now possible.