Skip to content

Commit

Permalink
Fix Fabric Block View API support
Browse files Browse the repository at this point in the history
Fixes #2670
  • Loading branch information
IMS212 committed Aug 16, 2024
1 parent 5e3c95a commit e7413de
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -46,7 +47,7 @@
*
* <p>Object pooling should be used to avoid huge allocations as this class contains many large arrays.</p>
*/
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.
Expand Down Expand Up @@ -399,12 +400,12 @@ public SodiumModelData getPlatformModelData(BlockPos pos) {
return modelMap.getModelData(pos);
}

//@Override
@Override
public boolean hasBiomes() {
return true;
}

//@Override
@Override
public Holder<Biome> getBiomeFabric(BlockPos pos) {
return this.biomeSlice.getBiome(pos.getX(), pos.getY(), pos.getZ());
}
Expand Down

0 comments on commit e7413de

Please sign in to comment.