Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.20.5] Resource Conditions in Pack Overlays #3702

Closed

Conversation

Apollounknowndev
Copy link
Contributor

Supercedes #3589, rebased to target 1.20.5.

1.20.2 added pack overlays (explained in the 23w31a changelog), which conditionally overlay resource/data pack files from sub-directories onto the base pack. This PR extends this system to allow for overlays based on resource conditions, which allow overlays to be applied based on conditions other than just the current pack format.

The main difference between the 1.20.4 and 1.20.5 versions of the PR is that OverlayConditionsMetadata has been completely refactored for the new codec-based resource conditions, which means they are parsed with a codec now. The class has also been moved to api for datagen purposes.

@modmuss50 modmuss50 added the enhancement New feature or request label Apr 10, 2024
@Apollounknowndev Apollounknowndev deleted the overlay-conditions branch April 11, 2024 22:22
@Apollounknowndev Apollounknowndev restored the overlay-conditions branch April 11, 2024 22:23
ResourceCondition.CODEC.fieldOf("condition").forGetter(Entry::condition),
Codec.STRING.validate(OverlayConditionsMetadata::validateDirectory).fieldOf("directory").forGetter(Entry::overlay)
).apply(instance, Entry::new));
public boolean shouldApply() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space missing above

Co-authored-by: Drex <nicknamedrex@gmail.com>
TelepathicGrunt and others added 9 commits May 7, 2024 19:06
* Created tag translation datagen

* generate lang file

* Add fruit translation

* renamed interface injection

* Adjust missing translation message

* Fixed for checkStyle

* More checkstyle fighting...

* Bump version of modules.

* Oops wrong module got bumped

* moving and renaming files

* adjust enum class naming

* rename enum and move package

* Renamed one more enum

* Undo version bump. Will be handled at release

* Some suggestions implemented

* Added crowdin entry

* Update crowdin.yml

Co-authored-by: modmuss <modmuss50@gmail.com>

* Cleanup enum checking

* spotless fixes

* Added buckets and powder snow bucket tag translation

* Some more suggested changes

* setup ConventionLogWarnings to match ConventionLogWarningsClient setup

* Change property to be usable in prod

* Set short as default property

* Remove unused import

* Fixed copy/paste error

* fixed ingot translations

* lang and method name fixes

* Fixed filepath issue

* Fixed redstone name

* fixed javadoc whitespace

* Move translation warning to server

* Move translation class to better file path

* trying to pass the regex

* put it under impl

* Cleanup translation check

* Update fabric-data-generation-api-v1/src/main/java/net/fabricmc/fabric/api/datagen/v1/provider/FabricLanguageProvider.java

Co-authored-by: Juuz <6596629+Juuxel@users.noreply.github.com>

* Update fabric-data-generation-api-v1/src/main/java/net/fabricmc/fabric/api/datagen/v1/provider/FabricLanguageProvider.java

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

* Update fabric-convention-tags-v2/src/main/java/net/fabricmc/fabric/api/tag/FabricTagKey.java

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

* Update fabric-convention-tags-v2/src/main/java/net/fabricmc/fabric/api/tag/FabricTagKey.java

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

---------

Co-authored-by: modmuss <modmuss50@gmail.com>
Co-authored-by: Juuz <6596629+Juuxel@users.noreply.github.com>
Co-authored-by: haykam821 <24855774+haykam821@users.noreply.github.com>
(cherry picked from commit 70fd1b4)
…MC#3726)

* use knownPack to avoid syncing mod data packs.

* remove empty class

* checkstyle and licenses

* move debug logging from testmod into main module

* fix knownPackInfo not working for build-in data packs.

* make bundled data packs not required for client, and don't auto enable

* improve testmod with added builtin data pack + better error message

* Increase max known packs in C2S packet

* validate size before sending
* changeable with system property

* change mixin from ModifyConstant to ModifyArg to be more clear.

* Apply suggestions from code review

Co-authored-by: modmuss <modmuss50@gmail.com>

* store list of knownPacks as server start

