Backpacks keep food cold even without permissionFixed

Hi,
I have only 3 permissions granted for the backpack (oxide.show user):
backpacks.size.12, backpacks.gather, backpacks.use,

I don't have nofoodspoil permission. However food is still being frozen/kept cold when added to it. I think this is a bug?

I don't see a config option to it in general config file

There is no known bug which causes this. One possibility that comes to mind is that the location of the backpack containers (far below the center of the map) could possibly be considered to be in the arctic biome on your particular map. If you see this issue only one specific maps, then that root cause is plausible. Otherwise, the only possibility is something going on with permissions, since the plugin doesn't have any functionality related to this outside of permissions.

It's worth mentioning that a future version of this plugin will make it so the backpack refrigerates food while the player is in the arctic biome, as requested by some users. This functionality is already available in the version of the plugin on GitHub, so if you installed that version already for some reason, that could be the cause of what you are seeing, but that would only explain it if you are seeing this behavior in the arctic biome.

If the issue is caused by the location of the backpack containers, there is a Vector3 somewhere in the cs file which you can edit to experimentally change this. I dont have the line of code off hand, but if you use AI, it should be able to easily locate it. Don't change the height, just the X and Z coordinates. If changing the location resolves the issue, that will be strong evidence of the issue, so that I can implement a solution for it in a future update.

Thank you, chaging the vector3 position fixed the issue. Backpack container was in arctic zone.
var storageEntity = GameManager.server.CreateEntity(CoffinPrefab, new Vector3(300, -500, 0));

Hi WhiteThunder,

Thank you as always for your work on the Backpacks plugin.

I wanted to follow up regarding the issue where food inside backpacks was being kept cold / frozen even for players who do not have the backpacks.nofoodspoiling permission.

As you suggested in a previous reply, I tested changing the storage container position in the CS file.

The original line was:

var storageEntity = GameManager.server.CreateEntity(CoffinPrefab, new Vector3(0, -500, 0));

I changed only the X and Z coordinates, without changing the height:

var storageEntity = GameManager.server.CreateEntity(CoffinPrefab, new Vector3(300, -500, 1000));

After making this change, food inside the backpack started spoiling normally.

So it seems that, on my current map, the original backpack storage container position was being treated as a cold / arctic biome location, causing the food to be refrigerated even without the nofoodspoiling permission.

Would it be possible to add a config option for the hidden backpack storage container position, or to adjust the plugin so the internal storage containers are placed in a location that will not be affected by biome temperature?

Also, if there are any risks or side effects from using this temporary workaround, please let me know.

Thank you very much.

I looked into the issue and there isn't a good way to fix it without moving the backpack container location. I am planning to make an update which will sample various locations around the map to one that is outside of the Arctic biome. Hopefully that will be sufficient but it's hard to say without testing it on every map. I suppose if there is a map which is entirely Arctic biome then it would be OK for food to not spoil in that case anyway.

Yes, this workaround is totally safe, no side effects.

Thank you very much for looking into this.

I’m glad to hear that the workaround is safe and has no side effects.

I understand that moving the hidden backpack container location is currently the best solution, and I appreciate that you are planning to improve this in a future update by checking multiple locations and selecting one outside the Arctic biome.

I’ll continue using the current workaround for now.

Thank you again for your support and for maintaining this great plugin.

Merged post

I found one more issue after applying the workaround.

Changing the hidden backpack storage container position fixed the issue where food was being kept cold/frozen.

However, I noticed that food spoilage time does not seem to progress normally while the item remains inside the plugin backpack.

When I take the food out of the backpack, the spoilage time appears to update all at once.

In the past, food inside the plugin backpack used to spoil over time while it remained inside the backpack.

So this seems different from the previous behavior.

To clarify:

  • The Arctic/cold biome issue appears to be fixed by changing the hidden storage container position.

  • But food spoilage does not seem to update in real time while the food remains inside the backpack.

  • When the food is removed from the backpack, the elapsed spoilage time is applied all at once.

Is this the intended behavior in the current version, or could this be a regression/change in how food spoilage is handled inside backpacks?

Thank you very much.

I didn't follow your explanation of symptoms exactly, so I will just explain how it's supposed to work and then we can go from there.

When a player enters the arctic biome, there is a delay of up to 10 seconds before the items in their backpack become chilled (snowflake icon). Once an item in the backpack becomes chilled, its stops spoiling immediately (timer stops updating). When the player leaves the arctic biome, there is again a delay of up to 10 seconds before the item thaws and resumes ticking. This is expected as the result of performance optimizations. I could speed it up but there isn't much reason to. The only issue I can imagine is that a player might be confused if they have food in both their inventory and their backpack visible at once and notice they are not in sync, but that is just an issue of confusion.

