Skip to content

1.12.2 CraftTweaker's scripts for fancy working with Crafting Table recipes

License

Notifications You must be signed in to change notification settings

Krutoy242/Craft.zs

Repository files navigation

Craft.zs

A ZenScript auxiliary scripts for quick recipe making.



Installation

Drop content of this repo into your Minecraft 1.12 scripts/craft/ folder.

Extended Crafting mod optional.

Usage

  1. Lay out your crafting recipes in an block inventory ( for example).
  2. 3x3 for intup, output on the right.
  3. Right-Click inventory with .
  4. Code generated in crafttweaker.log.

# [Piston] from [Copper Gear][+3]
craft.remake(<minecraft:piston> * 4, ["pretty",
  "# # #",
  "░ ¤ ░",
  "░ ♥ ░"], {
  "#": <ore:plankWood>,    # Oak Wood Planks
  "": <ore:cobblestone>,  # Cobblestone
  "¤": <ore:gearCopper>,   # Copper Gear
  "": <ore:dustRedstone>, # Redstone
});

# [Chest]*2 from [Oak Wood]
craft.remake(<minecraft:chest> * 2, ["pretty",
  "# # #",
  "#   #",
  "# # #"], {
  "#": <ore:logWood>, # Oak Wood
});

Usage Details

Lay out recipes

To lay out recipes you can use any 3x3 inventory (like Crafting Station from Tinker's Construct), or table of any tier from Extended Crafting:

In this case, put output in first player's slot.
You can lay out several recipes at once in Chest / Crate from other mods, imaginary devide GUI grid by 4x3 rectarangles.
List of valid inventories can be found in recipeInventory.zs.

Bone right-click

You must be in creative /gamemode 1 to use Bone.

Bone can be configured with NBT tags. See helper_jei.zs.

Shift+RightClick will merge inventory together, so they would use same items in recipes

val ingrs = {
  "p": <ore:pattern>,
  "": <ore:logWood>,
  "": <ore:stickWood>,
  "#": <ore:plankWood>,
  "w": <ore:workbench>
} as IIngredient[string];
  
craft.remake(<tconstruct:pattern> * 4, ["#≢", "≢#"], ingrs);
craft.remake(<tconstruct:tooltables:4>, ["###", "#p#", "###"], ingrs);
craft.remake(<thermalfoundation:upgrade:3>, ["## ", "##w"], ingrs);
craft.remake(<tconstruct:tooltables:1>, [" p", " #"], ingrs);
craft.remake(<conarm:armorstation>, [" p ", "pwp", " p "], ingrs);
craft.remake(<tconstruct:tooltables:2>, [" p", ""], ingrs);
craft.remake(<tconstruct:tooltables>, ["w"], ingrs);

Advanced Ingredients

Amount

The amount of each ingredient affects its representation:

  • 1 - Automatic replacement according to the ore dictionary (if not disabled by the style)
  • 2 - The item will be taken "as is"
  • 3 - Item will be Wildcarded

craft.remake(<minecraft:planks> * 30, [
  "≢#≠"], {
  "": <ore:logWood>,       // Any Wood Log
  "#": <forestry:logs.1:3>, // Sequoia Wood
  "": <forestry:logs.1:*>, // Wildcarded Logs
});

Catalysts

Large inventories with 4x3 grids have two free slots. Place special items there to change the logic of crafting:

  • - The recipe will be shapeless.
  • - Added removal of old recipes by name.

Additional Support

Out of the box, Craft.zs provide support for several modded crafting methods:

You can find how to use them here.

API

See Advanced API readme for using other functions.

Most common of them is using Grid - part of Craft.zs for generating arrays of ingredients.

Grid(["uw","wu"], {
  "w": <ore:plankTreatedWood>,
  "u": <ore:logWood>,
}).shaped();
// returns [
//   [<ore:logWood>, <ore:plankTreatedWood>],
//   [<ore:plankTreatedWood>, <ore:logWood>]
// ] as IIngredient[][]

Grid(["u  w  u"], {
  "w": <ore:plankTreatedWood>,
  "u": <ore:logWood>,
}).shapeless();
// returns [
//  <ore:logWood>, <ore:plankTreatedWood>, <ore:logWood>
// ] as IIngredient[]

About

1.12.2 CraftTweaker's scripts for fancy working with Crafting Table recipes

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published