I'm an idiot

This commit is contained in:
Ell 2020-10-19 20:41:48 +02:00
parent 5c5988f8a7
commit 398d0680b6

View file

@ -27,7 +27,7 @@ import net.minecraftforge.fluids.capability.templates.FluidTank;
public class TileEntitySpring extends TileEntityImpl implements ITickableTileEntity { public class TileEntitySpring extends TileEntityImpl implements ITickableTileEntity {
private final IFluidTank tank = new InfiniteTank(); private final IFluidHandler tank = new InfiniteTank();
private AABBTicket waterTicket; private AABBTicket waterTicket;
public TileEntitySpring() { public TileEntitySpring() {
@ -140,7 +140,7 @@ public class TileEntitySpring extends TileEntityImpl implements ITickableTileEnt
return (!source || state.isSource()) && state.getFluid().isIn(FluidTags.LAVA); return (!source || state.isSource()) && state.getFluid().isIn(FluidTags.LAVA);
} }
private class InfiniteTank implements IFluidTank { private class InfiniteTank implements IFluidTank, IFluidHandler {
@Override @Override
public FluidStack getFluid() { public FluidStack getFluid() {
return new FluidStack(Fluids.WATER, 1000); return new FluidStack(Fluids.WATER, 1000);
@ -180,5 +180,25 @@ public class TileEntitySpring extends TileEntityImpl implements ITickableTileEnt
return this.drain(resource.getAmount(), action); return this.drain(resource.getAmount(), action);
return FluidStack.EMPTY; return FluidStack.EMPTY;
} }
@Override
public int getTanks() {
return 1;
}
@Override
public FluidStack getFluidInTank(int tank) {
return this.getFluid();
}
@Override
public int getTankCapacity(int tank) {
return this.getCapacity();
}
@Override
public boolean isFluidValid(int tank, FluidStack stack) {
return this.isFluidValid(stack);
}
} }
} }