Commit graph

109 commits

Author SHA1 Message Date
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
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