fabric/fabric-api-lookup-api-v1
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
..
src Port to 24w03b (#3537) 2024-01-22 18:24:37 +00:00
build.gradle Update to loom 1.3 and use Mod Publish Plugin (#3158) 2023-08-02 18:51:21 +01:00
README.md Entity API Lookup (#1836) 2021-12-03 13:38:35 +00:00

Fabric API Lookup API (v1)

This module allows API instances to be associated with game objects without specifying how the association is implemented. This is useful when the same API could be implemented more than once or implemented in different ways. See also the package-info.java file.

  • What we call an API is any object that can be offered or queried, possibly by different mods, to be used in an agreed-upon manner.
  • This module allows flexible retrieving of such APIs, represented by the generic type A, from blocks in the world or from item stacks.
  • It also provides building blocks for defining custom ways of retrieving APIs from other game objects.

Retrieving APIs from blocks

See the javadoc of BlockApiLookup for a full usage example.

BlockApiLookup

The primary way of querying API instances for blocks in the world. It exposes a find function to retrieve an API instance, and multiple register* functions to register APIs for blocks and block entities.

Instances can be obtained using the get function.

BlockApiCache

A BlockApiLookup bound to a position and a server world, allowing much faster repeated API queries.

Retrieving APIs from items

See the javadoc of ItemApiLookup for a full usage example.

ItemApiLookup

The way to query API instances from item stacks. It exposes a find function to retrieve an API instance, and multiple register* functions to register APIs for items.

Retrieving APIs from entities

See the javadoc of EntityApiLookup for a full usage example.

EntityApiLookup

The way to query API instances from entities. Exposes a find function to retrieve an API instance, and multiple register* functions to register APIs for entity types.

Retrieving APIs from custom objects

The subpackage custom provides helper classes to accelerate implementations of ApiLookups for custom objects, similar to the existing BlockApiLookup, but with different query parameters.

ApiLookupMap

A map meant to be used as the backing storage for custom ApiLookup instances, to implement a custom equivalent of BlockApiLookup#get.

ApiProviderMap

A fast thread-safe copy-on-write map meant to be used as the backing storage for registered providers.