2020import org .apache .commons .lang3 .Validate ;
2121import org .apache .logging .log4j .LogManager ;
2222import org .apache .logging .log4j .Logger ;
23+ import org .lwjgl .opengl .GL11 ;
2324import top .fpsmaster .FPSMaster ;
2425import top .fpsmaster .font .impl .UFontRenderer ;
2526import top .fpsmaster .utils .render .draw .Hover ;
27+ import top .fpsmaster .utils .render .draw .Images ;
28+ import top .fpsmaster .utils .render .draw .Rects ;
29+ import top .fpsmaster .utils .render .gui .UiScale ;
2630
2731import java .awt .image .BufferedImage ;
2832import java .net .UnknownHostException ;
@@ -84,7 +88,6 @@ public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight
8488 UFontRenderer title = FPSMaster .fontManager .s18 ;
8589 UFontRenderer text = FPSMaster .fontManager .s16 ;
8690
87-
8891 boolean flag = this .server .version > 47 ;
8992 boolean flag1 = this .server .version < 47 ;
9093 boolean flag2 = flag || flag1 ;
@@ -135,9 +138,10 @@ public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight
135138 s1 = "Pinging..." ;
136139 }
137140
138- GlStateManager .color (1.0F , 1.0F , 1.0F , 1.0F );
139- this .mc .getTextureManager ().bindTexture (Gui .icons );
140- Gui .drawModalRectWithCustomSizedTexture (x + listWidth - 15 - 5 , y + 5 , (float ) (k * 10 ), (float ) (176 + l * 8 ), 10 , 8 , 256.0F , 256.0F );
141+ // this.mc.getTextureManager().bindTexture(Gui.icons);
142+ Images .drawUV (Gui .icons , x + listWidth - 15 - 5 , y + 5 , k * 10 , 176 + l * 8 , 10 , 8 , 256 , 256 ,-1 ,false );
143+
144+ // Gui.drawModalRectWithCustomSizedTexture(UiScale.scale(x + listWidth - 15 - 5), UiScale.scale(y + 5), (float) (k * 10), (float) (176 + l * 8), 10, 8, 256.0F, 256.0F);
141145 if (this .server .getBase64EncodedIconData () != null && !this .server .getBase64EncodedIconData ().equals (this .field_148299_g )) {
142146 this .field_148299_g = this .server .getBase64EncodedIconData ();
143147 this .prepareServerIcon ();
@@ -149,9 +153,10 @@ public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight
149153 } else {
150154 this .drawTextureAt (x + 10 , y + 10 , UNKNOWN_SERVER );
151155 }
152-
153- int i1 = mouseX - x ;
154- int j1 = mouseY - y ;
156+ GlStateManager .enableTexture2D ();
157+ GlStateManager .disableBlend ();
158+ // int i1 = mouseX - x;
159+ // int j1 = mouseY - y;
155160// String tooltip = FMLClientHandler.instance().enhanceServerListEntry(this, this.server, x, listWidth, y, i1, j1);
156161// if (tooltip != null) {
157162// this.owner.setHoveringText(tooltip);
@@ -161,48 +166,13 @@ public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight
161166// this.owner.setHoveringText(s);
162167// }
163168
164- if (Hover .is (x + listWidth - text . getStringWidth ( s1 ) , y + 4 , 10 , 10 , mouseX , mouseY )) {
165- text .drawString (s1 , x + listWidth - text . getStringWidth ( s1 ) + 12 , y + 4 , -1 );
169+ if (Hover .is (x + listWidth - 16 , y + 4 , 16 , 12 , mouseX , mouseY )) {
170+ text .drawString (s1 , x + listWidth - 8 , y + 4 , -1 );
166171 }
167-
168- if (this .mc .gameSettings .touchscreen || isSelected ) {
169- this .mc .getTextureManager ().bindTexture (SERVER_SELECTION_BUTTONS );
170- Gui .drawRect (x , y , x + 32 , y + 32 , -1601138544 );
171- GlStateManager .color (1.0F , 1.0F , 1.0F , 1.0F );
172- int k1 = mouseX - x ;
173- int l1 = mouseY - y ;
174- if (this .func_178013_b ()) {
175- if (k1 < 32 && k1 > 16 ) {
176- Gui .drawModalRectWithCustomSizedTexture (x , y , 0.0F , 32.0F , 32 , 32 , 256.0F , 256.0F );
177- } else {
178- Gui .drawModalRectWithCustomSizedTexture (x , y , 0.0F , 0.0F , 32 , 32 , 256.0F , 256.0F );
179- }
180- }
181-
182- // if (this.owner.func_175392_a(this, slotIndex)) {
183- // if (k1 < 16 && l1 < 16) {
184- // Gui.drawModalRectWithCustomSizedTexture(x, y, 96.0F, 32.0F, 32, 32, 256.0F, 256.0F);
185- // } else {
186- // Gui.drawModalRectWithCustomSizedTexture(x, y, 96.0F, 0.0F, 32, 32, 256.0F, 256.0F);
187- // }
188- // }
189- //
190- // if (this.owner.func_175394_b(this, slotIndex)) {
191- // if (k1 < 16 && l1 > 16) {
192- // Gui.drawModalRectWithCustomSizedTexture(x, y, 64.0F, 32.0F, 32, 32, 256.0F, 256.0F);
193- // } else {
194- // Gui.drawModalRectWithCustomSizedTexture(x, y, 64.0F, 0.0F, 32, 32, 256.0F, 256.0F);
195- // }
196- // }
197- }
198-
199172 }
200173
201174 protected void drawTextureAt (int p_178012_1_ , int p_178012_2_ , ResourceLocation p_178012_3_ ) {
202- this .mc .getTextureManager ().bindTexture (p_178012_3_ );
203- GlStateManager .enableBlend ();
204- Gui .drawModalRectWithCustomSizedTexture (p_178012_1_ , p_178012_2_ , 0.0F , 0.0F , 32 , 32 , 32.0F , 32.0F );
205- GlStateManager .disableBlend ();
175+ Images .draw (p_178012_3_ , p_178012_1_ , p_178012_2_ , 32 , 32 );
206176 }
207177
208178 private boolean func_178013_b () {
0 commit comments