Skip to content

Commit

Permalink
fix merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
PrototypeTrousers committed Jun 5, 2021
1 parent cfcf226 commit e2f654b
Showing 1 changed file with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import codechicken.lib.render.pipeline.IVertexOperation;
import codechicken.lib.vec.Matrix4;
import gregtech.api.capability.impl.FluidTankList;
import gregtech.api.capability.impl.NotifiableItemStackHandler;
import gregtech.api.gui.GuiTextures;
import gregtech.api.gui.ModularUI;
import gregtech.api.gui.ModularUI.Builder;
Expand Down Expand Up @@ -36,14 +37,14 @@ public class MetaTileEntityFluidHatch extends MetaTileEntityMultiblockPart imple

private static final int INITIAL_INVENTORY_SIZE = 8000;
private ItemStackHandler containerInventory;
private FluidTank fluidTank;
private NotifiableFluidTank fluidTank;
private boolean isExportHatch;

public MetaTileEntityFluidHatch(ResourceLocation metaTileEntityId, int tier, boolean isExportHatch) {
super(metaTileEntityId, tier);
this.containerInventory = new ItemStackHandler(2);
this.isExportHatch = isExportHatch;
this.fluidTank = new FluidTank(getInventorySize());
this.fluidTank = new NotifiableFluidTank(getInventorySize(), this, isExportHatch);
initializeInventory();
}

Expand Down Expand Up @@ -118,6 +119,20 @@ public void registerAbilities(List<IFluidTank> abilityList) {
abilityList.addAll(isExportHatch ? this.exportFluids.getFluidTanks() : this.importFluids.getFluidTanks());
}

@Override
public void setupNotifiableMetaTileEntity(MetaTileEntity metaTileEntity) {
NotifiableFluidTank handler = null;
if (isExportHatch) {
handler = (NotifiableFluidTank) getExportFluids().getTankAt(0);
} else {
handler = (NotifiableFluidTank) getImportFluids().getTankAt(0);
}
if (handler != null) {
handler.setNotifiableMetaTileEntity(metaTileEntity);
handler.addToNotifiedList(this, handler, isExportHatch);
}
}

@Override
protected ModularUI createUI(EntityPlayer entityPlayer) {
return createTankUI((isExportHatch ? exportFluids : importFluids).getTankAt(0), containerInventory, getMetaFullName(), entityPlayer)
Expand Down

0 comments on commit e2f654b

Please sign in to comment.