Commit graph

9 commits

Author SHA1 Message Date
Technici4n
dc716ea167
Fabric API Lookup (#1234)
# Fabric API Lookup API v1
## Introduction
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.

Many thanks to @Grondag for providing the original concept (#1072).
Thanks also go to @i509VCB, @Pyrofab, @sfPlayer1 and the others who were involved with the design of this module.

This is the foundation upon which can be built for example a fluid transfer api (#1166). Closes #1199.

## Flexible Api Querying
## Block Api Usage example
## Building blocks
This PR was changed a lot, please have a look at the README, the package info, and the javadoc for `BlockApiLookup` and `ApiLookupMap` for up-to-date documentation.

## More usage examples
FastTransferLib (https://github.com/Technici4n/FastTransferLib) is an experiment to build an item, fluid and energy transfer api on top of this module. (Which was until recently called `fabric-provider-api-v1`.)

## Missing things?
~~I could add an overload of `BlockApiLookup#find` with nullable `BlockState` and `BlockEntity` parameters, so that the caller can directly provide them if they are available for some reason.~~ Added in later commits.

There is no module to retrieve apis from items or entities yet because there were unsolved issues with those. The community can use the provided building blocks to experiment with their own implementations of `ItemStackApiLookup` and `EntityApiLookup` until the way forward becomes clear, but let's please not delay the `BlockApiLookup` because of that.

Co-authored-by: i509VCB <git@i509.me>
Co-authored-by: PepperBell <44146161+PepperCode1@users.noreply.github.com>
2021-03-08 20:32:36 +00:00
Player
d86a720d2c
Checkstyle: Detect package names ending with ss as singular 2020-09-09 03:14:01 +00:00
modmuss50
63435d4b92
Restart Testmods (#593) 2020-05-03 16:56:50 +00:00
liach
1a47cd78f6
Update checkstyle and change tab width to be 4 than 8 (#518)
* Remove unnecessary chmod in travis script
* Update checkstyle and fix indent config
* Travis CI optimizations and checkstyle fixes
2020-04-11 18:21:53 +00:00
Juuxel
ce867d209a Make checkstyle always use English 2020-01-04 19:25:14 +00:00
Player
5a0f9a60f7 Fix checkstyle package check using client/server as the module name and missing suffix validation, adapt missed fabric-renderer-registry package 2019-11-27 13:24:36 +01:00
Player
6d6e6117b4 Fix checkstyle config not supporting windows line endings 2019-11-13 18:46:19 +01:00
Player
b7f9825dbb Add checkstyle verification for package names, fix non-API packages. 2019-11-03 20:14:45 +01:00
Player
dfdb52d6e5 Add checkstyle, format existing code accordingly. 2019-10-27 15:40:26 +01:00