package com.lion328.thaifixes;

import com.lion328.thaifixes.renderer.IFontRenderer;

import java.util.ArrayList;
import java.util.List;

public abstract class FontRendererWrapper
{

    private IFontRenderer renderer;

    public void setRenderer(IFontRenderer renderer)
    {
        this.renderer = renderer;
    }

    public void removeRenderer()
    {
        this.renderer = null;
    }

    public int getCharWidth(char c)
    {
        if (renderer.isSupportedCharacter(c))
        {
            renderer.getCharacterWidth(c);
        }

        return getDefaultCharacterWidth(c);
    }

    public abstract float getX();

    public abstract float getY();

    public abstract char getLastCharacterRendered();

    public abstract void bindTexture(String mcpxTextureLocationResource);

    public abstract void loadUnicodeTexture(int i);

    public abstract int getRawUnicodeWidth(char c);

    public abstract int getDefaultCharacterWidth(char c);
}

@@ -271,37 +271,36 @@
 )%0A    %7B%0A        
-this.
+if (
 renderer = rende
@@ -297,64 +297,133 @@
 er =
- r
+= null)%0A        %7B%0A            removeR
 enderer
+()
 ;%0A    
-%7D%0A%0A    public void removeRenderer()%0A    %7B
+        return;%0A        %7D%0A%0A        renderer.setFontRendererWrapper(this);
 %0A   
@@ -443,20 +443,24 @@
 derer = 
-null
+renderer
 ;%0A    %7D%0A
@@ -475,31 +475,34 @@
 lic 
-int getCharWidth(char c
+IFontRenderer getRenderer(
 )%0A  
@@ -513,28 +513,31 @@
         
-if (
+return 
 renderer
 .isSuppo
@@ -532,32 +532,84 @@
 erer
-.isSupportedCharacter(c)
+;%0A    %7D%0A%0A    public void removeRenderer()%0A    %7B%0A        if (renderer != null
 )%0A  
@@ -641,83 +641,77 @@
 rer.
-getCharacterWidth(c);%0A        %7D%0A%0A        return getDefaultCharacterWidth(c)
+setFontRendererWrapper(null);%0A        %7D%0A%0A        this.renderer = null
 ;%0A  
@@ -1022,66 +1022,7 @@
  c);
-%0A%0A    public abstract int getDefaultCharacterWidth(char c);
 %0A%7D%0A

Add null check, remove methods, add a method in FontRendererWrapper