This snapshot is possibly one of the most impactful for API we have ever had. This PR is an inital port to support 22w06a, stuff will be missing and broken.
# Removed modules:
- fabric-mining-levels-v0 - Previously deprecated
- fabric-object-builders-v0 - Previously deprecated
- fabric-tag-extensions-v0
- fabric-tool-attribute-api-v1
# Modules with API breaking changes:
- fabric-biome-api-v1
- fabric-content-registries-v0
- fabric-data-generation-api-v1
- fabric-mining-level-api-v1
- fabric-object-builder-api-v1
- fabric-resource-conditions-api-v1
- fabric-structure-api-v1
# Impactful API changes:
### fabric-object-builder-api-v1
- Removed - FabricBlockSettings.breakByHand
- Removed - FabricBlockSettings.breakByTool - Previously deprecated
# Notable changes
- fabric-registry-sync-v0 moves vanilla's new registry freezing to a later point in time, allowing mods to add to the registry during init.
# Known issues:
- ServerBugfixMixin used to fix https://bugs.mojang.com/browse/MC-195468 has not yet been ported.
* Mining Level API, part 1
* Fix incorrect netherite mining level in MiningLevelManager docs
* Add some format checks in dynamic mining level tag checking
* Add mining level API test mod
* Grammar
* Add cursed basic support for the tool attribute api
* Fix tool attribute JD
* Add proper compat for tool attribute api
Also fixes the remaining bugs in it!
* Update license headers
* stuff
* better comments
* more test mod work
* more
* Fix test mod
* i'm done with this module
* Address some code review things
* Use Reference2IntMap (basically IdentityHashMap for int values)
* Prefix mixin handlers with fabric$
* Add missing license header
* Update fabric-object-builder-api-v1/src/main/java/net/fabricmc/fabric/api/object/builder/v1/block/FabricBlockSettings.java
* Resolve liach's comment
* Update to use TagFactory
* First proof of concept pass
* Cleanup and fixes.
* Checkstyle
* Fix running.
* Updated
* Fix build
* Cleanup + fixes.
* Fix package
* and test package
* game-test -> gametest
* Fix exclusion
* Review feedback and fixes.
* Remove comment
* Review feedback.
* Don't set the game instance
* Fix
* Work around shadowed fields from super classes not getting remapped... dejavu anyone?
See: 2e359e933a (diff-0956caa3cd38a54f5910979f0cfd98198a93e4d585e111300f2f7ab7301ad122)
* Add mixin to exit with a non-zero exit code in case the test server fails to start.
* Enable JUnit XML report generation.
Co-authored-by: Sebastian Hartte <sebastian@hartte.de>
* Original fluid API design
* Rework the transaction system
* First javadoc pass
* Add a testmod, a base implementation for fluid storages and fix some little bugs
* Fix checkstyle
* Make Movement#move extract from the view and not the whole Storage
* Document and update FluidPreconditions
* Use for-each in CombinedStorage and document a little
* Remove useless overrides in Insertion/ExtractionOnlyStorage
* Move SnapshotParticipant#snapshots to the top of the class, and make updateSnapshots public
* Fix garbage collection of unused CauldronWrappers
* Use ArrayList directly
* Remove locking, reorganize transaction implementation, and add outer close callback
* Add more javadoc
* Rework Storage#forEach into Storage#iterator
* Add a few missing `transaction.addCloseCallback(iterator)`
* Add anyView(), exactView(), capacity() and isEmpty()
* Add Storage#iterable to make iteration friendlier to for loops
* Storages may now have multiple open iterators
Co-authored-by: Devan-Kerman <dev.sel20@gmail.com>
* Make CombinedStorage#supportsInsertion/Extraction iterate through the parts
* Block updates should be used when the supportsInsertion/Extraction status changes
* Fluid -> FluidKey
* Remove all references to ItemKey inside FluidKey, and other minor tweaks
* Cache FluidKeys with a null tag inside Fluid directly
* Fluid unit convention
* Add FluidKeyRendering and RenderHandler
* Bump version for more testing (also published to my maven)
* Add SingleViewIterator, massively reduce code duplication!
* Make API experimental, and add README
* Bump version
* Apparently Fluids.EMPTY is flowing
* Add package info
* Minor adjustements
* 1.17 port, cauldron support, add ResourceKey
* Checkstyle, gas rendering, use record for ResourceAmount
* Add a few helpers, rename some stuff
* Remove anyView, allow nullable in StorageUtil#find*, fix missing try block
* Slight findStoredResource cleanup
* Slightly improve implementation
* Bump version
* Fix wrong transaction
* I wrote in a comment that this could happen...
* Fix SingleFluidStorage bugs, add tests in the testmod, add testmod assets
* Add extract stick
* Rename a few things
* `ResourceKey<T>` -> `TransferKey<O>`
* `ResourceKey#getResource()` -> `TransferKey#getObject()` as resource is already widely used through the API for the keys themselves.
* `tag` -> `nbt`
* Add `get` prefixes to `StorageView` functions
* Bump version
* FluidKey -> FluidVariant
* Bump version
* Expand getVersion() documentation, make it thread-safe and use long.
Co-authored-by: Player <player@player.to>
* empty resource -> blank resource, and update SingleFluidStorage
Co-authored-by: Player <player@player.to>
* Make CauldronFluidContent a final class instead of a record.
Co-authored-by: Player <player@player.to>
* Get rid of CauldronFluidContent#minLevel (was always 1)
* Fix nested commits. (Thanks @warjort!)
* Separate Transaction and TransactionContext
Co-authored-by: Devan-Kerman <dev.sel20@gmail.com>
Co-authored-by: Player <player@player.to>
* Change WorldLocation into a private record
* Bump version
* Guard against exceptions thrown in close callbacks
* Make sure blank fluid variants don't have a tag
* Add documentation, make CauldronStorage clearer
Co-authored-by: frqnny <45723631+frqnny@users.noreply.github.com>
* Allow null storages in StorageUtil#move, and clarify sidedness of FluidStorage
* Add explicit hashCode and equals for transfer variants
* Remove ugly equals and hashCode overrides, and add constant time hashcode spec
Co-authored-by: Devan-Kerman <dev.sel20@gmail.com>
Co-authored-by: liach <liach@users.noreply.github.com>
Co-authored-by: Player <player@player.to>
Co-authored-by: frqnny <45723631+frqnny@users.noreply.github.com>
# 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>
(cherry picked from commit dc716ea167)
* Implement screen api
* Actually update to 20w27a
* Split render and tick events to before and after
* Rename and update
* A bit of javadoc and profiler name fixes
* Add functional interface annotations, move render and ticking events to actual FabricScreen instance.
* Add after screen resize event
* Implement key and mouse click/press and release events.
* Move keyboard and mouse events to their own pojos
* Init and resize are the same thing. Maybe Screen#init needs a rename
* Add mouse scroll events
* checkstyle
* Refresh event instances after init
* Before init is nessecary to listen to addition/removal of child elements
* Polish up the javadoc and do a rename to the public api interface.
* Mappings updates on testmod
* javadoc formatting again
* Rework screen api design to be more ergonomic.
* Add remove event, some javadoc
* Add allow phase
* Module dependencies
* Fix null ticking when no screen is open
* Refer to GLFW constants in mouse click/release events
* Keyboard event GLFW constant javadoc
* Remove redundant qualifier
* Some docs, degetterifying
* Because global go brr add screen params back around
* Add module lifecycle to FMJ
(cherry picked from commit 8e23c1d877)
* Entity Events v1.
First up is an event fired after a living entity is damaged. All vanilla living entities except armor stands work with this event.
* Events related to killing of entities, changing world, player respawn/copyFrom
Death related:
an entity killing something and an entity being killed by an adversary
Player related:
After respawn, copy to
* Adversary stuff isn't needed
* checkstyle again
* Call AFTER_KILLED_OTHER on a ServerPlayerEntity upon death.
* Add event which is fired when a player first joined a server and add functional interface annotations
* Update build.gradle
* mispelled
* Some renames, test events, drop damage event
Damage events need further consideration in future
* Comments and null check
* Update for mappings
* Warning comment
* Remove first join event and teleport helper
First join does not work atm and teleport is in dimensions pr
* Module dependencies
* Javadoc tweaks
* The serverening
(cherry picked from commit 79b23bee5b)
* Networking api v1
Some final docs?
Licenses and testmod
Fix a bunch o imports and make things work for v1 (v0 is bork)
Make the testmod pass checkstyle and work
Docs for v1
* Deprecate v0 and implement using v1
* Drop files down one package due to package check error
* Fix issue with channel registration, add another testmod
* jaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaavadoc
* Make javadoc use `code`, move impl interface to package access
* this things
* Rename a few internal methods
* Mark all client side stuff client only, move client mixins
* Add null checks around the place, clarify some javadoc and method names
* Make FutureListeners uninstantiable
* Some internal nullable annotations
* An impl class I forgot to rename
* Some comments and clarify some client login handler javadoc
* Add a missing FunctionalInterface annotation
* Split play and login, move client stuff to right package
* No interface left behind
* Inline channel registries in api
* Login and play subpackages not needed
* Add helper method to create play custom packets
* hasGlobalChannel -> hasGlobalReceiver
* Just rename the collection method for now
* Inline PlayPacketSender into static methods
* Start on testmod idea for verifying dynamic registration
* Add client login events
* You don't say hello when talking to yourself.
Also more testmod stuff
* Make event names present tense
* Some javadoc and impl interface rename
* Change the test keybinding
* Begin working on dynamic reg
* Dynamic reg works, just need a lot of cleanup and reimpling global
* A few renames, readd global methods
* Try to reduce the amount of duplicate registration logic
* Reimplement dynamic accessors
* More impl
* Start reimplementing global receivers. Still very hacky solution.
* Reimplement some server global reciever stuff
* Add login init event for server login.
* Implement client login query start event
* Move event invocations into addon, don't dual register global recievers
* Finally reimplement global recievers for all networking phases
* A revelation: Send packets properly
This also finds the issue with screen getting the proper S2C channels, current on TODO list.
* Disconnect event does not need a packet sender
* Clarify, add methods to get channels net handler can recieve on client
* Unregister actually works now
* Bunch of null checks, add simpler login delay test for vanilla clients
* Add some debug logging entries, fix unregister on client's session reg
* Play channel event javadoc and rename login query handlers
* More channel -> channelName
* thisening
* Introduce the basics infrastructure for tracking global receivers
* Add more substantial javadoc to login connection events
* Javadoc, reimplement unreg methods on v0, 1 impl fix
* Implement tracking for global recievers
* Dont forget to start tracked sessions in 3/4 cases
* Global receiver docs and move methods in classes
* Complete null checks
* big boi javadoc part 1
* Finish the main javadoc, usage javadoc is left
* Set so has method is not needed
* Rename receiveable and sendable methods
* Add the two missing private ctors
* buildscript update to upstream
* Split out player finding stuff to networking player tracking API v1
Signed-off-by: liach <liach@users.noreply.github.com>
Forward v0 PlayerStream to new module, add entity track events
Rename module to player tracking
Well javadoc can make sense
Decide on tracking for the name
Update fabric-player-tracking-api-v1/src/main/java/net/fabricmc/fabric/api/networking/player/tracking/v1/package-info.java
Co-authored-by: Erlend Åmdal <erlend@aamdal.com>
Remove exceptions from javadoc that are not thrown
javadoc fix again
Handle a case where the player manager happens to be null
rename player tracking to player lookup
Yeet
* Cherrypick #1092
* Remove some redundant client networking methods, rename `(un)register` to `(un)registerReceiver`
* Simplify access to dynamic reg on client
* Param shifting, let users get sender.
* Warning about time and distance units
* Make sure these are client only
* Fix control flow in ClientPlayNetworking#send
* Correct example code javadoc
* javadoc correction in server login
* Put login delay tests behind system property
Also remove unnecessary junk added by old module that was merged together.
* Fix ordering so channel registrations during `PHASE`_INIT work
* Fix prod bug and an oversight
* Fix login when connecting to dedicated server
* Update registry sync to v0 to prevent issue with reg sync hanging client
* this is done
* Ported 1.16.1 biomes-api-v1 to 1.16.2.
Public API changes:
- Removed flagging biomes as suitable for player spawns since that is now handled in the Biome Builder.
- Changed API over to RegistryKey's, not because it's necessary, but because it is more ergonomic since Vanilla Biomes in BuiltInBiomes are now all exposed as keys, rather than instances.
* Changed to CheaterCode's mixin for modifying the nether biomes, saving us one accessor.
* Move Bonanza
* Finished moving and updating of the module, added experimental markers.
* Adjusted experimental notes.
* Finished rename from biomes-v1 to biome-api-v1
* Reverted memory settings in preparation for loom-0.5
* Create GameRule API
* Some tweaks
* gamerule -> game-rule
* Fix translation keys and update to 20w22a
* Command results and remove unnessecary factory method
* Update to 1.16-pre1
* Update fabric-game-rule-api-v1/src/main/java/net/fabricmc/fabric/api/gamerule/v1/FabricRuleTypeConsumer.java
Co-authored-by: liach <7806504+liach@users.noreply.github.com>
* I like final things
* Update to 1.16-pre3, change enum button style
* checkstyle
* use right min values
* Document ValidatableRule
* Document LiteralRule, clarify generics
* Update to 20w27a
* Rename some parts to compensate for future yarn renames.
Flatten some logic related to EnumRules
* forgot one
* javadoc galore
* finish javadoc
* Start things
* Update to 20w29a, drop float rule
* Make cycle naming more accurate
* Convert colors to hex
Co-authored-by: Erlend Åmdal <erlend@aamdal.com>
* Update to 20w30a
* imports again
Co-authored-by: liach <7806504+liach@users.noreply.github.com>
Co-authored-by: Prospector <6166773+Prospector@users.noreply.github.com>
Co-authored-by: Erlend Åmdal <erlend@aamdal.com>
* 20w28a biome module fixes
* update version to 0.3.0
* major version bump to 1.0.0
* Update mappings
* Fix nether biome test's
* Fix nether biome's on the server
Closes https://github.com/FabricMC/fabric/issues/861
* Accessor name changes
Co-authored-by: modmuss50 <modmuss50@gmail.com>
* Lifecycle Events V1 (1.16)
Now includes Chunk and (Block)Entity (un)load events
(cherry picked from commit 82b372873fd930dd07768331f7b70f6f9d3d441d)
* Move around code to work on 1.16
* Checkstyle
* Remove primary server getters
(cherry picked from commit c84f36209d)
* IJ DO YOU SPEAK RESOLVING IMPORTS
* Prune the tests that shouldn't exist
(cherry picked from commit a5112223ca)
* Listen here checkstyle you bugger
* Split up events to individual interfaces. Make Chunk events use WorldChunk instead.
(cherry picked from commit 3431c0d894)
* Add screen handler API
* Use more descriptive letters for FabricHandledScreens generics
* Add missing Deprecated annotations
* Bump fabric-containers-v0 version
* Remove unused ServerPlayerEntityAccessor
* Remove [Fabric] from log messages
* Convert FabricHandledScreens to a class
* Add dependency on networking-v0
* Resolve threading issues with NetworkingClient
* Use Identifiers instead of int IDs, make ScreenHandlers a class
Also added a private constructor to FabricHandledScreens.
* NetworkingClient -> ClientNetworking
* Use more descriptive names for injections
* Use ID parameter instead of fetching again
* Add clarifying comment
* Port changes from FabLabs
* Fix compilation
* Replace the content of links in FabricHandledScreens for readability
* Sync with FabLabs
* Add test mod
* I suppose IInv shouldn't have CC0 anymore 👀
* Improve logging
- Networking now uses a logger instead of an exception
- The loggers are now suffixed with their side
- Fixed the client unregistered screen message using the title instead of the ID
* Fix test mod on 20w21a
* Fix ExtendedScreenHandlerFactory javadoc referencing old names
* Update test mod to 1.16-pre2
Just a simple mapping update. :)
* Fix incorrect javadoc references to screen-handler-api in containers-v0
* Remove Minecraft exclusion from build.gradle (thanks to Loom 0.4) + testmod change
Resource loader v0 is now testmodRuntimeOnly as it's not needed for compiling.
* Edited Clone of #244
- Fixed checkstyle issues
- Migrated to fabric-keybindings-v1
- Removed sticky keybindings from #244 as it sounds useless and you can just around it by simply adding that functionality yourself, I might add it back if someone can tell me the advantages of sticky keys except bloat
- Added a test mod
- Added FabricKeyBinding#getBoundKeyOf for getting vanilla bound keys with ease
- Renamed `registered` to `automaticallyRegister` as that is more of a better name
- Added a couple Objects.requireNonNull validations
* Add back StickyFabricKeyBinding as it is in vanilla, did not notice.
* Remove extra "key."
* Bump to 1.0.0
* build().register()
* Remove `register()`
Signed-off-by: shedaniel <daniel@shedaniel.me>
* Fix test
Signed-off-by: shedaniel <daniel@shedaniel.me>
* Rename module
Signed-off-by: shedaniel <daniel@shedaniel.me>
* Fix checkstyle violation
Signed-off-by: shedaniel <daniel@shedaniel.me>
* major refactor
Signed-off-by: shedaniel <daniel@shedaniel.me>
* revert some stuff
Signed-off-by: shedaniel <daniel@shedaniel.me>
* fix build
Signed-off-by: shedaniel <daniel@shedaniel.me>
* major stuff
Signed-off-by: shedaniel <daniel@shedaniel.me>
* fix license, of course
Signed-off-by: shedaniel <daniel@shedaniel.me>
* Add resource loader v0
Signed-off-by: shedaniel <daniel@shedaniel.me>
* Let's not break the api.
Signed-off-by: shedaniel <daniel@shedaniel.me>
* Rename to buildAndRegister
Signed-off-by: shedaniel <daniel@shedaniel.me>
* resolve reviews
Signed-off-by: shedaniel <daniel@shedaniel.me>
* Use GLFW
Signed-off-by: shedaniel <daniel@shedaniel.me>
* Dump the builder entirely
Signed-off-by: shedaniel <daniel@shedaniel.me>
* Rename to Key Binding
Signed-off-by: shedaniel <daniel@shedaniel.me>
* dim api initial port
* A whole bunch of work
* Checkstyle :)
* Minor tweaks based on feedback
* Update to latest snapshot
* Checkstyle ;)
* Some more dim work
* Re add default placer's, the example mod includes a test dim that currently marks the world as experimental
* license
* Fixup javadoc
Moves the ToolManager and tool tags declared in fabric-mining-levels-v0 to a new fabric-tool-attributes-v1, along with adding new interfaces to be implemented on tools so that mining speed, mining level, and entity attribute modifiers can be decided by the itemstack.
* Fix EntityRenderDispatcher hook (again)
* Add fabric-particles-v1
* Add a sync() method to BlockEntityClientSerializable
* Prevent CME due to off-thread block entity updates (#367)
* Restore rendering features disabled in first 19w39a release
* Remove rendering stuffs no longer needed due to snapshots
* Bump versions as needed
* 19w39a fixes (#387)
* Bump versions
* Breaks: BlockEntityRendererRegistry and EntityRendererRegistry
* Remove broken parts of rendering, bump major version
* Add renderer-registries, replaces broken parts of rendering api
* Slap a band-aid on renderer/Indigo - won't render properly, but runs
* Bump distribution versions, add renderer-registries to main build
* Clean up blockrenderlayer implementation package name
* Update versioning to match 1.15 branch
* Fix builtin mods being added as resource packs
* Update fabric-loader to replace deprecated methods
* Add more metadata to the modules (#353)
* Add fabric-api-base as a dep to fabric-networking-v0
* Allow for running fabric-api-base on the server-side environment (#360)
* Set curse version to 1.14.4
Also forces it to build again
* Fix NPE in fluid renderer mixin (#361)
* Fix NPE in fluid renderer mixin
* Ensure state, view, and pos are never null
* Bump fabric-rendering-fluids-v1 version
* Cooler dimension API, #309 (#319)
* pyro API
* Update fabric-dimensions-v1/src/main/java/net/fabricmc/fabric/api/dimension/EntityPlacer.java
clarify portalDir param
Co-Authored-By: Pyrofab <redstoneinfire@gmail.com>
* Update fabric-dimensions-v1/src/main/java/net/fabricmc/fabric/api/dimension/EntityPlacer.java
rename & clarify verticalOffset param
Co-Authored-By: Pyrofab <redstoneinfire@gmail.com>
* Update fabric-dimensions-v1/src/main/java/net/fabricmc/fabric/api/dimension/FabricDimensions.java
Co-Authored-By: Pyrofab <redstoneinfire@gmail.com>
* Update fabric-dimensions-v1/src/main/java/net/fabricmc/fabric/api/dimension/EntityPlacer.java
Co-Authored-By: Pyrofab <redstoneinfire@gmail.com>
* update parameter
* Add fabric-networking and fabric-registry-sync to dependencies
* Refactor FabricDimensionType to use a builder
Also adds a desiredRawId field separate from the actual raw
id fixed internally. The fixedRawId field is now set by
DimensionIdsFixer through reflection.
This change addresses concerns about the ability for any mod
to set a FabricDimensionType's raw id at any time.
* Improve javadoc of FabricDimensions#teleport
* Add an overload for FabricDimensions#teleport
* Update javadoc on DimensionIdsFixer
* Inline clientside packet handling
* Add side assertions to FabricDimensions#teleport
* Nuke minecraft's attempts to overwrite bad level properties
* Add license headers
* Reformat dimension API source code
* Update FabricDimensionType javadoc
* Remove redundant ThreadLocal from FabricDimensionInternals
* Fix crash on dedicated servers
* Fix Illegal Access during remapping
* Fix dimension remap exception propagation
* clarify EntityPlacer docs
* spacing fixes
* api.dimension -> api.dimension.v1
* Increment API patch version
Signifies inclusion of new Dimension API
* Partial fix to FabricDimensionType
* Bump dimension version
* Updates based on feedback
* Fix compilation errors (untested)
* Random fixes
* Various modded rendering fixes
* Restore contract of RenderAttachedBlockView
* Bump versions as needed
* Add API for BlockRenderLayer
* Minor format / name cleanup
Will do a more comprehensive pass as part of separate refactor PR
* Bump versions not handled earlier
* Bump loader/mc bounds for dependent modules
* Update fabric-blockrenderlayer-v1/src/main/java/net/fabricmc/fabric/impl/blockrenderlayer/v1/BlockRenderLayerMapImpl.java
Co-Authored-By: liach <7806504+liach@users.noreply.github.com>
* Update fabric-blockrenderlayer-v1/src/main/java/net/fabricmc/fabric/impl/blockrenderlayer/v1/BlockRenderLayerMapImpl.java
Co-Authored-By: liach <7806504+liach@users.noreply.github.com>
* Minor clean ups
* Improve docs, minor format corrections.
* Update MC dependency