mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 08:17:35 +00:00
Buildscript cleanup and organization.
Updated to use newer libraries that reduce the command line arguments needed to run the game. Fix issues in the SecureModule's classloader that caused resources to not be seen when they are on parent module layers.
This commit is contained in:
23 files changed
+281
-458
No files matched your search
@@ -16,6 +16,8 @@ import com.mojang.blaze3d.vertex.SheetedDecalTextureGenerator;
|
||||
import com.mojang.blaze3d.vertex.VertexConsumer;
|
||||
import com.mojang.datafixers.util.Either;
|
||||
import com.mojang.math.Constants;
|
||||
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.FileUtil;
|
||||
import net.minecraft.client.Camera;
|
||||
import net.minecraft.client.KeyMapping;
|
||||
@@ -155,7 +157,6 @@ import net.minecraftforge.fml.ModList;
|
||||
import net.minecraftforge.fml.ModLoader;
|
||||
import net.minecraftforge.fml.VersionChecker;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.forge.snapshots.ForgeSnapshotsModClient;
|
||||
import net.minecraftforge.gametest.ForgeGameTestHooks;
|
||||
import net.minecraftforge.network.NetworkContext;
|
||||
import net.minecraftforge.network.NetworkInitialization;
|
||||
@@ -344,9 +345,16 @@ public class ForgeHooksClient {
|
||||
//RenderingRegistry.registerBlockHandler(RenderBlockFluid.instance);
|
||||
}
|
||||
|
||||
public static void renderMainMenu(TitleScreen gui, GuiGraphics guiGraphics, Font font, int width, int height, int alpha) {
|
||||
public static void renderMainMenu(TitleScreen gui, GuiGraphics graphics, Font font, int width, int height, int alpha) {
|
||||
VersionChecker.Status status = ForgeVersion.getStatus();
|
||||
ForgeSnapshotsModClient.renderMainMenuWarning(status, gui, guiGraphics, font, width, height, alpha);
|
||||
|
||||
if (status == VersionChecker.Status.BETA || status == VersionChecker.Status.BETA_OUTDATED) {
|
||||
// Render a warning at the top of the screen
|
||||
Component line = Component.translatable("forge.update.beta.1", ChatFormatting.RED, ChatFormatting.RESET).withStyle(ChatFormatting.RED);
|
||||
graphics.drawCenteredString(font, line, width / 2, 4 + (0 * (font.lineHeight + 1)), 0xFFFFFF | alpha);
|
||||
line = Component.translatable("forge.update.beta.2");
|
||||
graphics.drawCenteredString(font, line, width / 2, 4 + (1 * (font.lineHeight + 1)), 0xFFFFFF | alpha);
|
||||
}
|
||||
|
||||
forgeStatusLine = switch(status) {
|
||||
// case FAILED -> " Version check failed";
|
||||
|
||||
@@ -64,7 +64,6 @@ import net.minecraftforge.fluids.ForgeFlowingFluid;
|
||||
import net.minecraftforge.fml.*;
|
||||
import net.minecraftforge.fml.config.ModConfig;
|
||||
import net.minecraftforge.fml.event.lifecycle.*;
|
||||
import net.minecraftforge.forge.snapshots.ForgeSnapshotsMod;
|
||||
import net.minecraftforge.registries.*;
|
||||
import net.minecraftforge.registries.holdersets.AndHolderSet;
|
||||
import net.minecraftforge.registries.holdersets.AnyHolderSet;
|
||||
@@ -389,7 +388,6 @@ public class ForgeMod {
|
||||
|
||||
public ForgeMod() {
|
||||
LOGGER.info(FORGEMOD,"Forge mod loading, version {}, for MC {} with MCP {}", ForgeVersion.getVersion(), MCPVersion.getMCVersion(), MCPVersion.getMCPVersion());
|
||||
ForgeSnapshotsMod.logStartupWarning();
|
||||
INSTANCE = this;
|
||||
MinecraftForge.initialize();
|
||||
CrashReportCallables.registerCrashCallable("Crash Report UUID", ()-> {
|
||||
|
||||
@@ -16,23 +16,18 @@ import net.minecraft.server.packs.resources.ResourceManagerReloadListener;
|
||||
import net.minecraftforge.client.ForgeHooksClient;
|
||||
import net.minecraftforge.common.ForgeI18n;
|
||||
import net.minecraftforge.fml.ModList;
|
||||
import net.minecraftforge.forge.snapshots.ForgeSnapshotsMod;
|
||||
import net.minecraftforge.versions.forge.ForgeVersion;
|
||||
import net.minecraftforge.versions.mcp.MCPVersion;
|
||||
|
||||
|
||||
public class BrandingControl
|
||||
{
|
||||
public class BrandingControl {
|
||||
private static List<String> brandings;
|
||||
private static List<String> brandingsNoMC;
|
||||
private static List<String> overCopyrightBrandings;
|
||||
|
||||
private static void computeBranding()
|
||||
{
|
||||
if (brandings == null)
|
||||
{
|
||||
private static void computeBranding() {
|
||||
if (brandings == null) {
|
||||
ImmutableList.Builder<String> brd = ImmutableList.builder();
|
||||
brd.add(ForgeSnapshotsMod.BRANDING_NAME + ' ' + ForgeVersion.getVersion());
|
||||
brd.add("Forge " + ForgeVersion.getVersion());
|
||||
brd.add("Minecraft " + MCPVersion.getMCVersion());
|
||||
brd.add("MCP " + MCPVersion.getMCPVersion());
|
||||
int tModCount = ModList.get().size();
|
||||
@@ -42,14 +37,12 @@ public class BrandingControl
|
||||
}
|
||||
}
|
||||
|
||||
private static List<String> getBrandings(boolean includeMC, boolean reverse)
|
||||
{
|
||||
private static List<String> getBrandings(boolean includeMC, boolean reverse) {
|
||||
computeBranding();
|
||||
if (includeMC) {
|
||||
if (includeMC)
|
||||
return reverse ? Lists.reverse(brandings) : brandings;
|
||||
} else {
|
||||
else
|
||||
return reverse ? Lists.reverse(brandingsNoMC) : brandingsNoMC;
|
||||
}
|
||||
}
|
||||
|
||||
private static void computeOverCopyrightBrandings() {
|
||||
@@ -71,11 +64,11 @@ public class BrandingControl
|
||||
}
|
||||
|
||||
public static String getClientBranding() {
|
||||
return ForgeSnapshotsMod.BRANDING_ID;
|
||||
return "forge";
|
||||
}
|
||||
|
||||
public static String getServerBranding() {
|
||||
return ForgeSnapshotsMod.BRANDING_ID;
|
||||
return "forge";
|
||||
}
|
||||
|
||||
public static ResourceManagerReloadListener resourceManagerReloadListener() {
|
||||
|
||||
@@ -21,25 +21,14 @@ import java.io.File;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
public class CrashReportExtender
|
||||
{
|
||||
|
||||
public static void extendSystemReport(final SystemReport systemReport)
|
||||
{
|
||||
for (final ISystemReportExtender call : CrashReportCallables.allCrashCallables())
|
||||
{
|
||||
public class CrashReportExtender {
|
||||
public static void extendSystemReport(final SystemReport systemReport) {
|
||||
for (final ISystemReportExtender call : CrashReportCallables.allCrashCallables()) {
|
||||
if (call.isActive())
|
||||
{
|
||||
systemReport.setDetail(call.getLabel(), call);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void addCrashReportHeader(StringBuilder stringbuilder, CrashReport crashReport)
|
||||
{
|
||||
net.minecraftforge.forge.snapshots.ForgeSnapshotsMod.addCrashReportHeader(stringbuilder, crashReport);
|
||||
}
|
||||
|
||||
public static String generateEnhancedStackTrace(final Throwable throwable) {
|
||||
return generateEnhancedStackTrace(throwable, true);
|
||||
}
|
||||
@@ -55,7 +44,6 @@ public class CrashReportExtender
|
||||
return header ? s : s.substring(s.indexOf(Strings.LINE_SEPARATOR));
|
||||
}
|
||||
|
||||
|
||||
public static File dumpModLoadingCrashReport(final Logger logger, final LoadingFailedException error, final File topLevelDir) {
|
||||
final CrashReport crashReport = CrashReport.forThrowable(new Exception("Mod Loading has failed"), "Mod loading error has occurred");
|
||||
error.getErrors().forEach(mle -> {
|
||||
|
||||
Reference in new issue
Block a user