Merge branch 'dev/fabric-model-v1' into 1.20

This commit is contained in:
embeddedt 2023-07-18 11:28:24 -04:00
commit ed7bd69116
No known key found for this signature in database
GPG Key ID: A69433EC199B5613
5 changed files with 21 additions and 22 deletions

View File

@ -29,6 +29,18 @@ configurations {
}
}
// TODO remove
repositories {
maven {
name = "Technici4n"
url = "https://raw.githubusercontent.com/Technici4n/Technici4n-maven/master/"
content {
includeGroup "net.fabricmc.fabric-api"
}
}
}
dependencies {
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
testImplementation "net.fabricmc:fabric-loader-junit:${rootProject.fabric_loader_version}"
@ -37,7 +49,7 @@ dependencies {
modIncludeImplementation(fabricApi.module("fabric-lifecycle-events-v1", rootProject.fabric_api_version)) { exclude group: 'net.fabricmc', module: 'fabric-loader' }
modIncludeImplementation(fabricApi.module("fabric-screen-api-v1", rootProject.fabric_api_version)) { exclude group: 'net.fabricmc', module: 'fabric-loader' }
modIncludeImplementation(fabricApi.module("fabric-command-api-v2", rootProject.fabric_api_version)) { exclude group: 'net.fabricmc', module: 'fabric-loader' }
modIncludeImplementation(fabricApi.module("fabric-models-v0", rootProject.fabric_api_version)) { exclude group: 'net.fabricmc', module: 'fabric-loader' }
modIncludeImplementation(fabricApi.module("fabric-model-loading-api-v1", rootProject.fabric_api_version)) { exclude group: 'net.fabricmc', module: 'fabric-loader' }
modIncludeImplementation(fabricApi.module("fabric-resource-loader-v0", rootProject.fabric_api_version)) { exclude group: 'net.fabricmc', module: 'fabric-loader' }
modImplementation(fabricApi.module("fabric-data-generation-api-v1", rootProject.fabric_api_version)) { exclude group: 'net.fabricmc', module: 'fabric-loader' }
modImplementation("com.terraformersmc:modmenu:${rootProject.modmenu_version}") { transitive false }

View File

@ -1,19 +0,0 @@
package org.embeddedt.modernfix.fabric.mixin.perf.dynamic_resources;
import net.fabricmc.fabric.impl.client.model.ModelLoadingRegistryImpl;
import net.minecraft.client.resources.model.ModelBakery;
import org.embeddedt.modernfix.annotation.ClientOnlyMixin;
import org.embeddedt.modernfix.annotation.RequiresMod;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(ModelLoadingRegistryImpl.LoaderInstance.class)
@RequiresMod("fabric-models-v0")
@ClientOnlyMixin
public class LoaderInstanceMixin {
@Redirect(method = "finish", at = @At(value = "FIELD", target = "Lnet/fabricmc/fabric/impl/client/model/ModelLoadingRegistryImpl$LoaderInstance;loader:Lnet/minecraft/client/resources/model/ModelBakery;"))
private void keepLoader(ModelLoadingRegistryImpl.LoaderInstance instance, ModelBakery value) {
/* allow loading models to happen later */
}
}

View File

@ -76,9 +76,15 @@ public abstract class ModelBakeryMixin implements IExtendedModelBakery {
private boolean ignoreModelLoad;
// disable fabric recursion
@SuppressWarnings("unused")
private boolean fabric_enableGetOrLoadModelGuard;
@Redirect(method = "<init>", at = @At(value = "FIELD", opcode = Opcodes.PUTFIELD, target = "Lnet/minecraft/client/resources/model/ModelBakery;blockColors:Lnet/minecraft/client/color/block/BlockColors;"))
private void replaceTopLevelBakedModels(ModelBakery bakery, BlockColors val) {
// we can handle recursion in getModel without issues
fabric_enableGetOrLoadModelGuard = false;
this.blockColors = val;
this.ignoreModelLoad = true;
this.loadedBakedModels = CacheBuilder.newBuilder()

View File

@ -36,7 +36,7 @@
"fabric-lifecycle-events-v1": "*",
"fabric-screen-api-v1": "*",
"fabric-command-api-v2": "*",
"fabric-models-v0": "*",
"fabric-model-loading-api-v1": "*",
"minecraft": ">=1.16.2"
},
"breaks": {

View File

@ -17,7 +17,7 @@ rhino_version=1902.2.2-build.268
supported_minecraft_versions=1.20.1
fabric_loader_version=0.14.21
fabric_api_version=0.83.1+1.20.1
fabric_api_version=0.86.0+1.20.1
continuity_version=3.0.0-beta.2+1.19.3