Skip to content

Commit

Permalink
fix for Assline books
Browse files Browse the repository at this point in the history
  • Loading branch information
bartimaeusnek committed Jun 15, 2018
1 parent 6596b1f commit 8ce5ad6
Showing 1 changed file with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,11 @@ else if (aStack.getUnlocalizedName().matches(".*\\d+.*"))
for(GT_Recipe.GT_Recipe_AssemblyLine tRecipe:GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes){
if(GT_Utility.areStacksEqual(tRecipe.mResearchItem, aStack, true)){

String s = tRecipe.mOutput.getDisplayName();

this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()});
GT_Utility.ItemNBT.setBookTitle(this.mOutputItems[0], tRecipe.mOutput.getDisplayName()+" Construction Data");

GT_Utility.ItemNBT.setBookTitle(this.mOutputItems[0], s+" Construction Data");
NBTTagCompound tNBT = this.mOutputItems[0].getTagCompound();
if (tNBT == null) {
tNBT = new NBTTagCompound();
Expand All @@ -244,25 +246,29 @@ else if (aStack.getUnlocalizedName().matches(".*\\d+.*"))
}
tNBT.setString("author", "Assembling Line Recipe Generator");
NBTTagList tNBTList = new NBTTagList();
tNBTList.appendTag(new NBTTagString("Construction plan for "+tRecipe.mOutput.stackSize+" "+tRecipe.mOutput.getDisplayName()+". Needed EU/t: "+tRecipe.mEUt+" Production time: "+(tRecipe.mDuration/20)));
s=tRecipe.mOutput.getDisplayName();
tNBTList.appendTag(new NBTTagString("Construction plan for "+tRecipe.mOutput.stackSize+" "+s+". Needed EU/t: "+tRecipe.mEUt+" Production time: "+(tRecipe.mDuration/20)));
for(int i=0;i<tRecipe.mInputs.length;i++){
if (tRecipe.mOreDictAlt[i] != null) {
int count = 0;
StringBuilder tBuilder = new StringBuilder("Input Bus "+(i+1)+": ");
for (ItemStack tStack : tRecipe.mOreDictAlt[i]) {
if (tStack != null) {
tBuilder.append((count == 0 ? "" : "\nOr ") + tStack.stackSize+" "+tStack.getDisplayName());
s=tStack.getDisplayName();
tBuilder.append((count == 0 ? "" : "\nOr ") + tStack.stackSize+" "+s);
count++;
}
}
if (count > 0) tNBTList.appendTag(new NBTTagString(tBuilder.toString()));
} else if(tRecipe.mInputs[i]!=null){
tNBTList.appendTag(new NBTTagString("Input Bus "+(i+1)+": "+tRecipe.mInputs[i].stackSize+" "+tRecipe.mInputs[i].getDisplayName()));
s=tRecipe.mInputs[i].getDisplayName();
tNBTList.appendTag(new NBTTagString("Input Bus "+(i+1)+": "+tRecipe.mInputs[i].stackSize+" "+s));
}
}
for(int i=0;i<tRecipe.mFluidInputs.length;i++){
if(tRecipe.mFluidInputs[i]!=null){
tNBTList.appendTag(new NBTTagString("Input Hatch "+(i+1)+": "+tRecipe.mFluidInputs[i].amount+"L "+tRecipe.mFluidInputs[i].getLocalizedName()));
s=tRecipe.mFluidInputs[i].getLocalizedName();
tNBTList.appendTag(new NBTTagString("Input Hatch "+(i+1)+": "+tRecipe.mFluidInputs[i].amount+"L "+s));
}
}
tNBT.setTag("pages", tNBTList);
Expand Down

0 comments on commit 8ce5ad6

Please sign in to comment.