I'm trying to force the players to use the tinkersConstruct smelter for making blocks, ingots and nuggets for all metals, by removing the regular 3x3 recipes.
I havent found a mod or script that would accomplish this, so if there is, please tell me.
I was thinking of using a MineTweakerScript to check all oreDict entries for (string)"nugget", since there are a lot of non-metal blocks and even a few non-metal ingot entries in my modpack's oreDict, but the nuggets seem to be fine.
Then search for the recipes that have the nugget as output, and repeat for the recipes of ingot to block.
I am using the "UniDict" mod, and i dont know exactly what it does(in technical lingo) or if this mod acts before or after Minetweaker, which might be an issue.
System.out.println("number of nuggets: "+iNuggets)
System.out.println("number of ingots: "+iIngots)
System.out.println("number of blocks: "+iBlocks)
Thats what i managed to cobble together by searchin the web, the most important parts are missing since i'm pretty much a noob in ZenScript, and all the methods provided by forge and the datatypes they work with, but i'm hoping some of the more experienced modPack creators out there could help me out.
I made huge changes to the script after realizing that the syntax, field and methodNames for "old" MineTweaker and CraftTweaker are very different...
the loops aren't nested anymore either, instead i'm collecting the oreDictEntries for the nuggets, before going to the ingots loop etc.
new script:
import crafttweaker.oredict.IOreDict;
import crafttweaker.oredict.IOreDictEntry;
import crafttweaker.item.IItemStack;
import crafttweaker.recipes.ICraftingRecipe;
import crafttweaker.item.IIngredient;
//=================================================================================
//Remove nugget<->ingot<->block recipes
var nuggets = [] as IOreDictEntry[];
var ingots = [] as IOreDictEntry[];
var blocks = [] as IOreDictEntry[];
var recipeResult as IItemStack;
//var tmpRecipe as ICraftingRecipe;
var recipeInput = [[],[],[]] as IItemStack[][];
var flag = false;
val emptySlot = null as IItemStack;
val emptyRecipesNames = [
"armordye",
"bookcloning",
"mapcloning",
"fireworks",
"repairitem",
"tippedarrow",
"bannerduplicate",
"banneraddpattern",
"shielddecoration",
"shulkerboxcoloring",
"map_pinning"
] as string[];
for entry in oreDict {//get all nugget oredict entries
if entry.name.startsWith("nugget"){
nuggets += entry;
print("found nuggets: " ~ entry.name);
}
}
for tmpRecipe in recipes.all {//get all the ingots that can be crafted with the nuggets*9 and remove nugget<->ingot recipes.
if(!(emptyRecipesNames in tmpRecipe.name)){
print("RecipeName: " ~ tmpRecipe.name);
recipeResult = tmpRecipe.output;
for oreEntry in nuggets {
for thing in oreEntry.items {
recipeInput = tmpRecipe.ingredients2D;
flag = true;
while (flag == true){
for i in 0 to 2 {
for j in 0 to 2 {
if (recipeInput[i] != null){
flag = flag & (recipeInput[i][j].matchesExact(thing));
}
else{
flag = false;
}
}
}
}
if(flag){
recipes.removeByRecipeName(tmpRecipe.name);
print("recipe removed: " ~ recipeResult.displayName ~ " -> 9x " ~ thing.displayName);
recipes.removeShapeless(recipeResult,[thing,thing,thing,thing,thing,thing,thing,thing,thing]);
print("recipe removed: 9x " ~ thing.displayName ~ " -> " ~ recipeResult.displayName);
for entry in recipeResult.ores {
if (entry.name.startsWith("ingot")){
ingots += entry;
print("found ingots: " ~ entry.name);
}
}
}
}
}
}
}
/* for tmpRecipe in recipes.all {//get all the blocks that can be crafted with the ingots*9 and remove ingot<->block recipes.
if(!(emptyRecipesNames in tmpRecipe.name)){
print("RecipeName: " ~ tmpRecipe.name);
recipeResult = tmpRecipe.output as IItemStack;
for oreEntry in nuggets {
for thing in oreEntry.items {
recipeInput= tmpRecipe.ingredients1D as IItemStack[];
flag = true;
for i in 0 to 9 {
flag = flag & (recipeInput[i].matchesExact(thing));
}
if(flag){
recipes.removeByRecipeName(tmpRecipe.name);
print("recipe removed: " ~ recipeResult.displayName ~ " -> 9x " ~ thing.displayName);
recipes.removeShapeless(recipeResult,[thing,thing,thing,thing,thing,thing,thing,thing,thing]);
print("recipe removed: 9x " ~ thing.displayName ~ " -> " ~ recipeResult.displayName);
for entry in recipeResult.ores {
if (entry.name.startsWith("block")){
blocks += entry;
print("found blocks: " ~ entry.name);
}
}
}
}
}
}
}
*/
//sanity check:
print("nuggets: ");
for entry in nuggets{
print("-" ~entry.name ~ ":");
for thing in entry.items {
print("--" ~ thing.displayName);
}
}
print("ingots: ");
for entry in ingots{
print("-" ~entry.name ~ ":");
for thing in entry.items {
print("--" ~ thing.displayName);
}
}
print("blocks: ");
for entry in blocks{
print("-" ~entry.name ~ ":");
for thing in entry.items {
print("--" ~ thing.displayName);
}
}
I managed to filter out the "empty" recipes by checking for their names, but empty spaces in the recipes are still causing problems for me...
Hello,
I'm trying to force the players to use the tinkersConstruct smelter for making blocks, ingots and nuggets for all metals, by removing the regular 3x3 recipes.
I havent found a mod or script that would accomplish this, so if there is, please tell me.
I was thinking of using a MineTweakerScript to check all oreDict entries for (string)"nugget", since there are a lot of non-metal blocks and even a few non-metal ingot entries in my modpack's oreDict, but the nuggets seem to be fine.
Then search for the recipes that have the nugget as output, and repeat for the recipes of ingot to block.
I am using the "UniDict" mod, and i dont know exactly what it does(in technical lingo) or if this mod acts before or after Minetweaker, which might be an issue.
pseudo-script/wip-draft:
ArrayList recipes = (ArrayList) CraftingManager.getInstance().getRecipeList();
// these might not be necessary
ArrayList nuggets = {};
ArrayList ingots = {};
ArrayList blocks = {};
int iNuggets =0;
int iIngots=0;
int iBlocks=0;
for entry in oreDict{
(string)entry_name=entry.getName();
if entry_name.contains("nugget")){ //dont know if this string.contains exists, but you get the idea.
nuggets [iNuggets] = entry.item:
iNuggets += 1;
for (int scan = 0; scan < recipes.size(); scan++){
IRecipe tmpRecipe = (IRecipe) recipes.get(scan);
ItemStack recipeResult = tmpRecipe.getRecipeOutput();
for item in entry.items {
if (ItemStack.areItemStacksEqual(entry.item, recipeResult)){
//check if the input.name has "ingot"...if not: break;
ingots[iIngots] = (itemStack)theAboveIngot;
iIngots += 1;
recipes.remove(scan);
recipe.removeShapeless(theAboveIngot, entry.item, entry.item, entry.item, entry.item, entry.item, entry.item, entry.item, entry.item, entry.item);
for (int scan = 0; scan < recipes.size(); scan++){
IRecipe tmpRecipe = (IRecipe) recipes.get(scan);
ItemStack recipeResult = tmpRecipe.getRecipeOutput();
for item in entry.items {
if (ItemStack.areItemStacksEqual(theAboveIngot, recipeResult)){
//check if the input.name has "block"...if not: break;
blocks[iBlocks] = (itemStack)theAboveBlock;
iBlocks += 1;
recipes.remove(scan);
recipe.removeShapeless(theAboveBlock, theAboveIngot, theAboveIngot, theAboveIngot, theAboveIngot, theAboveIngot, theAboveIngot, theAboveIngot, theAboveIngot, theAboveIngot);
}
}
}
}
}
}
//sanity check:
System.out.println("number of nuggets: "+iNuggets)
System.out.println("number of ingots: "+iIngots)
System.out.println("number of blocks: "+iBlocks)
Thats what i managed to cobble together by searchin the web, the most important parts are missing since i'm pretty much a noob in ZenScript, and all the methods provided by forge and the datatypes they work with, but i'm hoping some of the more experienced modPack creators out there could help me out.
I made huge changes to the script after realizing that the syntax, field and methodNames for "old" MineTweaker and CraftTweaker are very different...
the loops aren't nested anymore either, instead i'm collecting the oreDictEntries for the nuggets, before going to the ingots loop etc.
new script:
I managed to filter out the "empty" recipes by checking for their names, but empty spaces in the recipes are still causing problems for me...