Commit graph

1603 commits

Author SHA1 Message Date
Jochen Jacobs
6a60afdd2e Extend Data Attachment API to ProtoChunk (#3548)
* allow data-attachment on ProtoChunks

- moved interfaceInjection from WorldChunk to Chunk
- dataAttachment saving on ProtoChunks in ChunkSerializer
- copy attachment from ProtoChunk to WorldChunk on creation.
- make WrapperProtoChunk wrap attachment calls to WorldChunk

* add test for data-attachment on ProtoChunks, and extend testmod.

* code style and license headers

* fix typos in javadoc

* extend testmod to test setting attachment during worldgen.

* code formatting

* fix testmod: don't crash when feature isn't placed (i.e. on GameTest server)

* add warning when adding persistent attachment to chunk with status EMPTY.

* update javadoc

* update javadoc to reference ServerLivingEntityEvents#MOB_CONVERSION

(cherry picked from commit 32782cfdc7)
2024-02-09 14:06:46 +00:00
JellySquid
6e2af442ba Expose a function for querying the non-default fluid renderer (#3558)
* Expose a function for querying the non-default fluid renderer

* Do not register default handlers as overrides

* Add @Nullable to getOverride

* Add @Nullable to get

---------

Co-authored-by: modmuss50 <modmuss50@gmail.com>
(cherry picked from commit d74054c1e7)
2024-02-09 14:06:14 +00:00
modmuss50
54b4400cee 24w06a 2024-02-07 19:01:58 +00:00
modmuss50
b77b568afd Bump version 2024-02-05 11:32:53 +00:00
Kevin
bab36248d7
Fix WorldRenderEvents.AFTER_TRANSLUCENT (#3563)
* Fix WorldRenderEvents.AFTER_TRANSLUCENT

* Add test for WorldRenderEvents.AFTER_TRANSLUCENT

* Reset matrixStack
2024-02-05 11:30:21 +00:00
apple502j
04ac8cf319
Improve 24w05a port (#3565)
* Fix wrong ops being used in AttachmentSerializingImpl

* Remove unused private method

* Require and use registry future in advancements and loot tables
2024-02-05 11:30:14 +00:00
modmuss
03be9f1df2
Port to 24w05a (#3560)
Co-authored-by: Drex <nicknamedrex@gmail.com>
2024-01-31 20:24:57 +00:00
apple502j
ac6e104df9 Fix duplicate resource pack names (#3557)
(cherry picked from commit b66dcf78f1)
2024-01-31 19:53:04 +00:00
modmuss50
f3561f053e Bump version 2024-01-28 13:53:02 +00:00
TelepathicGrunt
6dfe4c9bf6 Make chunk sections only convert vanilla air blocks to AIR (#3535)
* Make chunk sections only convert vanilla air blocks to AIR

* angry checkstyles calmed

* Comments added for future reference

(cherry picked from commit 3e2216cb03)
2024-01-28 13:32:39 +00:00
ErrorCraft
b6679678d4 Allow FabricCodecDataProvider to access dynamic registries (#3522)
* Add CompletableFuture to FabricCodecDataProvider

* Deprecate the old method and constructor, and fix the style

* Fix the style for real this time

* Add exceptions to the configure methods

* Apply suggestions from code review

---------

Co-authored-by: modmuss <modmuss50@gmail.com>

(cherry picked from commit 5c013344f0)
2024-01-28 13:03:05 +00:00
apple502j
3feeb09499 Refactor resource loader internals (#3473)
* First step toward fixing resource pack grouping

* Placeholder pack and pack dependency

* Various fixes

* Fix wrong variable in serialization code

* Hide packs in PackScreen and DatapackCommand

* Apparently Japanese people aren't alone in having their currency signs used as special chars...

* Inject directly to Pack

* Add temporary logging, fix bug

* Add proper sorting

* Improve logging

* Fix duplicate name registration

* Fix client pack handling

* Fix FMJ

* Stop using interface injection for internal interface

* Delete unused GroupResourcePack

* Move refreshAutoEnabledPacks to util

* Improve logging

* Make a few things private

* Use vanilla metadata serialization logic

* Improve javadoc

* Add junit test

* Some final refactors

* Update ja_jp.json

---------

Co-authored-by: modmuss <modmuss50@gmail.com>
(cherry picked from commit 707e4d1bfd)
2024-01-28 13:01:25 +00:00
apple502j
bbf5165de7
Fix porting issues in Dynamic Registries API (#3555)
* Fix TAGS_LOADED event not being invoked on client join

* Skip loading empty dynamic registries (client-side)

* Update ClientTest to handle 24w04a

* Skip syncing empty dynamic registries (server-side)

* Fix dynamic registry using wrong codec, tag syncing depending on class load order

* Fix DynamicRegistrySetupEvent being called on client

* Test syncing empty registry's tag

* Actually check skipOnEmpty

* Downgrade AssertionError to log due to MC-268096
2024-01-28 12:56:20 +00:00
modmuss50
9bfa344c7d 24w04a 2024-01-24 19:59:21 +00:00
apple502j
3945d7aeb7
Fix some registries being unsynced (#3550) 2024-01-24 16:21:02 +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
PepperCode1
e89ad72381 Add AtlasSourceTypeRegistry (#3504)
(cherry picked from commit 0d29db7657)
2024-01-19 11:15:50 +00:00
Syst3ms
93072209fd Data Attachment API (#3476)
* 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)
2024-01-19 11:15:42 +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
modmuss50
c10e41a5b1 Bump version 2024-01-15 13:54:51 +00:00
Jared
ab3cc93a49 Don't tick gametests if the server isn't ticking (#3528)
* Don't tick gametests if the server isn't ticking

* Fix import order

(cherry picked from commit 85d85a93b5)
2024-01-15 13:42:23 +00:00
modmuss
fd154599a6 Stack aware getFoodComponent (#3520)
* Stack aware `getFoodComponent`

Co-authored-by: Phoupraw <50520903+phoupraw@users.noreply.github.com>

* Back to redirects

---------

Co-authored-by: Phoupraw <50520903+phoupraw@users.noreply.github.com>
(cherry picked from commit d6f2b0841c)
2024-01-15 13:42:21 +00:00
Syst3ms
92bc82c0df Add mob conversion event (#3511)
* Add mob conversion event

* spacing

* use a smarter mixin strategy

* add pig and villager lightning triggers

* tyop

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

* handle tadpole -> frog conversion

- update javadoc to clarify the handled cases
- document keepEquipment parameter
- improve mixin handler names

---------

Co-authored-by: haykam821 <24855774+haykam821@users.noreply.github.com>
(cherry picked from commit 44c0f8c656)
2024-01-15 13:42:19 +00:00
modmuss
05ec3fa1a9
Update to loom 1.5 (#3515)
* Update to loom 1.5

* Continue to use the mixin AP for now.

* Bump
2024-01-15 13:40:32 +00:00
modmuss50
6f3c2ac4f4 Bump version 2024-01-11 20:48:04 +00:00
modmuss50
0cb20561ee Exclude meta projects from main maven artifact.
This fixes being unable to depend on it in dev.

(cherry picked from commit 7eebb47af6)
2024-01-11 20:47:06 +00:00
modmuss50
3fc873d1ee Bump version 2024-01-11 16:09:27 +00:00
Jason Penilla
22fe817d10 add fabric-api-bom and fabric-api-catalog (#3487)
* feat: add fabric-api-bom and fabric-api-catalog

* spotlessApply

* Apply suggestions from code review

Co-authored-by: Juuz <6596629+Juuxel@users.noreply.github.com>

---------

Co-authored-by: modmuss <modmuss50@gmail.com>
Co-authored-by: Juuz <6596629+Juuxel@users.noreply.github.com>
(cherry picked from commit 679aae3c9a)
2024-01-11 15:50:48 +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
ErrorCraft
51ad78441b Add a system property for a custom output directory for gametest structures (#3509)
* 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)
2024-01-11 15:50:43 +00:00
Jonathan Coates
bb43a8b9bf Check for the correct BE type in the lookup API (#3510)
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)
2024-01-11 15:50:41 +00:00
deirn
65757c5d7a fix jukebox state getting changed mid-transaction (#3517)
(cherry picked from commit e8434230ce)
2024-01-11 15:50:39 +00:00
modmuss50
6ae4991e0e Bump version 2024-01-05 18:26:42 +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
modmuss50
6fb5fe468a Bump version 2023-12-27 13:22:02 +00:00
Kevin
18c9eaa4cb Add Client After Block Break Event (#3367)
* Add clientside after block break event

* Update tests

* Checkstyle, of course

* Update Javadoc

* New Event

* Checkstyle 2 electric boogaloo

* Remove block entity parameter

* Refactor ClientPlayerBlockBreakEvents

* Update Javadoc

(cherry picked from commit 389931eb7a)
2023-12-27 13:01:42 +00:00
modmuss50
ae41f5ecb9 Test fix: Object Builder API's Testmod crashing on windows. Closes #3480
(cherry picked from commit 06274a4716)
2023-12-27 13:01:39 +00:00
modmuss50
efa5891941 Update CF version 2023-12-18 18:53:24 +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
modmuss50
4ced05928d Fix sleeping direction always being null.
Closes #3470
Closes #3471
2023-12-16 10:32:34 +00:00
modmuss50
33cef71655 Bump version 2023-12-08 15:43:09 +00:00
modmuss
f4db263479
Update loom and Gradle (#3452) 2023-12-08 15:19:29 +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
Phoupraw
0e40ff486c Fix FluidStorageUtil#moveWithSound Play Sound (#3431)
* fix play sound

* Update fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/api/transfer/v1/fluid/FluidStorageUtil.java

* Fix chute testmod

---------

Co-authored-by: modmuss <modmuss50@gmail.com>
(cherry picked from commit 4944b5a5ee)
2023-12-08 15:18:29 +00:00
modmuss50
b46767fdfc 1.20.4 2023-12-07 22:02:02 +00:00
modmuss50
dc89771ba2 1.20.4-rc1 2023-12-06 17:20:08 +00:00
modmuss50
e5e39e755d 1.20.3-pre4 2023-11-29 22:28:22 +00:00
modmuss50
f6e85ac2bb 1.20.3-pre3
Just mapping updates
2023-11-27 16:17:03 +00:00