From 8ce5ad6bd06413f3c9148cd586fef03a17fb920d Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Fri, 15 Jun 2018 20:49:20 +0200 Subject: fix for Assline books --- .../machines/basic/GT_MetaTileEntity_Scanner.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java index e102dde306..33e89a3faa 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java @@ -218,9 +218,11 @@ public class GT_MetaTileEntity_Scanner 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(); @@ -244,25 +246,29 @@ public class GT_MetaTileEntity_Scanner } 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 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 Date: Sat, 16 Jun 2018 17:45:37 +0200 Subject: fixed SMP Assembly Line book issures. --- .../machines/basic/GT_MetaTileEntity_Scanner.java | 23 +++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java index 33e89a3faa..e77a9253ca 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java @@ -1,5 +1,6 @@ package gregtech.common.tileentities.machines.basic; +import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.FMLLog; import forestry.api.genetics.AlleleManager; import forestry.api.genetics.IIndividual; @@ -16,6 +17,7 @@ import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.objects.ItemData; +import gregtech.api.util.GT_Assemblyline_Server; import gregtech.api.util.GT_Log; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; @@ -219,7 +221,11 @@ public class GT_MetaTileEntity_Scanner if(GT_Utility.areStacksEqual(tRecipe.mResearchItem, aStack, true)){ String s = tRecipe.mOutput.getDisplayName(); - + if (FMLCommonHandler.instance().getEffectiveSide().isServer()) { + s = GT_Assemblyline_Server.lServerNames.get(tRecipe.mOutput.getDisplayName()); + if (s==null) + s=tRecipe.mOutput.getDisplayName(); + } this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()}); GT_Utility.ItemNBT.setBookTitle(this.mOutputItems[0], s+" Construction Data"); @@ -247,6 +253,11 @@ public class GT_MetaTileEntity_Scanner tNBT.setString("author", "Assembling Line Recipe Generator"); NBTTagList tNBTList = new NBTTagList(); s=tRecipe.mOutput.getDisplayName(); + if (FMLCommonHandler.instance().getEffectiveSide().isServer()) { + s = GT_Assemblyline_Server.lServerNames.get(tRecipe.mOutput.getDisplayName()); + if (s==null) + 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 0) tNBTList.appendTag(new NBTTagString(tBuilder.toString())); } else if(tRecipe.mInputs[i]!=null){ s=tRecipe.mInputs[i].getDisplayName(); + if (FMLCommonHandler.instance().getEffectiveSide().isServer()) { + s = GT_Assemblyline_Server.lServerNames.get(tRecipe.mInputs[i].getDisplayName()); + if (s==null) + s=tRecipe.mInputs[i].getDisplayName(); + } tNBTList.appendTag(new NBTTagString("Input Bus "+(i+1)+": "+tRecipe.mInputs[i].stackSize+" "+s)); } } for(int i=0;i Date: Sat, 16 Jun 2018 22:00:03 +0200 Subject: fixed Multiple items on one page --- .../machines/basic/GT_MetaTileEntity_Scanner.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java index e77a9253ca..4fa4059108 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java @@ -223,8 +223,8 @@ public class GT_MetaTileEntity_Scanner String s = tRecipe.mOutput.getDisplayName(); if (FMLCommonHandler.instance().getEffectiveSide().isServer()) { s = GT_Assemblyline_Server.lServerNames.get(tRecipe.mOutput.getDisplayName()); - if (s==null) - s=tRecipe.mOutput.getDisplayName(); + if (s==null) + s=tRecipe.mOutput.getDisplayName(); } this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()}); GT_Utility.ItemNBT.setBookTitle(this.mOutputItems[0], s+" Construction Data"); @@ -255,8 +255,8 @@ public class GT_MetaTileEntity_Scanner s=tRecipe.mOutput.getDisplayName(); if (FMLCommonHandler.instance().getEffectiveSide().isServer()) { s = GT_Assemblyline_Server.lServerNames.get(tRecipe.mOutput.getDisplayName()); - if (s==null) - s=tRecipe.mOutput.getDisplayName(); + if (s==null) + 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 Date: Mon, 18 Jun 2018 02:35:47 +0200 Subject: fix for #2152 fix for reused DataSticks keep parts of old NBTTagCompound fixed blockores and removed one hashmap --- .../tileentities/machines/basic/GT_MetaTileEntity_Scanner.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java index 4fa4059108..c5dfb5483f 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java @@ -105,8 +105,8 @@ public class GT_MetaTileEntity_Scanner } if (ItemList.Tool_DataOrb.isStackEqual(getSpecialSlot(), false, true)) { if (ItemList.Tool_DataOrb.isStackEqual(aStack, false, true)) { - aStack.stackSize -= 1; - this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{ItemList.Tool_DataStick.get(1, new Object[]{})}); + aStack.stackSize -= 1; + this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()}); calculateOverclockedNess(30,512); //In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) @@ -227,12 +227,16 @@ public class GT_MetaTileEntity_Scanner s=tRecipe.mOutput.getDisplayName(); } this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()}); + + //remove possible old NBTTagCompound + this.mOutputItems[0].setTagCompound(new NBTTagCompound()); GT_Utility.ItemNBT.setBookTitle(this.mOutputItems[0], s+" Construction Data"); NBTTagCompound tNBT = this.mOutputItems[0].getTagCompound(); if (tNBT == null) { tNBT = new NBTTagCompound(); - } + } + tNBT.setTag("output", tRecipe.mOutput.writeToNBT(new NBTTagCompound())); tNBT.setInteger("time", tRecipe.mDuration); tNBT.setInteger("eu", tRecipe.mEUt); -- cgit