1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-01-09 08:50:29 +00:00
CC-Tweaked/projects
Jonathan Coates dcc74e15c7
Fix pocket upgrades not applying after crafting
The most annoying thing about pocket computers is handling computer
state (label, upgrades, etc...). Unlike other computers, which are tied
to a specific block entity, pocket computers float untethered. We can't
hold a reference to a specific item stack (as the computer might be
moved between inventories, crafted, etc...), so instead we explicitly
sync data between the computer and *current* stack, whenever the holding
player/entity is ticked.

In ed0b156e05 I rewrote this syncing code
to always treat the computer as the source of truth. Upgrades would be
copied to the computer, but never the other way round. However, this
meant that upgrades obtained by crafting would never be detected,
requiring the computer to be destroyed and recreated.

A more long-term fix here is probably to rewrite IPocketAccess to only
allow updating upgrade data on the main thread, and when we have a valid
PocketHolder. This is a breaking API change though, and so will have to
wait for 1.21.3.

For now, we just add a hook that refreshes the upgrade after crafting.

Fixes #1957
2024-10-27 09:49:01 +00:00
..
common Fix pocket upgrades not applying after crafting 2024-10-27 09:49:01 +00:00
common-api Fix several repeated words 2024-08-17 11:39:14 +01:00
core Fix wrong link in os.date docs 2024-10-24 14:03:06 +01:00
core-api Add a helper class for working with attached computers 2024-09-22 13:51:11 +01:00
fabric Use ARGB32 to store palette colours 2024-09-11 10:13:39 +01:00
fabric-api Rewrite turtle upgrade modeller registration API 2024-01-16 23:00:49 +00:00
forge Remove command translation keys 2024-10-11 12:12:02 +02:00
forge-api Rewrite turtle upgrade modeller registration API 2024-01-16 23:00:49 +00:00
lints Fix disk drives not setting/clearing removed flag 2024-08-15 09:03:33 +01:00
standalone Small bits of cleanup 2024-06-26 18:07:57 +01:00
web Publish docs via an artifact instead 2024-06-19 09:57:56 +01:00
ARCHITECTURE.md Add a standalone CC:T UI 2023-10-28 17:58:11 +01:00