Commit graph

83 commits

Author SHA1 Message Date
modmuss
86b12645b9
23w31a 2023-08-07 09:09:38 +01:00
modmuss
f4b7e42468
Update to loom 1.3 and use Mod Publish Plugin (#3158)
* Update to loom 1.3

* Fix more 1.3 deprecations

* Opps

* Move to mod publish plugin

* Revert some changes

* Fix some more Gradle deprecations

* Fix names

* Remove extra stuff

* Cleanup
2023-08-02 18:51:21 +01:00
apple502j
1e61dba1a0
Fix data generation for custom dynamic registry (#3216)
* Fix datagen for custom dynamic registry

* Test datagen for custom dynamic registry

* Check if the dynamic registry is registered with Fabric API

* Cleanup testmod

* Don't apply to registries not added using the fabric api.

---------

Co-authored-by: modmuss50 <modmuss50@gmail.com>
2023-07-25 14:21:33 +01:00
Shnupbups
6c31357e16
Some more TAWs for block creation and block loot tables (#3201)
* Some more TAWs

Added some TAWs for various methods in `Blocks` used to create certain types of blocks that mods may want to also create. Using these methods will allow them to ensure they have all the right block settings they need to stay consistent with vanilla blocks that use the same methods.

* Add some fields from BlockLootTableGenerator

useful fields from BlockLootTableGenerator. also cleaned up the datagen api's accesswidener file
2023-07-18 12:54:51 +01:00
Juuz
2e061fd481
Add dynamic registry API (#3163)
* Add API for adding custom dynamic registries

Closes #1012, supersedes #1031 and #2719.

* Add missing license headers

* Clarify RegistryLoaderMixin namespace injection

* Replace event with static registration, add skeleton for sorting registries

* Fix typo

* Refactor event phase sorting system for use with dynamic registries (#1)

* Make minor changes to Technici4n's PR

* Add test for nested dynamic objects

* Revert "Add test for nested dynamic objects"

This reverts commit 486e3e1ce0.

* Revert "Make minor changes to Technici4n's PR"

This reverts commit 741bd52c1e.

* Revert "Refactor event phase sorting system for use with dynamic registries (#1)"

This reverts commit bb7c8b8790.

* Remove sorting API

* Add support for defaulted dynamic registries

* Re-add test for nested dynamic objects

* Add missing license headers

* Fix typo

* Remove defaulted dynamic registries; flatten registration methods

* Remove last reference to registry sorting

* Add option to skip syncing for empty dynregs

* Update DynamicRegistrySyncOption docs

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

* Address review feedback

* Add registry namespace to tag paths for modded registries

* Move dynamic registry tests into their own class for readibility

* Finish DynamicRegistries doc

* Only apply tag change to dynamic registries

* Fix checkstyle

* Update fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/api/event/registry/DynamicRegistries.java

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

---------

Co-authored-by: Technici4n <13494793+Technici4n@users.noreply.github.com>
2023-07-18 12:53:34 +01:00
modmuss
b3afc78b68
Setup unit tests & format gradle files. (#3073) 2023-05-30 13:07:11 +01:00
Technici4n
01925f0fc2
Fix FabricBlockLootTableProvider breaking depending on the mapping set (#3070)
* Initial fix for FabricBlockLootTableProvider depending on mappings

* Remove internal implementation methods from  interface
2023-05-30 12:58:12 +01:00
modmuss50
ec0bbba5e9 1.20-pre5 2023-05-23 14:58:33 +01:00
modmuss50
0bf4e42290 Fix build 2023-05-16 15:56:23 +01:00
modmuss50
4d8536c91f
Add and test for missing method overrides in FabricBlockSettings (#3056) 2023-05-11 09:25:08 +01:00
modmuss50
03ef495b7f 1.20-pre1 2023-05-10 14:51:08 +01:00
modmuss50
fb8d95dacb Split test mods into client and common. (#3033) 2023-05-01 14:04:29 +01:00
modmuss50
39e100afd5 Fix build failure triggered by loom upgrade. 2023-04-26 18:38:20 +01:00
modmuss50
b3f2574b16 23w17a 2023-04-26 18:18:06 +01:00
Technici4n
81b63fb615 Make custom ingredient types and load conditions appear early in generated JSONs (#3020) 2023-04-23 13:28:37 +01:00
ErrorCraft
8e495dfc0f Add codec data provider (#2979) 2023-04-23 13:28:23 +01:00
modmuss50
eff26386be
23w16a (#3018)
# Breaking changes
- `VillagerPlantableRegistry` replaced with `ItemTags.VILLAGER_PLANTABLE_SEEDS`
- `FabricItemGroup.builder()` no longer takes an `Identifier`
- `FabricItemGroup.build()` no longer registers the ItemGroup, this now needs to go in the vanilla registry.
- `ItemGroupEvents.modifyEntriesEvent` now takes a `RegistryKey<ItemGroup>` in place of an `Identifier`
- `FabricLanguageProvider` now takes a `RegistryKey<ItemGroup>` in place of an `ItemGroup`
- `IdentifiableItemGroup` removed, replaced with vanilla registries.
- `FabricMaterialBuilder` removed, no replacement.
- `HudRenderCallback.onHudRender` now passed a `DrawableHelper` in place of `MatrixStack`
- `ScreenEvents.beforeRender` now passed a `DrawableHelper` in place of `MatrixStack`
- `ScreenEvents.afterRender` now passed a `DrawableHelper` in place of `MatrixStack`
- `Screens.getItemRenderer()` removed. Replace with `MinecraftClient.getItemRenderer()`

`DrawableHelper` is likely to be renamed soon, see: https://github.com/FabricMC/yarn/pull/3548/
2023-04-20 20:03:32 +01:00
modmuss50
158c189089 23w14a 2023-04-05 17:18:33 +01:00
modmuss50
848ffaabb4 23w13a 2023-03-29 16:07:13 +01:00
modmuss50
b09c81ea46 Fix build by removing old AW 2023-03-22 17:10:28 +00:00
modmuss50
5da15ca1b9 1.19.4-pre1 2023-02-22 19:56:50 +00:00
modmuss50
ae0966baae
Fix all valid Mixin AP warnings. (#2914) 2023-02-22 12:54:50 +00:00
Shnupbups
63b515f4db
BlockSetTypeRegistry and WoodTypeRegistry (#2916)
* BlockSetTypeRegistry and WoodTypeRegistry

Adds `BlockSetTypeRegistry` for creating `BlockSetType`s using Identifiers.
Also adds `WoodTypeRegistry` to replace `SignTypeRegistry`, matching the new more accurate Yarn name. The old `SignTypeRegistry` remains as deprecated for compatibility.

Also updates Yarn build.

* Delete SignTypeRegistry.java

Broke in the update anyway, no use keeping it

* Suggestions

* Whoops

* Suggestions
2023-02-22 12:54:42 +00:00
modmuss50
e45f7c6532 23w07a 2023-02-15 19:54:58 +00:00
Technici4n
e6c7d4eea9 Resource Conditions Additions (#2821)
* Resource Conditions Additions

- Add `registry_contains` condition. Closes #2548.
- Make `fabric:load_conditions` appear first in generated JSON objects.
- Uniformize implementation a bit.

* Update fabric-resource-conditions-api-v1/src/main/java/net/fabricmc/fabric/mixin/resource/conditions/DataProviderMixin.java

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

* itemsLoaded -> itemsRegistered

---------

Co-authored-by: Juuz <6596629+Juuxel@users.noreply.github.com>
(cherry picked from commit e63306e015)
2023-02-13 09:33:49 +00:00
modmuss50
57338cbe24 23w06a 2023-02-08 17:54:34 +00:00
modmuss50
12a6ba2c15 23w05a 2023-02-01 16:35:59 +00:00
modmuss50
a1ccd7bfed 23w04a 2023-01-24 16:59:43 +00:00
Technici4n
d471b08bab Fix #2552: Add way to use resource conditions for block loot table datagen (#2823)
(cherry picked from commit 06937c4b07)
2023-01-20 18:00:54 +00:00
Technici4n
1134c5b850
Remove leftover @ApiStatus.Internal annotations and add annotation validation (#2825)
* Remove leftover `@ApiStatus.Internal` annotations and add annotation validation

* Simplify

* Simplify more

* Update gradle/validate-annotations.gradle

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

Co-authored-by: Juuz <6596629+Juuxel@users.noreply.github.com>
2023-01-05 12:50:15 +00:00
modmuss50
abdb4ad90b
Generate a test datapack from the datagen testmod output. (#2824)
* Add a datapack zip for testing the datagen module

* Fix deprecation
2023-01-05 12:50:01 +00:00
Technici4n
5176f73dbb
add fabric-recipe-api-v1: Custom ingredients (#2586)
* Fabric custom ingredient API

* More Ingredient API work

* Optimize shapeless matching logic

* Fix all the things

* Move custom ingredient network serialization to account for ingredient extension API

* Apply suggestions from code review

Co-authored-by: apple502j <33279053+apple502j@users.noreply.github.com>

* Address 🍎 review

* Get rid of the @Overwrite

* Implement graceful fallback for clients not supporting some custom ingredients

* Move custom ingredient code to new Recipe API module

* Fix client package change

* Address review comments

- And/Or -> All/Any
- Move builtin ingredient registration to entrypoint
- Initial protocol version is 1
- Misc other changes

* Add testing instructions

* Use a List for `getMatchingStacks`

* Overengineer ingredient query a bit

Co-authored-by: apple502j <33279053+apple502j@users.noreply.github.com>
Co-authored-by: modmuss50 <modmuss50@gmail.com>
2023-01-05 12:49:19 +00:00
Shnupbups
87855a703c
Fixed blocks with vanilla loot tables making strict validation of datagen fail (#2816)
* Fixed blocks with vanilla loot tables making strict validation of datagen fail

Previously, blocks that used `.dropsLike(block)` in their block settings to use a vanilla block's loot table, or `.dropsNothing()` to use the `minecraft:empty` loot table, would cause strict validation in data generation to fail as the vanilla loot tables wouldn't be present in the mod's own block loot table generator.

This fixes that by ensuring that the block's loot table ID has a namespace that matches the loot table generator before adding it to the missing IDs list.

Two test blocks were added to the testmod, one which uses `.dropsLike(Blocks.STONE)` to use the same loot table as Stone, and one that uses `.dropsNothing()`. Previously, these would have caused strict validation to fail as the `minecraft:stone` and `minecraft:empty` loot tables aren't generated by the testmod's generator. Now they pass just fine.

* Fixed blocks with vanilla loot tables making strict validation of datagen fail

Previously, blocks that used `.dropsLike(block)` in their block settings to use a vanilla block's loot table, or `.dropsNothing()` to use the `minecraft:empty` loot table, would cause strict validation in data generation to fail as the vanilla loot tables wouldn't be present in the mod's own block loot table generator.

This fixes that by ensuring that the block's loot table ID has a namespace that matches the loot table generator before adding it to the missing IDs list.

Two test blocks were added to the testmod, one which uses `.dropsLike(Blocks.STONE)` to use the same loot table as Stone, and one that uses `.dropsNothing()`. Previously, these would have caused strict validation to fail as the `minecraft:stone` and `minecraft:empty` loot tables aren't generated by the testmod's generator. Now they pass just fine.
2023-01-02 13:03:40 +00:00
modmuss50
33a4e2d71e
Fix ItemGroup language generation. (#2785) 2022-12-23 17:52:51 +00:00
Technici4n
b808eab9dd
Add more transitive Access Wideners (#2780)
* Add more transitive Access Wideners

- Expose `StateProviderType` constructor. Fixes #474.
- Expose DefaultBiomeCreator.getSkyColor. Fixes #981.
- Make custom `RenderLayer` registration easier. Fixes #1635.
- Add warning at the beginning of the generated AW to prevent manual
  editing of the file.

* Add warning to datagen generated AW
2022-12-23 15:23:14 +00:00
Technici4n
8a534ba41e
Ensure consistent ordering of datagen TAW (#2781) 2022-12-23 13:09:13 +00:00
modmuss50
112a38be2a
Generate access wideners for DataProvider.getName implementations (#2736)
* Generate AW for DataProvider.getName impls

* Remove final

* Typo + improve memory usage
2022-12-11 13:50:46 +00:00
modmuss50
65e415cb4c
Add some useful helper methods to FabricDynamicRegistryProvider.Entries (#2692)
* Add some useful helper methods to FabricDynamicRegistryProvider.Entries

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

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

Co-authored-by: Juuz <6596629+Juuxel@users.noreply.github.com>
2022-11-26 19:58:25 +00:00
modmuss50
6d14859da5
Add FabricDataGenerator.createBuiltinResourcePack to support data generating builtin resourcepacks (#2697) 2022-11-26 19:57:50 +00:00
apple502j
8c84281028
1.19.3-pre2 javadoc fixes (#2698)
* 1.19.3-pre2 javadoc fixes

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

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

Co-authored-by: Technici4n <13494793+Technici4n@users.noreply.github.com>
2022-11-26 19:57:30 +00:00
modmuss50
ceb5661e2d
Add DataGeneratorEntrypoint.buildRegistry (#2681) 2022-11-24 15:05:09 +00:00
modmuss50
6605894492 Fix invalid accesswidener following the mapping update. 2022-11-23 20:23:12 +00:00
modmuss50
2894d6df22 1.19.3-pre1 2022-11-22 16:28:48 +00:00
90
f36e03c9c8 Add access widener for ItemModelGenerator#writer (#2635)
Allows for the use of custom Models and TextureMaps for generating item models.

(cherry picked from commit ad31814d3c)
2022-11-20 13:45:34 +00:00
modmuss50
49abcf7e64 Update mappings 2022-11-16 16:12:51 +00:00
apple502j
0d6838e783
Rename FabricWorldgenProvider to FabricDynamicRegistryProvider (#2638)
* Rename FabricWorldgenProvider

* Fix merge
2022-11-13 14:46:17 +00:00
modmuss50
f84bf2d968
22w45a (#2647) 2022-11-10 16:07:38 +00:00
modmuss50
f75bcd18f3
22w44a (#2632)
Co-authored-by: Sebastian Hartte <shartte@users.noreply.github.com>
2022-11-03 13:48:27 +00:00
modmuss50
65727739fb Rename FabricDataGenerator.create to createPack 2022-10-28 20:13:56 +01:00
modmuss50
11ba9c3b22
22w43a (#2610)
Co-authored-by: Technici4n <13494793+Technici4n@users.noreply.github.com>
2022-10-26 20:48:38 +01:00