TerraFirmaCraft

TerraFirmaCraft

2M Downloads

The time at which a barrel is sealed still resets when broken

Flaksmith opened this issue ยท 2 comments

commented

This bug has not been fixed

commented

In the future please fill out the template, but I figured out what you meant hopefully. Able to reproduce this by placing an already sealed barrel and then breaking it, which sets the sealed time to when you broke it instead of when it was originally sealed.

commented

Looks like this is the cause:

public void setBarrelContents(@Nullable FluidStack fluidStack, @Nullable NBTTagCompound inventoryTag, @Nullable NBTTagList surplusTag, long sealedTick, long sealedCalendarTick)
{
NBTTagCompound nbt = container.getTagCompound();
if (nbt == null)
{
nbt = new NBTTagCompound();
}
if (inventoryTag != null)
{
nbt.setTag("inventory", inventoryTag);
}
if (surplusTag != null)
{
nbt.setTag("surplus", surplusTag);
}
nbt.setLong("sealedTick", sealedTick);
nbt.setLong("sealedCalendarTick", sealedCalendarTick);
container.setTagCompound(nbt);
this.fill(fluidStack, true);
}

Since fill() calls setFluid() which always sets the seal tick to the current time, overriding what was just set before the call