Commit graph

230 commits

Author SHA1 Message Date
modmuss50
670b2ea08d Bump version
All versions bumped due to Loom upgrade.
2023-10-01 12:48:38 +01:00
modmuss50
3ccb77f2a4 Bump version 2023-09-23 10:11:13 +01:00
modmuss50
b1913a6ae6 Bump version 2023-09-21 19:33:57 +01:00
modmuss50
8fe45160ad 1.20.2 2023-09-21 19:23:46 +01:00
modmuss50
0708114127 Bump version 2023-09-18 18:07:48 +01:00
modmuss50
5c133856b8 1.20.2-rc2 2023-09-18 16:13:25 +01:00
modmuss50
daef22a2cb 1.20.2-rc1 2023-09-15 15:27:05 +01:00
modmuss50
109a65e5af 1.20.2-pre4 2023-09-13 17:22:35 +01:00
modmuss50
3bafade3d1 1.20.2-pre2 2023-09-07 15:23:20 +01:00
modmuss50
435112151c 1.20.2-pre1 2023-09-05 16:31:02 +01:00
modmuss50
462ea84f7d Bump version 2023-09-03 21:54:51 +01:00
modmuss50
22fb02c315 Bump version 2023-09-03 13:34:17 +01:00
PepperCode1
73761d2e2d BlockView API v2 (#3268)
* Fabric BlockView API v2

* Fix dependency on nonexistent module

* Add test for biome getter

* Improve getBiomeFabric documentation

* Simplify javadoc

(cherry picked from commit 92a0d36746)
2023-09-03 13:13:56 +01:00
modmuss
fce67b32cf
23w35a (#3292) 2023-08-31 12:50:38 +01:00
modmuss50
f091af96c5 23w33a 2023-08-17 16:51:04 +01:00
modmuss50
11da534fdc Bump version 2023-08-13 16:26:33 +01:00
modmuss50
09816d0313 Fix createAndPopulateRegistryMap() always returning null, preventing registry sync.
This was caused by the changes in the port to 23w32a
2023-08-11 12:14:20 +01:00
modmuss50
0ba8e9ce03 23w32a 2023-08-09 18:04:04 +01:00
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
modmuss50
d9acd820fc Bump version 2023-07-25 14:55:57 +01:00
modmuss50
e3d1b5f3d8 Bump version 2023-07-18 13:55:53 +01:00
Technici4n
9386d8a793
Model Loading API v1 (#3145)
This PR deprecates and supersedes the old `fabric-models-v0` module.

## Refactors compared to v0
### Model loading hooks
Mods now register a single `ModelLoadingPlugin` for any change they want to make to the model loading process. (Or multiple plugins if they want to). This replaces the old `ModelLoadingRegistry`.

Here is an example:

```java
ModelLoadingPlugin.register(pluginContext -> {
    // ResourceManager access is provided like in the v0 API, but in a central place, and can be used for shared processing in the plugin.
    ResourceManager manager = pluginContext.resourceManager();

    // Model resource providers still exist, but they are called model resolvers now
    pluginContext.resolveModel().register(context -> {
        // ...
    });
});
```

#### `ModelVariantProvider` -> `BlockStateResolver`
`ModelVariantProvider` was heavily reworked, and is now replaced by the `BlockStateResolver`, with a much better defined contract.

#### `ModelResourceProvider` -> `ModelResolver`
The resource provider is mostly unchanged. The biggest difference is that it is now registered as an event listener. This allows mods to use event phases for ordering between conflicting ~~providers~~ resolvers.

#### Removed custom exception
Additionally, `ModelProviderException` could be thrown by a variant or resource provider in the v0 API. This was not explained in the documentation, and would according to the code stop further processing of the providers and log an error.

In the new API, any `Exception` is caught and logged. If that happens, the other resolvers are still processed. There is no custom `Exception` subclass anymore.

### Helper method to get a `BakedModel` by `Identifier` from the manager
The v0 had such a method in a helper class: `BakedModelManagerHelper#getBakedModel`. It is now interface-injected instead. See `FabricBakedModelManager`.

## New model wrapping hooks
New hooks are added for the various needs of mods that want to override or wrap specific models. Thanks to @embeddedt for contributing an initial version of them!

Here is an example of wrapping the gold model to remove the bottom quads, for example:
```java
ModelLoadingPlugin.register(pluginContext -> {
	// remove bottom face of gold blocks
	pluginContext.modifyModelAfterBake().register(ModelModifier.WRAP_PHASE, (model, context) -> {
		if (context.identifier().getPath().equals("block/gold_block")) {
			return new DownQuadRemovingModel(model);
		} else {
			return model;
		}
	});
});
```

There are 3 events, for the following use cases:
- Wrapping `UnbakedModel`s right when they are loaded. This allows replacing them entirely in dependent models too.
- Wrapping `UnbakedModel`s right before they are baked. This allows replacing them without affecting dependent models (which might not be expecting a model class change).
- Wrapping `BakedModel`s right when they are baked.

Multiple mods have implemented their own version of them. Providing them in Fabric API will make it easier on these mods, and will additionally allow optimization mods that perform on-demand model loading to simply fire the hooks themselves instead of working around injections performed by other mods.

Co-authored-by: embeddedt <42941056+embeddedt@users.noreply.github.com>
Co-authored-by: PepperCode1 <44146161+PepperCode1@users.noreply.github.com>
Co-authored-by: Juuz <6596629+Juuxel@users.noreply.github.com>
2023-07-18 12:53:13 +01:00
modmuss50
1ac061308b Bump version 2023-07-03 14:05:25 +01:00
modmuss50
8643158e89 Bump version 2023-06-21 10:18:14 +01:00
modmuss50
91e182c28a Bump version 2023-06-13 12:49:45 +01:00
modmuss50
5c1d40156b 1.20.1-rc1 2023-06-09 16:09:11 +01:00
modmuss50
96a7932e17 Bump version 2023-05-30 13:41:14 +01:00
modmuss
b3afc78b68
Setup unit tests & format gradle files. (#3073) 2023-05-30 13:07:11 +01:00
modmuss50
e808a8f296 1.20-pre7 2023-05-29 16:13:02 +01:00
modmuss50
df34a27454 1.20-pre6 2023-05-25 14:26:11 +01:00
modmuss50
488c3cd2d8 Bump version 2023-05-24 21:22:22 +01:00
modmuss50
ec0bbba5e9 1.20-pre5 2023-05-23 14:58:33 +01:00
modmuss50
63e9e1806d 1.20-pre3
- Only mapping updates.
2023-05-19 13:34:23 +01:00
modmuss50
b04edc7ab9 1.20-pre2 2023-05-16 15:36:50 +01:00
Technici4n
6b6af38432 Bump version 2023-05-15 21:36:03 +02:00
modmuss50
5495d89582 Bump version 2023-05-14 15:15:39 +01:00
modmuss50
f39272b79c Bump version 2023-05-11 09:31:56 +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
cbbb1b3fc0 23w18a 2023-05-03 14:56:35 +01:00
modmuss50
e1361c3ac5 Bump version 2023-05-01 14:12:23 +01:00
modmuss50
bd913b0dc6 Fix FontManagerMixin target. 2023-04-27 12:06:25 +01:00
modmuss50
b3f2574b16 23w17a 2023-04-26 18:18:06 +01:00
modmuss50
07640e5410 Bump versions
All versions bumped due to loom upgrade
2023-04-23 13:39:59 +01:00
modmuss50
c2fad32519 Update to Loom 1.2 and Gradle 8.1 (#3016) 2023-04-23 13:24:38 +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
451493807b Bump version 2023-04-11 10:05:43 +01:00
modmuss50
b5a544aa78 Bump version 2023-04-06 15:00:28 +01:00
modmuss50
158c189089 23w14a 2023-04-05 17:18:33 +01:00