Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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) {
- // This function occurs when the items are finished making what would be the script. Notice the output above is null.
- // Grab the nbt data of the input item marked above.
- var inTag = ins.onekitemcell.tag;
- // Grab the crafting inventory and write it to "inv"
- var inv = cInfo.inventory;
- // Write the output item with the nbt "inTag" from above.
- cInfo.inventory.setStack(4,<appliedenergistics2:storage_cell_4k>.withTag(inTag));
- // Loop through all the items in the crafting inventory and decrement by 1 until empty.
- for i in 0 to 9 {
- var totali = 0 as int;
- if (i != 4) {
- var itemcheck as IItemStack = inv.getStack(i);
- // print(itemcheck.name);
- if !isNull(itemcheck) {
- totali = itemcheck.amount;
- }
- // print(totali);
- if (totali <= 1) {
- inv.setStack(i,null);
- } else {
- totali -= 1;
- // print(totali);
- var newtotalitem as IItemStack = itemcheck * totali;
- inv.setStack(i,newtotalitem);
- }
- }
- }
- return null;
- }, null);
Advertisement
Add Comment
Please, Sign In to add comment