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

Commit

Permalink
fix a stupid mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
GlodBlock committed Jul 22, 2021
1 parent 41c9ff0 commit 30feb7f
Showing 1 changed file with 21 additions and 16 deletions.
37 changes: 21 additions & 16 deletions src/main/java/GoodGenerator/Blocks/TEs/FuelRefineFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import gregtech.api.metatileentity.implementations.*;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Log;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
Expand All @@ -34,16 +35,15 @@

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;

import static com.github.technus.tectech.mechanics.structure.StructureUtility.*;
import static com.github.technus.tectech.mechanics.structure.StructureUtility.ofChain;

public class FuelRefineFactory extends GT_MetaTileEntity_MultiblockBase_EM implements TecTechEnabledMulti, IConstructable {

private IStructureDefinition<FuelRefineFactory> multiDefinition = null;
private int Tier = -1;
private int[] cnt = new int[]{0,0,0};
private static final Block[] coils = new Block[]{Loaders.FRF_Coil_1,Loaders.FRF_Coil_2,Loaders.FRF_Coil_3};

public FuelRefineFactory(String name){super(name);}
Expand Down Expand Up @@ -119,9 +119,18 @@ public IStructureDefinition<FuelRefineFactory> getStructure_EM() {
).addElement(
'F',
ofChain(
ofFieldCoil(0),
ofFieldCoil(1),
ofFieldCoil(2)
onElementPass(
x -> ++x.cnt[0],
ofFieldCoil(0)
),
onElementPass(
x -> ++x.cnt[1],
ofFieldCoil(1)
),
onElementPass(
x -> ++x.cnt[2],
ofFieldCoil(2)
)
)
)
.build();
Expand Down Expand Up @@ -199,21 +208,17 @@ public String[] getStructureDescription(ItemStack itemStack){

@Override
public boolean checkMachine_EM(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
Tier = getTier();
return structureCheck_EM(mName, 7,12,1);
cnt[0] = 0;cnt[1] = 0;cnt[2] = 0;
return structureCheck_EM(mName, 7,12,1) && getTier() != -1;
}

public int getTier(){
IGregTechTileEntity aTile = this.getBaseMetaTileEntity();
int[] dx = {1,-1,0,0,0,0};
int[] dy = {0,0,1,-1,0,0};
int[] dz = {0,0,0,0,1,-1};
for (int i = 0; i < 3; i ++)
for (int j = 0; j < 6; j ++){
if (aTile.getBlockOffset(dx[j],dy[j],dz[j]) == coils[i]){
return i + 1;
}
for (int i = 0; i < 3; i ++) {
if (cnt[i] == 32) {
Tier = i + 1;
return i;
}
}
return -1;
}

Expand Down

0 comments on commit 30feb7f

Please sign in to comment.