More compile cleanups. (#5139)

This commit is contained in:
tterrag authored and LexManos committed 2018-09-14 09:30:56 -07:00
1 parent dbf649225a
commit 3f743887e7
71 files changed
+901 -411

No files matched your search

@@ -20,11 +20,11 @@
package net.minecraftforge.fml.client;
import net.minecraft.client.gui.GuiScreen;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
public interface IDisplayableError
{
@SideOnly(Side.CLIENT)
@OnlyIn(Dist.CLIENT)
GuiScreen createGui();
}
@@ -203,7 +203,7 @@ public class SplashProgress
}
catch(IOException e)
{
FMLLog.log.error("Could not save the splash.properties file", e);
LOGGER.error("Could not save the splash.properties file", e);
}
miscPack = createResourcePack(miscPackFile);
@@ -240,7 +240,7 @@ public class SplashProgress
}
catch (LWJGLException e)
{
FMLLog.log.error("Error starting SplashProgress:", e);
LOGGER.error("Error starting SplashProgress:", e);
disableSplash(e);
}
@@ -537,7 +537,7 @@ public class SplashProgress
}
catch (LWJGLException e)
{
FMLLog.log.error("Error setting GL context:", e);
LOGGER.error("Error setting GL context:", e);
throw new RuntimeException(e);
}
glClearColor((float)((backgroundColor >> 16) & 0xFF) / 0xFF, (float)((backgroundColor >> 8) & 0xFF) / 0xFF, (float)(backgroundColor & 0xFF) / 0xFF, 1);
@@ -564,7 +564,7 @@ public class SplashProgress
}
catch (LWJGLException e)
{
FMLLog.log.error("Error releasing GL context:", e);
LOGGER.error("Error releasing GL context:", e);
throw new RuntimeException(e);
}
finally
@@ -578,7 +578,7 @@ public class SplashProgress
@Override
public void uncaughtException(Thread t, Throwable e)
{
FMLLog.log.error("Splash thread Exception", e);
LOGGER.error("Splash thread Exception", e);
threadError = e;
}
});
@@ -629,7 +629,7 @@ public class SplashProgress
}
catch (LWJGLException e)
{
FMLLog.log.error("Error setting GL context:", e);
LOGGER.error("Error setting GL context:", e);
throw new RuntimeException(e);
}
}
@@ -650,7 +650,7 @@ public class SplashProgress
}
catch (LWJGLException e)
{
FMLLog.log.error("Error releasing GL context:", e);
LOGGER.error("Error releasing GL context:", e);
throw new RuntimeException(e);
}
lock.unlock();
@@ -673,7 +673,7 @@ public class SplashProgress
}
catch (Exception e)
{
FMLLog.log.error("Error finishing SplashProgress:", e);
LOGGER.error("Error finishing SplashProgress:", e);
disableSplash(e);
}
}
@@ -726,7 +726,7 @@ public class SplashProgress
}
catch(IOException e)
{
FMLLog.log.error("Could not save the splash.properties file", e);
LOGGER.error("Could not save the splash.properties file", e);
return false;
}
return true;
@@ -843,7 +843,7 @@ public class SplashProgress
}
catch(IOException e)
{
FMLLog.log.error("Error reading texture from file: {}", location, e);
LOGGER.error("Error reading texture from file: {}", location, e);
throw new RuntimeException(e);
}
finally
@@ -38,10 +38,11 @@ import net.minecraftforge.fml.client.config.GuiConfigEntries.IConfigEntry;
import net.minecraftforge.fml.client.event.ConfigChangedEvent;
import net.minecraftforge.fml.client.event.ConfigChangedEvent.OnConfigChangedEvent;
import net.minecraftforge.fml.client.event.ConfigChangedEvent.PostConfigChangedEvent;
import net.minecraftforge.fml.common.FMLLog;
import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.eventbus.api.Event.Result;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.lwjgl.input.Keyboard;
import javax.annotation.Nullable;
@@ -54,6 +55,8 @@ import javax.annotation.Nullable;
*/
public class GuiConfig extends GuiScreen
{
private static final Logger LOGGER = LogManager.getLogger();
/**
* A reference to the screen object that created this. Used for navigating between screens.
*/
@@ -289,7 +292,7 @@ public class GuiConfig extends GuiScreen
}
catch (Throwable e)
{
FMLLog.log.error("Error performing GuiConfig action:", e);
LOGGER.error("Error performing GuiConfig action:", e);
}
if (flag)
@@ -36,9 +36,11 @@ import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.resources.I18n;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.fml.ModList;
import net.minecraftforge.fml.common.FMLLog;
import net.minecraftforge.fml.loading.moddiscovery.ModInfo;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.lwjgl.input.Keyboard;
/**
@@ -49,6 +51,8 @@ import org.lwjgl.input.Keyboard;
*/
public class GuiConfigEntries extends GuiListExtended
{
private static final Logger LOGGER = LogManager.getLogger();
public final GuiConfig owningScreen;
public final Minecraft mc;
public List<IConfigEntry> listEntries;
@@ -129,7 +133,7 @@ public class GuiConfigEntries extends GuiListExtended
}
catch (Throwable e)
{
FMLLog.log.error("There was a critical error instantiating the custom IConfigEntry for config element {}.", configElement.getName(), e);
LOGGER.error("There was a critical error instantiating the custom IConfigEntry for config element {}.", configElement.getName(), e);
}
else if (configElement.isProperty())
{
@@ -33,7 +33,8 @@ import net.minecraft.util.text.TextFormatting;
import static net.minecraftforge.fml.client.config.GuiUtils.RESET_CHAR;
import static net.minecraftforge.fml.client.config.GuiUtils.UNDO_CHAR;
import net.minecraftforge.fml.common.FMLLog;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.lwjgl.input.Keyboard;
/**
@@ -44,6 +45,8 @@ import org.lwjgl.input.Keyboard;
*/
public class GuiEditArray extends GuiScreen
{
private static final Logger LOGGER = LogManager.getLogger();
protected GuiScreen parentScreen;
protected IConfigElement configElement;
protected GuiEditArrayEntries entryList;
@@ -129,7 +132,7 @@ public class GuiEditArray extends GuiScreen
}
catch (Throwable e)
{
FMLLog.log.error("Error performing GuiEditArray action:", e);
LOGGER.error("Error performing GuiEditArray action:", e);
}
this.mc.displayGuiScreen(this.parentScreen);
}
@@ -29,8 +29,9 @@ import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.resources.I18n;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.fml.client.config.GuiConfigEntries.ArrayEntry;
import net.minecraftforge.fml.common.FMLLog;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.lwjgl.input.Keyboard;
import static net.minecraftforge.fml.client.config.GuiUtils.INVALID;
@@ -42,6 +43,8 @@ import static net.minecraftforge.fml.client.config.GuiUtils.VALID;
*/
public class GuiEditArrayEntries extends GuiListExtended
{
private static final Logger LOGGER = LogManager.getLogger();
protected GuiEditArray owningGui;
public IConfigElement configElement;
public List<IArrayEntry> listEntries;
@@ -80,7 +83,7 @@ public class GuiEditArrayEntries extends GuiListExtended
}
catch (Throwable e)
{
FMLLog.log.error("There was a critical error instantiating the custom IGuiEditListEntry for property {}.", configElement.getName(), e);
LOGGER.error("There was a critical error instantiating the custom IGuiEditListEntry for property {}.", configElement.getName(), e);
}
}
}
@@ -155,7 +158,7 @@ public class GuiEditArrayEntries extends GuiListExtended
}
catch (Throwable e)
{
FMLLog.log.error("There was a critical error instantiating the custom IGuiEditListEntry for property {}.", configElement.getName(), e);
LOGGER.error("There was a critical error instantiating the custom IGuiEditListEntry for property {}.", configElement.getName(), e);
}
}
else if (configElement.isList() && configElement.getType() == ConfigGuiType.BOOLEAN)
@@ -559,7 +562,7 @@ public class GuiEditArrayEntries extends GuiListExtended
}
}
public static class BaseEntry implements IArrayEntry
public static class BaseEntry extends GuiListExtended.IGuiListEntry implements IArrayEntry
{
protected final GuiEditArray owningScreen;
protected final GuiEditArrayEntries owningEntryList;
@@ -592,31 +595,31 @@ public class GuiEditArrayEntries extends GuiListExtended
}
@Override
public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected, float partial)
public void func_194999_a(int entryWidth, int entryHeight, int mouseX, int mouseY, boolean isHovered, float partial)
{
if (this.getValue() != null && this.isValidated)
owningEntryList.getMC().fontRenderer.drawString(
owningEntryList.getMC().fontRenderer.func_211126_b(
isValidValue ? TextFormatting.GREEN + VALID : TextFormatting.RED + INVALID,
listWidth / 4 - owningEntryList.getMC().fontRenderer.getStringWidth(VALID) - 2,
y + slotHeight / 2 - owningEntryList.getMC().fontRenderer.FONT_HEIGHT / 2,
entryWidth / 4 - owningEntryList.getMC().fontRenderer.getStringWidth(VALID) - 2,
entryHeight / 2 - owningEntryList.getMC().fontRenderer.FONT_HEIGHT / 2,
16777215);
int half = listWidth / 2;
int half = entryWidth / 2;
if (owningEntryList.canAddMoreEntries)
{
this.btnAddNewEntryAbove.visible = true;
this.btnAddNewEntryAbove.x = half + ((half / 2) - 44);
this.btnAddNewEntryAbove.y = y;
this.btnAddNewEntryAbove.y = this.func_195001_c();
this.btnAddNewEntryAbove.drawButton(owningEntryList.getMC(), mouseX, mouseY, partial);
}
else
this.btnAddNewEntryAbove.visible = false;
if (!configElement.isListLengthFixed() && slotIndex != owningEntryList.listEntries.size() - 1)
if (!configElement.isListLengthFixed() && this.field_195005_b != owningEntryList.listEntries.size() - 1)
{
this.btnRemoveEntry.visible = true;
this.btnRemoveEntry.x = half + ((half / 2) - 22);
this.btnRemoveEntry.y = y;
this.btnRemoveEntry.y = this.func_195001_c();
this.btnRemoveEntry.drawButton(owningEntryList.getMC(), mouseX, mouseY, partial);
}
else
@@ -689,7 +692,7 @@ public class GuiEditArrayEntries extends GuiListExtended
public void updatePosition(int p_178011_1_, int p_178011_2_, int p_178011_3_, float partial){}
}
public static interface IArrayEntry extends GuiListExtended.IGuiListEntry
public static interface IArrayEntry
{
void keyTyped(char eventChar, int eventKey);
@@ -25,12 +25,14 @@ import java.util.Collections;
import java.util.List;
import java.util.Map;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.resources.I18n;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.fml.common.FMLLog;
import static net.minecraftforge.fml.client.config.GuiUtils.RESET_CHAR;
import static net.minecraftforge.fml.client.config.GuiUtils.UNDO_CHAR;
@@ -42,6 +44,8 @@ import static net.minecraftforge.fml.client.config.GuiUtils.UNDO_CHAR;
*/
public class GuiSelectString extends GuiScreen
{
private static final Logger LOGGER = LogManager.getLogger();
protected GuiScreen parentScreen;
protected IConfigElement configElement;
protected GuiSelectStringEntries entryList;
@@ -129,7 +133,7 @@ public class GuiSelectString extends GuiScreen
}
catch (Throwable e)
{
FMLLog.log.error("Error performing GuiSelectString action:", e);
LOGGER.error("Error performing GuiSelectString action:", e);
}
this.mc.displayGuiScreen(this.parentScreen);
}
@@ -21,7 +21,9 @@ package net.minecraftforge.fml.client.gui;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiErrorScreen;
import net.minecraft.client.gui.GuiScreen;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fml.client.IDisplayableError;
import net.minecraftforge.fml.common.EnhancedRuntimeException;
import net.minecraftforge.fml.common.IFMLHandledException;
import net.minecraftforge.api.distmarker.Dist;
@@ -22,17 +22,21 @@ package net.minecraftforge.fml.client.gui;
import java.io.File;
import java.io.IOException;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.GuiYesNo;
import net.minecraft.client.gui.GuiYesNoCallback;
import net.minecraftforge.fml.client.FMLClientHandler;
import net.minecraftforge.fml.common.FMLLog;
import net.minecraftforge.fml.StartupQuery;
import net.minecraftforge.fml.common.ZipperUtil;
public class GuiOldSaveLoadConfirm extends GuiYesNo implements GuiYesNoCallback {
private static final Logger LOGGER = LogManager.getLogger();
private String dirName;
private String saveName;
private File zip;
@@ -75,7 +79,7 @@ public class GuiOldSaveLoadConfirm extends GuiYesNo implements GuiYesNoCallback
}
else
{
FMLLog.log.info("Capturing current state of world {} into file {}", saveName, zip.getAbsolutePath());
LOGGER.info("Capturing current state of world {} into file {}", saveName, zip.getAbsolutePath());
try
{
String skip = System.getProperty("fml.doNotBackup");
@@ -86,11 +90,11 @@ public class GuiOldSaveLoadConfirm extends GuiYesNo implements GuiYesNoCallback
else
{
for (int x = 0; x < 10; x++)
FMLLog.log.fatal("!!!!!!!!!! UPDATING WORLD WITHOUT DOING BACKUP !!!!!!!!!!!!!!!!");
LOGGER.fatal("!!!!!!!!!! UPDATING WORLD WITHOUT DOING BACKUP !!!!!!!!!!!!!!!!");
}
} catch (IOException e)
{
FMLLog.log.warn("There was a problem saving the backup {}. Please fix and try again", zip.getName(), e);
LOGGER.warn("There was a problem saving the backup {}. Please fix and try again", zip.getName(), e);
FMLClientHandler.instance().showGuiScreen(new GuiBackupFailed(parent, zip));
return;
}
@@ -52,10 +52,10 @@ public class GuiSortingProblem extends GuiScreen {
this.drawCenteredString(this.fontRenderer, "The remainder of the cycle involves these mods", this.width / 2, offset, 0xFFFFFF);
offset+=5;
for (ModContainer mc : failedList.getVisitedNodes())
{
{/* TODO Mod dependencies
offset+=10;
this.drawCenteredString(this.fontRenderer, String.format("%s : before: %s, after: %s", mc.toString(), mc.getDependants(), mc.getDependencies()), this.width / 2, offset, 0xEEEEEE);
}
*/}
offset+=20;
this.drawCenteredString(this.fontRenderer, "The file 'ForgeModLoader-client-0.log' contains more information", this.width / 2, offset, 0xFFFFFF);
}
@@ -44,13 +44,13 @@ public class ClientRegistry
* @param tileEntityClass
* @param id
* @param specialRenderer
*/
* / TODO GameRegistry
public static <T extends TileEntity> void registerTileEntity(Class<T> tileEntityClass, String id, TileEntityRenderer<? super T> specialRenderer)
{
GameRegistry.registerTileEntity(tileEntityClass, id);
bindTileEntitySpecialRenderer(tileEntityClass, specialRenderer);
}
*/
public static <T extends TileEntity> void bindTileEntitySpecialRenderer(Class<T> tileEntityClass, TileEntityRenderer<? super T> specialRenderer)
{
TileEntityRendererDispatcher.instance.renderers.put(tileEntityClass, specialRenderer);