diff options
Diffstat (limited to 'src/Java/gtPlusPlus/xmod')
6 files changed, 55 insertions, 22 deletions
diff --git a/src/Java/gtPlusPlus/xmod/bop/blocks/rainforest/SaplingRainforestTree.java b/src/Java/gtPlusPlus/xmod/bop/blocks/rainforest/SaplingRainforestTree.java index e36d24e695..0cd76fa734 100644 --- a/src/Java/gtPlusPlus/xmod/bop/blocks/rainforest/SaplingRainforestTree.java +++ b/src/Java/gtPlusPlus/xmod/bop/blocks/rainforest/SaplingRainforestTree.java @@ -13,16 +13,18 @@ import net.minecraft.world.gen.feature.*; public class SaplingRainforestTree extends SaplingBase { - public SaplingRainforestTree(){ - super("Rainforest Oak Sapling", "rainforestoak", new String[]{"rainforest"}); - } + public SaplingRainforestTree(){ + super("Rainforest Oak Sapling", "rainforestoak", new String[]{"rainforest"}); + } - @Override + @Override public void func_149878_d(World world, int x, int y, int z, Random rand){ Utils.LOG_WARNING("func_149878_d - 1"); if (!net.minecraftforge.event.terraingen.TerrainGen.saplingGrowTree(world, rand, x, y, z)) return; int l = world.getBlockMetadata(x, y, z) & 7; - Object object = rand.nextInt(10) == 0 ? new WorldGenBigTree(true) : new WorldGenTrees(true); + rand.nextInt(10); + new WorldGenBigTree(true); + new WorldGenTrees(true); int i1 = 0; int j1 = 0; boolean flag = false; @@ -40,10 +42,8 @@ public class SaplingRainforestTree extends SaplingBase { { world.setBlock(x, y, z, block, 0, 4); } -//public WorldGenRainForestTree_Ex(Block wood, Block leaves, int woodMeta, int leavesMeta, boolean doBlockNotify, int minTreeHeight, int randomTreeHeight) { - Class C = BOP_Block_Registrator.class; Object o = new WorldGenRainForestTree_Ex(BOP_Block_Registrator.log_Rainforest, BOP_Block_Registrator.leaves_Rainforest, 0, 0, true, 50, 75); - + if (!((WorldGenerator)o).generate(world, rand, x + i1, y, z + j1)) { if (flag) @@ -59,5 +59,5 @@ public class SaplingRainforestTree extends SaplingBase { } } } - + }
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_AdvancedBoiler.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_AdvancedBoiler.java index d3ec2b024b..e480ffbfef 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_AdvancedBoiler.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_AdvancedBoiler.java @@ -60,7 +60,7 @@ public class CONTAINER_AdvancedBoiler this.mWaterAmount = Math.min(54, Math.max(0, this.mWaterAmount * 54 / (this.maxStorage-100))); this.mProcessingEnergy = Math.min(14, Math.max(this.mProcessingEnergy > 0 ? 1 : 0, this.mProcessingEnergy * 14 / 1000)); - Iterator var2 = this.crafters.iterator(); + Iterator<?> var2 = this.crafters.iterator(); while (var2.hasNext()) { ICrafting var1 = (ICrafting) var2.next(); var1.sendProgressBarUpdate(this, 100, this.mTemperature); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/objects/GregtechItemData.java b/src/Java/gtPlusPlus/xmod/gregtech/api/objects/GregtechItemData.java index 0a5351afdc..fb35c0ac21 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/objects/GregtechItemData.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/objects/GregtechItemData.java @@ -120,7 +120,7 @@ public class GregtechItemData { } public ArrayList<GregtechMaterialStack> getAllGT_MaterialStacks() { - final ArrayList<GregtechMaterialStack> rList = new ArrayList(); + final ArrayList<GregtechMaterialStack> rList = new ArrayList<GregtechMaterialStack>(); if (this.hasValidMaterialData()) { rList.add(this.mMaterial); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityTreeFarm.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityTreeFarm.java index 191312dbfa..dd2837b021 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityTreeFarm.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityTreeFarm.java @@ -65,13 +65,8 @@ public class GregtechMetaTileEntityTreeFarm extends GT_MetaTileEntity_MultiBlock private EntityPlayerMP farmerAI; - private SAWTOOL mCurrentMachineTool = SAWTOOL.NONE; private boolean canChop = false; - private final int cuttingNumber = 0; - private final int cuttingNumber2 = 0; - private final int cuttingNumber3 = 0; - public GregtechMetaTileEntityTreeFarm(final int aID, final String aName, final String aNameRegional) { super(aID, aName, aNameRegional); } @@ -253,10 +248,8 @@ public class GregtechMetaTileEntityTreeFarm extends GT_MetaTileEntity_MultiBlock final SAWTOOL currentInputItem = TreeFarmHelper.isCorrectMachinePart(aStack); if (currentInputItem != SAWTOOL.NONE){ if (currentInputItem == SAWTOOL.SAW){ - this.mCurrentMachineTool = SAWTOOL.SAW; } else { - this.mCurrentMachineTool = SAWTOOL.BUZZSAW; } isValid = true; } @@ -423,6 +416,7 @@ public class GregtechMetaTileEntityTreeFarm extends GT_MetaTileEntity_MultiBlock + @SuppressWarnings("unused") private boolean findLogs(final IGregTechTileEntity aBaseMetaTileEntity){ Utils.LOG_MACHINE_INFO("called findLogs()"); @@ -556,6 +550,7 @@ public class GregtechMetaTileEntityTreeFarm extends GT_MetaTileEntity_MultiBlock return true; } + @SuppressWarnings("deprecation") private boolean plantSaplings(final IGregTechTileEntity aBaseMetaTileEntity){ Utils.LOG_MACHINE_INFO("called plantSaplings()"); final World world = aBaseMetaTileEntity.getWorld(); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_CatalyticReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_CatalyticReactor.java index ab47262d38..e13360b7c5 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_CatalyticReactor.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_CatalyticReactor.java @@ -58,6 +58,7 @@ public class GregtechMetaTileEntity_CatalyticReactor extends GT_MetaTileEntity_M return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "LFTR.png"); } + @SuppressWarnings("unused") @Override public boolean checkRecipe(final ItemStack aStack) { if ((this.mInventory[1] == null) || (this.mInventory[1].isItemEqual(GT_ModHandler.getIC2Item("miningPipe", 1L)) && (this.mInventory[1].stackSize < this.mInventory[1].getMaxStackSize()))) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_Refinery.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_Refinery.java index cf1cd7b439..875990a12e 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_Refinery.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_Refinery.java @@ -2,6 +2,7 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi; import java.util.ArrayList; +import gregtech.api.enums.GT_Values; import gregtech.api.enums.TAE; import gregtech.api.enums.Textures; import gregtech.api.gui.GT_GUIContainer_MultiMachine; @@ -26,8 +27,8 @@ import net.minecraftforge.fluids.FluidStack; public class GregtechMetaTileEntity_Refinery extends GT_MetaTileEntity_MultiBlockBase { - private boolean completedCycle = false; - + public GT_Recipe mLastRecipe; + public GregtechMetaTileEntity_Refinery(final int aID, final String aName, final String aNameRegional) { super(aID, aName, aNameRegional); } @@ -68,7 +69,7 @@ public class GregtechMetaTileEntity_Refinery extends GT_MetaTileEntity_MultiBloc return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "LFTR.png"); } - @Override + /*@Override public boolean checkRecipe(final ItemStack aStack) { ArrayList<FluidStack> tFluidList = getStoredFluids(); @@ -127,7 +128,43 @@ public class GregtechMetaTileEntity_Refinery extends GT_MetaTileEntity_MultiBloc } Utils.LOG_INFO("Bad Recipe. [1]"); return false; - } + }*/ + + @Override + public boolean checkRecipe(ItemStack aStack) { + ArrayList<FluidStack> tFluidList = getStoredFluids(); + int tFluidList_sS=tFluidList.size(); + for (int i = 0; i < tFluidList_sS - 1; i++) { + for (int j = i + 1; j < tFluidList_sS; 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--); tFluidList_sS=tFluidList.size(); + } else { + tFluidList.remove(i--); tFluidList_sS=tFluidList.size(); + break; + } + } + } + } + if (tFluidList.size() > 1) { + FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sFusionRecipes.findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, GT_Values.V[4], tFluids, new ItemStack[]{}); + if ((tRecipe == null && !mRunningOnLoad) || (maxEUStore() < tRecipe.mSpecialValue)) { + this.mLastRecipe = null; + return false; + } + if (mRunningOnLoad || tRecipe.isRecipeInputEqual(true, tFluids, new ItemStack[]{})) { + this.mLastRecipe = tRecipe; + this.mEUt = this.mLastRecipe.mEUt; + this.mMaxProgresstime = this.mLastRecipe.mDuration; + this.mEfficiencyIncrease = 10000; + this.mOutputFluids = this.mLastRecipe.mFluidOutputs; + mRunningOnLoad = false; + return true; + } + } + return false; + } @Override public boolean checkMachine(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) { |