06-03-2012, 07:30 PM
The Eye of Ender has 6 possibilities, if coded right (use a 2x2 grid only). Still, that's too much.
Now that I've seen the code for the parser, I'm inclined to rewrite it from scratch. So we can adjust the recipe syntax to whatever we want.
My personal favorite is this:
Examples:
Compare with the old definition of TNT:
The grid size doesn't matter anymore, since the parser will automatically bound the recipe to correct grid size.
Is anyone against this new syntax? Does anyone see any potential flaws? If I rewrote the recipe parser, would anyone be kind enough to rewrite the current recipes.txt to match this format?
Now that I've seen the code for the parser, I'm inclined to rewrite it from scratch. So we can adjust the recipe syntax to whatever we want.
My personal favorite is this:
Code:
<Line> = <Recipe>#<Comment>
<Recipe> = <Ingredient1> | <Ingredient2> | ... | <IngredientN> | <Result>
<IngredientN> = <ItemID>, <X1> : <Y1>, <X2> : <Y2>, ..., <Xn> : <Yn>
<ItemID> = <ItemType> [^DamageValue]
<Xn>, <Yn> = "1" .. "3", or "*" for any value (-> shapeless)
<Result> = <ItemType> [^DamageValue] [, <Count>]
ItemType may be a number or an item name (resolved through items.ini).
Examples:
Code:
#Eye of Ender:
EnderPearl, *:* | Blaze powder, *:* | EyeOfEnder
#Stone hoe:
Stick, 2:2, 2:3, Cobblestone: 2:1, *:1 | StoneHoe
# The stone ingredient says one stone has to be at 2:1 and one more has to be anywhere in the top row
#Red wool:
Wool, *:* | Dye^1, *:* | Wool^14
#Sticks:
Planks, *:* | Stick, 4
#TNT:
Gunpowder, 1:1, 3:1, 2:2, 3:1, 3:3 | Sand, 2:1, 1:2, 3:2, 2:3 | TNT
Compare with the old definition of TNT:
Code:
3x3,1:1:289:1,3:1:289:1,2:2:289:1,1:3:289:1,3:3:289:1,2:1:12:1,1:2:12:1,3:2:12:1,2:3:12:1@46:1 # -> TNT
The grid size doesn't matter anymore, since the parser will automatically bound the recipe to correct grid size.
Is anyone against this new syntax? Does anyone see any potential flaws? If I rewrote the recipe parser, would anyone be kind enough to rewrite the current recipes.txt to match this format?