Fix liquid tank contents not being rendered (#588)

This commit is contained in:
Snownee 2020-12-24 21:27:26 +08:00
parent 13cc4324ca
commit 0cc6fe1de7
2 changed files with 15 additions and 1 deletions

View File

@ -68,4 +68,9 @@ public class FluidTankRenderer extends SafeTileEntityRenderer<FluidTankTileEntit
ms.pop();
}
@Override
public boolean isGlobalRenderer(FluidTankTileEntity te) {
return te.isController();
}
}

View File

@ -284,7 +284,16 @@ public class FluidTankTileEntity extends SmartTileEntity {
@Override
@OnlyIn(Dist.CLIENT)
public AxisAlignedBB getRenderBoundingBox() {
return super.getRenderBoundingBox().expand(width - 1, height - 1, width - 1);
if (isController())
return super.getRenderBoundingBox().expand(width - 1, height - 1, width - 1);
return super.getRenderBoundingBox();
}
@Override
@OnlyIn(Dist.CLIENT)
public double getMaxRenderDistanceSquared() {
int dist = 64 + getMaxHeight() * 2;
return dist * dist;
}
@Nullable