Skip to content

Commit

Permalink
Fix rare spout crash and offset rendering (#7025)
Browse files Browse the repository at this point in the history
  • Loading branch information
MoePus authored Jan 26, 2025
1 parent 28d30f3 commit 4ba5e98
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ public void tick() {
protected void spawnProcessingParticles(FluidStack fluid) {
if (isVirtual())
return;
if (fluid.isEmpty())
return;
Vec3 vec = VecHelper.getCenterOf(worldPosition);
vec = vec.subtract(0, 8 / 16f, 0);
ParticleOptions particle = FluidFX.getFluidParticle(fluid);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ protected void renderSafe(SpoutBlockEntity be, float partialTicks, PoseStack ms,
processingProgress = Mth.clamp(processingProgress, 0, 1);
float radius = 0;

if (processingTicks != -1) {
if (!fluidStack.isEmpty() && processingTicks != -1) {
radius = (float) (Math.pow(((2 * processingProgress) - 1), 2) - 1);
AABB bb = new AABB(0.5, .5, 0.5, 0.5, -1.2, 0.5).inflate(radius / 32f);
AABB bb = new AABB(0.5, 0.0, 0.5, 0.5, -1.2, 0.5).inflate(radius / 32f);
FluidRenderer.renderFluidBox(fluidStack, (float) bb.minX, (float) bb.minY, (float) bb.minZ,
(float) bb.maxX, (float) bb.maxY, (float) bb.maxZ, buffer, ms, light, true);
}
Expand Down

0 comments on commit 4ba5e98

Please sign in to comment.