use of net.minecraft.client.gui.ServerListEntryNormal in project Almura by AlmuraDev.
the class MixinGuiMultiplayer method onSelectServer.
@Inject(method = "selectServer", at = @At("RETURN"))
public void onSelectServer(int index, CallbackInfo ci) {
final GuiListExtended.IGuiListEntry entry = index < 0 ? null : this.serverListSelector.getListEntry(index);
if (entry != null && entry instanceof ServerListEntryNormal) {
final ServerListEntryNormal serverEntry = (ServerListEntryNormal) entry;
if (serverEntry.getServerData().serverName.equals(PUBLIC_SERVER_DATA.serverName) && serverEntry.getServerData().serverIP.equals(PUBLIC_SERVER_DATA.serverIP)) {
this.btnDeleteServer.enabled = false;
this.btnEditServer.enabled = false;
} else if (serverEntry.getServerData().serverName.equals(DEV_SERVER_DATA.serverName) && serverEntry.getServerData().serverIP.equals(DEV_SERVER_DATA.serverIP)) {
this.btnDeleteServer.enabled = false;
this.btnEditServer.enabled = false;
}
}
}
Aggregations