avoids desync on pack change (since registries aren't reloaded)

* be extra safe: only request knownPacks that were enabled at server start and still are.

Doesn't rely on the fact that registries aren't synced anymore.

---------

Co-authored-by: modmuss <modmuss50@gmail.com>
(cherry picked from commit c0e5481)
* Add API to modify default item components

* Add test for removal

* Some review feedback

* API design changes

* Review feedback

* Add overload that takes a Collection<Item>

(cherry picked from commit 5bcea88)
- Add all dynamic registries to the initial registry.
 - Expose a getter for the registry future.
 - Register cloners for all dynamic registries.

(cherry picked from commit ad47449)
…C#3749)

* Support loading a single condition instead of array

* Remove extra space

* Use LIST_CODEC field instead of CODEC.listOf()

Co-authored-by: Juuz <6596629+Juuxel@users.noreply.github.com>

---------

Co-authored-by: Juuz <6596629+Juuxel@users.noreply.github.com>
(cherry picked from commit 83154f1)
* Modify enchantment API for new system

breaking: complete overhaul of EnchantingContext

* Incorporate changes by apple

from FabricMC#3760
@Apollounknowndev Apollounknowndev changed the base branch from 1.20.5 to 1.20.6 May 15, 2024 01:12
modmuss50 and others added 11 commits May 16, 2024 18:47
* Port to 24w20a

* Update yarn

* Fix TODOs

* Bump version

---------

Co-authored-by: Drex <nicknamedrex@gmail.com>
* Add resource conditions to dynamic registries

* Support conditions in FabricDynamicRegistryProvider

 - Add matching overloads for all add(...) methods which take a varargs
   list of ResourceConditions.

 - Add an additional overload for registering RegistryEntry.References
   directly. This makes it a little easier to register directly from a
   RegistryBuilder.

* Throw error if we cannot add resource conditions

* Rename EntryWithConditions to ConditionalEntry

(cherry picked from commit a5d5299)
* [BREAKING] pass entity to EquipmentSlotProvider

* Improve mixin for chunk unload event

* `TestContext#getBlockEntity` result can be used without checks/casts now

* Fix typos
Co-authored-by: Drex <nicknamedrex@gmail.com>
Co-authored-by: embeddedt <42941056+embeddedt@users.noreply.github.com>
* No longer allow unused registry ids when syncing.

* Freeze registries much sooner after mod init
* Delete `FabricDimensions`

This broke during the 1.21 cycle and can be easily replaced with `Entity#teleportTo`.

* Rename testmod data directories

* [Breaking] use singular path in GameTest

* Fix attribute modifier in testmod

* Small mixin refactors related to teleportTo

* Fix behavior change in ModNioResourcePack for invalid paths

* Fix javadocs referencing Identifier ctor

* Add new FabricCodecDataProvider ctor

* Move empty structure

* Fix transfer api testmod

* pro tip: don't write datagen output by hand

* Refactor networking API to remove redundant code

* Stop calling CustomDamageHandler in creative mode
* 1.21-pre1 port

* Bump version
modmuss50 and others added 24 commits May 30, 2024 13:07
Co-authored-by: Drex <nicknamedrex@gmail.com>
* Tag cleanup and additions for 1.21

Closes FabricMC#3742
Closes FabricMC#3755
Closes FabricMC#3790
Closes FabricMC#3731

* Fixed music disc javadoc

* Re-add redundant tags but deprecate them

* remove eroded badlands from sparse vegetation

* Switched to singular name for inner files for tools

* deprecate redundant shulker box tag

* Added glazed terracotta tag

* Added concrete and concrete powder tags

* checkstyle issue
* Port Model Loading API v1

* Fix checkstyle and address review comments
FabricMC#3839)

* Add Mangrove Swamp to Dense Overworld Vegetation tag

Closes FabricMC#3823

* Added bamboo jungle to dense tag

(cherry picked from commit bd772e8)
* Add API to control creative inventory screen

* Rename methods

* Apply suggestions from code review

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

* Update fabric-item-group-api-v1/src/client/java/net/fabricmc/fabric/api/client/itemgroup/v1/FabricCreativeInventoryScreen.java

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

---------

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

* Review fixes.

* Update fabric-networking-api-v1/src/testmodClient/java/net/fabricmc/fabric/test/networking/client/configuration/NetworkingConfigurationClientTest.java

Co-authored-by: Octol1ttle <l1ttleofficial@outlook.com>

---------

Co-authored-by: Octol1ttle <l1ttleofficial@outlook.com>
… special glint transform (FabricMC#3854)

* Fix FabricMC#3853

* Revert parity change

This disparity exists on purpose to make the behavior of BlendMode.TRANSLUCENT more consistent
…#3850)

* change: add MinecraftClient/Server instances to networking contexts

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>

* style: optimize imports

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>

* change: use client instance from context in FabricRegistryClientInit

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>

* fix: remove unused import <_<

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>

* fix: update Javadocs in Networking classes

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>

---------

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
* Fix new tags not being plural

Fixes FabricMC#3807

Matches neoforged/NeoForge#1030

* Fixed concrete and terracotta

* Update fabric-convention-tags-v2/src/main/java/net/fabricmc/fabric/api/tag/convention/v2/ConventionalItemTags.java

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

* Update fabric-convention-tags-v2/src/datagen/java/net/fabricmc/fabric/impl/tag/convention/datagen/generators/EnglishTagLangGenerator.java

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

* Update fabric-convention-tags-v2/src/datagen/java/net/fabricmc/fabric/impl/tag/convention/datagen/generators/EnglishTagLangGenerator.java

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

* Update fabric-convention-tags-v2/src/datagen/java/net/fabricmc/fabric/impl/tag/convention/datagen/generators/EnglishTagLangGenerator.java

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

* Update fabric-convention-tags-v2/src/datagen/java/net/fabricmc/fabric/impl/tag/convention/datagen/generators/EnglishTagLangGenerator.java

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

* regen data

---------

Co-authored-by: haykam821 <24855774+haykam821@users.noreply.github.com>
@Apollounknowndev Apollounknowndev deleted the overlay-conditions branch June 20, 2024 23:36
@Apollounknowndev Apollounknowndev restored the overlay-conditions branch June 20, 2024 23:44
@Apollounknowndev Apollounknowndev deleted the overlay-conditions branch June 20, 2024 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.