There are some edge cases I could get into around backpacks being fully unloaded from memory (backed up to disk only), since the timer can't actually tick in that case, so the plugin has to track timestamps and deduct time later on when the backpack is loaded back into memory. I only mention this in passing since it is probably not coming into play in what you are witnessing.

Sorry for the delayed confirmation and reply.

Thank you very much for the detailed explanation. I understand now how the system is intended to work.

I also understand that the spoilage timer stopping while items are chilled, and the delayed update behavior in some cases, are expected due to the way the plugin handles performance and storage.

Thank you again for your support and for taking the time to explain it.

Hi WhiteThunder,

 
Thank you as always for maintaining Backpacks.
 
I’m currently using Backpacks v3.17.5, but the food refrigeration issue still seems to be happening on my server.
 
Players do not have the backpacks.nofoodspoiling permission, but food placed inside plugin backpacks is still kept cold / refrigerated everywhere on the map, not only in Arctic areas.
 
Since it happens everywhere, it seems like the hidden backpack storage container may still be placed in a location that is treated as Arctic biome on this custom map.
 
Would it be possible to check whether the automatic container location selection added in v3.17.5 can still select an Arctic biome location on some maps?
 
Also, is there a way to confirm which hidden container position the plugin selected?
 
If changing only the X and Z coordinates is still a safe temporary workaround, I would appreciate guidance on the safest way to do that in v3.17.5.
 
Thank you very much.

First, you can try reloading the plugin and checking the server logs. If you see the following message, that means the plugin sampled 100 locations  across the entire span of the map and could not find one outside of the Arctic biome.

Warning: All backpacks will be exempt from food spoiling because the plugin failed to locate a map position outside of the Arctic Biome

If you do not see that message, and you want to know which location was selected, or if you want to update the fallback location, you can try updating the code as follows.

if (TryFindBackpackContainerPositionNotInArcticBiome(out var position, out var sampleCount))
{
    _backpackContainerPosition = position;
    LogWarning($"Backpack container location: {position}");  // <--- Add this line
}
else
{
    LogWarning($"Warning: All backpacks will be exempt from food spoiling because the plugin failed to locate a map position outside of the Arctic Biome out of [{sampleCount}] samples.");
    _backpackContainerPosition = new Vector3(0f, BackpackContainerHeight, 0f);  // <--- Edit this line to change the fallback location
}

 

 

Hi WhiteThunder,

 
Thank you very much for checking this and for explaining what I should look for.
 
I’m currently away on a work trip, so I can’t access and test the server properly right now.
 
As soon as I return, I will reload the plugin, check the server logs, and confirm whether that warning message appears. If needed, I will also try the code change you suggested to log or adjust the selected backpack container position.
 
I really appreciate your support and the time you are taking to help with this.
 
Thank you again.


Merged post

Hi WhiteThunder,
 
I reloaded Backpacks v3.17.5 and checked the console.
 
The plugin reloaded successfully:
 
Unloaded plugin Backpacks v3.17.5 by WhiteThunder
Loaded plugin Backpacks v3.17.5 by WhiteThunder
 
I did not see the warning message:
 
“Warning: All backpacks will be exempt from food spoiling...”
 
So it looks like the plugin did not log that it failed to find a non-Arctic location.
 
I will try the code change you suggested to log which backpack container position is selected once I am back from my work trip and can properly access the server files.
 
Thank you again for your help.


Merged post

Hi WhiteThunder,

I added the log output and reloaded Backpacks v3.17.5.

Here is the result:

Backpack container position selected: (0.00, -500.00, 0.00) | Arctic: True | Samples: 100

Food in backpacks is still being refrigerated everywhere on the map.

It looks like the selected hidden backpack container position is being treated as Arctic biome.

I will try changing the initial center check and/or forcing the container position temporarily.

Thank you again for your help.

I found the issue. Toward the end of developing this capability, I added a check to use the default location if it was not in the arctic biome, before searching around the map. There was a typo and that check was inverted, so it only used it if it was in the arctic biome. I pushed the update to GitHub for you to test further.

Thank you very much for checking this so quickly and for pushing the update to GitHub.
I’m glad the cause was found. The explanation makes sense, and it matches what I saw in the log.
I will test the updated version from GitHub and confirm whether the backpack container position is now selected outside the Arctic biome, and whether food spoilage works normally again.
Thank you again for your fast support and for maintaining this plugin.