diff options
author | miozune <miozune@gmail.com> | 2022-06-01 20:36:42 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-01 13:36:42 +0200 |
commit | 8bde03f5330693cfb1c04c256af87f57ac86ca18 (patch) | |
tree | ead2b18588fe71c15997b802b72942ff33916f2e /src/main/java/gtPlusPlus/xmod | |
parent | 6be27cf6dfaa474b36172a88568d375d7bb1c9fc (diff) | |
download | GT5-Unofficial-8bde03f5330693cfb1c04c256af87f57ac86ca18.tar.gz GT5-Unofficial-8bde03f5330693cfb1c04c256af87f57ac86ca18.tar.bz2 GT5-Unofficial-8bde03f5330693cfb1c04c256af87f57ac86ca18.zip |
Fixes (#198)
* Fix IsaMill controller GUI void items
* Add structure check for Milling Ball Housing
* Fix internal crash that was handled somewhere else
* Fix ore type can be locked to 0
* Add scan result for locked ore type
* Fix height in tooltip
* Delegate to native isRecipeInputEqual
* Don't consume energy to fill water
* Fix flowing water is not filled sometimes
* Add info about filling water
* Fix carelessness
* Fix flowing water in Algae Farm
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod')
6 files changed, 59 insertions, 30 deletions
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; |