Sophisticated Core

Sophisticated Core

49M Downloads

Some foods are incompatible with Feeding Upgrades, causing the game to crash

James103 opened this issue ยท 2 comments

commented

To reproduce with barrels:

  1. Create a new world with cheats enabled.
  2. Give yourself a Sophisticated Barrel, an Advanced Feeding Upgrade, and the Infinite Steak from Project Expansion.
  3. Place the barrel, open the barrel, add the Advanced Feeding Upgrade, and place the Infinite Steak inside the barrel.
  4. Make yourself hungry.
  5. As soon as your hunger is not full (foodLevel != 20) and you are near the barrel, the server crashes.

To reproduce with backpacks:

  1. Create a new world with cheats enabled.
  2. Give yourself a Sophisticated Backpack, an Advanced Feeding Upgrade, and the Infinite Steak from Project Expansion.
  3. Open the backpack, add the Advanced Feeding Upgrade, and place the Infinite Steak inside the backpack.
  4. Make yourself hungry.
  5. As soon as your hunger is not full (foodLevel != 20), the server crashes.

Logs: https://paste.ee/p/JwGQ5
The above logs contain two crash reports. The first crash report is from the first set of reproduction steps, while the second crash report is from the second set of reproduction steps.

I'm reporting here because the game may crash with certain other foods as well, but it did crash with the Infinite Steak from Project Expansion. If this issue is determined to be caused by Project Expansion, it will be reposted in that repo's issue tracker.

Modlist from crash report:

	Mod List: 
		client-1.18.2-20220404.173914-srg.jar             |Minecraft                     |minecraft                     |1.18.2              |DONE      |Manifest: a1:d4:5e:04:4f:d3:d6:e0:7b:37:97:cf:77:b0:de:ad:4a:47:ce:8c:96:49:5f:0a:cf:8c:ae:b2:6d:4b:8a:3f
		notenoughcrashes-4.1.4+1.18.2-forge.jar           |Not Enough Crashes            |notenoughcrashes              |4.1.4+1.18.2        |DONE      |Manifest: NOSIGNATURE
		ProjectE-1.18.2-PE1.0.1.jar                       |ProjectE                      |projecte                      |1.0.1               |DONE      |Manifest: NOSIGNATURE
		forge-1.18.2-40.1.31-universal.jar                |Forge                         |forge                         |40.1.31             |DONE      |Manifest: 84:ce:76:e8:45:35:e4:0e:63:86:df:47:59:80:0f:67:6c:c1:5f:6e:5f:4d:b3:54:47:1a:9f:7f:ed:5e:f2:90
		ProjectExpansion-1.18.2-1.0.6.jar                 |Project Expansion             |projectexpansion              |1.18.2-1.0.6        |DONE      |Manifest: e9:fa:82:d2:7b:66:ce:37:db:52:70:63:25:68:04:a9:72:41:8f:cf:6c:9a:da:52:ab:05:5b:97:2c:13:54:37
		sophisticatedcore-1.18.2-0.2.6.30.jar             |Sophisticated Core            |sophisticatedcore             |1.18.2-0.2.6.30     |DONE      |Manifest: NOSIGNATURE
		sophisticatedbackpacks-1.18.2-3.17.2.588.jar      |Sophisticated Backpacks       |sophisticatedbackpacks        |1.18.2-3.17.2.588   |DONE      |Manifest: NOSIGNATURE
		sophisticatedstorage-1.18.2-0.1.1.35.jar          |Sophisticated Storage         |sophisticatedstorage          |1.18.2-0.1.1.35     |DONE      |Manifest: NOSIGNATURE
commented

Looking at this there's some incorrect implementation of food as it doesn't have any food properties and thus doesn't have nutrition that it restores and similar stuff that other mods can use to determine how good food it is. But I am going to add an implementation to prevent crashes like this which will just consider it nutrition level 1 so it won't crash, but may not work great as calculations related to when player is supposed to eat it won't have accurate values.

commented

fixed on curseforge