Skip to content

Commit 590fa86

Browse files
committed
we still need this, actually
1 parent f1f12a2 commit 590fa86

File tree

1 file changed

+15
-18
lines changed

1 file changed

+15
-18
lines changed

src/main/java/gregtech/common/metatileentities/multi/multiblockpart/MetaTileEntityFluidHatch.java

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -339,27 +339,11 @@ private void setLocked(boolean locked) {
339339
fluidTank.onContentsChanged();
340340
}
341341

342-
// todo remove
343-
@Deprecated
344-
protected class HatchFluidTank extends NotifiableFluidTank {
342+
protected class HatchFluidTank extends NotifiableFluidTank implements IFilter<FluidStack> {
345343

346344
public HatchFluidTank(int capacity, MetaTileEntity entityToNotify, boolean isExport) {
347345
super(capacity, entityToNotify, isExport);
348-
setFilter(new IFilter<>() {
349-
350-
@Override
351-
public boolean test(@NotNull FluidStack fluidStack) {
352-
if (!isExportHatch) return true;
353-
return !locked || lockedFluid == null || fluidStack.isFluidEqual(lockedFluid);
354-
}
355-
356-
@Override
357-
public int getPriority() {
358-
if (!isExportHatch) return IFilter.noPriority();
359-
return !locked || lockedFluid == null ? IFilter.noPriority() :
360-
IFilter.whitelistPriority(1);
361-
}
362-
});
346+
setFilter(this);
363347
}
364348

365349
@Override
@@ -378,5 +362,18 @@ public int fillInternal(FluidStack resource, boolean doFill) {
378362
public void onContentsChanged() {
379363
super.onContentsChanged();
380364
}
365+
366+
@Override
367+
public boolean test(@NotNull FluidStack fluidStack) {
368+
if (!isExportHatch) return true;
369+
return !locked || lockedFluid == null || fluidStack.isFluidEqual(lockedFluid);
370+
}
371+
372+
@Override
373+
public int getPriority() {
374+
if (!isExportHatch) return IFilter.noPriority();
375+
return !locked || lockedFluid == null ? IFilter.noPriority() :
376+
IFilter.whitelistPriority(1);
377+
}
381378
}
382379
}

0 commit comments

Comments
 (0)