From e7413def68367ce3003236f529da3cc04b6eaff2 Mon Sep 17 00:00:00 2001 From: IMS212 Date: Thu, 15 Aug 2024 20:21:24 -0700 Subject: [PATCH] Fix Fabric Block View API support Fixes #2670 --- .../caffeinemc/mods/sodium/client/world/LevelSlice.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/net/caffeinemc/mods/sodium/client/world/LevelSlice.java b/common/src/main/java/net/caffeinemc/mods/sodium/client/world/LevelSlice.java index 9ab896d82d..5f24211177 100644 --- a/common/src/main/java/net/caffeinemc/mods/sodium/client/world/LevelSlice.java +++ b/common/src/main/java/net/caffeinemc/mods/sodium/client/world/LevelSlice.java @@ -7,6 +7,7 @@ import net.caffeinemc.mods.sodium.client.world.cloned.ChunkRenderContext; import net.caffeinemc.mods.sodium.client.world.cloned.ClonedChunkSection; import net.caffeinemc.mods.sodium.client.world.cloned.ClonedChunkSectionCache; +import net.fabricmc.fabric.api.blockview.v2.FabricBlockView; import net.fabricmc.fabric.api.rendering.data.v1.RenderAttachedBlockView; import net.minecraft.client.Minecraft; import net.minecraft.client.multiplayer.ClientLevel; @@ -46,7 +47,7 @@ * *

Object pooling should be used to avoid huge allocations as this class contains many large arrays.

*/ -public final class LevelSlice implements BlockAndTintGetter, RenderAttachedBlockView { +public final class LevelSlice implements BlockAndTintGetter, RenderAttachedBlockView, FabricBlockView { private static final LightLayer[] LIGHT_TYPES = LightLayer.values(); // The number of blocks in a section. @@ -399,12 +400,12 @@ public SodiumModelData getPlatformModelData(BlockPos pos) { return modelMap.getModelData(pos); } - //@Override + @Override public boolean hasBiomes() { return true; } - //@Override + @Override public Holder getBiomeFabric(BlockPos pos) { return this.biomeSlice.getBiome(pos.getX(), pos.getY(), pos.getZ()); }