From b5bc6de82559596b58c93a80dad0b592c9eb5264 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Mon, 7 May 2018 06:12:45 +0200 Subject: added mechanic to scan Schematics to data stics --- .../machines/basic/GT_MetaTileEntity_Scanner.java | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/main/java') 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 0294889b06..0c66aced50 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 @@ -150,6 +150,33 @@ public class GT_MetaTileEntity_Scanner return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; return 2; } + + if (aStack.getItem().getUnlocalizedName().contains("Schematic")||aStack.getItem().getUnlocalizedName().contains("schematic")){ + String sTier =""; + + if (aStack.getItem().getUnlocalizedName().contains("moonbuggy")) + sTier = "100"; + else if(aStack.getItem().getUnlocalizedName().contains("cargo")) + sTier = "101"; + else if(aStack.getItem().getUnlocalizedName().contains("astro")) + sTier = "102"; + else if (aStack.getItem().getUnlocalizedName().matches(".*\\d+.*")) + sTier = aStack.getItem().getUnlocalizedName().split("(?<=\\D)(?=\\d)")[1].substring(0, 1); + else + sTier = "1"; + + getSpecialSlot().stackSize -= 1; + aStack.stackSize -= 1; + + this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()}); + this.mOutputItems[0].setTagCompound(GT_Utility.getNBTContainingShort(new NBTTagCompound(), "rocket_tier", Short.parseShort(sTier) )); + calculateOverclockedNess(512,36000); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + return 2; + } + } if (getSpecialSlot() == null && ItemList.Tool_DataStick.isStackEqual(aStack, false, true)) { if (GT_Utility.ItemNBT.getBookTitle(aStack).equals("Raw Prospection Data")) { -- cgit