Skip to content
This repository has been archived by the owner on Mar 8, 2024. It is now read-only.

Commit

Permalink
Fix quality design. (#97)
Browse files Browse the repository at this point in the history
* Fix structure check

* Fix structure

* Fix descriptions

* Add tier check for laser hatches

* Fix description

My mistake + Machine type change.

Former-commit-id: 18bb856eb2af76dbc55f7f90fc0ef209b1b57a60
  • Loading branch information
kuba6000 authored Feb 27, 2022
1 parent 15c2bcf commit dae1ede
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@
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;
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;
Expand All @@ -46,6 +48,7 @@
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;
Expand Down Expand Up @@ -83,7 +86,7 @@ public GT_Multiblock_Tooltip_Builder createTooltip() {
.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)
Expand Down Expand Up @@ -199,22 +202,47 @@ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack a
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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
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;
Expand All @@ -40,6 +41,7 @@
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;
Expand All @@ -48,6 +50,7 @@
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;
Expand Down Expand Up @@ -75,7 +78,7 @@ public GT_TileEntity_MegaOilCracker(String aName) {
@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")
Expand Down Expand Up @@ -223,22 +226,46 @@ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack a
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()
Expand Down

0 comments on commit dae1ede

Please sign in to comment.