* Config networking refactor :)
* Add some unit tests for common packets.
* write FabricPacket on network thread.
Split ServerConfigurationConnectionEvents into two.
* Fixes
* Rename event
* Add a testmod + ssome docs
* Improve registry sync fixing deadlock in a number of cases.
* Cleanup channel events.
* Review feedback and fixes.
* Update to loom 1.3
* Fix more 1.3 deprecations
* Opps
* Move to mod publish plugin
* Revert some changes
* Fix some more Gradle deprecations
* Fix names
* Remove extra stuff
* Cleanup
* Add API for adding custom dynamic registries
Closes#1012, supersedes #1031 and #2719.
* Add missing license headers
* Clarify RegistryLoaderMixin namespace injection
* Replace event with static registration, add skeleton for sorting registries
* Fix typo
* Refactor event phase sorting system for use with dynamic registries (#1)
* Make minor changes to Technici4n's PR
* Add test for nested dynamic objects
* Revert "Add test for nested dynamic objects"
This reverts commit 486e3e1ce0.
* Revert "Make minor changes to Technici4n's PR"
This reverts commit 741bd52c1e.
* Revert "Refactor event phase sorting system for use with dynamic registries (#1)"
This reverts commit bb7c8b8790.
* Remove sorting API
* Add support for defaulted dynamic registries
* Re-add test for nested dynamic objects
* Add missing license headers
* Fix typo
* Remove defaulted dynamic registries; flatten registration methods
* Remove last reference to registry sorting
* Add option to skip syncing for empty dynregs
* Update DynamicRegistrySyncOption docs
Co-authored-by: Technici4n <13494793+Technici4n@users.noreply.github.com>
* Address review feedback
* Add registry namespace to tag paths for modded registries
* Move dynamic registry tests into their own class for readibility
* Finish DynamicRegistries doc
* Only apply tag change to dynamic registries
* Fix checkstyle
* Update fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/api/event/registry/DynamicRegistries.java
Co-authored-by: Technici4n <13494793+Technici4n@users.noreply.github.com>
---------
Co-authored-by: Technici4n <13494793+Technici4n@users.noreply.github.com>
# Breaking changes
- `VillagerPlantableRegistry` replaced with `ItemTags.VILLAGER_PLANTABLE_SEEDS`
- `FabricItemGroup.builder()` no longer takes an `Identifier`
- `FabricItemGroup.build()` no longer registers the ItemGroup, this now needs to go in the vanilla registry.
- `ItemGroupEvents.modifyEntriesEvent` now takes a `RegistryKey<ItemGroup>` in place of an `Identifier`
- `FabricLanguageProvider` now takes a `RegistryKey<ItemGroup>` in place of an `ItemGroup`
- `IdentifiableItemGroup` removed, replaced with vanilla registries.
- `FabricMaterialBuilder` removed, no replacement.
- `HudRenderCallback.onHudRender` now passed a `DrawableHelper` in place of `MatrixStack`
- `ScreenEvents.beforeRender` now passed a `DrawableHelper` in place of `MatrixStack`
- `ScreenEvents.afterRender` now passed a `DrawableHelper` in place of `MatrixStack`
- `Screens.getItemRenderer()` removed. Replace with `MinecraftClient.getItemRenderer()`
`DrawableHelper` is likely to be renamed soon, see: https://github.com/FabricMC/yarn/pull/3548/
* Move duplicated v0/v1 impl packages to v0 subpackages
Fixes#2616. The convention is adopted from the command API (v1)
whose impl classes have the v1 subpackage.
* Separate client code into its own packages everywhere
* Fix code style
* Fix code style, part 2
* Allow v0 in package names
* Allow v0 in package names (fixed)
(cherry picked from commit 9244241639)
* Fix DynamicRegistrySetupCallback, add EndDynamicRegistrySetupCallback
`DynamicRegistrySetupCallback` did not work as intended because the injection
was too late. This moves the injection point to `RegistryLoader`, just before it
is loaded.
`EndDynamicRegistrySetupCallback` is a new event triggered when the loading is
finished. This has access to the combined DRM, allowing context-aware modification.
This also replaces `System.out.println` use in testmod.
* Remove useless force-init of BiomeKeys
* Remove now-unnecessary DynamicRegistryManagerMixin
* Fix crash in testmod
This caveat needs proper documentation.
* Add note to javadoc
* Mark impl as internal
* Remove EndDynamicRegistrySetupCallback
* Fix testmod checkstyle issues
* Add automated event call check
* Fix test
* Update javadoc
* Add `@see`
* Re-run actions
A common source of crashes on modded Minecraft servers comes from modders accidently calling client only code from the client, this PR is another large step towards elimitating that.
This PR has been months in the making and years in the planning, requiring major changes to Loom & Loader. In recent Minecraft versions Mojang has made it easier than ever to cleanly split the jar, going against the status-quo of merging the client and server into one jar.
From the start we have designed Fabric to have a very clear split between client and common (client & server) code. Fabric has always encoraged keeping client only code seprate from the server, this can be seen at a fundamental level with the entrypoints in Loader. Fabric API's have all been designed with this mind.
This PR provides a compile safety net around Fabric API using client only code on the server. Even though there are almost 400 changed files, minimal changes beyond moving the files were required to achieve this in Fabric API, thanks to the effort of all contributors in the past.
These changes should not affect modders or players in anyway, a single "universal" jar is still produced. Im happy to awnswer any questions.
This snapshot is possibly one of the most impactful for API we have ever had. This PR is an inital port to support 22w06a, stuff will be missing and broken.
# Removed modules:
- fabric-mining-levels-v0 - Previously deprecated
- fabric-object-builders-v0 - Previously deprecated
- fabric-tag-extensions-v0
- fabric-tool-attribute-api-v1
# Modules with API breaking changes:
- fabric-biome-api-v1
- fabric-content-registries-v0
- fabric-data-generation-api-v1
- fabric-mining-level-api-v1
- fabric-object-builder-api-v1
- fabric-resource-conditions-api-v1
- fabric-structure-api-v1
# Impactful API changes:
### fabric-object-builder-api-v1
- Removed - FabricBlockSettings.breakByHand
- Removed - FabricBlockSettings.breakByTool - Previously deprecated
# Notable changes
- fabric-registry-sync-v0 moves vanilla's new registry freezing to a later point in time, allowing mods to add to the registry during init.
# Known issues:
- ServerBugfixMixin used to fix https://bugs.mojang.com/browse/MC-195468 has not yet been ported.
* Optimize registry sync packet
* Make sure that the id map is sorted by the raw id
Send the difference of the first raw id and the last raw id from the bulk before
* Add packet size log prints
* Use Boolean.getBoolean
Don't send sync packet if the player is the server host
* Use generic Map
* Multiple raw id bulk test
* Group object namespace first before grouping raw ids
* Revert "Add packet size log prints"
This reverts commit fcb8b71e
* RegistrySyncPacket -> RegistryPacketSerializer
Move RegistryPacketSerializer singleton to the interface
* Packet size log prints
* Sort raw id on each namespace group
* Use Identifier.DEFAULT_NAMESPACE
* Slice to multiple packet if necessary
* Make MAX_PAYLOAD_SIZE configurable
Make testmod registry bigger
Print buffer size in equality test
* Move static packet handler instance to RegistrySyncManager
Release combinedBuf before discarding it
Discard syncedRegistryMap after it's accessed
* Use PacketByteBufs to create buffers