public void registerOre(
      OrePrefixes aPrefix,
      Materials aMaterial,
      String aOreDictName,
      String aModName,
      ItemStack aStack) {
    if (aOreDictName.equals("logRubber")) {
      GT_Values.RA.addCentrifugeRecipe(
          GT_Utility.copyAmount(1L, new Object[] {aStack}),
          null,
          null,
          Materials.Methane.getGas(60L),
          ItemList.IC2_Resin.get(1L, new Object[0]),
          GT_ModHandler.getIC2Item("plantBall", 1L),
          GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Carbon, 1L),
          GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L),
          null,
          null,
          new int[] {5000, 3750, 2500, 2500},
          200,
          20);
      GT_ModHandler.addSawmillRecipe(
          GT_Utility.copyAmount(1L, new Object[] {aStack}),
          ItemList.IC2_Resin.get(1L, new Object[0]),
          GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 16L));
      GT_ModHandler.addExtractionRecipe(
          GT_Utility.copyAmount(1L, new Object[] {aStack}),
          GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Rubber, 1L));
      GT_ModHandler.addPulverisationRecipe(
          GT_Utility.copyAmount(1L, new Object[] {aStack}),
          GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 6L),
          ItemList.IC2_Resin.get(1L, new Object[0]),
          33,
          false);
    } else {
      GT_ModHandler.addPulverisationRecipe(
          GT_Utility.copyAmount(1L, new Object[] {aStack}),
          GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 6L),
          GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L),
          80,
          false);
    }

    GT_ModHandler.addCraftingRecipe(
        GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Wood, 2L),
        gregtech.api.util.GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS
            | gregtech.api.util.GT_ModHandler.RecipeBits.BUFFERED,
        new Object[] {
          "sLf", Character.valueOf('L'), GT_Utility.copyAmount(1L, new Object[] {aStack})
        });
    GT_Values.RA.addLatheRecipe(
        GT_Utility.copyAmount(1L, new Object[] {aStack}),
        GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Wood, 4L),
        GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 2L),
        160,
        8);
    GT_Values.RA.addAssemblerRecipe(
        GT_Utility.copyAmount(1L, new Object[] {aStack}),
        ItemList.Circuit_Integrated.getWithDamage(0L, 2L, new Object[0]),
        Materials.SeedOil.getFluid(50L),
        ItemList.FR_Stick.get(1L, new Object[0]),
        16,
        8);
    GT_Values.RA.addAssemblerRecipe(
        GT_Utility.copyAmount(8L, new Object[] {aStack}),
        ItemList.Circuit_Integrated.getWithDamage(0L, 8L, new Object[0]),
        Materials.SeedOil.getFluid(250L),
        ItemList.FR_Casing_Impregnated.get(1L, new Object[0]),
        64,
        16);
    GT_Values.RA.addChemicalBathRecipe(
        GT_Utility.copyAmount(1L, new Object[] {aStack}),
        Materials.Creosote.getFluid(1000L),
        GT_ModHandler.getModItem("Railcraft", "tile.railcraft.cube", 1L, 8),
        null,
        null,
        null,
        16,
        16);

    short aMeta = (short) aStack.getItemDamage();

    if (aMeta == Short.MAX_VALUE) {
      if ((GT_Utility.areStacksEqual(
          GT_ModHandler.getSmeltingOutput(
              GT_Utility.copyAmount(1L, new Object[] {aStack}), false, null),
          new ItemStack(Items.coal, 1, 1)))) {
        if (GregTech_API.sRecipeFile.get(
            ConfigCategories.Recipes.disabledrecipes, "wood2charcoalsmelting", true)) {
          GT_ModHandler.removeFurnaceSmelting(GT_Utility.copyAmount(1L, new Object[] {aStack}));
        }
      }
      for (int i = 0; i < 32767; i++) {
        if ((GT_Utility.areStacksEqual(
            GT_ModHandler.getSmeltingOutput(new ItemStack(aStack.getItem(), 1, i), false, null),
            new ItemStack(Items.coal, 1, 1)))) {
          if (GregTech_API.sRecipeFile.get(
              ConfigCategories.Recipes.disabledrecipes, "wood2charcoalsmelting", true)) {
            GT_ModHandler.removeFurnaceSmelting(new ItemStack(aStack.getItem(), 1, i));
          }
        }
        ItemStack tStack =
            GT_ModHandler.getRecipeOutput(new ItemStack[] {new ItemStack(aStack.getItem(), 1, i)});
        if (tStack == null) {
          if (i >= 16) {
            break;
          }
        } else {

          ItemStack tPlanks = GT_Utility.copy(new Object[] {tStack});
          tPlanks.stackSize = (tPlanks.stackSize * 3 / 2);
          GT_Values.RA.addCutterRecipe(
              new ItemStack(aStack.getItem(), 1, i),
              Materials.Lubricant.getFluid(1L),
              GT_Utility.copy(new Object[] {tPlanks}),
              GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L),
              200,
              8);
          GT_Values.RA.addCutterRecipe(
              new ItemStack(aStack.getItem(), 1, i),
              GT_Utility.copyAmount(
                  GT_Mod.gregtechproxy.mNerfedWoodPlank
                      ? tStack.stackSize
                      : tStack.stackSize * 5 / 4,
                  new Object[] {tStack}),
              GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 2L),
              200,
              8);
          GT_ModHandler.addSawmillRecipe(
              new ItemStack(aStack.getItem(), 1, i),
              tPlanks,
              GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L));
          GT_ModHandler.removeRecipe(new ItemStack[] {new ItemStack(aStack.getItem(), 1, i)});
          GT_ModHandler.addCraftingRecipe(
              GT_Utility.copyAmount(
                  GT_Mod.gregtechproxy.mNerfedWoodPlank
                      ? tStack.stackSize
                      : tStack.stackSize * 5 / 4,
                  new Object[] {tStack}),
              new Object[] {
                "s", "L", Character.valueOf('L'), new ItemStack(aStack.getItem(), 1, i)
              });
          GT_ModHandler.addShapelessCraftingRecipe(
              GT_Utility.copyAmount(
                  tStack.stackSize / (GT_Mod.gregtechproxy.mNerfedWoodPlank ? 2 : 1),
                  new Object[] {tStack}),
              new Object[] {new ItemStack(aStack.getItem(), 1, i)});
        }
      }
    } else {
      if ((GT_Utility.areStacksEqual(
          GT_ModHandler.getSmeltingOutput(
              GT_Utility.copyAmount(1L, new Object[] {aStack}), false, null),
          new ItemStack(Items.coal, 1, 1)))) {
        if (GregTech_API.sRecipeFile.get(
            ConfigCategories.Recipes.disabledrecipes, "wood2charcoalsmelting", true)) {
          GT_ModHandler.removeFurnaceSmelting(GT_Utility.copyAmount(1L, new Object[] {aStack}));
        }
      }
      ItemStack tStack =
          GT_ModHandler.getRecipeOutput(
              new ItemStack[] {GT_Utility.copyAmount(1L, new Object[] {aStack})});
      if (tStack != null) {
        ItemStack tPlanks = GT_Utility.copy(new Object[] {tStack});
        tPlanks.stackSize = (tPlanks.stackSize * 3 / 2);
        GT_Values.RA.addCutterRecipe(
            GT_Utility.copyAmount(1L, new Object[] {aStack}),
            Materials.Lubricant.getFluid(1L),
            GT_Utility.copy(new Object[] {tPlanks}),
            GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L),
            200,
            8);
        GT_Values.RA.addCutterRecipe(
            GT_Utility.copyAmount(1L, new Object[] {aStack}),
            GT_Utility.copyAmount(
                GT_Mod.gregtechproxy.mNerfedWoodPlank ? tStack.stackSize : tStack.stackSize * 5 / 4,
                new Object[] {tStack}),
            GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 2L),
            200,
            8);
        GT_ModHandler.addSawmillRecipe(
            GT_Utility.copyAmount(1L, new Object[] {aStack}),
            tPlanks,
            GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L));
        GT_ModHandler.removeRecipe(
            new ItemStack[] {GT_Utility.copyAmount(1L, new Object[] {aStack})});
        GT_ModHandler.addCraftingRecipe(
            GT_Utility.copyAmount(
                GT_Mod.gregtechproxy.mNerfedWoodPlank ? tStack.stackSize : tStack.stackSize * 5 / 4,
                new Object[] {tStack}),
            new Object[] {
              "s", "L", Character.valueOf('L'), GT_Utility.copyAmount(1L, new Object[] {aStack})
            });
        GT_ModHandler.addShapelessCraftingRecipe(
            GT_Utility.copyAmount(
                tStack.stackSize / (GT_Mod.gregtechproxy.mNerfedWoodPlank ? 2 : 1),
                new Object[] {tStack}),
            new Object[] {GT_Utility.copyAmount(1L, new Object[] {aStack})});
      }
    }

    if ((GT_Utility.areStacksEqual(
        GT_ModHandler.getSmeltingOutput(
            GT_Utility.copyAmount(1L, new Object[] {aStack}), false, null),
        new ItemStack(Items.coal, 1, 1)))) {
      if (GregTech_API.sRecipeFile.get(
          ConfigCategories.Recipes.disabledrecipes, "wood2charcoalsmelting", true))
        GT_ModHandler.removeFurnaceSmelting(GT_Utility.copyAmount(1L, new Object[] {aStack}));
    }
  }
 public boolean allowPutStack(
     IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
   return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack))
       && (GT_Utility.areStacksEqual(aStack, this.mInventory[(aIndex + 9)]));
 }
  public boolean checkRecipe(ItemStack aStack) {
    if (!isCorrectMachinePart(mInventory[1])) {
      return false;
    }
    GT_Recipe.GT_Recipe_Map map = getRecipeMap();
    if (map == null) {
      return false;
    }
    ArrayList<ItemStack> tInputList = getStoredInputs();
    int tTier = 0;
    if (mInventory[1].getUnlocalizedName().endsWith("1")) {
      tTier = 1;
    }
    if (mInventory[1].getUnlocalizedName().endsWith("2")) {
      tTier = 2;
    }
    if (mInventory[1].getUnlocalizedName().endsWith("3")) {
      tTier = 3;
    }
    if (mInventory[1].getUnlocalizedName().endsWith("4")) {
      tTier = 4;
    }
    if (mInventory[1].getUnlocalizedName().endsWith("5")) {
      tTier = 5;
    }
    for (int i = 0; i < tInputList.size() - 1; i++) {
      for (int j = i + 1; j < tInputList.size(); j++) {
        if (GT_Utility.areStacksEqual(
            (ItemStack) tInputList.get(i), (ItemStack) tInputList.get(j))) {
          if (((ItemStack) tInputList.get(i)).stackSize
              >= ((ItemStack) tInputList.get(j)).stackSize) {
            tInputList.remove(j--);
          } else {
            tInputList.remove(i--);
            break;
          }
        }
      }
    }
    ItemStack[] tInputs =
        (ItemStack[])
            Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2);

    ArrayList<FluidStack> tFluidList = getStoredFluids();
    for (int i = 0; i < tFluidList.size() - 1; i++) {
      for (int j = i + 1; j < tFluidList.size(); j++) {
        if (GT_Utility.areFluidsEqual(
            (FluidStack) tFluidList.get(i), (FluidStack) tFluidList.get(j))) {
          if (((FluidStack) tFluidList.get(i)).amount >= ((FluidStack) tFluidList.get(j)).amount) {
            tFluidList.remove(j--);
          } else {
            tFluidList.remove(i--);
            break;
          }
        }
      }
    }
    FluidStack[] tFluids =
        (FluidStack[])
            Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tInputList.size()]), 0, 1);
    if (tInputList.size() > 0 || tFluids.length > 0) {
      GT_Recipe tRecipe =
          map.findRecipe(
              getBaseMetaTileEntity(),
              mLastRecipe,
              false,
              gregtech.api.enums.GT_Values.V[tTier],
              tFluids,
              tInputs);
      if (tRecipe != null) {
        mLastRecipe = tRecipe;
        this.mEUt = 0;
        this.mOutputItems = null;
        this.mOutputFluids = null;
        this.mMaxProgresstime = tRecipe.mDuration;
        int machines = Math.min(16, mInventory[1].stackSize);
        this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
        this.mEfficiencyIncrease = 10000;
        int i = 0;
        for (; i < machines; i++) {
          if (!tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) break;
        }
        //										System.out.println("recipe:"+i+" "+tRecipe.mDuration+" "+tRecipe.mEUt);
        //										if(tRecipe.mOutputs.length>0){
        //											System.out.println(tRecipe.mOutputs[0].getUnlocalizedName());
        //										}
        //										if(tRecipe.mFluidOutputs.length>0){
        //											System.out.println(tRecipe.mFluidOutputs[0].getUnlocalizedName());
        //										}
        if (tRecipe.mEUt <= 16) {
          this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
          this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1));
        } else {
          this.mEUt = tRecipe.mEUt;
          this.mMaxProgresstime = tRecipe.mDuration;
          while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
            this.mEUt *= 4;
            this.mMaxProgresstime /= 2;
          }
        }
        this.mEUt *= i;
        if (this.mEUt > 0) {
          this.mEUt = (-this.mEUt);
        }
        ItemStack[] tOut = new ItemStack[tRecipe.mOutputs.length];
        for (int h = 0; h < tRecipe.mOutputs.length; h++) {
          tOut[h] = tRecipe.getOutput(h).copy();
          tOut[h].stackSize = 0;
        }
        FluidStack tFOut = null;
        if (tRecipe.getFluidOutput(0) != null) tFOut = tRecipe.getFluidOutput(0).copy();
        for (int f = 0; f < tOut.length; f++) {
          if (tRecipe.mOutputs[f] != null && tOut[f] != null) {
            for (int g = 0; g < i; g++) {
              if (getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(f))
                tOut[f].stackSize += tRecipe.mOutputs[f].stackSize;
            }
          }
        }
        if (tFOut != null) {
          int tSize = tFOut.amount;
          tFOut.amount = tSize * i;
        }
        this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
        this.mOutputItems = tOut;
        this.mOutputFluids = new FluidStack[] {tFOut};
        //										System.out.println("ArrayOut"+mOutputItems.length+" "+mOutputFluids.length+"
        // "+(mOutputItems.length>0?mOutputItems[0].getUnlocalizedName():"")+"
        // "+(mOutputFluids.length>0?mOutputFluids[0].getUnlocalizedName():" "));
        updateSlots();
        return true;
      }
    }
    return false;
  }