mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2026-10-22 23:42:30 +00:00
When we upgrade a normal pocket computer to an advanced one, we need to create a new ServerComputer instance (and destroy the old one). On 1.20.1 the ComputerUpgradeRecipe does not preserve the instance/session ID on the resulting stack. When the item is next ticked, we create a new computer, with the old computer no longer being kept alive and eventually dying. On 1.21.1 we copy all components, *including* the the current computer reference. This means a new computer is never created and so we continue to use the old one (with the wrong family). We could exclude the computer component from the recipe (and so have the same behaviour as 1.20.1), but by adding a hook in onCraftedBy we can destroy the old computer immediately, ensuring it no longer continues to run. Fixes #2479.