Commit graph

820 commits

Author SHA1 Message Date
shartte
fb712d3a80
Fixes the structure API for 1.18. (#1730)
Structures are no longer linked to Biomes via an instance field  in the Biome class. Instead they are linked by registry keys. This means that standard biome spawning rules also apply to superflat worlds, instead of the hardcoded list of structures linked with superflat worlds by default. Changes the FabricStructureBuilder to allow adding structures to this default list.
2021-09-19 09:06:27 +01:00
modmuss50
dc466edebd Update loom 2021-09-19 09:02:15 +01:00
shartte
d7a7efac01
Fix running game tests / build [1.18] (#1731)
* Fix running game tests.

* Fix dimension api bugfix mixin. Of note: The Vanilla bug is still present, and the bugfix still needed.

* Fix references to unmatched RegistryOps method.
2021-09-17 23:32:44 +01:00
shartte
a2c681827d
Compile Fixes (#1729) 2021-09-17 20:06:14 +01:00
modmuss50
5553aff888 21w37a: Compile pass 2021-09-17 18:42:42 +01:00
modmuss50
46582230fb Bump version 2021-09-09 19:28:18 +01:00
Technici4n
86bae2c0e9
Work around vanilla capturing ItemStack references (#1700) 2021-09-09 18:47:06 +01:00
grondag
ffb6d41e97
Fix InvalidateRenderStateCallback only firing on resource reload (#1701)
Co-authored-by: grondag <>
2021-09-09 18:46:58 +01:00
Player
0265fac409 Remove client-only env restriction from fabric-rendering-fluids-v1.
This is a workaround for transfer-api having unsatisfiable dependencies
in the dedicated server environemnt. Fabric Loader 0.11 doesn't check
this dependency correctly, but it breaks on 0.12 - as it should. A proper
solution is too incompatible for now.
2021-09-08 21:12:27 +02:00
modmuss50
fc40aa9d88 Bump version 2021-09-01 18:57:12 +01:00
modmuss50
e409d7e818 Set remap to false in MainMixin 2021-09-01 18:40:15 +01:00
Technici4n
9f7c50187c
Transfer API: continuous fluid-containing items and other base implementations. (#1665)
* Transfer API: continuous fluid-containing items and other base implementations

* Update player inventory storage TODO

* Add PlayerInventoryStorage test

* getHandSlot() and small fixes

* Use simulateExtract in findExtractableContent

* Apply review

* Post-rebase fixes

* Add tentative InventoryProvider support

Co-authored-by: Player <player@player.to>
2021-09-01 12:23:34 +01:00
modmuss50
cbda9318cd
Update Gradle/Loom and mappings. (#1692)
* Update Gradle/Loom and mappings.

* Fix deprecations and enforce

* Review feedback

* More cleanup and deprecation fixes.
2021-08-31 14:00:20 +01:00
Potatoboy99999
3fb13e467a
Send block entity update packet along with regular block update packet (#1689)
* Send block entity update packet along with regular block update packet

* Fix style
2021-08-31 14:00:06 +01:00
Technici4n
49e84ad51a
Add Transaction#getCurrentUnsafe and fix mixin fields (#1685)
* Add Transaction#getCurrentUnsafe and fix mixin fields

* Update fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/impl/transfer/transaction/TransactionManagerImpl.java

Co-authored-by: BasiqueEvangelist <basiqueevangelist@yandex.ru>

Co-authored-by: BasiqueEvangelist <basiqueevangelist@yandex.ru>
2021-08-31 13:59:58 +01:00
Juuxel
87cc6e4c30
Sleeping event fixes (#1681)
* Un-hardcode FACING property checks from only BedBlocks

* Use a better injection point for EntitySleepEvents.ALLOW_BED

* Fix #1680

* Bump entity events version

* Clarify javadoc

* Let's not forget license headers

* Add a note about the vanilla bug

* Update BedBlockMixin.java
2021-08-31 13:59:48 +01:00
modmuss50
fe42ded042
Fabric Game Test API (#1622)
* 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>
2021-08-31 13:59:35 +01:00
modmuss50
62e33f4127 Fix dedicated dev server crash #1670 2021-08-25 20:05:23 +01:00
modmuss50
077fc48468 Work around shadowed fields from super classes not getting remapped... dejavu anyone?
See: 2e359e933a (diff-0956caa3cd38a54f5910979f0cfd98198a93e4d585e111300f2f7ab7301ad122)
2021-08-24 21:49:05 +01:00
modmuss50
b06cb95bac Bump version 2021-08-24 18:52:24 +01:00
deirn
c2ece0401d
Fix DynamicRegistryManager being initialized too early (#1660) 2021-08-24 17:44:25 +01:00
deirn
647b9e3efb
Add biome tag selector (#1640)
* Move biome modifications after datapack loaded

* Biome tag selector
2021-08-24 17:44:19 +01:00
Juuxel
8a9f12e01d
Add sleeping events (#1633)
* Add sleeping events

* Fix wake up event triggering on every wakeUp() call

* Make direction modifications stackable

* Simplify by not using Optional in MODIFY_SLEEPING_DIRECTION

* Add two new events

* Let's call it VERIFY_BED

* And it's ALLOW_BED now

* Add the rest of the events

* Clarify docs

* Expand docs, add missing vanillaResult

* WAKE_UP -> STOP_SLEEPING, javadoc

* Make sleepingPos checks more consistent in LivingEntityMixin
2021-08-24 17:44:12 +01:00
Juuxel
211ddf95aa
Add flattening, stripping and tilling registries (#1632)
* Add flattening, stripping and tilling registries

* Where'd the spaces come from?

* Clarify docs

* Better overloads for TillableBlockRegistry.register

* Mutablise AxeItem.STRIPPED_BLOCKS if needed

* Remove simplest TillableBlockRegistry.register overload because the default predicate is for farmland

* Add test mod

* Update fabric-content-registries-v0/src/main/java/net/fabricmc/fabric/api/registry/TillableBlockRegistry.java

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

Co-authored-by: haykam821 <24855774+haykam821@users.noreply.github.com>
2021-08-24 17:44:06 +01:00
Technici4n
96bf6a7e71
Allow fluid variant colors to depend on the position (#1620)
* Allow fluid variant colors to depend on the position

Also add a smarter FluidVariantRendering#getTooltip.

* Add fluid variant rendering testmod

* 255/256 is not 1

* Actually it's in the top left
2021-08-24 17:43:59 +01:00
deirn
0d6db0fc9d
Move biome modifications after datapack loaded (#1571) 2021-08-24 17:43:51 +01:00
altrisi
2a2a2c5485
Deprecate and move fabric-rendering-registries-v1 into fabric-rendering-v1 (#1470)
* Deprecate and move fabric-rendering-registries-v1 into fabric-rendering-v1

* Make the event work again

* Use lambda for RegistrationHelper

* Checkstyle in rendererregistries

* Checkstyle for rendering-v1

* Remove mixins file

And add two `forRemoval`

* Raise EntityModelLayerRegistry out of experimental

And update javadoc

* Change INSTANCE to a static method in two registries

* Readd unwillingly removed annotation

* Disallow constructing API instances

* Added Environment and ApiStatus annotations

* Update testmod's entrypoint

Co-authored-by: Technici4n <13494793+Technici4n@users.noreply.github.com>

* Remove renderer-registries testmod

* Remove `var` usage

* Don't specify `forRemoval = true` in `@Deprecated`

* Inline old registry implementations in anonymous classes

Co-authored-by: Technici4n <13494793+Technici4n@users.noreply.github.com>
2021-08-24 17:43:44 +01:00
modmuss50
8195aec1e2 Bump version 2021-08-21 20:29:23 +01:00
Technici4n
a9bcdbef6a
Reorganize transfer API testmod and rework item api injections (#1652)
* Reorganize the transer API testmod

* Rework mixins. Closes #1649.
2021-08-21 18:33:23 +01:00
modmuss50
d19fec74a7 Revert accidental loom update. 2021-08-20 12:14:55 +01:00
modmuss50
0b4433eeba Bump version 2021-08-20 12:14:05 +01:00
Technici4n
a6db925daf
Fix droppers deleting items when they fail to insert (#1646) (#1647) 2021-08-20 12:01:43 +01:00
modmuss50
3fe74aa162 Bump version 2021-08-18 18:39:11 +01:00
Technici4n
2f75c6ce5f
Add BlockApiLookup#registerForBlockEntity (#1638)
* Add BlockApiLookup#registerForBlockEntity

* Typo
2021-08-17 19:08:55 +01: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
Maity
f3747de3d0
Fix typo (#1637) 2021-08-17 19:07:42 +01:00
deirn
5e85fc0a09
Tag Factory API (#1562)
* Tag factory

* Add static biome tag factory to the API

* Use SERVER_STARTING event

* Use the ctor directly

* Use the default BIOME factory

* AccessorDynamicRegistryManager -> DynamicRegistryManagerAccess

* Return Tag.Identified

* Load dynamic registry tags right after datapack entries loaded

* DynamicRegistryManagerAccess -> DynamicRegistryManagerAccessor

* Fix grammar
2021-08-17 19:07:12 +01:00
modmuss50
2e8bd82f1c Bump version 2021-08-08 18:39:30 +01:00
Juuxel
1b48b75b18
Fix FuelRegistry not following vanilla checks for valid fuels (#1554) 2021-08-08 18:18:01 +01:00
Aelpecyem
3c3f33ee93
Re-implement ArmorRenderingRegistry (#1607)
* reimplement ArmorRenderingRegistry

* fix license headers

* remove todo

* move registry to static method

* minor reformat

* reduce api classes into one

* reformat

* make registry static

* reformat

* change Item in registry to ItemConvertible

* register mixin properly this time

* explain test mod

* reformat

* stricter null check
2021-08-08 18:17:54 +01:00
Player
edbb166422 Use less spammy logging for invalid IDs in registration packets 2021-08-02 18:03:52 +02:00
modmuss50
a00e834bd3 Fix build 2021-07-23 18:09:54 +01:00
modmuss50
5ab9934c7c Bump version 2021-07-23 17:28:43 +01:00
modmuss50
bc1653ce03 Use a wildcard version for dep on fabric-lifecycle-events-v1 so it can be ran in dev without gradle. 2021-07-23 17:16:17 +01:00
Fred
fc9d06d347
Add client command source properties (#1518)
* Add extra fields to FabricClientCommandSource

* Re-add `getPlayer`

* Fix style errors

* Make the meta property a `Map`

* Update Javadoc

* Implement requested changes

* Fix styling errors

* Implement requested changes

* Implement requested changes

* Implement requested changes
2021-07-23 17:06:18 +01:00
Technici4n
25611bb75a
Stop DefaultResourcePack scanning the entire classpath (#1564)
* Stop DefaultResourcePack scanning the entire classpath

* Use another approach to find the JAR

* Make it work for filesystem assets as well (tested, it works!)

* Only patch what is necessary
2021-07-23 17:06:03 +01:00
modmuss50
fb3bff2eed
Generate a changelog (#1592) 2021-07-23 17:05:52 +01:00
modmuss50
3fe3c3f50c Bump version 2021-07-12 19:25:45 +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
grondag
5f02c96920
Prevent SpriteFinder from returning Missing sprite for wrong atlas (#1541)
Co-authored-by: grondag <>
2021-07-05 18:47:06 +01:00