From a59d2fbaed3057b8f5ad4961ee65b4ef7a5e0693 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> 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/tileentities') 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