Update ServerComponent.java

This commit is contained in:
kirillsaint 2023-08-27 19:57:51 +06:00
parent be6627e741
commit 57c23a03f8

View File

@ -37,7 +37,7 @@ public class ServerComponent {
private static final ResourceLocation SERVER_SELECTION_BUTTONS = new ResourceLocation("textures/gui/server_selection.png");
private final SilentMultiplayerGui owner;
private final Minecraft mc;
private final ServerData server;
private ServerData server;
private final ResourceLocation serverIcon;
private String field_148299_g;
private DynamicTexture field_148305_h;
@ -82,7 +82,7 @@ public class ServerComponent {
});
}
boolean isHovered = MouseUtils.isInside(mouseX, mouseY, x, y, 240, 35);
RenderUtil.drawRoundedOutline(x, y, 240, 35, 3, 1, Theme.borderColor().getRGB());
RenderUtil.drawRoundedOutline(x, y, 240, 35, 3, isSelected ? 3 : 1, isSelected ? -1 : Theme.borderColor().getRGB());
if(isHovered || isSelected) {
RenderUtil.drawRoundedRect(x, y, 240, 35, 3, new Color(255, 255, 255, 30).getRGB());
if(isHovered) {
@ -248,4 +248,10 @@ public class ServerComponent {
public ServerData getServer() {
return server;
}
public void setServer(ServerData server) {
if(!server.serverIP.equalsIgnoreCase(this.server.serverIP)) {
this.server = new ServerData(server.serverName, server.serverIP, false);
}
}
}