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

Commit

Permalink
fix the FRF coil check bug and change the recipe load order
Browse files Browse the repository at this point in the history
  • Loading branch information
GlodBlock committed May 23, 2021
1 parent f745810 commit cc04267
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 21 deletions.
20 changes: 11 additions & 9 deletions src/main/java/GoodGenerator/Blocks/TEs/FuelRefineFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyTunnel;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
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 Down Expand Up @@ -145,7 +145,7 @@ public boolean checkCoil(){
vis.clear();
if (aTile.getBlockOffset(dx[i],dy[i],dz[i]) == block[j])
if (dfs(block[j], aTile.getWorld(),aTile.getXCoord() + dx[i],aTile.getYCoord() + dy[i],aTile.getZCoord() + dz[i],32)){
Tier = j;
Tier = j + 1;
return true;
}
}
Expand Down Expand Up @@ -248,13 +248,15 @@ public boolean checkRecipe_EM(ItemStack aStack){
}
}

for (GT_Recipe recipe : tRecipes){
FluidStack[] inFluids = tFluids.toArray(new FluidStack[tFluids.size()]);
ItemStack[] inItems = tItems.toArray(new ItemStack[tItems.size()]);

for (GT_Recipe recipe : tRecipes){
checkCoil();
if (recipe.mSpecialValue > Tier) continue;

if (recipe.isRecipeInputEqual(true, tFluids.toArray(new FluidStack[tFluids.size()]), tItems.toArray(new ItemStack[tItems.size()]))){
calculatePerfectOverclockedNessMulti(recipe.mEUt, recipe.mDuration / (Tier - recipe.mSpecialValue + 1), 1, maxVoltage);
if (recipe.isRecipeInputEqual(true, inFluids, inItems)){
mEUt = recipe.mEUt;
mMaxProgresstime = recipe.mDuration / (1 << (Tier - recipe.mSpecialValue));
this.mOutputFluids = recipe.mFluidOutputs;
this.updateSlots();
return true;
Expand Down Expand Up @@ -330,8 +332,8 @@ public boolean isCorrectMachinePart(ItemStack aStack) {
@SuppressWarnings("ALL")
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
if(aSide == aFacing){
if(aActive) return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(48),new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE_GLOW)};
return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(48),new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_GLOW)};
if(aActive) return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(48),new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE_GLOW).glow().build()};
return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(48),new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE),TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_GLOW).glow().build()};
}
return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(48)};
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/GoodGenerator/Blocks/TEs/MultiNqGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.*;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
Expand Down Expand Up @@ -390,7 +391,7 @@ public String[] getDescription() {
@SuppressWarnings("ALL")
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
if(aSide == aFacing){
if(aActive) return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(44),new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_FRONT_ACTIVE_GLOW)};
if(aActive) return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(44),new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_FRONT_ACTIVE), TextureFactory.builder().addIcon(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_FRONT_ACTIVE_GLOW).glow().build()};
return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(44),new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_FRONT)};
}
return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(44)};
Expand Down
24 changes: 13 additions & 11 deletions src/main/java/GoodGenerator/Loader/RecipeLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -543,17 +543,6 @@ public static void RecipeLoad(){
960
);

GT_Values.RA.addBlastRecipe(
MyMaterial.extremelyUnstableNaquadah.get(OrePrefixes.dust,1),
GT_Utility.getIntegratedCircuit(1),
null,null,
MyMaterial.extremelyUnstableNaquadah.get(OrePrefixes.ingotHot),
null,
8000,
114514,
7000
);

CrackRecipeAdder.crackerAdder(
MyMaterial.naquadahGas.getFluidOrGas(1000),
MyMaterial.atomicSeparationCatalyst.getMolten(4),
Expand Down Expand Up @@ -1072,6 +1061,19 @@ public static void RecipeLoad(){
);
}

public static void InitLoadRecipe(){
GT_Values.RA.addBlastRecipe(
MyMaterial.extremelyUnstableNaquadah.get(OrePrefixes.dust,1),
GT_Utility.getIntegratedCircuit(1),
null,null,
MyMaterial.extremelyUnstableNaquadah.get(OrePrefixes.ingotHot),
null,
8000,
114514,
7000
);
}

public static void Fixer(){
MaterialFix.MaterialFluidExtractionFix(MyMaterial.atomicSeparationCatalyst);
MaterialFix.MaterialFluidExtractionFix(MyMaterial.extremelyUnstableNaquadah);
Expand Down
1 change: 1 addition & 0 deletions src/main/java/GoodGenerator/Main/GoodGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public static void preInit(FMLPreInitializationEvent event){
@Mod.EventHandler
public static void init(FMLInitializationEvent event){
proxy.init(event);
RecipeLoader.InitLoadRecipe();
FuelRecipeLoader.RegisterFuel();
}
@Mod.EventHandler
Expand Down

0 comments on commit cc04267

Please sign in to comment.