Я написал две функции отрисовки ректа но ни одна из них не воркает,хотя отрисовка текста воркает,функци вызывал в классе ingamgui,
Функция 1:
public static void drawRect(int x,int y, int width, int height, int color){
AbstractGui.fill(matrixStack,x,y,x + width, y + height, color);
}
Функция 2:
public static void drawRect(double left, double top, double right, double bottom, int color)
{
if (left < right)
{
double i = left;
left = right;
right = i;
}
if (top < bottom)
{
double j = top;
top = bottom;
bottom = j;
}
float f3 = (float)(color >> 24 & 255) / 255.0F;
float f = (float)(color >> 16 & 255) / 255.0F;
float f1 = (float)(color >> 8 & 255) / 255.0F;
float f2 = (float)(color & 255) / 255.0F;
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder worldrenderer = tessellator.getBuffer();
GlStateManager.enableBlend();
GlStateManager.disableTexture();
GlStateManager.color((int) f, (int) f1, (int) f2, (int) f3);
worldrenderer.begin(7, DefaultVertexFormats.POSITION);
worldrenderer.pos((double)left, (double)bottom, 0.0D).endVertex();
worldrenderer.pos((double)right, (double)bottom, 0.0D).endVertex();
worldrenderer.pos((double)right, (double)top, 0.0D).endVertex();
worldrenderer.pos((double)left, (double)top, 0.0D).endVertex();
tessellator.draw();
GlStateManager.enableTexture();
GlStateManager.disableBlend();
}
}