Skip to content

Conversation

Copy link

Copilot AI commented Dec 13, 2025

Users requested a way to preserve food by salting with configurable recipes. The datapack workaround allowed infinite salting of expired food since spoilage only converts to rotten flesh on consumption.

Changes

New Components

  • SaltingRecipe - Model for recipe configuration: food type, salt material, amount, mode (RESET/EXTEND), time modifier
  • SaltingCraftListener - Intercepts PrepareItemCraftEvent to detect salting recipes and apply timestamp modifications
    • Validates food hasn't spoiled before allowing preservation
    • Prevents the infinite salting issue

Enhanced Services

  • LocalTimeStampService - Added resetTimeStamp() and extendTimeStamp() methods
  • LocalConfigService - Loads salting recipes from config, added reload() for hot-reloading

Configuration

Added salting-recipes section to config.yml:

salting-recipes:
  CHICKEN:
    salt-material: SUGAR
    salt-amount: 8
    mode: RESET              # or EXTEND
    time-modifier: PT0H      # ISO-8601 duration

Behavior

RESET mode: Resets timer to original duration (e.g., raw meats)
EXTEND mode: Adds time to remaining duration (e.g., fish +48h)

Crafting 1 food + N salt items triggers salting. Already-spoiled items return null result, blocking the craft.

Default recipes configured for raw meats (RESET) and fish (EXTEND) using sugar as salt.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • hub.spigotmc.org
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.invoke=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.prefs/java.util.prefs=ALL-UNNAMED --add-opens java.prefs/java.util.prefs=ALL-UNNAMED --add-opens java.base/java.nio.charset=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.util.concurrent.atomic=ALL-UNNAMED -XX:MaxMetaspaceSize=256m (dns block)
  • jitpack.io
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.invoke=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.prefs/java.util.prefs=ALL-UNNAMED --add-opens java.prefs/java.util.prefs=ALL-UNNAMED --add-opens java.base/java.nio.charset=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.util.concurrent.atomic=ALL-UNNAMED -XX:MaxMetaspaceSize=256m (dns block)
  • repo.rpkit.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.invoke=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.prefs/java.util.prefs=ALL-UNNAMED --add-opens java.prefs/java.util.prefs=ALL-UNNAMED --add-opens java.base/java.nio.charset=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.util.concurrent.atomic=ALL-UNNAMED -XX:MaxMetaspaceSize=256m (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>[Feature Request] Salting meats to increase/reset their spoil time (configurable)</issue_title>
<issue_description>(reposted from the Discord)

Hi Dan I have a suggestion for the food spoilage plugin.

It would be cool if users could add in the config file some "salting recipes" for different types of meat. And "salting" the meat would either reset its spoilage timer or just increase how much time it takes to spoil by a configurable amount.

I tried to add a salting recipe myself with a datapack, it looked like this:
1 chicken + 8 sugar = 1 chicken (crafting it would reset the spoilage timer)

But the issue I had was that this could be done infinitely on the same piece of meat, and since spoiled meat doesn't turn into rotten flesh UNTIL you try to eat it, you could salt meat that was 10 years past its spoilage date because it hadn't turned into rotten flesh yet.

But I think this idea would function better as a real feature of the mod instead of a janky datapack I made anyway, and those issues could be fixed :]

Let me know if you ever plan to add anything like this, it would be cool to see.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Add configurable salting recipes for meat spoilage Add configurable salting recipes to preserve food and prevent spoilage Dec 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants