Commit graph

92 commits

Author SHA1 Message Date
deirn
21518609e3 fix local login query response handler not working (#3495)
(cherry picked from commit b7e14635cf)
2024-01-11 15:50:46 +00:00
modmuss
d89921fbaf Fix race condition when handling unknown packets. (#3508)
(cherry picked from commit 875cc147cf)
2024-01-05 18:16:18 +00:00
modmuss
3434862fbd
Port to 23w51b (#3474)
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`
2023-12-18 18:47:42 +00:00
modmuss
78d798af9d
Update to loader 0.15 (#3451) 2023-12-08 15:19:17 +00:00
deirn
8cf3df9c01 Copy untyped payload buffer on read/write (#3450)
* copy untyped payload buffer on read/write

* use the actual handler on junit tests

(cherry picked from commit 95a8ac5184)
2023-12-08 15:18:31 +00:00
deirn
901470e4e3 Only retain buffer on receiving side (#3446)
(cherry picked from commit e3b6950386)
2023-11-27 10:22:46 +00:00
deirn
bd733d6b9f Avoid serializing object-based payload into PacketByteBuf on the main thread (#3407)
* 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)
2023-11-26 13:09:47 +00:00
modmuss50
ed814d36ba 1.20.3-pre1
Just a mappings update :)
2023-11-20 16:36:56 +00:00
modmuss50
6f7ba8f277 23w46a 2023-11-16 17:01:20 +00:00
modmuss
8ed13effa6 Network addon session refactor (#3394)
* refactor network addon session handling

* Check payload size

* Fix ClientLoginNetworkAddon does not handle unsuccessful query responses
Closes #3384

* Adjust some logging.

---------

Co-authored-by: deirn <deirn@bai.lol>
(cherry picked from commit bff13c8545)
2023-11-02 10:33:12 +00:00
modmuss50
f31bf881a9 23w44a 2023-11-01 17:00:09 +00:00
modmuss
9468a19de0
Configure spotless for imports, sort imports. (#3365)
* Configure spotless to also do imports. Allows for auto applying.

* Order imports
2023-10-22 13:35:58 +01:00
modmuss
ebb15496af Make some experimental APIs stable. (#3354)
* Make some experimental APIs stable.

* Imports.

(cherry picked from commit e3d2bf3f57)
2023-10-08 13:03:18 +01:00
modmuss
b18afef34a
Fix incorrect internal method names in ServerNetworkingImpl (#3349)
No functional change.
2023-10-01 12:37:30 +01:00
modmuss
74a33ae79d
Fix ClientConfigurationNetworkAddon.handleReady() being called too late. (#3331)
This fixes a crash when assertions are enabled.
Also fixes ClientConfigurationConnectionEvents.READY being called at the incorrect time.
Assertions have also been enabled for all Fabric API run configs.
2023-09-23 10:08:54 +01:00
modmuss
69e331e36e
Fix unhandled packets disconnecting the client. (#3324) 2023-09-18 16:45:22 +01:00
modmuss50
3bafade3d1 1.20.2-pre2 2023-09-07 15:23:20 +01:00
modmuss50
435112151c 1.20.2-pre1 2023-09-05 16:31:02 +01:00
apple502j
017b9d93e2
Networking API javadoc fixes and small refactors (#3285)
* Mark events class constructor as private

* Enhance FabricServerConfigurationNetworkHandler javadoc

* Expand package-info

* Mark some interfaces as non-extendable

* Refactor PlayerLookup and fix javadoc

The example about block entities was removed. This is not the proper way to
do it anymore; you should use `BlockEntity#markDirty` and the built-in syncing.

* Fix missing period

* Fix typos

* Fix checkstyle.

---------

Co-authored-by: modmuss50 <modmuss50@gmail.com>
2023-08-30 16:23:17 +01:00
modmuss50
f091af96c5 23w33a 2023-08-17 16:51:04 +01:00
modmuss
839aeb4e2c
Misc networking API cleanup + fixes (#3265) 2023-08-17 16:46:30 +01:00
modmuss
96274c18fc Fix #3255 (#3257) 2023-08-13 16:14:09 +01:00
modmuss50
0ba8e9ce03 23w32a 2023-08-09 18:04:04 +01:00
modmuss
0b2eb405dc
[1.20.2] Support common registration packets. Add configuration task API (#3244)
* 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.
2023-08-09 16:30:51 +01:00
modmuss
86b12645b9
23w31a 2023-08-07 09:09:38 +01:00
modmuss
f4b7e42468
Update to loom 1.3 and use Mod Publish Plugin (#3158)
* 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
2023-08-02 18:51:21 +01:00
modmuss
b3afc78b68
Setup unit tests & format gradle files. (#3073) 2023-05-30 13:07:11 +01:00
modmuss50
b04edc7ab9 1.20-pre2 2023-05-16 15:36:50 +01:00
modmuss50
fb8d95dacb Split test mods into client and common. (#3033) 2023-05-01 14:04:29 +01:00
modmuss50
b3f2574b16 23w17a 2023-04-26 18:18:06 +01:00
modmuss50
eff26386be
23w16a (#3018)
# 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/
2023-04-20 20:03:32 +01:00
modmuss50
158c189089 23w14a 2023-04-05 17:18:33 +01:00
apple502j
7cef2bbfdf Networking: introduce packet-object based API
Signed-off-by: modmuss50 <modmuss50@gmail.com>
2023-04-04 12:56:41 +01:00
Technici4n
ca5f59aa6b
Fix custom packet inside of bundled packet not being processed (#2947) 2023-03-15 09:20:48 +00:00
modmuss50
4e68ac5bb4 Fix rendering issues after visiting the disconnected screen.
Fixes #2944
2023-03-01 13:20:54 +00:00
modmuss50
ae0966baae
Fix all valid Mixin AP warnings. (#2914) 2023-02-22 12:54:50 +00:00
modmuss50
c477957e8d
[1.19.4] Fail hard when unable to register key bindings, and update Loader. (#2880)
Improve networking API test keybindings.
2023-02-04 14:17:31 +00:00
modmuss50
a1ccd7bfed 23w04a 2023-01-24 16:59:43 +00:00
modmuss50
b69ba7fabe
23w03a (#2854)
* First look at 223w03a

* Fix login

* Support onboarding screen in client tests

* Fix AFTER_ENTITY_CHANGE_WORLD event

* Bump version
2023-01-18 21:21:41 +00:00
apple502j
4017a8cb18
Catch exception inside client-side JOIN event (#2813)
* Catch exception inside client-side JOIN event

* Update fabric-networking-api-v1/src/client/java/net/fabricmc/fabric/impl/networking/client/ClientPlayNetworkAddon.java

Co-authored-by: haykam821 <24855774+haykam821@users.noreply.github.com>

Co-authored-by: haykam821 <24855774+haykam821@users.noreply.github.com>
2023-01-02 13:03:53 +00:00
modmuss50
99f9db8063
Cleanup Environment annotation usage. (#2755)
* Remove @Environment(EnvType.CLIENT) from BoundedIntRule.validate

* Move ItemTooltipCallback to client source set

* Remove @Environment(EnvType.CLIENT) annotation

* Remove @Environment(EnvType.SERVER) from WorldChunkMixin
2022-12-23 13:10:16 +00:00
Technici4n
afca2f3e33
Small Cleanups (#2767)
* ServerLoginNetworking javadoc fix

* Improve Rendering Data Attachment javadocs. Fixes #863

* Deprecate `NbtType`. Fixes #1401

* Remove redundancy
2022-12-23 13:10:03 +00:00
modmuss50
a16aaf981b
Fix disconnect screen scissoring on high-resolution displays (#2770) 2022-12-23 13:09:27 +00:00
apple502j
d9ac3c39e0
Networking: fix type of created packet (#2712) 2022-11-29 18:11:22 +00:00
modmuss50
28ac448f9c Update mappings
Use alternative fastutil javadoc link.
2022-11-24 15:46:56 +00:00
modmuss50
2894d6df22 1.19.3-pre1 2022-11-22 16:28:48 +00:00
modmuss50
b83334a063 Split all duplicated packages (#2617)
* 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)
2022-11-20 13:58:41 +00:00
modmuss50
49abcf7e64 Update mappings 2022-11-16 16:12:51 +00:00
modmuss50
f84bf2d968
22w45a (#2647) 2022-11-10 16:07:38 +00:00
modmuss50
f75bcd18f3
22w44a (#2632)
Co-authored-by: Sebastian Hartte <shartte@users.noreply.github.com>
2022-11-03 13:48:27 +00:00