1.16.3 Update

Also included a bunch of warning cleanups.
This commit is contained in:
LexManos committed 2020-09-10 12:01:45 -07:00
1 parent 2353cd982a
commit c75eb9e7cf
73 files changed
+73 -381

No files matched your search

@@ -25,16 +25,13 @@ import net.minecraft.crash.CrashReport;
import net.minecraft.crash.CrashReportCategory;
import net.minecraftforge.fml.common.ICrashCallable;
import net.minecraftforge.fml.loading.moddiscovery.ModFileInfo;
import net.minecraftforge.forgespi.language.IModFileInfo;
import net.minecraftforge.forgespi.language.IModInfo;
import net.minecraftforge.forgespi.locating.IModFile;
import org.apache.logging.log4j.Logger;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.Callable;
import java.util.stream.Collectors;
public class CrashReportExtender
{
@@ -29,7 +29,6 @@ import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;
import net.minecraftforge.fml.event.lifecycle.ParallelDispatchEvent;
import net.minecraftforge.fml.javafmlmod.FMLModContainer;
import org.apache.commons.lang3.time.StopWatch;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -19,12 +19,8 @@
package net.minecraftforge.fml;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.Marker;
import org.apache.logging.log4j.MarkerManager;
import org.apache.logging.log4j.core.config.Configurator;
public class Logging
{
@@ -21,16 +21,12 @@ package net.minecraftforge.fml;
import com.google.common.collect.ImmutableList;
import cpw.mods.modlauncher.TransformingClassLoader;
import net.minecraft.util.registry.Bootstrap;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.common.capabilities.CapabilityManager;
import net.minecraftforge.common.data.ExistingFileHelper;
import net.minecraftforge.eventbus.api.Event;
import net.minecraftforge.fml.config.ConfigTracker;
import net.minecraftforge.fml.config.ModConfig;
import net.minecraftforge.fml.event.lifecycle.GatherDataEvent;
import net.minecraftforge.fml.event.lifecycle.IModBusEvent;
import net.minecraftforge.fml.event.lifecycle.ModLifecycleEvent;
import net.minecraftforge.fml.loading.FMLLoader;
import net.minecraftforge.fml.loading.FMLPaths;
import net.minecraftforge.fml.loading.LoadingModList;
@@ -48,7 +44,6 @@ import net.minecraftforge.versions.forge.ForgeVersion;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.nio.file.Path;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
@@ -56,7 +51,6 @@ import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionException;
import java.util.concurrent.Executor;
@@ -20,9 +20,7 @@
package net.minecraftforge.fml;
import com.google.common.collect.Streams;
import net.minecraft.util.StringUtils;
import net.minecraftforge.fml.loading.EarlyLoadingException;
import net.minecraftforge.fml.loading.moddiscovery.ModInfo;
import net.minecraftforge.forgespi.language.IModInfo;
import java.util.Arrays;
@@ -34,6 +32,7 @@ import java.util.stream.Stream;
*/
public class ModLoadingException extends RuntimeException
{
private static final long serialVersionUID = 2048947398536935507L;
/**
* Mod Info for mod with issue
*/
@@ -21,7 +21,6 @@ package net.minecraftforge.fml;
import com.google.common.io.ByteStreams;
import com.google.gson.Gson;
import net.minecraftforge.common.ForgeConfig;
import net.minecraftforge.fml.loading.FMLConfig;
import net.minecraftforge.fml.loading.moddiscovery.ModInfo;
import net.minecraftforge.forgespi.language.IModInfo;
@@ -45,23 +44,6 @@ import java.util.concurrent.ConcurrentHashMap;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import static net.minecraftforge.fml.VersionChecker.Status.*;
public class VersionChecker
@@ -191,7 +173,6 @@ public class VersionChecker
throw new IOException("Too many redirects while trying to fetch " + url);
}
@SuppressWarnings("UnstableApiUsage")
private void process(IModInfo mod)
{
Status status = PENDING;
@@ -35,7 +35,6 @@ import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.client.entity.player.ClientPlayerEntity;
import net.minecraft.client.gui.AbstractGui;
import net.minecraft.client.gui.screen.MultiplayerScreen;
import net.minecraft.client.gui.screen.WorldSelectionScreen;
import net.minecraft.client.multiplayer.PlayerController;
import net.minecraft.util.text.StringTextComponent;
import net.minecraftforge.client.event.ClientPlayerNetworkEvent;
@@ -52,7 +51,6 @@ import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.Marker;
import org.apache.logging.log4j.MarkerManager;
import com.google.common.base.CharMatcher;
import com.google.common.base.MoreObjects;
import com.google.common.base.Strings;
@@ -185,6 +183,7 @@ public class ClientHooks
return description.endsWith(":NOFML§r") ? description.substring(0, description.length() - 8)+"§r" : description;
}
@SuppressWarnings("resource")
static File getSavesDir()
{
return new File(Minecraft.getInstance().gameDir, "saves");
@@ -23,7 +23,6 @@ import static net.minecraftforge.fml.Logging.CORE;
import static net.minecraftforge.fml.loading.LogMarkers.LOADING;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.Map.Entry;
import java.util.concurrent.CompletableFuture;
@@ -32,8 +31,6 @@ import java.util.concurrent.TimeUnit;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import net.minecraft.crash.CrashReport;
import net.minecraft.crash.CrashReportCategory;
import net.minecraft.resources.IFutureReloadListener;
import net.minecraft.resources.IPackNameDecorator;
import net.minecraft.resources.IReloadableResourceManager;
@@ -42,7 +39,6 @@ import net.minecraft.resources.ResourcePackInfo;
import net.minecraft.resources.ResourcePackList;
import net.minecraft.util.datafix.codec.DatapackCodec;
import net.minecraftforge.fml.*;
import net.minecraftforge.fml.loading.moddiscovery.ModFileInfo;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -45,6 +45,7 @@ public class EarlyLoaderGUI {
this.window = window;
}
@SuppressWarnings("deprecation")
private void setupMatrix() {
RenderSystem.clear(256, Minecraft.IS_RUNNING_ON_MAC);
RenderSystem.matrixMode(5889);
@@ -63,6 +64,7 @@ public class EarlyLoaderGUI {
renderMessages();
}
@SuppressWarnings("deprecation")
void renderTick() {
if (handledElsewhere) return;
int guiScale = window.calcGuiScale(0, false);
@@ -116,6 +118,7 @@ public class EarlyLoaderGUI {
renderMessage(memory, memorycolour, 1, 1.0f);
}
@SuppressWarnings("deprecation")
void renderMessage(final String message, final float[] colour, int line, float alpha) {
GlStateManager.enableClientState(GL11.GL_VERTEX_ARRAY);
ByteBuffer charBuffer = MemoryUtil.memAlloc(message.length() * 270);
@@ -124,9 +127,9 @@ public class EarlyLoaderGUI {
RenderSystem.enableBlend();
RenderSystem.disableTexture();
// STBEasyFont's quads are in reverse order or what OGGL expects, so it gets culled for facing the wrong way.
// STBEasyFont's quads are in reverse order or what OGGL expects, so it gets culled for facing the wrong way.
// So Disable culling https://github.com/MinecraftForge/MinecraftForge/pull/6824
RenderSystem.disableCull();
RenderSystem.disableCull();
GL14.glBlendColor(0,0,0, alpha);
RenderSystem.blendFunc(GlStateManager.SourceFactor.CONSTANT_ALPHA, GlStateManager.DestFactor.ONE_MINUS_CONSTANT_ALPHA);
RenderSystem.color3f(colour[0],colour[1],colour[2]);
@@ -20,28 +20,18 @@
package net.minecraftforge.fml.client.gui;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.AbstractGui;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.IRenderTypeBuffer;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IReorderingProcessor;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.vector.Matrix4f;
import net.minecraft.util.text.ITextProperties;
import net.minecraftforge.client.event.RenderTooltipEvent;
import net.minecraftforge.common.MinecraftForge;
import org.lwjgl.opengl.GL11;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Nonnull;
/**
@@ -157,6 +147,7 @@ public class GuiUtils
* @param rightBorder the size of the box's right border
* @param zLevel the zLevel to draw at
*/
@SuppressWarnings("deprecation")
public static void drawContinuousTexturedBox(int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight,
int topBorder, int bottomBorder, int leftBorder, int rightBorder, float zLevel)
{
@@ -426,6 +417,7 @@ public class GuiUtils
}
*/
@SuppressWarnings("deprecation")
public static void drawGradientRect(Matrix4f mat, int zLevel, int left, int top, int right, int bottom, int startColor, int endColor)
{
float startAlpha = (float)(startColor >> 24 & 255) / 255.0F;
@@ -409,6 +409,7 @@ public class ModListScreen extends Screen
List<String> lines = new ArrayList<>();
VersionChecker.CheckResult vercheck = VersionChecker.getResult(selectedMod);
@SuppressWarnings("resource")
Pair<ResourceLocation, Size2i> logoData = selectedMod.getLogoFile().map(logoFile->
{
TextureManager tm = this.field_230706_i_.getTextureManager();
@@ -22,7 +22,6 @@ package net.minecraftforge.fml.client.gui.widget;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.widget.button.Button;
import net.minecraft.util.text.IFormattableTextComponent;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraftforge.fml.client.gui.GuiUtils;
@@ -88,7 +88,7 @@ public class FMLPlayMessages
SpawnEntity(Entity e)
{
this.entity = e;
this.typeId = Registry.ENTITY_TYPE.getId(e.getType());
this.typeId = Registry.ENTITY_TYPE.getId(e.getType()); //TODO: Codecs
this.entityId = e.getEntityId();
this.uuid = e.getUniqueID();
this.posX = e.getPosX();
@@ -55,13 +55,12 @@ import org.apache.maven.artifact.versioning.ArtifactVersion;
import com.google.common.io.ByteStreams;
import com.google.common.io.Files;
import net.minecraftforge.versions.forge.ForgeVersion;
import net.minecraftforge.fml.loading.FMLEnvironment;
public class LibraryManager
{
private static final Logger LOGGER = LogManager.getLogger();
public static final boolean DISABLE_EXTERNAL_MANIFEST = Boolean.parseBoolean(System.getProperty("forge.disable_external_manifest", "false"));
public static final boolean ENABLE_AUTO_MOD_MOVEMENT = Boolean.parseBoolean(System.getProperty("forge.enable_auto_mod_movement", "false"));
private static final String LIBRARY_DIRECTORY_OVERRIDE = System.getProperty("forge.lib_folder", null);
@@ -447,7 +446,6 @@ public class LibraryManager
{
List<File> list = new ArrayList<>();
@SuppressWarnings("unchecked")
Map<String,String> args = Collections.emptyMap(); // TODO Launch args - do we need this? (Map<String, String>)Launcher.INSTANCE.blackboard().get("launchArgs");
String extraMods = args.get("--mods");
if (extraMods != null)
@@ -40,8 +40,6 @@ import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonSyntaxException;
import net.minecraftforge.versions.forge.ForgeVersion;
public class ModList
{
private static final Logger LOGGER = LogManager.getLogger();
@@ -19,17 +19,12 @@
package net.minecraftforge.fml.server;
import net.minecraft.crash.CrashReport;
import net.minecraft.crash.CrashReportCategory;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.*;
import net.minecraftforge.fml.loading.moddiscovery.ModFileInfo;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.concurrent.CompletableFuture;