Skip to content

Commit

Permalink
fix ghost circ init
Browse files Browse the repository at this point in the history
  • Loading branch information
ghzdude committed Apr 14, 2024
1 parent bff5c92 commit 030dfa3
Showing 1 changed file with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,10 @@ public MetaTileEntityFluidHatch(ResourceLocation metaTileEntityId, int tier, boo
super(metaTileEntityId, tier, isExportHatch);
this.fluidTank = new HatchFluidTank(getInventorySize(), this, isExportHatch);
this.workingEnabled = true;
initializeInventory();
}

@Override
protected void initializeInventory() {
super.initializeInventory();
if (!this.hasGhostCircuitInventory()) return;

this.circuitInventory = new GhostCircuitItemStackHandler(this);
this.circuitInventory.addNotifiableMetaTileEntity(this);
if (this.hasGhostCircuitInventory()) {
this.circuitInventory = new GhostCircuitItemStackHandler(this);
this.circuitInventory.addNotifiableMetaTileEntity(this);
}
}

@Override
Expand Down Expand Up @@ -380,13 +374,15 @@ private Consumer<List<ITextComponent>> getFluidAmountText(TankWidget tankWidget)
@Override
public void addToMultiBlock(MultiblockControllerBase controllerBase) {
super.addToMultiBlock(controllerBase);
this.circuitInventory.addNotifiableMetaTileEntity(controllerBase);
if (hasGhostCircuitInventory())
this.circuitInventory.addNotifiableMetaTileEntity(controllerBase);
}

@Override
public void removeFromMultiBlock(MultiblockControllerBase controllerBase) {
super.removeFromMultiBlock(controllerBase);
this.circuitInventory.removeNotifiableMetaTileEntity(controllerBase);
if (hasGhostCircuitInventory())
this.circuitInventory.removeNotifiableMetaTileEntity(controllerBase);
}

@Override
Expand Down

0 comments on commit 030dfa3

Please sign in to comment.