Skip to content

Commit

Permalink
Use FluidRenderer even for modded fluids
Browse files Browse the repository at this point in the history
  • Loading branch information
Asek3 committed Jan 13, 2024
1 parent d22e91e commit 3ac465e
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import net.minecraft.world.WorldType;
import net.minecraftforge.client.ForgeHooksClient;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fluids.IFluidBlock;
import org.embeddedt.embeddium.api.ChunkDataBuiltEvent;

/**
Expand Down Expand Up @@ -99,7 +100,7 @@ public ChunkBuildResult<T> performBuild(ChunkRenderCacheLocal cache, ChunkBuildB

// If the block is vanilla air, assume it renders nothing. Don't use isAir because mods
// can abuse it for all sorts of things
if (block.getMaterial(blockState) == Material.AIR) {
if (blockState.getMaterial() == Material.AIR) {
continue;
}

Expand All @@ -114,7 +115,7 @@ public ChunkBuildResult<T> performBuild(ChunkRenderCacheLocal cache, ChunkBuildB
}
}

if (renderType == EnumBlockRenderType.MODEL) {
if (renderType == EnumBlockRenderType.MODEL && !(block instanceof IFluidBlock)) {
IBakedModel model = cache.getBlockModels()
.getModelForState(blockState);

Expand All @@ -134,7 +135,7 @@ public ChunkBuildResult<T> performBuild(ChunkRenderCacheLocal cache, ChunkBuildB
}

}
} else if (renderType == EnumBlockRenderType.LIQUID) {
} else if (block instanceof IFluidBlock) {
for (BlockRenderLayer layer : LAYERS) {
if(!block.canRenderInLayer(blockState, layer)) {
continue;
Expand Down

0 comments on commit 3ac465e

Please sign in to comment.