package squeek.spiceoflife.foodtracker.foodqueue;

import squeek.spiceoflife.ModConfig;
import net.minecraft.nbt.NBTTagCompound;

public class FixedTimeQueue extends FoodQueue
{
	private static final long serialVersionUID = 4071948082682614961L;
	protected long tickLimit;

	public FixedTimeQueue(long tickLimit)
	{
		this.tickLimit = tickLimit;
	}

	/**
	 * Called every update tick. See {@link squeek.spiceoflife.foodtracker.FoodTracker#onLivingUpdate}
	 */
	public void prune(long absoluteTime, long relativeTime)
	{
		while (hasHeadExpired(absoluteTime, relativeTime))
		{
			super.remove();
		}
	}

	public boolean hasHeadExpired(long absoluteTime, long relativeTime)
	{
		if (size() <= 0)
			return false;

		if (ModConfig.PROGRESS_TIME_WHILE_LOGGED_OFF)
			return absoluteTime >= get(0).worldTimeEaten + tickLimit;
		else
			return relativeTime >= get(0).playerTimeEaten + tickLimit;
	}

	@Override
	public void readFromNBTData(NBTTagCompound data)
	{
		super.readFromNBTData(data);
	}

	@Override
	public void writeToNBTData(NBTTagCompound data)
	{
		super.writeToNBTData(data);
	}
}

@@ -679,19 +679,27 @@
 if (
-size() %3C= 0
+peekFirst() == null
 )%0A%09%09
@@ -788,21 +788,26 @@
 Time %3E= 
-ge
+peekFirs
 t(
-0
 ).worldT
@@ -865,13 +865,18 @@
  %3E= 
-ge
+peekFirs
 t(
-0
 ).pl

Use peekFirst instead of get(0) in FixedTimeQueue