@Override public void connectToSelected() { ServerSelectionList selector = ReflectionHelper.get(ObfuscatedField.GuiMultiplayer_serverListSelector, serverListSelector, this); if (selector == null) { PatchManager.instance().getGlobalAppliedPatches().setPatchSuccessfullyApplied(PatchList.PATCH_ENTITYPLAYERSP, false); super.connectToSelected(); return; } GuiListExtended.IGuiListEntry entry = selector.getSelected() < 0 ? null : selector.getListEntry(selector.getSelected()); if (entry instanceof ServerListEntryNormal) this.connectToServer(((ServerListEntryNormal) entry).getServerData()); else if (entry instanceof ServerListEntryLanDetected) { LanServerInfo lanserverinfo = ((ServerListEntryLanDetected) entry).getServerData(); this.connectToServer(new ServerData(lanserverinfo.getServerMotd(), lanserverinfo.getServerIpPort(), true)); } }
public static void updateLastServerFromDirectConnect( GuiMultiplayer guiMultiplayer, ServerData serverData) { currentServerIP = serverData.serverIP; if(!currentServerIP.contains(":")) currentServerIP += ":25565"; lastServer = new ServerListEntryNormal(guiMultiplayer, serverData); }
private ServerData getServerData(final GuiMultiplayer mpgui, final int index) { if (index<0) return null; final IGuiListEntry guilistextended$iguilistentry = this.compat.getListEntry(mpgui, index); if (guilistextended$iguilistentry instanceof ServerListEntryNormal) return this.compat.getServerData((ServerListEntryNormal) guilistextended$iguilistentry); return null; }
@Override public void draw(ServerListEntryNormal entry, int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isHovering) { entry.drawEntry(slotIndex, x, y, listWidth, slotHeight, mouseX, mouseY, isHovering); }
public ServerListEntryPublic(GuiMultiplayer mp, ServerListEntryNormal wrapped) { super(mp, wrapped.func_148296_a()); owner = mp; this.wrapped = wrapped; }
@Override public void draw(ServerListEntryNormal entry, int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isHovering) { entry.func_192634_a(slotIndex, x, y, listWidth, slotHeight, mouseX, mouseY, isHovering, 0); }
public ServerListEntryPublic(GuiMultiplayer mp, ServerListEntryNormal wrapped) { super(mp, wrapped.getServerData()); owner = mp; this.wrapped = wrapped; }
@Override public boolean canMoveUp(ServerListEntryNormal p_175392_1_, int p_175392_2_) { return false; }
@Override public boolean canMoveDown(ServerListEntryNormal p_175394_1_, int p_175394_2_) { return false; }
@Override public ServerData getServerData(final ServerListEntryNormal entry) { return entry.getServerData(); }
@Override public ServerData getServerData(final ServerListEntryNormal entry) { return entry.func_148296_a(); }
public String enhanceServerListEntry(ServerListEntryNormal serverListEntry, ServerData serverEntry, int x, int width, int y, int relativeMouseX, int relativeMouseY) { String tooltip; int idx; boolean blocked = false; if (serverDataTag.containsKey(serverEntry)) { ExtendedServerListData extendedData = serverDataTag.get(serverEntry); if ("FML".equals(extendedData.type) && extendedData.isCompatible) { idx = 0; tooltip = String.format("Compatible FML modded server\n%d mods present", extendedData.modData.size()); } else if ("FML".equals(extendedData.type) && !extendedData.isCompatible) { idx = 16; tooltip = String.format("Incompatible FML modded server\n%d mods present", extendedData.modData.size()); } else if ("BUKKIT".equals(extendedData.type)) { idx = 32; tooltip = String.format("Bukkit modded server"); } else if ("VANILLA".equals(extendedData.type)) { idx = 48; tooltip = String.format("Vanilla server"); } else { idx = 64; tooltip = String.format("Unknown server data"); } blocked = extendedData.isBlocked; } else { return null; } this.client.getTextureManager().bindTexture(iconSheet); Gui.drawModalRectWithCustomSizedTexture(x + width - 18, y + 10, 0, (float)idx, 16, 16, 256.0f, 256.0f); if (blocked) { Gui.drawModalRectWithCustomSizedTexture(x + width - 18, y + 10, 0, 80, 16, 16, 256.0f, 256.0f); } return relativeMouseX > width - 15 && relativeMouseX < width && relativeMouseY > 10 && relativeMouseY < 26 ? tooltip : null; }
public String enhanceServerListEntry(ServerListEntryNormal serverListEntry, ServerData serverEntry, int x, int width, int y, int relativeMouseX, int relativeMouseY) { String tooltip; int idx; boolean blocked = false; if (serverDataTag.containsKey(serverEntry)) { ExtendedServerListData extendedData = serverDataTag.get(serverEntry); if ("FML".equals(extendedData.type) && extendedData.isCompatible) { idx = 0; tooltip = String.format("Compatible FML modded server\n%d mods present", extendedData.modData.size()); } else if ("FML".equals(extendedData.type) && !extendedData.isCompatible) { idx = 16; tooltip = String.format("Incompatible FML modded server\n%d mods present", extendedData.modData.size()); } else if ("BUKKIT".equals(extendedData.type)) { idx = 32; tooltip = String.format("Bukkit modded server"); } else if ("VANILLA".equals(extendedData.type)) { idx = 48; tooltip = String.format("Vanilla server"); } else { idx = 64; tooltip = String.format("Unknown server data"); } blocked = extendedData.isBlocked; } else { return null; } this.client.func_110434_K().func_110577_a(iconSheet); Gui.func_146110_a(x + width - 18, y + 10, 0, (float)idx, 16, 16, 256.0f, 256.0f); if (blocked) { Gui.func_146110_a(x + width - 18, y + 10, 0, 80, 16, 16, 256.0f, 256.0f); } return relativeMouseX > width - 15 && relativeMouseX < width && relativeMouseY > 10 && relativeMouseY < 26 ? tooltip : null; }
public static void updateLastServerFromDirectConnect(GuiMultiplayer guiMultiplayer, ServerData serverData) { currentServerIP = serverData.serverIP; if (!currentServerIP.contains(":")) currentServerIP += ":25565"; lastServer = new ServerListEntryNormal(guiMultiplayer, serverData); }
public String enhanceServerListEntry(ServerListEntryNormal serverListEntry, ServerData serverEntry, int x, int width, int y, int relativeMouseX, int relativeMouseY) { String tooltip; int idx; boolean blocked = false; if (serverDataTag.containsKey(serverEntry)) { ExtendedServerListData extendedData = serverDataTag.get(serverEntry); if ("FML".equals(extendedData.type) && extendedData.isCompatible) { idx = 0; tooltip = String.format("Compatible FML modded server\n%d mods present", extendedData.modData.size()); } else if ("FML".equals(extendedData.type) && !extendedData.isCompatible) { idx = 16; tooltip = String.format("Incompatible FML modded server\n%d mods present", extendedData.modData.size()); } else if ("BUKKIT".equals(extendedData.type)) { idx = 32; tooltip = String.format("Bukkit modded server"); } else if ("VANILLA".equals(extendedData.type)) { idx = 48; tooltip = String.format("Vanilla server"); } else { idx = 64; tooltip = String.format("Unknown server data"); } blocked = extendedData.isBlocked; } else { return null; } this.client.getTextureManager().bindTexture(iconSheet); Gui.func_146110_a(x + width - 18, y + 10, 0, (float)idx, 16, 16, 256.0f, 256.0f); if (blocked) { Gui.func_146110_a(x + width - 18, y + 10, 0, 80, 16, 16, 256.0f, 256.0f); } return relativeMouseX > width - 15 && relativeMouseX < width && relativeMouseY > 10 && relativeMouseY < 26 ? tooltip : null; }
void draw(ServerListEntryNormal entry, int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isHovering);
ServerData getServerData(ServerListEntryNormal entry);