diff options
Diffstat (limited to 'src')
7 files changed, 59 insertions, 105 deletions
diff --git a/src/main/java/gregtech/api/util/GTPP_Recipe.java b/src/main/java/gregtech/api/util/GTPP_Recipe.java index e777a0bf36..93144aed83 100644 --- a/src/main/java/gregtech/api/util/GTPP_Recipe.java +++ b/src/main/java/gregtech/api/util/GTPP_Recipe.java @@ -234,81 +234,6 @@ public class GTPP_Recipe extends GT_Recipe implements IComparableRecipe { return this.mFluidOutputs[aIndex].copy(); } - @Override - public boolean isRecipeInputEqual(final boolean aDecreaseStacksizeBySuccess, final FluidStack[] aFluidInputs, final ItemStack... aInputs) { - return this.isRecipeInputEqual(aDecreaseStacksizeBySuccess, false, aFluidInputs, aInputs); - } - - @Override - public boolean isRecipeInputEqual(final boolean aDecreaseStacksizeBySuccess, final boolean aDontCheckStackSizes, final FluidStack[] aFluidInputs, final ItemStack... aInputs) { - if ((this.mFluidInputs.length > 0) && (aFluidInputs == null)) { - return false; - } - for (final FluidStack tFluid : this.mFluidInputs) { - if (tFluid != null) { - boolean temp = true; - for (final FluidStack aFluid : aFluidInputs) { - if ((aFluid != null) && aFluid.isFluidEqual(tFluid) && (aDontCheckStackSizes || (aFluid.amount >= tFluid.amount))) { - temp = false; - break; - } - } - if (temp) { - return false; - } - } - } - - if ((this.mInputs.length > 0) && (aInputs == null)) { - return false; - } - - for (final ItemStack tStack : this.mInputs) { - if (tStack != null) { - boolean temp = true; - for (final ItemStack aStack : aInputs) { - if ((GT_Utility.areUnificationsEqual(aStack, tStack, true) || GT_Utility.areUnificationsEqual(GT_OreDictUnificator.get(false, aStack), tStack, true)) && (aDontCheckStackSizes || (aStack.stackSize >= tStack.stackSize))) { - temp = false; - break; - } - } - if (temp) { - return false; - } - } - } - - if (aDecreaseStacksizeBySuccess) { - if (aFluidInputs != null) { - for (final FluidStack tFluid : this.mFluidInputs) { - if (tFluid != null) { - for (final FluidStack aFluid : aFluidInputs) { - if ((aFluid != null) && aFluid.isFluidEqual(tFluid) && (aDontCheckStackSizes || (aFluid.amount >= tFluid.amount))) { - aFluid.amount -= tFluid.amount; - break; - } - } - } - } - } - - if (aInputs != null) { - for (final ItemStack tStack : this.mInputs) { - if (tStack != null) { - for (final ItemStack aStack : aInputs) { - if ((GT_Utility.areUnificationsEqual(aStack, tStack, true) || GT_Utility.areUnificationsEqual(GT_OreDictUnificator.get(false, aStack), tStack, true)) && (aDontCheckStackSizes || (aStack.stackSize >= tStack.stackSize))) { - aStack.stackSize -= tStack.stackSize; - break; - } - } - } - } - } - } - - return true; - } - public static class GTPP_Recipe_Map_Internal extends GT_Recipe_Map { public static final Collection<GTPP_Recipe_Map_Internal> sMappingsEx = new ArrayList<>(); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java index 1232166baa..009530c447 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java @@ -914,7 +914,7 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En public long getMaxInputEnergy() { long rEnergy = 0; - if (mEnergyHatches.size() < 2) // so it only takes 1 amp is only 1 hatch is present so it works like most gt multies + if (mEnergyHatches.size() == 1) // so it only takes 1 amp is only 1 hatch is present so it works like most gt multies return mEnergyHatches.get(0).getBaseMetaTileEntity().getInputVoltage(); for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) if (isValidMetaTileEntity(tHatch)) rEnergy += tHatch.getBaseMetaTileEntity().getInputVoltage() * tHatch.getBaseMetaTileEntity().getInputAmperage(); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWashPlant.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWashPlant.java index 616459dd1f..b5d0bcba9b 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWashPlant.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWashPlant.java @@ -77,6 +77,8 @@ public class GregtechMetaTileEntity_IndustrialWashPlant extends GregtechMeta_Mul .addInfo("400% faster than using single block machines of the same voltage") .addInfo("Processes four item per voltage tier") .addInfo("Always requires an Input Hatch full of water to refill structure") + .addInfo("Need to be filled with water.") + .addInfo("Will automatically fill water from input hatch.") .addPollutionAmount(getPollutionPerSecond(null)) .addSeparator() .beginStructureBlock(5, 3, 7, true) @@ -308,13 +310,15 @@ public class GregtechMetaTileEntity_IndustrialWashPlant extends GregtechMeta_Mul } } } - if ((tAmount >= 45)){ + + boolean isValidWater = tAmount >= 45; + if (isValidWater){ Logger.WARNING("Filled structure."); } else { Logger.WARNING("Did not fill structure."); } - return (tAmount >= 45); + return isValidWater; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IsaMill.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IsaMill.java index e86f98ef66..4eff685a35 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IsaMill.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IsaMill.java @@ -148,6 +148,11 @@ public class GregtechMetaTileEntity_IsaMill extends GregtechMeta_MultiBlockBase< return checkPiece(mName, 1, 1, 0) && mCasing >= 48 - 8 && checkHatch(); } + @Override + public boolean checkHatch() { + return super.checkHatch() && mMillingBallBuses.size() == 1; + } + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { return new ITexture[]{ Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(2)), @@ -173,10 +178,6 @@ public class GregtechMetaTileEntity_IsaMill extends GregtechMeta_MultiBlockBase< return super.addToMachineList(aTileEntity, aBaseCasingIndex); } - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeDieselEngine.png"); - } - @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { return GTPP_Recipe.GTPP_Recipe_Map.sOreMillRecipes; @@ -386,7 +387,7 @@ public class GregtechMetaTileEntity_IsaMill extends GregtechMeta_MultiBlockBase< @Override public boolean hasSlotInGUI() { - return false; + return true; } @Override @@ -431,7 +432,7 @@ public class GregtechMetaTileEntity_IsaMill extends GregtechMeta_MultiBlockBase< } private ItemStack findMillingBall(ItemStack[] aItemInputs) { - if (mMillingBallBuses.isEmpty() || mMillingBallBuses.size() > 1) { + if (mMillingBallBuses.size() != 1) { return null; } else { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java index 715ef30697..04621ce44e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java @@ -69,7 +69,7 @@ public class GregtechMTE_FrothFlotationCell extends GregtechMeta_MultiBlockBase< .addInfo("Process that milled ore!") .addPollutionAmount(getPollutionPerSecond(null)) .addSeparator() - .beginStructureBlock(3, 3, 3, true) + .beginStructureBlock(3, 9, 3, true) .addController("Front Center") .addCasingInfo("Inconel Reinforced Casing", 68) .addCasingInfo("Flotation Casing", 52) @@ -450,6 +450,15 @@ public class GregtechMTE_FrothFlotationCell extends GregtechMeta_MultiBlockBase< public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); mLockedOreType = aNBT.getInteger("mLockedOreType"); + if (mLockedOreType == 0) { + mLockedOreType = -1; + } + } + + @Override + public String[] getExtraInfoData() { + return new String[] { + "Locked Ore Type: " + mLockedOreType + }; } - } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java index 0d516f213a..d9b388bd4d 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java @@ -45,6 +45,11 @@ public class GregtechMetaTileEntity_IndustrialFishingPond extends GregtechMeta_M private static final Item circuit = CI.getNumberedCircuit(0).getItem(); private int mCasing; private IStructureDefinition<GregtechMetaTileEntity_IndustrialFishingPond> STRUCTURE_DEFINITION = null; + private static final Class<?> cofhWater; + + static { + cofhWater = ReflectionUtils.getClass("cofh.asmhooks.block.BlockWater"); + } public GregtechMetaTileEntity_IndustrialFishingPond(final int aID, final String aName, final String aNameRegional) { super(aID, aName, aNameRegional); @@ -74,6 +79,8 @@ public class GregtechMetaTileEntity_IndustrialFishingPond extends GregtechMeta_M .addInfo("Circuit 14 for Fish") .addInfo("Circuit 15 for Junk") .addInfo("Circuit 16 for Treasure") + .addInfo("Need to be filled with water.") + .addInfo("Will automatically fill water from input hatch.") .addPollutionAmount(getPollutionPerSecond(null)) .addSeparator() .beginStructureBlock(9, 3, 9, true) @@ -294,8 +301,8 @@ public class GregtechMetaTileEntity_IndustrialFishingPond extends GregtechMeta_M for (int j = mOffsetZ_Lower + 1; j <= mOffsetZ_Upper - 1; ++j) { for (int h = 0; h < 2; h++) { Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j); - // byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j); - if (tBlock == Blocks.air || tBlock == Blocks.flowing_water || tBlock == BlocksItems.getFluidBlock(InternalName.fluidDistilledWater)) { + byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j); + if (isNotStaticWater(tBlock, tMeta)) { if (this.getStoredFluids() != null) { for (FluidStack stored : this.getStoredFluids()) { if (stored.isFluidEqual(FluidUtils.getFluidStack("water", 1))) { @@ -323,25 +330,20 @@ public class GregtechMetaTileEntity_IndustrialFishingPond extends GregtechMeta_M } boolean isValidWater = tAmount >= 60; - if (isValidWater) { log("Filled structure."); - return true; } - else { - - long aAvgVoltage = 0; - for (GT_MetaTileEntity_Hatch_Energy g : this.mEnergyHatches) { - if (g != null) { - aAvgVoltage += (g.maxEUInput() * g.maxAmperesIn()); - } - } - this.mEUt = (int) Math.max(30, aAvgVoltage); - this.mMaxProgresstime = (int) Math.max(((aAvgVoltage/8)*20/10), 100); - this.mProgresstime = 1; - log("Did not fill structure. Consuming "+aAvgVoltage+"eu/t to try fill."); - return false; + else { + log("Did not fill structure."); } + return isValidWater; + } + + private boolean isNotStaticWater(Block block, byte meta) { + return block == Blocks.air + || block == Blocks.flowing_water + || block == BlocksItems.getFluidBlock(InternalName.fluidDistilledWater) + || (cofhWater != null && cofhWater.isAssignableFrom(block.getClass()) && meta != 0); } private static AutoMap<AutoMap<WeightedRandomFishable>> categories = new AutoMap<AutoMap<WeightedRandomFishable>>(); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java index 0631b64a81..10c2f51ce0 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java @@ -14,6 +14,7 @@ import com.gtnewhorizon.structurelib.structure.StructureDefinition; import gregtech.api.metatileentity.implementations.*; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.reflect.ReflectionUtils; import org.apache.commons.lang3.ArrayUtils; import gregtech.api.GregTech_API; @@ -48,6 +49,11 @@ public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase<Gregt private int mCasing; private IStructureDefinition<GregtechMTE_AlgaePondBase> STRUCTURE_DEFINITION = null; private int checkMeta; + private static final Class<?> cofhWater; + + static { + cofhWater = ReflectionUtils.getClass("cofh.asmhooks.block.BlockWater"); + } public GregtechMTE_AlgaePondBase(final int aID, final String aName, final String aNameRegional) { super(aID, aName, aNameRegional); @@ -241,8 +247,8 @@ public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase<Gregt for (int j = mOffsetZ_Lower + 1; j <= mOffsetZ_Upper - 1; ++j) { for (int h = 0; h < 2; h++) { Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j); - // byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j); - if (tBlock == Blocks.air || tBlock == Blocks.flowing_water || tBlock == BlocksItems.getFluidBlock(InternalName.fluidDistilledWater)) { + byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j); + if (isNotStaticWater(tBlock, tMeta)) { if (this.getStoredFluids() != null) { for (FluidStack stored : this.getStoredFluids()) { if (stored.isFluidEqual(FluidUtils.getFluidStack("water", 1))) { @@ -280,6 +286,13 @@ public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase<Gregt } } + private boolean isNotStaticWater(Block block, byte meta) { + return block == Blocks.air + || block == Blocks.flowing_water + || block == BlocksItems.getFluidBlock(InternalName.fluidDistilledWater) + || (cofhWater != null && cofhWater.isAssignableFrom(block.getClass()) && meta != 0); + } + @Override public int getMaxEfficiency(final ItemStack aStack) { return 10000; |