mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 16:27:47 +00:00
Jar-In-Jar (#8715)
This commit is contained in:
1 parent
5acfc6ae3c
commit
5979636ee5
25 files changed
+837
-155
No files matched your search
@@ -94,7 +94,11 @@ public class LoadingErrorScreen extends ErrorScreen {
|
||||
}
|
||||
public static class LoadingEntryList extends ObjectSelectionList<LoadingEntryList.LoadingMessageEntry> {
|
||||
LoadingEntryList(final LoadingErrorScreen parent, final List<ModLoadingException> errors, final List<ModLoadingWarning> warnings) {
|
||||
super(parent.minecraft, parent.width, parent.height, 35, parent.height - 50, 2 * parent.minecraft.font.lineHeight + 8);
|
||||
super(Objects.requireNonNull(parent.minecraft), parent.width, parent.height, 35, parent.height - 50,
|
||||
Math.max(
|
||||
errors.stream().mapToInt(error -> parent.font.split(Component.literal(error.getMessage() != null ? error.getMessage() : ""), parent.width - 20).size()).max().orElse(0),
|
||||
warnings.stream().mapToInt(warning -> parent.font.split(Component.literal(warning.formatToString() != null ? warning.formatToString() : ""), parent.width - 20).size()).max().orElse(0)
|
||||
) * parent.minecraft.font.lineHeight + 8);
|
||||
boolean both = !errors.isEmpty() && !warnings.isEmpty();
|
||||
if (both)
|
||||
addEntry(new LoadingMessageEntry(parent.errorHeader, true));
|
||||
@@ -140,13 +144,14 @@ public class LoadingErrorScreen extends ErrorScreen {
|
||||
@Override
|
||||
public void render(PoseStack poseStack, int entryIdx, int top, int left, final int entryWidth, final int entryHeight, final int mouseX, final int mouseY, final boolean p_194999_5_, final float partialTick) {
|
||||
Font font = Minecraft.getInstance().font;
|
||||
final List<FormattedCharSequence> strings = font.split(message, LoadingEntryList.this.width);
|
||||
final List<FormattedCharSequence> strings = font.split(message, LoadingEntryList.this.width - 20);
|
||||
int y = top + 2;
|
||||
for (int i = 0; i < Math.min(strings.size(), 2); i++) {
|
||||
for (FormattedCharSequence string : strings)
|
||||
{
|
||||
if (center)
|
||||
font.draw(poseStack, strings.get(i), left + (width) - font.width(strings.get(i)) / 2F, y, 0xFFFFFF);
|
||||
font.draw(poseStack, string, left + (width) - font.width(string) / 2F, y, 0xFFFFFF);
|
||||
else
|
||||
font.draw(poseStack, strings.get(i), left + 5, y, 0xFFFFFF);
|
||||
font.draw(poseStack, string, left + 5, y, 0xFFFFFF);
|
||||
y += font.lineHeight;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,8 @@ import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import net.minecraft.client.gui.narration.NarrationElementOutput;
|
||||
import net.minecraft.client.renderer.GameRenderer;
|
||||
import net.minecraftforge.client.gui.widget.ModListWidget;
|
||||
import net.minecraftforge.fml.loading.moddiscovery.ModFile;
|
||||
import net.minecraftforge.fml.loading.moddiscovery.ModFileInfo;
|
||||
import net.minecraftforge.resource.PathResourcePack;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
@@ -450,7 +452,7 @@ public class ModListScreen extends Screen
|
||||
|
||||
if (vercheck.status() == VersionChecker.Status.OUTDATED || vercheck.status() == VersionChecker.Status.BETA_OUTDATED)
|
||||
lines.add(ForgeI18n.parseMessage("fml.menu.mods.info.updateavailable", vercheck.url() == null ? "" : vercheck.url()));
|
||||
lines.add(ForgeI18n.parseMessage("fml.menu.mods.info.license", selectedMod.getOwningFile().getLicense()));
|
||||
lines.add(ForgeI18n.parseMessage("fml.menu.mods.info.license", ((ModFileInfo) selectedMod.getOwningFile()).getLicense()));
|
||||
lines.add(null);
|
||||
lines.add(selectedMod.getDescription());
|
||||
|
||||
|
||||
Reference in new issue
Block a user