Clean up a bunch of compiler warnings.

This commit is contained in:
Christian 2014-07-29 14:11:41 -02:30
parent 5643237fb9
commit 0de92f4db7
14 changed files with 160 additions and 116 deletions

View File

@ -30,7 +30,8 @@ public class FMLConfigGuiFactory implements IModGuiFactory
super(parent, getConfigElements(), "FML", false, false, I18n.format("fml.config.sample.title"));
}
private static List<IConfigElement> getConfigElements()
@SuppressWarnings({ "rawtypes", "unchecked" })
private static List<IConfigElement> getConfigElements()
{
List<IConfigElement> list = new ArrayList<IConfigElement>();
List<IConfigElement> listsList = new ArrayList<IConfigElement>();
@ -86,11 +87,9 @@ public class FMLConfigGuiFactory implements IModGuiFactory
}
}
private Minecraft minecraft;
@Override
public void initialize(Minecraft minecraftInstance)
{
this.minecraft = minecraftInstance;
}
@Override

View File

@ -49,8 +49,10 @@ public class DummyConfigElement<T> implements IConfigElement<T>
protected boolean requiresMcRestart = false;
protected boolean isListFixedLength = false;
protected int maxListLength = -1;
protected List<IConfigElement> childElements;
protected Class<? extends IConfigEntry> configEntryClass;
@SuppressWarnings("rawtypes")
protected List<IConfigElement> childElements;
@SuppressWarnings("rawtypes")
protected Class<? extends IConfigEntry> configEntryClass;
protected Class<? extends IArrayEntry> arrayEntryClass;
/**
@ -59,17 +61,20 @@ public class DummyConfigElement<T> implements IConfigElement<T>
*/
public static class DummyCategoryElement<T> extends DummyConfigElement<T>
{
public DummyCategoryElement(String name, String langKey, List<IConfigElement> childElements)
@SuppressWarnings("rawtypes")
public DummyCategoryElement(String name, String langKey, List<IConfigElement> childElements)
{
this(name, langKey, childElements, (Class) null);
this(name, langKey, childElements, (Class<? extends IConfigEntry>) null);
}
public DummyCategoryElement(String name, String langKey, Class<? extends IConfigEntry> customListEntryClass)
@SuppressWarnings("rawtypes")
public DummyCategoryElement(String name, String langKey, Class<? extends IConfigEntry> customListEntryClass)
{
this(name, langKey, new ArrayList<IConfigElement>(), customListEntryClass);
}
public DummyCategoryElement(String name, String langKey, List<IConfigElement> childElements, Class<? extends IConfigEntry> customListEntryClass)
@SuppressWarnings("rawtypes")
public DummyCategoryElement(String name, String langKey, List<IConfigElement> childElements, Class<? extends IConfigEntry> customListEntryClass)
{
super(name, (T) null, ConfigGuiType.CONFIG_CATEGORY, langKey);
this.childElements = childElements;
@ -144,7 +149,8 @@ public class DummyConfigElement<T> implements IConfigElement<T>
this(name, defaultValues, type, langKey, false, maxListLength, validStringPattern, (T) null, (T) null);
}
public DummyListElement setCustomEditListEntryClass(Class<? extends IArrayEntry> clazz)
@SuppressWarnings("rawtypes")
public DummyListElement setCustomEditListEntryClass(Class<? extends IArrayEntry> clazz)
{
this.arrayEntryClass = clazz;
return this;
@ -157,7 +163,8 @@ public class DummyConfigElement<T> implements IConfigElement<T>
}
}
public DummyConfigElement(String name, T defaultValue, ConfigGuiType type, String langKey, String[] validValues, Pattern validStringPattern, T minValue, T maxValue)
@SuppressWarnings("unchecked")
public DummyConfigElement(String name, T defaultValue, ConfigGuiType type, String langKey, String[] validValues, Pattern validStringPattern, T minValue, T maxValue)
{
this.name = name;
this.defaultValue = defaultValue;
@ -206,7 +213,8 @@ public class DummyConfigElement<T> implements IConfigElement<T>
this(name, defaultValue, type, langKey, (String[]) null, (Pattern) null, minValue, maxValue);
}
public DummyConfigElement setCustomListEntryClass(Class<? extends IConfigEntry> clazz)
@SuppressWarnings("rawtypes")
public DummyConfigElement setCustomListEntryClass(Class<? extends IConfigEntry> clazz)
{
this.configEntryClass = clazz;
return this;
@ -218,19 +226,22 @@ public class DummyConfigElement<T> implements IConfigElement<T>
return isProperty;
}
public IConfigElement setConfigEntryClass(Class<? extends IConfigEntry> clazz)
@SuppressWarnings("rawtypes")
public IConfigElement setConfigEntryClass(Class<? extends IConfigEntry> clazz)
{
this.configEntryClass = clazz;
return this;
}
@Override
@SuppressWarnings("rawtypes")
@Override
public Class<? extends IConfigEntry> getConfigEntryClass()
{
return configEntryClass;
}
public IConfigElement setArrayEntryClass(Class<? extends IArrayEntry> clazz)
@SuppressWarnings("rawtypes")
public IConfigElement setArrayEntryClass(Class<? extends IArrayEntry> clazz)
{
this.arrayEntryClass = clazz;
return this;
@ -266,7 +277,8 @@ public class DummyConfigElement<T> implements IConfigElement<T>
return I18n.format(langKey + ".tooltip");
}
@Override
@SuppressWarnings("rawtypes")
@Override
public List<IConfigElement> getChildElements()
{
return childElements;

View File

@ -15,8 +15,6 @@ package cpw.mods.fml.client.config;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import org.lwjgl.opengl.GL11;
/**
* This class provides a button that fixes several bugs present in the vanilla GuiButton drawing code.
* The gist of it is that it allows buttons of any size without gaps in the graphics and with the

View File

@ -12,25 +12,20 @@
package cpw.mods.fml.client.config;
import java.lang.reflect.Method;
import static cpw.mods.fml.client.config.GuiUtils.RESET_CHAR;
import static cpw.mods.fml.client.config.GuiUtils.UNDO_CHAR;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiMainMenu;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.GuiYesNo;
import net.minecraft.client.multiplayer.WorldClient;
import net.minecraft.client.resources.I18n;
import net.minecraft.util.ChatComponentText;
import org.lwjgl.input.Keyboard;
import static cpw.mods.fml.client.config.GuiUtils.RESET_CHAR;
import static cpw.mods.fml.client.config.GuiUtils.UNDO_CHAR;
import cpw.mods.fml.client.config.GuiConfigEntries.IConfigEntry;
import cpw.mods.fml.client.event.ConfigChangedEvent;
import cpw.mods.fml.client.event.ConfigChangedEvent.OnConfigChangedEvent;
@ -53,8 +48,10 @@ public class GuiConfig extends GuiScreen
public final GuiScreen parentScreen;
public String title = "Config GUI";
public String titleLine2;
public final List<IConfigElement> configElements;
public final List<IConfigEntry> initEntries;
@SuppressWarnings("rawtypes")
public final List<IConfigElement> configElements;
@SuppressWarnings("rawtypes")
public final List<IConfigEntry> initEntries;
public GuiConfigEntries entryList;
private GuiButtonExt btnDefaultAll;
private GuiButtonExt btnUndoAll;
@ -90,7 +87,8 @@ public class GuiConfig extends GuiScreen
* @param title the desired title for this screen. For consistency it is recommended that you pass the path of the config file being
* edited.
*/
public GuiConfig(GuiScreen parentScreen, List<IConfigElement> configElements, String modID, String configID,
@SuppressWarnings("rawtypes")
public GuiConfig(GuiScreen parentScreen, List<IConfigElement> configElements, String modID, String configID,
boolean allRequireWorldRestart, boolean allRequireMcRestart, String title)
{
this(parentScreen, configElements, modID, configID, allRequireWorldRestart, allRequireMcRestart, title, null);
@ -108,7 +106,8 @@ public class GuiConfig extends GuiScreen
* @param title the desired title for this screen. For consistency it is recommended that you pass the path of the config file being
* edited.
*/
public GuiConfig(GuiScreen parentScreen, List<IConfigElement> configElements, String modID,
@SuppressWarnings("rawtypes")
public GuiConfig(GuiScreen parentScreen, List<IConfigElement> configElements, String modID,
boolean allRequireWorldRestart, boolean allRequireMcRestart, String title)
{
this(parentScreen, configElements, modID, null, allRequireWorldRestart, allRequireMcRestart, title, null);
@ -128,7 +127,8 @@ public class GuiConfig extends GuiScreen
* @param titleLine2 the desired title second line for this screen. Typically this is used to send the category name of the category
* currently being edited.
*/
public GuiConfig(GuiScreen parentScreen, List<IConfigElement> configElements, String modID,
@SuppressWarnings("rawtypes")
public GuiConfig(GuiScreen parentScreen, List<IConfigElement> configElements, String modID,
boolean allRequireWorldRestart, boolean allRequireMcRestart, String title, String titleLine2)
{
this(parentScreen, configElements, modID, null, allRequireWorldRestart, allRequireMcRestart, title, titleLine2);
@ -151,7 +151,8 @@ public class GuiConfig extends GuiScreen
* @param titleLine2 the desired title second line for this screen. Typically this is used to send the category name of the category
* currently being edited.
*/
public GuiConfig(GuiScreen parentScreen, List<IConfigElement> configElements, String modID, String configID,
@SuppressWarnings("rawtypes")
public GuiConfig(GuiScreen parentScreen, List<IConfigElement> configElements, String modID, String configID,
boolean allRequireWorldRestart, boolean allRequireMcRestart, String title, String titleLine2)
{
this.mc = Minecraft.getMinecraft();
@ -180,7 +181,8 @@ public class GuiConfig extends GuiScreen
return path.replace("\\", "/").replace(mc.mcDataDir.getAbsolutePath().replace("\\", "/"), "/.minecraft");
}
@Override
@SuppressWarnings("unchecked")
@Override
public void initGui()
{
Keyboard.enableRepeatEvents(true);
@ -342,7 +344,8 @@ public class GuiConfig extends GuiScreen
this.drawToolTip(this.mc.fontRenderer.listFormattedStringToWidth(I18n.format("fml.configgui.tooltip.applyGlobally"), 300), mouseX, mouseY);
}
public void drawToolTip(List stringList, int x, int y)
@SuppressWarnings("rawtypes")
public void drawToolTip(List stringList, int x, int y)
{
this.func_146283_a(stringList, x, y);
}

View File

@ -11,6 +11,9 @@
*/
package cpw.mods.fml.client.config;
import static cpw.mods.fml.client.config.GuiUtils.RESET_CHAR;
import static cpw.mods.fml.client.config.GuiUtils.UNDO_CHAR;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@ -18,10 +21,8 @@ import java.util.Map;
import java.util.TreeMap;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiListExtended;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.GuiSlot;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.resources.I18n;
@ -29,9 +30,6 @@ import net.minecraft.util.EnumChatFormatting;
import org.lwjgl.input.Keyboard;
import static cpw.mods.fml.client.config.GuiUtils.RESET_CHAR;
import static cpw.mods.fml.client.config.GuiUtils.UNDO_CHAR;
import cpw.mods.fml.common.FMLLog;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.ModContainer;
@ -46,7 +44,8 @@ public class GuiConfigEntries extends GuiListExtended
{
public final GuiConfig owningScreen;
public final Minecraft mc;
public List<IConfigEntry> listEntries;
@SuppressWarnings("rawtypes")
public List<IConfigEntry> listEntries;
/**
* The max width of the label of all IConfigEntry objects.
*/
@ -76,15 +75,16 @@ public class GuiConfigEntries extends GuiListExtended
*/
public int scrollBarX;
public GuiConfigEntries(GuiConfig parent, Minecraft mc)
@SuppressWarnings({ "rawtypes", "unchecked" })
public GuiConfigEntries(GuiConfig parent, Minecraft mc)
{
super(mc, parent.width, parent.height, parent.titleLine2 != null ? 33 : 23, parent.height - 32, 20);
this.owningScreen = parent;
this.setShowSelectionBox(false);
this.mc = mc;
this.listEntries = new ArrayList<IConfigEntry>();
int i = 0;
String s = null;
// int i = 0;
// String s = null;
for (IConfigElement configElement : parent.configElements)
{
@ -168,7 +168,8 @@ public class GuiConfigEntries extends GuiListExtended
}
}
protected void initGui()
@SuppressWarnings("rawtypes")
protected void initGui()
{
this.width = owningScreen.width;
this.height = owningScreen.height;
@ -205,7 +206,8 @@ public class GuiConfigEntries extends GuiListExtended
/**
* Gets the IGuiListEntry object for the given index
*/
@Override
@SuppressWarnings("rawtypes")
@Override
public IConfigEntry getListEntry(int index)
{
return this.listEntries.get(index);
@ -229,7 +231,8 @@ public class GuiConfigEntries extends GuiListExtended
/**
* This method is a pass-through for IConfigEntry objects that require keystrokes. Called from the parent GuiConfig screen.
*/
public void keyTyped(char eventChar, int eventKey)
@SuppressWarnings("rawtypes")
public void keyTyped(char eventChar, int eventKey)
{
for (IConfigEntry entry : this.listEntries)
entry.keyTyped(eventChar, eventKey);
@ -239,7 +242,8 @@ public class GuiConfigEntries extends GuiListExtended
* This method is a pass-through for IConfigEntry objects that contain GuiTextField elements. Called from the parent GuiConfig
* screen.
*/
public void updateScreen()
@SuppressWarnings("rawtypes")
public void updateScreen()
{
for (IConfigEntry entry : this.listEntries)
entry.updateCursorCounter();
@ -249,7 +253,8 @@ public class GuiConfigEntries extends GuiListExtended
* This method is a pass-through for IConfigEntry objects that contain GuiTextField elements. Called from the parent GuiConfig
* screen.
*/
public void mouseClicked(int mouseX, int mouseY, int mouseEvent)
@SuppressWarnings("rawtypes")
public void mouseClicked(int mouseX, int mouseY, int mouseEvent)
{
for (IConfigEntry entry : this.listEntries)
entry.mouseClicked(mouseX, mouseY, mouseEvent);
@ -258,7 +263,8 @@ public class GuiConfigEntries extends GuiListExtended
/**
* This method is a pass-through for IConfigListEntry objects that need to perform actions when the containing GUI is closed.
*/
public void onGuiClosed()
@SuppressWarnings("rawtypes")
public void onGuiClosed()
{
for (IConfigEntry entry : this.listEntries)
entry.onGuiClosed();
@ -268,7 +274,8 @@ public class GuiConfigEntries extends GuiListExtended
* Saves all properties on this screen / child screens. This method returns true if any elements were changed that require
* a restart for proper handling.
*/
public boolean saveConfigElements()
@SuppressWarnings("rawtypes")
public boolean saveConfigElements()
{
boolean requiresRestart = false;
for (IConfigEntry entry : this.listEntries)
@ -282,7 +289,8 @@ public class GuiConfigEntries extends GuiListExtended
* Returns true if all IConfigEntry objects on this screen are set to default. If includeChildren is true sub-category
* objects are checked as well.
*/
public boolean areAllEntriesDefault(boolean includeChildren)
@SuppressWarnings("rawtypes")
public boolean areAllEntriesDefault(boolean includeChildren)
{
for (IConfigEntry entry : this.listEntries)
if ((includeChildren || !(entry instanceof CategoryEntry)) && !entry.isDefault())
@ -295,7 +303,8 @@ public class GuiConfigEntries extends GuiListExtended
* Sets all IConfigEntry objects on this screen to default. If includeChildren is true sub-category objects are set as
* well.
*/
public void setAllToDefault(boolean includeChildren)
@SuppressWarnings("rawtypes")
public void setAllToDefault(boolean includeChildren)
{
for (IConfigEntry entry : this.listEntries)
if ((includeChildren || !(entry instanceof CategoryEntry)))
@ -306,7 +315,8 @@ public class GuiConfigEntries extends GuiListExtended
* Returns true if any IConfigEntry objects on this screen are changed. If includeChildren is true sub-category objects
* are checked as well.
*/
public boolean hasChangedEntry(boolean includeChildren)
@SuppressWarnings("rawtypes")
public boolean hasChangedEntry(boolean includeChildren)
{
for (IConfigEntry entry : this.listEntries)
if ((includeChildren || !(entry instanceof CategoryEntry)) && entry.isChanged())
@ -319,7 +329,8 @@ public class GuiConfigEntries extends GuiListExtended
* Returns true if any IConfigEntry objects on this screen are enabled. If includeChildren is true sub-category objects
* are checked as well.
*/
public boolean areAnyEntriesEnabled(boolean includeChildren)
@SuppressWarnings("rawtypes")
public boolean areAnyEntriesEnabled(boolean includeChildren)
{
for (IConfigEntry entry : this.listEntries)
if ((includeChildren || !(entry instanceof CategoryEntry)) && entry.enabled())
@ -332,7 +343,8 @@ public class GuiConfigEntries extends GuiListExtended
* Reverts changes to all IConfigEntry objects on this screen. If includeChildren is true sub-category objects are
* reverted as well.
*/
public void undoAllChanges(boolean includeChildren)
@SuppressWarnings("rawtypes")
public void undoAllChanges(boolean includeChildren)
{
for (IConfigEntry entry : this.listEntries)
if ((includeChildren || !(entry instanceof CategoryEntry)))
@ -343,7 +355,8 @@ public class GuiConfigEntries extends GuiListExtended
* Calls the drawToolTip() method for all IConfigEntry objects on this screen. This is called from the parent GuiConfig screen
* after drawing all other elements.
*/
public void drawScreenPost(int mouseX, int mouseY, float partialTicks)
@SuppressWarnings("rawtypes")
public void drawScreenPost(int mouseX, int mouseY, float partialTicks)
{
for (IConfigEntry entry : this.listEntries)
entry.drawToolTip(mouseX, mouseY);
@ -414,7 +427,8 @@ public class GuiConfigEntries extends GuiListExtended
}
}
@Override
@SuppressWarnings("unchecked")
@Override
public boolean saveConfigElement()
{
if (enabled() && isChanged())
@ -521,7 +535,8 @@ public class GuiConfigEntries extends GuiListExtended
}
}
@Override
@SuppressWarnings("unchecked")
@Override
public boolean saveConfigElement()
{
if (enabled() && isChanged())
@ -654,7 +669,8 @@ public class GuiConfigEntries extends GuiListExtended
}
}
@Override
@SuppressWarnings("unchecked")
@Override
public boolean saveConfigElement()
{
if (enabled() && isChanged())
@ -689,7 +705,8 @@ public class GuiConfigEntries extends GuiListExtended
protected final Object[] beforeValues;
protected Object[] currentValues;
public ArrayEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement)
@SuppressWarnings("rawtypes")
public ArrayEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement)
{
super(owningScreen, owningEntryList, configElement);
beforeValues = configElement.getList();
@ -754,7 +771,8 @@ public class GuiConfigEntries extends GuiListExtended
}
}
@Override
@SuppressWarnings("unchecked")
@Override
public boolean saveConfigElement()
{
if (enabled() && isChanged())
@ -846,7 +864,8 @@ public class GuiConfigEntries extends GuiListExtended
}
}
@Override
@SuppressWarnings("unchecked")
@Override
public boolean saveConfigElement()
{
if (this.enabled() && this.isChanged())
@ -967,7 +986,8 @@ public class GuiConfigEntries extends GuiListExtended
{
protected final int beforeValue;
public IntegerEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement)
@SuppressWarnings("rawtypes")
public IntegerEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement)
{
super(owningScreen, owningEntryList, configElement);
this.beforeValue = Integer.valueOf(configElement.get().toString());
@ -1026,7 +1046,8 @@ public class GuiConfigEntries extends GuiListExtended
this.textFieldValue.setText(String.valueOf(beforeValue));
}
@Override
@SuppressWarnings("unchecked")
@Override
public boolean saveConfigElement()
{
if (enabled())
@ -1072,7 +1093,8 @@ public class GuiConfigEntries extends GuiListExtended
{
protected final double beforeValue;
public DoubleEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement)
@SuppressWarnings("rawtypes")
public DoubleEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement)
{
super(owningScreen, owningEntryList, configElement);
this.beforeValue = Double.valueOf(configElement.get().toString());
@ -1132,7 +1154,8 @@ public class GuiConfigEntries extends GuiListExtended
this.textFieldValue.setText(String.valueOf(beforeValue));
}
@Override
@SuppressWarnings("unchecked")
@Override
public boolean saveConfigElement()
{
if (enabled())
@ -1257,7 +1280,8 @@ public class GuiConfigEntries extends GuiListExtended
this.textFieldValue.setText(beforeValue);
}
@Override
@SuppressWarnings("unchecked")
@Override
public boolean saveConfigElement()
{
if (enabled())
@ -1300,7 +1324,8 @@ public class GuiConfigEntries extends GuiListExtended
protected GuiScreen childScreen;
protected final GuiButtonExt btnSelectCategory;
public CategoryEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement)
@SuppressWarnings("rawtypes")
public CategoryEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement)
{
super(owningScreen, owningEntryList, configElement);
@ -1315,7 +1340,8 @@ public class GuiConfigEntries extends GuiListExtended
/**
* This method is called in the constructor and is used to set the childScreen field.
*/
protected GuiScreen buildChildScreen()
@SuppressWarnings("unchecked")
protected GuiScreen buildChildScreen()
{
return new GuiConfig(this.owningScreen, this.configElement.getChildElements(), this.owningScreen.modID,
owningScreen.allRequireWorldRestart || this.configElement.requiresWorldRestart(),
@ -1460,25 +1486,27 @@ public class GuiConfigEntries extends GuiListExtended
*
* Provides a base entry for others to extend. Handles drawing the prop label (if drawLabel == true) and the Undo/Default buttons.
*/
public static abstract class ListEntryBase implements IConfigEntry
@SuppressWarnings("rawtypes")
public static abstract class ListEntryBase implements IConfigEntry
{
protected final GuiConfig owningScreen;
protected final GuiConfigEntries owningEntryList;
protected final IConfigElement configElement;
protected final IConfigElement configElement;
protected final Minecraft mc;
protected final String name;
protected final GuiButtonExt btnUndoChanges;
protected final GuiButtonExt btnDefault;
protected List toolTip;
protected List undoToolTip;
protected List defaultToolTip;
protected List toolTip;
protected List undoToolTip;
protected List defaultToolTip;
protected boolean isValidValue = true;
protected HoverChecker tooltipHoverChecker;
protected HoverChecker undoHoverChecker;
protected HoverChecker defaultHoverChecker;
protected boolean drawLabel;
public ListEntryBase(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement)
@SuppressWarnings({ "unchecked" })
public ListEntryBase(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement)
{
this.owningScreen = owningScreen;
this.owningEntryList = owningEntryList;
@ -1673,7 +1701,8 @@ public class GuiConfigEntries extends GuiListExtended
* Gets the IConfigElement object owned by this entry.
* @return
*/
public IConfigElement getConfigElement();
@SuppressWarnings("rawtypes")
public IConfigElement getConfigElement();
/**
* Gets the name of the ConfigElement owned by this entry.

View File

@ -36,7 +36,8 @@ import org.lwjgl.input.Keyboard;
public class GuiEditArray extends GuiScreen
{
protected GuiScreen parentScreen;
protected IConfigElement configElement;
@SuppressWarnings("rawtypes")
protected IConfigElement configElement;
private GuiEditArrayEntries entryList;
private GuiButtonExt btnUndoChanges, btnDefault, btnDone;
private String title;
@ -46,10 +47,12 @@ public class GuiEditArray extends GuiScreen
private final Object[] beforeValues;
private Object[] currentValues;
private HoverChecker tooltipHoverChecker;
private List toolTip;
@SuppressWarnings("rawtypes")
private List toolTip;
protected boolean enabled;
public GuiEditArray(GuiScreen parentScreen, IConfigElement configElement, int slotIndex, Object[] currentValues, boolean enabled)
@SuppressWarnings("rawtypes")
public GuiEditArray(GuiScreen parentScreen, IConfigElement configElement, int slotIndex, Object[] currentValues, boolean enabled)
{
this.mc = Minecraft.getMinecraft();
this.parentScreen = parentScreen;
@ -94,7 +97,8 @@ public class GuiEditArray extends GuiScreen
}
}
@Override
@SuppressWarnings("unchecked")
@Override
public void initGui()
{
this.entryList = new GuiEditArrayEntries(this, this.mc, this.configElement, this.beforeValues, this.currentValues);
@ -197,7 +201,8 @@ public class GuiEditArray extends GuiScreen
drawToolTip(this.toolTip, par1, par2);
}
public void drawToolTip(List stringList, int x, int y)
@SuppressWarnings("rawtypes")
public void drawToolTip(List stringList, int x, int y)
{
this.func_146283_a(stringList, x, y);
}

View File

@ -37,11 +37,12 @@ import cpw.mods.fml.common.FMLLog;
*
* @author bspkrs
*/
@SuppressWarnings("rawtypes")
public class GuiEditArrayEntries extends GuiListExtended
{
private GuiEditArray owningGui;
public Minecraft mc;
public IConfigElement configElement;
public IConfigElement configElement;
public List<IArrayEntry> listEntries;
public boolean isDefault;
public boolean isChanged;
@ -50,7 +51,8 @@ public class GuiEditArrayEntries extends GuiListExtended
public final Object[] beforeValues;
public Object[] currentValues;
public GuiEditArrayEntries(GuiEditArray parent, Minecraft mc, IConfigElement configElement, Object[] beforeValues, Object[] currentValues)
@SuppressWarnings("unchecked")
public GuiEditArrayEntries(GuiEditArray parent, Minecraft mc, IConfigElement configElement, Object[] beforeValues, Object[] currentValues)
{
super(mc, parent.width, parent.height, parent.titleLine2 != null ? (parent.titleLine3 != null ? 43 : 33) : 23, parent.height - 32, 20);
this.owningGui = parent;
@ -219,7 +221,8 @@ public class GuiEditArrayEntries extends GuiListExtended
return true;
}
protected void saveListChanges()
@SuppressWarnings("unchecked")
protected void saveListChanges()
{
int listLength = configElement.isListLengthFixed() ? listEntries.size() : listEntries.size() - 1;
@ -540,7 +543,8 @@ public class GuiEditArrayEntries extends GuiListExtended
protected boolean isValidValue = true;
protected boolean isValidated = false;
public BaseEntry(GuiEditArray owningScreen, GuiEditArrayEntries owningEntryList, IConfigElement configElement)
@SuppressWarnings({ "unchecked" })
public BaseEntry(GuiEditArray owningScreen, GuiEditArrayEntries owningEntryList, IConfigElement configElement)
{
this.owningScreen = owningScreen;
this.owningEntryList = owningEntryList;

View File

@ -33,7 +33,8 @@ import static cpw.mods.fml.client.config.GuiUtils.UNDO_CHAR;
public class GuiSelectString extends GuiScreen
{
protected GuiScreen parentScreen;
protected IConfigElement configElement;
@SuppressWarnings("rawtypes")
protected IConfigElement configElement;
private GuiSelectStringEntries entriesList;
private GuiButtonExt btnUndoChanges, btnDefault, btnDone;
private String title;
@ -44,10 +45,12 @@ public class GuiSelectString extends GuiScreen
public final Object beforeValue;
public Object currentValue;
private HoverChecker tooltipHoverChecker;
private List toolTip;
@SuppressWarnings("rawtypes")
private List toolTip;
protected boolean enabled;
public GuiSelectString(GuiScreen parentScreen, IConfigElement configElement, int slotIndex, Map<Object, String> selectableValues, Object currentValue, boolean enabled)
@SuppressWarnings("rawtypes")
public GuiSelectString(GuiScreen parentScreen, IConfigElement configElement, int slotIndex, Map<Object, String> selectableValues, Object currentValue, boolean enabled)
{
this.mc = Minecraft.getMinecraft();
this.parentScreen = parentScreen;
@ -89,7 +92,8 @@ public class GuiSelectString extends GuiScreen
}
}
@Override
@SuppressWarnings("unchecked")
@Override
public void initGui()
{
this.entriesList = new GuiSelectStringEntries(this, this.mc, this.configElement, this.selectableValues);
@ -165,7 +169,8 @@ public class GuiSelectString extends GuiScreen
drawToolTip(this.toolTip, par1, par2);
}
public void drawToolTip(List stringList, int x, int y)
@SuppressWarnings("rawtypes")
public void drawToolTip(List stringList, int x, int y)
{
this.func_146283_a(stringList, x, y);
}

View File

@ -34,13 +34,15 @@ public class GuiSelectStringEntries extends GuiListExtended
{
public GuiSelectString owningScreen;
public Minecraft mc;
public IConfigElement configElement;
@SuppressWarnings("rawtypes")
public IConfigElement configElement;
public List<IGuiSelectStringListEntry> listEntries;
public final Map<Object, String> selectableValues;
public int selectedIndex = -1;
public int maxEntryWidth = 0;
public GuiSelectStringEntries(GuiSelectString owningScreen, Minecraft mc, IConfigElement configElement, Map<Object, String> selectableValues)
@SuppressWarnings("rawtypes")
public GuiSelectStringEntries(GuiSelectString owningScreen, Minecraft mc, IConfigElement configElement, Map<Object, String> selectableValues)
{
super(mc, owningScreen.width, owningScreen.height, owningScreen.titleLine2 != null ? (owningScreen.titleLine3 != null ? 43 : 33) : 23,
owningScreen.height - 32, 11);
@ -141,7 +143,8 @@ public class GuiSelectStringEntries extends GuiListExtended
return owningScreen.currentValue != null ? owningScreen.currentValue.equals(configElement.getDefault()) : configElement.getDefault() == null;
}
public void saveChanges()
@SuppressWarnings("unchecked")
public void saveChanges()
{
if (owningScreen.slotIndex != -1 && owningScreen.parentScreen != null
&& owningScreen.parentScreen instanceof GuiConfig

View File

@ -1,7 +1,6 @@
package cpw.mods.fml.client.config;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import org.lwjgl.opengl.GL11;

View File

@ -34,7 +34,8 @@ public interface IConfigElement<T>
* This method returns a class that implements {@code IConfigEntry} or null. This class MUST
* provide a constructor with the following parameter types: {@code GuiConfig}, {@code GuiConfigEntries}, {@code IConfigElement}
*/
public Class<? extends IConfigEntry> getConfigEntryClass();
@SuppressWarnings("rawtypes")
public Class<? extends IConfigEntry> getConfigEntryClass();
/**
* This method returns a class that implements {@code IArrayEntry}. This class MUST provide a constructor with the
@ -67,7 +68,8 @@ public interface IConfigElement<T>
/**
* [Category] Gets this category's child categories/properties.
*/
public List<IConfigElement> getChildElements();
@SuppressWarnings("rawtypes")
public List<IConfigElement> getChildElements();
/**
* [Property, Category] Gets the ConfigGuiType value corresponding to the type of this property object, or CONFIG_CATEGORY if this is a

View File

@ -27,14 +27,10 @@ import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.jar.Manifest;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import java.util.zip.ZipOutputStream;
@ -55,7 +51,6 @@ import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.google.common.collect.Multimap;
import com.google.common.io.ByteSource;
import com.google.common.io.CharSource;
import com.google.common.io.LineProcessor;
import com.google.common.io.Resources;

View File

@ -15,7 +15,8 @@ import cpw.mods.fml.relauncher.FMLRelaunchLog;
public class ModAccessTransformer extends AccessTransformer {
private static Map<String, String> embedded = Maps.newHashMap(); //Needs to be primitive so that both classloaders get the same class.
public ModAccessTransformer() throws Exception
@SuppressWarnings("unchecked")
public ModAccessTransformer() throws Exception
{
super(ModAccessTransformer.class);
//We are in the new ClassLoader here, so we need to get the static field from the other ClassLoader.

View File

@ -1,26 +1,15 @@
package cpw.mods.fml.common.launcher;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.Proxy;
import java.net.URL;
import java.util.List;
import java.util.Map;
import org.apache.commons.io.IOUtils;
import org.apache.logging.log4j.LogManager;
import com.google.common.base.Charsets;
import com.google.common.base.Throwables;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mojang.authlib.Agent;
import com.mojang.authlib.exceptions.*;
import com.mojang.authlib.yggdrasil.*;
import com.mojang.authlib.exceptions.AuthenticationException;
import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService;
import com.mojang.authlib.yggdrasil.YggdrasilUserAuthentication;
/**
* Basic implementation of Mojang's 'Yggdrasil' login system, purely intended as a dev time bare bones login.