aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorJakub <53441451+kuba6000@users.noreply.github.com>2022-02-27 21:44:26 +0100
committerGitHub <noreply@github.com>2022-02-27 21:44:26 +0100
commitc8d78c16f0aefb288975338778eda53af147b714 (patch)
tree14cf8e4c2b6728f87a378a1259de0c010f2c41ba /src/main
parent6ede855f3df3491fa617cc3e794742ce7a783124 (diff)
downloadGT5-Unofficial-c8d78c16f0aefb288975338778eda53af147b714.tar.gz
GT5-Unofficial-c8d78c16f0aefb288975338778eda53af147b714.tar.bz2
GT5-Unofficial-c8d78c16f0aefb288975338778eda53af147b714.zip
Fix quality design. (#97)
* Fix structure check * Fix structure * Fix descriptions * Add tier check for laser hatches * Fix description My mistake + Machine type change. Former-commit-id: 36aad0273d97b72cd272221eadc46cc0f5c3c5e0
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java46
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java45
2 files changed, 73 insertions, 18 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java
index e2383c8fa1..d7878a7973 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java
@@ -31,6 +31,7 @@ import com.github.bartimaeusnek.bartworks.util.MegaUtils;
import com.github.bartimaeusnek.bartworks.util.Pair;
import com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti;
import com.github.bartimaeusnek.crossmod.tectech.helper.TecTechUtils;
+import com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered.LowPowerLaser;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
import cpw.mods.fml.common.Optional;
@@ -38,6 +39,7 @@ import gregtech.api.GregTech_API;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
@@ -46,6 +48,7 @@ import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.List;
import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput;
@@ -83,7 +86,7 @@ public class GT_TileEntity_MegaChemicalReactor extends GT_MetaTileEntity_LargeCh
.addInfo("Follow the Structure Lib hologram projector to build the main structure.")
.addSeparator()
.beginStructureBlock(5, 5, 9, false)
- .addController("Front bottom")
+ .addController("Front center")
.addStructureInfo("The glass tier limits the Energy Input tier")
.addEnergyHatch("Hint block ", 3)
.addMaintenanceHatch("Hint block ",2)
@@ -199,22 +202,47 @@ public class GT_TileEntity_MegaChemicalReactor extends GT_MetaTileEntity_LargeCh
this.getTecTechEnergyTunnels().clear();
}
- if(checkPiece(STRUCTURE_PIECE_MAIN,2,2,0)&&(mMaintenanceHatches.size()==1)){
+ if(!checkPiece(STRUCTURE_PIECE_MAIN,2,2,0))
return false;
- }
- if (this.glasTier < 8 && !this.mEnergyHatches.isEmpty()) {
- for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : this.mEnergyHatches) {
- if (this.glasTier < hatchEnergy.mTier) {
+ if(mMaintenanceHatches.size() != 1)
+ return false;
+
+ if (LoaderReference.tectech && this.glasTier < 8)
+ if (!areLazorsLowPowa() || areThingsNotProperlyTiered(this.getTecTechEnergyTunnels()) || areThingsNotProperlyTiered(this.getTecTechEnergyMultis()))
+ return false;
+
+ if (this.glasTier < 8 && !this.mEnergyHatches.isEmpty())
+ for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : this.mEnergyHatches)
+ if (this.glasTier < hatchEnergy.mTier)
return false;
- }
- }
- }
return true;
}
+
+ @SuppressWarnings("rawtypes")
+ @Optional.Method(modid = "tectech")
+ private boolean areThingsNotProperlyTiered(Collection collection) {
+ if (!collection.isEmpty())
+ for (Object tecTechEnergyMulti : collection)
+ if (((GT_MetaTileEntity_TieredMachineBlock) tecTechEnergyMulti).mTier > this.glasTier)
+ return true;
+ return false;
+ }
+
+ @SuppressWarnings("rawtypes")
+ @Optional.Method(modid = "tectech")
+ private boolean areLazorsLowPowa() {
+ Collection collection = this.getTecTechEnergyTunnels();
+ if (!collection.isEmpty())
+ for (Object tecTechEnergyMulti : collection)
+ if (!(tecTechEnergyMulti instanceof LowPowerLaser))
+ return false;
+ return true;
+ }
+
private static final int CASING_INDEX = 176;
private static final String STRUCTURE_PIECE_MAIN = "main";
private static final IStructureDefinition<GT_TileEntity_MegaChemicalReactor> STRUCTURE_DEFINITION = StructureDefinition.<GT_TileEntity_MegaChemicalReactor>builder()
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java
index b936958948..ffe6d46ade 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java
@@ -31,6 +31,7 @@ import com.github.bartimaeusnek.bartworks.util.MegaUtils;
import com.github.bartimaeusnek.bartworks.util.Pair;
import com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti;
import com.github.bartimaeusnek.crossmod.tectech.helper.TecTechUtils;
+import com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered.LowPowerLaser;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
import cpw.mods.fml.common.Optional;
@@ -40,6 +41,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
@@ -48,6 +50,7 @@ import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.List;
import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput;
@@ -75,7 +78,7 @@ public class GT_TileEntity_MegaOilCracker extends GT_MetaTileEntity_OilCracker i
@Override
public GT_Multiblock_Tooltip_Builder createTooltip() {
final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType("Oil Cracking Unit")
+ tt.addMachineType("Cracker")
.addInfo("Controller block for the Mega Oil Cracking")
.addInfo("Thermally cracks heavy hydrocarbons into lighter fractions")
.addInfo("More efficient than the Chemical Reactor")
@@ -223,22 +226,46 @@ public class GT_TileEntity_MegaOilCracker extends GT_MetaTileEntity_OilCracker i
this.getTecTechEnergyTunnels().clear();
}
- if(checkPiece(STRUCTURE_PIECE_MAIN,6,6,0)&&(mMaintenanceHatches.size()==1)&&(mEnergyHatches.size()<=2)){
+ if(!checkPiece(STRUCTURE_PIECE_MAIN,6,6,0))
+ return false;
+
+ if(mMaintenanceHatches.size() != 1)
return false;
- }
+ if (LoaderReference.tectech && this.glasTier < 8)
+ if (!areLazorsLowPowa() || areThingsNotProperlyTiered(this.getTecTechEnergyTunnels()) || areThingsNotProperlyTiered(this.getTecTechEnergyMultis()))
+ return false;
- if (this.glasTier < 8 && !this.mEnergyHatches.isEmpty()) {
- for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : this.mEnergyHatches) {
- if (this.glasTier < hatchEnergy.mTier) {
+ if (this.glasTier < 8 && !this.mEnergyHatches.isEmpty())
+ for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : this.mEnergyHatches)
+ if (this.glasTier < hatchEnergy.mTier)
return false;
- }
- }
- }
return true;
}
+
+ @SuppressWarnings("rawtypes")
+ @Optional.Method(modid = "tectech")
+ private boolean areThingsNotProperlyTiered(Collection collection) {
+ if (!collection.isEmpty())
+ for (Object tecTechEnergyMulti : collection)
+ if (((GT_MetaTileEntity_TieredMachineBlock) tecTechEnergyMulti).mTier > this.glasTier)
+ return true;
+ return false;
+ }
+
+ @SuppressWarnings("rawtypes")
+ @Optional.Method(modid = "tectech")
+ private boolean areLazorsLowPowa() {
+ Collection collection = this.getTecTechEnergyTunnels();
+ if (!collection.isEmpty())
+ for (Object tecTechEnergyMulti : collection)
+ if (!(tecTechEnergyMulti instanceof LowPowerLaser))
+ return false;
+ return true;
+ }
+
private static final int CASING_INDEX = 49;
private static final String STRUCTURE_PIECE_MAIN = "main";
private static final IStructureDefinition<GT_TileEntity_MegaOilCracker> STRUCTURE_DEFINITION = StructureDefinition.<GT_TileEntity_MegaOilCracker>builder()