Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Issue with #73 #74

Merged
merged 1 commit into from
Aug 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
}
}
}