aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/tileentities
diff options
context:
space:
mode:
authorbartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com>2018-06-17 00:10:56 +0200
committerGitHub <noreply@github.com>2018-06-17 00:10:56 +0200
commit3e5b4f63967ed306a74f8f597a66185d76c7f335 (patch)
tree160455b707b14dc49fd8610ac59c2f46386257da /src/main/java/gregtech/common/tileentities
parentc62aed22a3f49c40b690a899fdac0db2d5850423 (diff)
downloadGT5-Unofficial-3e5b4f63967ed306a74f8f597a66185d76c7f335.tar.gz
GT5-Unofficial-3e5b4f63967ed306a74f8f597a66185d76c7f335.tar.bz2
GT5-Unofficial-3e5b4f63967ed306a74f8f597a66185d76c7f335.zip
Smp assembly-line books issures (#128)
Diffstat (limited to 'src/main/java/gregtech/common/tileentities')
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java46
1 files changed, 40 insertions, 6 deletions
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..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
@@ -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;
@@ -218,9 +220,15 @@ 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();
+ 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], 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 +252,51 @@ 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();
+ 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<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();
+ if (FMLCommonHandler.instance().getEffectiveSide().isServer()) {
+ s=GT_Assemblyline_Server.lServerNames.get(tStack.getDisplayName());
+ if (s==null)
+ 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();
+ 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<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();
+ if (FMLCommonHandler.instance().getEffectiveSide().isServer()) {
+ s = GT_Assemblyline_Server.lServerNames.get(tRecipe.mFluidInputs[i].getLocalizedName());
+ if (s==null)
+ s=tRecipe.mFluidInputs[i].getLocalizedName();
+ }
+ tNBTList.appendTag(new NBTTagString("Input Hatch "+(i+1)+": "+tRecipe.mFluidInputs[i].amount+"L "+s));
}
}
tNBT.setTag("pages", tNBTList);