[Change] Build against FAPI 0.86

This commit is contained in:
Frank 2023-07-23 02:26:54 +02:00
parent 3984d34d27
commit 3ede6a4ce0
3 changed files with 17 additions and 12 deletions

View file

@ -100,7 +100,9 @@ dependencies {
modCompileOnly "dev.emi:trinkets:${project.trinkets_version}" modCompileOnly "dev.emi:trinkets:${project.trinkets_version}"
modCompileOnly "dev.emi:emi-fabric:${emi_version}:api" modCompileOnly "dev.emi:emi-fabric:${emi_version}:api"
modLocalRuntime "dev.emi:emi-fabric:${emi_version}" // modLocalRuntime("dev.emi:emi-fabric:${emi_version}") {
// transitive = false
// }
if (local_wunderlib) { if (local_wunderlib) {
println "Using local WunderLib" println "Using local WunderLib"

View file

@ -4,7 +4,7 @@ org.gradle.jvmargs=-Xmx2G
# check these on https://fabricmc.net/versions.html # check these on https://fabricmc.net/versions.html
minecraft_version=1.20.1 minecraft_version=1.20.1
loader_version=0.14.21 loader_version=0.14.21
fabric_version=0.85.0+1.20.1 fabric_version=0.86.0+1.20.1
#Loom #Loom
loom_version=1.0-SNAPSHOT loom_version=1.0-SNAPSHOT
#Modrinth #Modrinth
@ -21,6 +21,6 @@ archives_base_name=better-end
patchouli_version=1.19-73-FABRIC patchouli_version=1.19-73-FABRIC
bclib_version=3.0.12 bclib_version=3.0.12
rei_version=12.0.622 rei_version=12.0.622
emi_version=1.0.3+1.20 emi_version=1.0.12+1.20.1
trinkets_version=3.7.0 trinkets_version=3.7.0
cca_version=5.2.1 cca_version=5.2.1

View file

@ -16,7 +16,7 @@ import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;
import net.fabricmc.api.ClientModInitializer; import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.model.ModelLoadingRegistry; import net.fabricmc.fabric.api.client.model.loading.v1.ModelLoadingPlugin;
import net.fabricmc.fabric.api.client.rendering.v1.DimensionRenderingRegistry; import net.fabricmc.fabric.api.client.rendering.v1.DimensionRenderingRegistry;
public class BetterEndClient implements ClientModInitializer { public class BetterEndClient implements ClientModInitializer {
@ -35,16 +35,19 @@ public class BetterEndClient implements ClientModInitializer {
ResourceLocation checkPlantId = new ResourceLocation("item/chorus_plant"); ResourceLocation checkPlantId = new ResourceLocation("item/chorus_plant");
ResourceLocation toLoadFlowerId = new ResourceLocation("betterend", "item/custom_chorus_flower"); ResourceLocation toLoadFlowerId = new ResourceLocation("betterend", "item/custom_chorus_flower");
ResourceLocation toLoadPlantId = new ResourceLocation("betterend", "item/custom_chorus_plant"); ResourceLocation toLoadPlantId = new ResourceLocation("betterend", "item/custom_chorus_plant");
ModelLoadingRegistry.INSTANCE.registerResourceProvider(manager -> (resourceId, context) -> {
ModelLoadingPlugin.register(pluginContext -> {
pluginContext.resolveModel().register((context) -> {
if (GeneratorOptions.changeChorusPlant()) { if (GeneratorOptions.changeChorusPlant()) {
if (resourceId.equals(checkFlowerId)) { if (context.id().equals(checkFlowerId)) {
return context.loadModel(toLoadFlowerId); return context.getOrLoadModel(toLoadFlowerId);
} else if (resourceId.equals(checkPlantId)) { } else if (context.id().equals(checkPlantId)) {
return context.loadModel(toLoadPlantId); return context.getOrLoadModel(toLoadPlantId);
} }
} }
return null; return null;
}); });
});
if (ClientOptions.isCustomSky()) { if (ClientOptions.isCustomSky()) {
DimensionRenderingRegistry.registerSkyRenderer(Level.END, new BetterEndSkyRenderer()); DimensionRenderingRegistry.registerSkyRenderer(Level.END, new BetterEndSkyRenderer());