Skip to content

Commit

Permalink
Fix items in basin dont render on contraptions
Browse files Browse the repository at this point in the history
Fix items culled wrongly if player is resized
  • Loading branch information
songqingyuan02 committed Jan 31, 2025
1 parent a101060 commit 4ecc18e
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
import com.simibubi.create.foundation.blockEntity.behaviour.fluid.SmartFluidTankBehaviour.TankSegment;
import com.simibubi.create.foundation.blockEntity.renderer.SmartBlockEntityRenderer;
import com.simibubi.create.foundation.fluid.FluidRenderer;
import com.simibubi.create.foundation.ponder.PonderWorld;
import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.AnimationTickHolder;
import com.simibubi.create.foundation.utility.IntAttached;
import com.simibubi.create.foundation.utility.VecHelper;

import com.simibubi.create.foundation.utility.worldWrappers.WrappedWorld;

import dev.engine_room.flywheel.lib.transform.TransformStack;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.MultiBufferSource;
Expand Down Expand Up @@ -41,7 +42,7 @@ protected void renderSafe(BasinBlockEntity basin, float partialTicks, PoseStack
super.renderSafe(basin, partialTicks, ms, buffer, light, overlay);

Entity camera = Minecraft.getInstance().cameraEntity;
if (basin.getLevel() instanceof PonderWorld || (camera != null && basin.getBlockPos().getY() - 1.0F <= camera.getY())) {
if (basin.getLevel() instanceof WrappedWorld || (camera != null && basin.getBlockPos().getY() + 1.0F <= camera.getEyeY())) {
float fluidLevel = renderFluids(basin, partialTicks, ms, buffer, light, overlay);
renderInsideItems(basin, partialTicks, ms, buffer, light, overlay, fluidLevel);
}
Expand Down

0 comments on commit 4ecc18e

Please sign in to comment.