1
1
package com .falsepattern .lib .compat ;
2
2
3
3
import com .google .common .collect .Lists ;
4
+
4
5
import java .util .List ;
5
6
6
7
import cpw .mods .fml .relauncher .Side ;
13
14
import org .lwjgl .opengl .GL11 ;
14
15
15
16
@ SideOnly (Side .CLIENT )
16
- public class GuiLabel extends Gui
17
- {
17
+ public class GuiLabel extends Gui {
18
18
protected int width ;
19
19
protected int height ;
20
20
public int x ;
@@ -31,8 +31,7 @@ public class GuiLabel extends Gui
31
31
private final FontRenderer fontRenderer ;
32
32
private final int border ;
33
33
34
- public GuiLabel (FontRenderer fontRendererObj , int p_i45540_2_ , int p_i45540_3_ , int p_i45540_4_ , int p_i45540_5_ , int p_i45540_6_ , int p_i45540_7_ )
35
- {
34
+ public GuiLabel (FontRenderer fontRendererObj , int p_i45540_2_ , int p_i45540_3_ , int p_i45540_4_ , int p_i45540_5_ , int p_i45540_6_ , int p_i45540_7_ ) {
36
35
this .fontRenderer = fontRendererObj ;
37
36
this .id = p_i45540_2_ ;
38
37
this .x = p_i45540_3_ ;
@@ -49,49 +48,39 @@ public GuiLabel(FontRenderer fontRendererObj, int p_i45540_2_, int p_i45540_3_,
49
48
this .border = 0 ;
50
49
}
51
50
52
- public void addLine (String p_175202_1_ )
53
- {
51
+ public void addLine (String p_175202_1_ ) {
54
52
this .labels .add (I18n .format (p_175202_1_ ));
55
53
}
56
54
57
55
/**
58
56
* Sets the Label to be centered
59
57
*/
60
- public GuiLabel setCentered ()
61
- {
58
+ public GuiLabel setCentered () {
62
59
this .centered = true ;
63
60
return this ;
64
61
}
65
62
66
- public void drawLabel (Minecraft mc , int mouseX , int mouseY )
67
- {
68
- if (this .visible )
69
- {
63
+ public void drawLabel (Minecraft mc , int mouseX , int mouseY ) {
64
+ if (this .visible ) {
70
65
GL11 .glEnable (GL11 .GL_BLEND );
71
66
OpenGlHelper .glBlendFunc (770 , 771 , 1 , 0 );
72
67
GL11 .glBlendFunc (GL11 .GL_SRC_ALPHA , GL11 .GL_ONE_MINUS_SRC_ALPHA );
73
68
this .drawLabelBackground (mc , mouseX , mouseY );
74
69
int i = this .y + this .height / 2 + this .border / 2 ;
75
70
int j = i - this .labels .size () * 10 / 2 ;
76
71
77
- for (int k = 0 ; k < this .labels .size (); ++k )
78
- {
79
- if (this .centered )
80
- {
72
+ for (int k = 0 ; k < this .labels .size (); ++k ) {
73
+ if (this .centered ) {
81
74
this .drawCenteredString (this .fontRenderer , this .labels .get (k ), this .x + this .width / 2 , j + k * 10 , this .textColor );
82
- }
83
- else
84
- {
75
+ } else {
85
76
this .drawString (this .fontRenderer , this .labels .get (k ), this .x , j + k * 10 , this .textColor );
86
77
}
87
78
}
88
79
}
89
80
}
90
81
91
- protected void drawLabelBackground (Minecraft mcIn , int mouseX , int mouseY )
92
- {
93
- if (this .labelBgEnabled )
94
- {
82
+ protected void drawLabelBackground (Minecraft mcIn , int mouseX , int mouseY ) {
83
+ if (this .labelBgEnabled ) {
95
84
int i = this .width + this .border * 2 ;
96
85
int j = this .height + this .border * 2 ;
97
86
int k = this .x - this .border ;
0 commit comments