keaft

Untitled

Apr 16th, 2024
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. recipes.addShaped("appliedenergistics2_network_cells_storage_cell_4k", null, [[<minecraft:redstone>,<appliedenergistics2:material:23>,<minecraft:redstone>],[<appliedenergistics2:material:35>,<appliedenergistics2:storage_cell_1k>.marked('onekitemcell'),<appliedenergistics2:material:35>],[<minecraft:redstone>,<appliedenergistics2:material:35>,<minecraft:redstone>]], function(out, ins, cInfo) {
  2. // This function occurs when the items are finished making what would be the script. Notice the output above is null.
  3. // Grab the nbt data of the input item marked above.
  4. var inTag = ins.onekitemcell.tag;
  5. // Grab the crafting inventory and write it to "inv"
  6. var inv = cInfo.inventory;
  7. // Write the output item with the nbt "inTag" from above.
  8. cInfo.inventory.setStack(4,<appliedenergistics2:storage_cell_4k>.withTag(inTag));
  9. // Loop through all the items in the crafting inventory and decrement by 1 until empty.
  10. for i in 0 to 9 {
  11. var totali = 0 as int;
  12. if (i != 4) {
  13. var itemcheck as IItemStack = inv.getStack(i);
  14. // print(itemcheck.name);
  15. if !isNull(itemcheck) {
  16. totali = itemcheck.amount;
  17. }
  18. // print(totali);
  19. if (totali <= 1) {
  20. inv.setStack(i,null);
  21. } else {
  22. totali -= 1;
  23. // print(totali);
  24. var newtotalitem as IItemStack = itemcheck * totali;
  25. inv.setStack(i,newtotalitem);
  26. }
  27. }
  28. }
  29. return null;
  30. }, null);
Advertisement
Add Comment
Please, Sign In to add comment