Skip to content

Commit

Permalink
fix another issue (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
ghzdude authored Aug 11, 2024
1 parent 2b86734 commit edb76b2
Showing 1 changed file with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,17 @@
*/
public class MetaTileEntityLargeDistillery extends GCYMRecipeMapMultiblockController implements IDistillationTower {

protected DistillationTowerLogicHandler handler = null;
protected final DistillationTowerLogicHandler handler;

public MetaTileEntityLargeDistillery(ResourceLocation metaTileEntityId) {
this(metaTileEntityId, false);
}

public MetaTileEntityLargeDistillery(ResourceLocation metaTileEntityId, boolean useAdvHatchLogic) {
super(metaTileEntityId, new RecipeMap[] { RecipeMaps.DISTILLATION_RECIPES, RecipeMaps.DISTILLERY_RECIPES });
this.recipeMapWorkable = new LargeDistilleryRecipeLogic(this);
if (useAdvHatchLogic)
this.handler = new DistillationTowerLogicHandler(this);
this.handler = new DistillationTowerLogicHandler(this);
}

@Override
public MetaTileEntity createMetaTileEntity(IGregTechTileEntity metaTileEntityHolder) {
return new MetaTileEntityLargeDistillery(this.metaTileEntityId, usesAdvHatchLogic());
return new MetaTileEntityLargeDistillery(this.metaTileEntityId);
}

/**
Expand Down Expand Up @@ -118,7 +113,7 @@ protected void formStructure(PatternMatchContext context) {
}

protected boolean usesAdvHatchLogic() {
return getCurrentRecipeMap() == RecipeMaps.DISTILLATION_RECIPES && this.handler != null;
return getCurrentRecipeMap() == RecipeMaps.DISTILLATION_RECIPES;
}

@Override
Expand Down Expand Up @@ -265,7 +260,10 @@ protected boolean setupAndConsumeRecipeInputs(@NotNull Recipe recipe,

@Override
protected IMultipleTankHandler getOutputTank() {
return handler.getFluidTanks();
if (usesAdvHatchLogic())
return handler.getFluidTanks();

return super.getOutputTank();
}
}
}

0 comments on commit edb76b2

Please sign in to comment.