mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-01-28 22:05:01 +01:00
fix spout rendering bug and crash
This commit is contained in:
parent
aa15182005
commit
fbc99137c0
2 changed files with 4 additions and 2 deletions
|
@ -232,6 +232,8 @@ public class SpoutBlockEntity extends SmartBlockEntity implements IHaveGoggleInf
|
|||
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);
|
||||
|
|
|
@ -65,9 +65,9 @@ public class SpoutRenderer extends SafeBlockEntityRenderer<SpoutBlockEntity> {
|
|||
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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue