Commit graph

118 commits

Author SHA1 Message Date
Joseph Burton
d3cf6d4e02 Add access to ClientConfigurationNetworkHandler in context (#4097)
(cherry picked from commit c7469b213f)
2024-09-23 18:47:34 +01:00
modmuss
d48ec150ba
24w36a (#4068)
Some checks failed
Build / build (21-ubuntu) (push) Has been cancelled
Build / client_test (push) Has been cancelled
Build / server_test (push) Has been cancelled
Build / check_resources (push) Has been cancelled
* 24w36a

* Some fixes

* More work

* Fixes

* Update yarn

* Update fabric loader

* Bump versions
2024-09-05 11:42:30 +01:00
modmuss
6c0945c34f
Update Fabric Loader and re-enable server test (#4056) 2024-08-29 17:55:03 +01:00
apple502j
01f3a03986
24w34a porting fixes (#4054)
* Fix elytra events not working

* Add note on paused dedicated server

* Add note on thrown tridents in `CustomDamageHandler`

Thrown tridents are handled in a different method to ensure they do not break after
successful use (you cannot throw tridents that are almost broken). To make the API simple
(as you cannot use this with vanilla items anyway), exclude them from coverage.

* Fix javadoc in VillagerInteractionRegistries

* Fix javadoc
2024-08-26 12:02:31 +01:00
modmuss
1bb677a646 Port to 24w33a (#4033)
Some checks failed
Build / build (21-ubuntu) (push) Has been cancelled
Build / client_test (push) Has been cancelled
Build / server_test (push) Has been cancelled
Build / check_resources (push) Has been cancelled
Co-authored-by: haykam821 <24855774+haykam821@users.noreply.github.com>
Co-authored-by: hypherionmc <hypherionmc@gmail.com>
(cherry picked from commit 952fb19a0df7354e8352ef0c993a956b2bed32c2)
2024-08-18 19:16:27 +01:00
modmuss
60c3209bf5
Revert registry sync changes. Allowing duplicate entries and vanilla clients on servers with modded registries. (#3999)
* Revert "Prevent vanilla clients from joining servers that require modded registry entries. (#3992)"

This reverts commit 8759e7555a.

* Revert "Throw the exception when a duplicate registry entry is found. (#3991)"

* Keep javadoc fix
2024-08-05 10:51:31 +01:00
Patbox
8759e7555a
Prevent vanilla clients from joining servers that require modded registry entries. (#3992)
* Prevent vanilla clients from joining servers that require modded registry entries
2024-08-04 14:10:27 +01:00
modmuss
ba9dae065f
Don't track fake player network addons (#3977)
* Don't track fake player network addons

* Review feedback
2024-08-04 13:52:41 +01:00
Octol1ttle
ab7edbac5e
Add MinecraftClient/Server instances to networking contexts (#3850)
* change: add MinecraftClient/Server instances to networking contexts

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>

* style: optimize imports

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>

* change: use client instance from context in FabricRegistryClientInit

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>

* fix: remove unused import <_<

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>

* fix: update Javadocs in Networking classes

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>

---------

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
2024-06-17 18:10:28 +01:00
modmuss
686dcdcec5
Configuration networking improvements (#3832)
* Configuration networking fixes

* Review fixes.

* Update fabric-networking-api-v1/src/testmodClient/java/net/fabricmc/fabric/test/networking/client/configuration/NetworkingConfigurationClientTest.java

Co-authored-by: Octol1ttle <l1ttleofficial@outlook.com>

---------

Co-authored-by: Octol1ttle <l1ttleofficial@outlook.com>
2024-06-08 14:08:21 +01:00
modmuss
b55973447a
1.21-pre1 port (#3811)
* 1.21-pre1 port

* Bump version
2024-05-29 16:25:22 +01:00
apple502j
6fc22b9905
Improve 24w21b port (#3801)
* Delete `FabricDimensions`

This broke during the 1.21 cycle and can be easily replaced with `Entity#teleportTo`.

* Rename testmod data directories

* [Breaking] use singular path in GameTest

* Fix attribute modifier in testmod

* Small mixin refactors related to teleportTo

* Fix behavior change in ModNioResourcePack for invalid paths

* Fix javadocs referencing Identifier ctor

* Add new FabricCodecDataProvider ctor

* Move empty structure

* Fix transfer api testmod

* pro tip: don't write datagen output by hand

* Refactor networking API to remove redundant code

* Stop calling CustomDamageHandler in creative mode
2024-05-29 15:31:48 +01:00
modmuss
6573ed8ccc
24w21b (#3789)
Co-authored-by: Drex <nicknamedrex@gmail.com>
Co-authored-by: embeddedt <42941056+embeddedt@users.noreply.github.com>
2024-05-23 10:20:54 +01:00
apple502j
0684cd12de
Finish port to 24w20a (#3777)
* [BREAKING] pass entity to EquipmentSlotProvider

* Improve mixin for chunk unload event

* `TestContext#getBlockEntity` result can be used without checks/casts now

* Fix typos
2024-05-23 09:06:12 +01:00
modmuss
e633f8839b
Port to 24w20a (#3772)
* Port to 24w20a

* Update yarn

* Fix TODOs

* Bump version

---------

Co-authored-by: Drex <nicknamedrex@gmail.com>
2024-05-16 18:47:15 +01:00
modmuss
0af3f5a702
24w18a (#3757)
Co-authored-by: Drex <nicknamedrex@gmail.com>
2024-05-04 14:28:29 +01:00
modmuss
0dca0349ce
Always get the latest ServerPlayerEntity from ServerPlayNetworkHandler (#3735) 2024-04-26 22:14:28 +01:00
modmuss
9342ba640d
Fix server play networking (#3648) 2024-03-14 20:30:19 +00:00
apple502j
42c290b4ca
24w10a porting fixes (#3638)
* Rename mixin using unmapped name

* Fix potential crash in item API testmod

* Improve custom ingredient javadoc

* More javadoc improvements

* Add more tests

* whoops

* Fix typos

* Remove test for strict NBT matching

* another whoopsie

* Finish NBT -> components changes

Breaking change: `FabricItem#allowNbtUpdateAnimation` was renamed to
`allowComponentsUpdateAnimation`.

* Fix broken javadoc links

* Fix broken screen handler testmod
2024-03-12 09:22:55 +00:00
modmuss
1172e89799
24w09a (#3623)
* In game

* More fixes

* Small fixes + changes

* Rename

* Fix test
2024-02-29 19:16:35 +00:00
modmuss
793274c90b
Fix ClientPlayNetworking.Contexnt.player() being null (#3603)
* Fix ClientPlayNetworking.Contexnt.player() being null

* Minor cleanup
2024-02-18 13:18:07 +00:00
modmuss
ac5f7177e8
[1.20.5] Misc networking cleanup (#3594)
* Misc networking cleanup

* Dont invoke event twice

* Review tweaks
2024-02-18 13:04:12 +00:00
modmuss
03be9f1df2
Port to 24w05a (#3560)
Co-authored-by: Drex <nicknamedrex@gmail.com>
2024-01-31 20:24:57 +00:00
modmuss
7b70ea8a7a
Port to 24w03b (#3537)
* Deprecate FabricBlockSettings

* Deprecate FabricItemSettings

* Start on 24w03a

* Main menu :)

* Update mappings

* PayloadTypeRegistry

* Networking part 2 of many

* Networking part 3 of many

* Networking part 4 of many

* Recipe api

* Port Item API to 1.20.5

* Is this even right?

* Port FabricParticleTypes to 1.20.5

* Remove redundant fuel caching logic

* Remove fabric-containers-v0, deprecated since 2020

* Regsync work

* Adapt screen handler to new networking

* Update yarn + more work

* More mapping updates

* Compile fixes

* Checkstyle + small fixes

* Single and multiplayer fixes

* Handle play packets on main thread.

* Update mappings

* Even more networking

* Networking tests

* Fix todo's

* Update javadocs

* Networking API improvements

* Some small regsync refactors

* Fix handling of null NBT in NbtIngredient

* Update fabric-object-builder-api-v1/src/main/java/net/fabricmc/fabric/api/object/builder/v1/block/FabricBlockSettings.java

Co-authored-by: ErrorCraft <51973682+ErrorCraft@users.noreply.github.com>

* Update fabric-object-builder-api-v1/src/main/java/net/fabricmc/fabric/api/object/builder/v1/block/FabricBlockSettings.java

Co-authored-by: ErrorCraft <51973682+ErrorCraft@users.noreply.github.com>

* Add context objects

* ChannelInfoHolder.getPendingChannelsNames -> fabric_getPendingChannelsNames

* Fix crash

* send `c:register` packet for play phase instead of config (#3544)

* Bump version

---------

Co-authored-by: ErrorCraft <51973682+ErrorCraft@users.noreply.github.com>
Co-authored-by: apple502j <33279053+apple502j@users.noreply.github.com>
Co-authored-by: Drex <nicknamedrex@gmail.com>
Co-authored-by: deirn <deirn@bai.lol>
2024-01-22 18:24:37 +00:00
deirn
c22763908d fix login network addon not properly initialized (#3531)
(cherry picked from commit bf1eca5483)
2024-01-17 18:02:31 +00:00
modmuss50
80f8cf516f Update Fabric Loader 2024-01-17 17:15:38 +00:00
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