07-11-2012, 02:43 PM
I'm working on something where I have to load some text from a file, parse it, and then insert that parsed text as code into an array.
For example, here's what the relevant part of my file might look like:
Here's what I need the array to look like:
Here's what I would be getting with my current code:
How do I convert those strings into plain codetext? Is it even possible?
For example, here's what the relevant part of my file might look like:
Code:
Recipe: new ItemStack(Item.paper, 1, 0); new ItemStack(Item.dyePowder, 1, 5);
Here's what I need the array to look like:
Code:
ItemStack[] testRecipe = ItemStack[]{new ItemStack(Item.paper, 1, 0), new ItemStack(Item.dyePowder, 1, 5)};
Here's what I would be getting with my current code:
Code:
ItemStack[] testRecipe = ItemStack[]{"new ItemStack(Item.paper, 1, 0)", "new ItemStack(Item.dyePowder, 1, 5)"};
How do I convert those strings into plain codetext? Is it even possible?