Mod Warning Fixes
This commit is contained in:
parent
d473451295
commit
9a356dbf0d
3 changed files with 17 additions and 7 deletions
|
@ -6,6 +6,7 @@ import net.fabricmc.fabric.api.networking.v1.PacketSender;
|
||||||
import net.fabricmc.loader.api.metadata.ModEnvironment;
|
import net.fabricmc.loader.api.metadata.ModEnvironment;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.network.FriendlyByteBuf;
|
import net.minecraft.network.FriendlyByteBuf;
|
||||||
|
import net.minecraft.network.chat.CommonComponents;
|
||||||
import net.minecraft.network.chat.TranslatableComponent;
|
import net.minecraft.network.chat.TranslatableComponent;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import ru.bclib.BCLib;
|
import ru.bclib.BCLib;
|
||||||
|
@ -380,7 +381,7 @@ public class HelloClient extends DataHandler.FromServer {
|
||||||
showSyncFilesScreen(client, filesToRequest, filesToRemove);
|
showSyncFilesScreen(client, filesToRequest, filesToRemove);
|
||||||
return;
|
return;
|
||||||
} else if (serverPublishedModInfo && mismatchingMods.size()>0 && Configs.CLIENT_CONFIG.isShowingModInfo()) {
|
} else if (serverPublishedModInfo && mismatchingMods.size()>0 && Configs.CLIENT_CONFIG.isShowingModInfo()) {
|
||||||
client.setScreen(new ModListScreen(client.screen, new TranslatableComponent("title.bclib.modmissmatch"), new TranslatableComponent("message.bclib.modmissmatch"), ModUtil.getMods(), modVersion));
|
client.setScreen(new ModListScreen(client.screen, new TranslatableComponent("title.bclib.modmissmatch"), new TranslatableComponent("message.bclib.modmissmatch"), CommonComponents.GUI_PROCEED, ModUtil.getMods(), modVersion));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,6 @@ import ru.bclib.gui.gridlayout.GridLayout;
|
||||||
import ru.bclib.gui.gridlayout.GridRow;
|
import ru.bclib.gui.gridlayout.GridRow;
|
||||||
import ru.bclib.gui.gridlayout.GridScreen;
|
import ru.bclib.gui.gridlayout.GridScreen;
|
||||||
import ru.bclib.util.ModUtil;
|
import ru.bclib.util.ModUtil;
|
||||||
import ru.bclib.util.Pair;
|
|
||||||
import ru.bclib.util.PathUtil;
|
import ru.bclib.util.PathUtil;
|
||||||
import ru.bclib.util.Triple;
|
import ru.bclib.util.Triple;
|
||||||
|
|
||||||
|
@ -30,22 +29,32 @@ public class ModListScreen extends BCLibScreen {
|
||||||
private final List<ModUtil.ModInfo> mods;
|
private final List<ModUtil.ModInfo> mods;
|
||||||
private final HelloClient.IServerModMap serverInfo;
|
private final HelloClient.IServerModMap serverInfo;
|
||||||
private final Component description;
|
private final Component description;
|
||||||
|
private final Component buttonTitle;
|
||||||
|
|
||||||
private static List<ModUtil.ModInfo> extractModList(Map<String, ModUtil.ModInfo> mods){
|
private static List<ModUtil.ModInfo> extractModList(Map<String, ModUtil.ModInfo> mods){
|
||||||
List<ModUtil.ModInfo> list = new LinkedList<ModUtil.ModInfo>();
|
List<ModUtil.ModInfo> list = new LinkedList<ModUtil.ModInfo>();
|
||||||
ModUtil.getMods().forEach((id, info) -> list.add(info));
|
ModUtil.getMods().forEach((id, info) -> list.add(info));
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ModListScreen(Screen parent, Component title, Component description, Map<String, ModUtil.ModInfo> mods, HelloClient.IServerModMap serverInfo) {
|
public ModListScreen(Screen parent, Component title, Component description, Map<String, ModUtil.ModInfo> mods, HelloClient.IServerModMap serverInfo) {
|
||||||
this(parent, title, description, extractModList(mods), serverInfo);
|
this(parent, title, description, CommonComponents.GUI_BACK, mods, serverInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ModListScreen(Screen parent, Component title, Component description, List<ModUtil.ModInfo> mods, HelloClient.IServerModMap serverInfo) {
|
||||||
|
this(parent, title, description, CommonComponents.GUI_BACK, mods, serverInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ModListScreen(Screen parent, Component title, Component description, Component button, Map<String, ModUtil.ModInfo> mods, HelloClient.IServerModMap serverInfo) {
|
||||||
|
this(parent, title, description, button, extractModList(mods), serverInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ModListScreen(Screen parent, Component title, Component description, List<ModUtil.ModInfo> mods, HelloClient.IServerModMap serverInfo) {
|
public ModListScreen(Screen parent, Component title, Component description, Component button, List<ModUtil.ModInfo> mods, HelloClient.IServerModMap serverInfo) {
|
||||||
super(parent, title, 10, true);
|
super(parent, title, 10, true);
|
||||||
this.mods = mods;
|
this.mods = mods;
|
||||||
this.serverInfo = serverInfo;
|
this.serverInfo = serverInfo;
|
||||||
this.description = description;
|
this.description = description;
|
||||||
|
this.buttonTitle = button;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<String> localMissing(HelloClient.IServerModMap serverInfo){
|
public static List<String> localMissing(HelloClient.IServerModMap serverInfo){
|
||||||
|
@ -197,7 +206,7 @@ public class ModListScreen extends BCLibScreen {
|
||||||
grid.addSpacerRow(8);
|
grid.addSpacerRow(8);
|
||||||
row = grid.addRow();
|
row = grid.addRow();
|
||||||
row.addFiller();
|
row.addFiller();
|
||||||
row.addButton(CommonComponents.GUI_BACK, 20, font, (n)-> {
|
row.addButton(buttonTitle, 20, font, (n)-> {
|
||||||
onClose();
|
onClose();
|
||||||
System.out.println("Closing");
|
System.out.println("Closing");
|
||||||
});
|
});
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
"title.config.bclib.client.auto_sync.acceptConfigs": "Accept incoming Confog Files",
|
"title.config.bclib.client.auto_sync.acceptConfigs": "Accept incoming Confog Files",
|
||||||
"title.config.bclib.client.auto_sync.acceptFiles": "Accept incoming Files",
|
"title.config.bclib.client.auto_sync.acceptFiles": "Accept incoming Files",
|
||||||
"title.config.bclib.client.auto_sync.acceptMods": "Accept incoming Mods",
|
"title.config.bclib.client.auto_sync.acceptMods": "Accept incoming Mods",
|
||||||
"title.config.bclib.client.auto_sync.syncModFolder": "Sync entire Mod-Folder from Server",
|
"title.config.bclib.client.auto_sync.displayModInfo": "Display warning when Serverside Mods differ from Client",
|
||||||
"title.config.bclib.client.auto_sync.debugHashes": "Print Auto-Sync Debug-Hashes to Log",
|
"title.config.bclib.client.auto_sync.debugHashes": "Print Auto-Sync Debug-Hashes to Log",
|
||||||
|
|
||||||
"title.bclib.syncfiles.modInfo": "Mod Info",
|
"title.bclib.syncfiles.modInfo": "Mod Info",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue