* Data Attachment API
* javadoc
* Remove AttachmentSerializer & independent syncability and persistence
- removed AttachmentSerializer in favor of codecs
- renamed serializability to "persistence"
- made persistence and syncability independent switches
- reworked convenience registry methods to use Suppliers from the get-go
* Move some serialization-related methods to impl
- changed logger name
* rename Attachment to AttachmentType
* Added DefaultedAttachmentType and reworded Javadoc
* add warning in getAttached
* javadoc
* fix defaulted API
* Add unit tests
* remove DefaultedAttachmentType, add helper methods
bikeshedding inbound
* add more unit tests
* add testmod
it works
* stash syncing for a further PR
* missed license header
* address most reviews
* more reviews
* naming convention
* fix tyop
* fix invalid file name error
* simplify API in the absence of sync
It was established that the presence of a codec might be useful for other things than persistence, and while this seems to couple the two, the API can be changed later in a backward-compatible way if need be.
* couple codec with persistence
committing to the change I mentioned previously
* little fixes
* Fix mixins + requests
- Copy attachments on entity copy,& with a customizable flag in the case of player respawn
- Call relevant change-notifying methods when calling setAttached on BEs and chunks
- Change persistence key
- Fix mixin visibility
* Write tests for entity copy
* replace mixin by COPY_FROM event
* missed license header
* more advanced copy mechanics
- attachments require an EntityCopyHandler to be copied across entities
- a copy handler is automatically derived if there's a codec
- updated javadoc for chunk and BE targets
* Revert "more advanced copy mechanics"
This reverts commit 3f53b554fb.
* replaced complicated API by a stern warning
- also handled cross-world entity teleportation
* add gametest
* fix compilation
* flipped boolean
* forgot some more bools to flip
* requests
* fix FMJ
* fix BE mixin and add gametest
* add client player entity copying
* Use new mob conversion event
---------
Co-authored-by: modmuss <modmuss50@gmail.com>
(cherry picked from commit 25e1b4769d)
* Add a check for the output directory in the test command
* Fix style and add a run configuration with the output directory set
* Update fabric-gametest-api-v1/build.gradle
---------
Co-authored-by: modmuss <modmuss50@gmail.com>
(cherry picked from commit a21facc05f)
The block lookup API's registerForBlockEntities method currently just
registers the passed provider for each valid block for that block
entity.
However, in some situations (such as update suppression or a misbehaving
mod), the wrong block entity will be present for one of these blocks.
This means that the (incorrect) block entity will be passed off to the
provider. Providers (especially those registered with
registerForBlockEntity) will often blind-cast the supplied BE, leading
to crashes.
While the wrong BE being present is a bug, we should follow vanilla's
lead and handle this more gracefully. In this case, we just check
whether the correct BE type is present before forwarding it to the
main provider.
(cherry picked from commit 82b1bb3ec3)
Breaking changes:
- `FabricBrewingRecipeRegistry.registerPotionRecipe` takes `RegistryEntry<Potion>` instead of `Potion`
- `SculkSensorFrequencyRegistry.regster` takes `RegistryKey<GameEvent>` instead of `GameEvent`
- `FabricLanguageProvider.add` takes `RegistryEntry<EntityAttribute>` instead of `EntityAttribute`
- `FabricTagProvider.GameEventTagProvider` was removed replace with `FabricTagProvider<GameEvent>`
- `FabricItem.getAttributeModifiers` returns a Multimap with a key of `RegistryEntry<EntityAttribute>` instead of `EntityAttribute`
- `ModifyItemAttributeModifiersCallback.modifyAttributeModifiers` takes Multimap with a key of `RegistryEntry<EntityAttribute>` instead of `EntityAttribute`
* channeled network addon refactor
* checkstyle
* fix junit tests
* convert TypedPayload <-> UntypedPayload if necessary
* assert payload size
* add vm arg to force serialization
* change log level to info and make it single line
(cherry picked from commit 6225d43a70)