Commit graph

4 commits

Author SHA1 Message Date
ToBinio
d73f365284 Fix links in transfer-api README.md (#3694) 2024-04-10 22:17:45 +01: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
Technici4n
0d7a4ee070
Fabric Transfer API: item transfer and fluid-containing items. (#1553)
* Add item and "fluid item" APIs

* Rework ContainerItemContext javadoc

* Rework the Inventory wrapper API

* Cleanup inventory wrapper implementation, add < 64 max stack count test, separate tests better

* Fix Inventory wrapper not limiting the stack count correctly (thanks @lilybeevee!)

* Rewrite inventory wrapper, add SingleStackStorage base implementation

* Composters

* SingleStackStorage adjustements

* Bump version

* Move icon to correct location. Closes #1565

* Bump version

* Remove composter implementation (it's broken), slight renames

* Fix SidedInventory extract

* Bump version

* Don't use MAVEN_USERNAME if it's not specified

* Add comparator output, add missing markDirty calls, fix tests

* Bump version

* Add SingleVariantStorage, deprecate SingleFluidStorage, definalize a few things, make sure markDirty() is only called once per successful outer transaction in inventory wrappers

* Add composter support

* Move EmptyFluidView to BlankVariantView, update README and package-info

* Bump version

* Key -> variant

* Add Transaction#openNested(@Nullable TransactionContext)

* Add SingleSlotContainerItemContext

* Bump prerelease version

* Remove useless comment

* Remove ContainerItemContext#getWorld

* Bump prerelease version

* Add StorageUtil#findExtractableContent and ContainerItemContext#withInitial

* Bump prerelease version
2021-08-17 19:08:09 +01:00
Technici4n
c09be4c48a
Fabric Transfer API: "fluid only" edition (#1356)
* 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>
2021-07-12 18:28:33 +01:00