[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

@ -16,7 +16,7 @@ import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.Level;
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;
public class BetterEndClient implements ClientModInitializer {
@ -35,15 +35,18 @@ public class BetterEndClient implements ClientModInitializer {
ResourceLocation checkPlantId = new ResourceLocation("item/chorus_plant");
ResourceLocation toLoadFlowerId = new ResourceLocation("betterend", "item/custom_chorus_flower");
ResourceLocation toLoadPlantId = new ResourceLocation("betterend", "item/custom_chorus_plant");
ModelLoadingRegistry.INSTANCE.registerResourceProvider(manager -> (resourceId, context) -> {
if (GeneratorOptions.changeChorusPlant()) {
if (resourceId.equals(checkFlowerId)) {
return context.loadModel(toLoadFlowerId);
} else if (resourceId.equals(checkPlantId)) {
return context.loadModel(toLoadPlantId);
ModelLoadingPlugin.register(pluginContext -> {
pluginContext.resolveModel().register((context) -> {
if (GeneratorOptions.changeChorusPlant()) {
if (context.id().equals(checkFlowerId)) {
return context.getOrLoadModel(toLoadFlowerId);
} else if (context.id().equals(checkPlantId)) {
return context.getOrLoadModel(toLoadPlantId);
}
}
}
return null;
return null;
});
});
if (ClientOptions.isCustomSky()) {