diff --git a/fml/patches/minecraft/net/minecraft/block/Block.java.patch b/fml/patches/minecraft/net/minecraft/block/Block.java.patch index 7e49ded730..5bc6e21155 100644 --- a/fml/patches/minecraft/net/minecraft/block/Block.java.patch +++ b/fml/patches/minecraft/net/minecraft/block/Block.java.patch @@ -16,3 +16,12 @@ private CreativeTabs field_149772_a; protected String field_149768_d; public static final Block.SoundType field_149769_e = new Block.SoundType("stone", 1.0F, 1.0F); +@@ -102,6 +103,8 @@ + protected IIcon field_149761_L; + private static final String __OBFID = "CL_00000199"; + ++ public final cpw.mods.fml.common.registry.RegistryDelegate delegate = ++ ((cpw.mods.fml.common.registry.FMLControlledNamespacedRegistry)field_149771_c).getDelegate(this, Block.class); + public static int func_149682_b(Block p_149682_0_) + { + return field_149771_c.func_148757_b(p_149682_0_); diff --git a/fml/patches/minecraft/net/minecraft/client/Minecraft.java.patch b/fml/patches/minecraft/net/minecraft/client/Minecraft.java.patch index 9e8b82a35a..3abab08e6b 100644 --- a/fml/patches/minecraft/net/minecraft/client/Minecraft.java.patch +++ b/fml/patches/minecraft/net/minecraft/client/Minecraft.java.patch @@ -78,7 +78,7 @@ try { Display.setVSyncEnabled(this.field_71474_y.field_74352_v); -@@ -971,9 +980,11 @@ +@@ -970,9 +979,11 @@ if (!this.field_71454_w) { @@ -90,7 +90,7 @@ } GL11.glFlush(); -@@ -1555,6 +1566,8 @@ +@@ -1554,6 +1565,8 @@ --this.field_71467_ac; } @@ -99,7 +99,7 @@ this.field_71424_I.func_76320_a("gui"); if (!this.field_71445_n) -@@ -1699,6 +1712,7 @@ +@@ -1698,6 +1711,7 @@ this.field_71462_r.func_146274_d(); } } @@ -107,7 +107,7 @@ } if (this.field_71429_W > 0) -@@ -1835,6 +1849,7 @@ +@@ -1834,6 +1848,7 @@ } } } @@ -115,7 +115,7 @@ } } -@@ -2026,12 +2041,15 @@ +@@ -2025,12 +2040,15 @@ this.field_71453_ak.func_74428_b(); } @@ -131,7 +131,7 @@ this.func_71403_a((WorldClient)null); System.gc(); ISaveHandler isavehandler = this.field_71469_aa.func_75804_a(p_71371_1_, false); -@@ -2067,6 +2085,12 @@ +@@ -2066,6 +2084,12 @@ while (!this.field_71437_Z.func_71200_ad()) { @@ -144,7 +144,7 @@ String s2 = this.field_71437_Z.func_71195_b_(); if (s2 != null) -@@ -2142,6 +2166,7 @@ +@@ -2141,6 +2165,7 @@ this.field_110448_aq.func_148529_f(); this.func_71351_a((ServerData)null); this.field_71455_al = false; diff --git a/fml/patches/minecraft/net/minecraft/item/Item.java.patch b/fml/patches/minecraft/net/minecraft/item/Item.java.patch index c577fca1eb..dd8c2a4f1a 100644 --- a/fml/patches/minecraft/net/minecraft/item/Item.java.patch +++ b/fml/patches/minecraft/net/minecraft/item/Item.java.patch @@ -18,3 +18,12 @@ protected static final UUID field_111210_e = UUID.fromString("CB3F55D3-645C-4F38-A497-9C13A33DB5CF"); private CreativeTabs field_77701_a; protected static Random field_77697_d = new Random(); +@@ -62,6 +64,8 @@ + protected String field_111218_cA; + private static final String __OBFID = "CL_00000041"; + ++ public final cpw.mods.fml.common.registry.RegistryDelegate delegate = ++ ((cpw.mods.fml.common.registry.FMLControlledNamespacedRegistry)field_150901_e).getDelegate(this, Item.class); + public static int func_150891_b(Item p_150891_0_) + { + return p_150891_0_ == null ? 0 : field_150901_e.func_148757_b(p_150891_0_); diff --git a/fml/src/main/java/cpw/mods/fml/client/FMLConfigGuiFactory.java b/fml/src/main/java/cpw/mods/fml/client/FMLConfigGuiFactory.java index ab22961c8f..bee4112a90 100644 --- a/fml/src/main/java/cpw/mods/fml/client/FMLConfigGuiFactory.java +++ b/fml/src/main/java/cpw/mods/fml/client/FMLConfigGuiFactory.java @@ -31,7 +31,7 @@ public class FMLConfigGuiFactory implements IModGuiFactory } @SuppressWarnings({ "rawtypes", "unchecked" }) - private static List getConfigElements() + private static List getConfigElements() { List list = new ArrayList(); List listsList = new ArrayList(); diff --git a/fml/src/main/java/cpw/mods/fml/client/config/DummyConfigElement.java b/fml/src/main/java/cpw/mods/fml/client/config/DummyConfigElement.java index 16a6ee6346..1f8078d73e 100644 --- a/fml/src/main/java/cpw/mods/fml/client/config/DummyConfigElement.java +++ b/fml/src/main/java/cpw/mods/fml/client/config/DummyConfigElement.java @@ -50,9 +50,9 @@ public class DummyConfigElement implements IConfigElement protected boolean isListFixedLength = false; protected int maxListLength = -1; @SuppressWarnings("rawtypes") - protected List childElements; + protected List childElements; @SuppressWarnings("rawtypes") - protected Class configEntryClass; + protected Class configEntryClass; protected Class arrayEntryClass; /** @@ -62,19 +62,19 @@ public class DummyConfigElement implements IConfigElement public static class DummyCategoryElement extends DummyConfigElement { @SuppressWarnings("rawtypes") - public DummyCategoryElement(String name, String langKey, List childElements) + public DummyCategoryElement(String name, String langKey, List childElements) { this(name, langKey, childElements, (Class) null); } @SuppressWarnings("rawtypes") - public DummyCategoryElement(String name, String langKey, Class customListEntryClass) + public DummyCategoryElement(String name, String langKey, Class customListEntryClass) { this(name, langKey, new ArrayList(), customListEntryClass); } @SuppressWarnings("rawtypes") - public DummyCategoryElement(String name, String langKey, List childElements, Class customListEntryClass) + public DummyCategoryElement(String name, String langKey, List childElements, Class customListEntryClass) { super(name, (T) null, ConfigGuiType.CONFIG_CATEGORY, langKey); this.childElements = childElements; @@ -150,7 +150,7 @@ public class DummyConfigElement implements IConfigElement } @SuppressWarnings("rawtypes") - public DummyListElement setCustomEditListEntryClass(Class clazz) + public DummyListElement setCustomEditListEntryClass(Class clazz) { this.arrayEntryClass = clazz; return this; @@ -164,7 +164,7 @@ public class DummyConfigElement implements IConfigElement } @SuppressWarnings("unchecked") - public DummyConfigElement(String name, T defaultValue, ConfigGuiType type, String langKey, String[] validValues, Pattern validStringPattern, T minValue, T maxValue) + public DummyConfigElement(String name, T defaultValue, ConfigGuiType type, String langKey, String[] validValues, Pattern validStringPattern, T minValue, T maxValue) { this.name = name; this.defaultValue = defaultValue; @@ -214,7 +214,7 @@ public class DummyConfigElement implements IConfigElement } @SuppressWarnings("rawtypes") - public DummyConfigElement setCustomListEntryClass(Class clazz) + public DummyConfigElement setCustomListEntryClass(Class clazz) { this.configEntryClass = clazz; return this; @@ -227,21 +227,21 @@ public class DummyConfigElement implements IConfigElement } @SuppressWarnings("rawtypes") - public IConfigElement setConfigEntryClass(Class clazz) + public IConfigElement setConfigEntryClass(Class clazz) { this.configEntryClass = clazz; return this; } @SuppressWarnings("rawtypes") - @Override + @Override public Class getConfigEntryClass() { return configEntryClass; } @SuppressWarnings("rawtypes") - public IConfigElement setArrayEntryClass(Class clazz) + public IConfigElement setArrayEntryClass(Class clazz) { this.arrayEntryClass = clazz; return this; @@ -278,7 +278,7 @@ public class DummyConfigElement implements IConfigElement } @SuppressWarnings("rawtypes") - @Override + @Override public List getChildElements() { return childElements; diff --git a/fml/src/main/java/cpw/mods/fml/client/config/GuiConfig.java b/fml/src/main/java/cpw/mods/fml/client/config/GuiConfig.java index 6a36487e5c..9299808086 100644 --- a/fml/src/main/java/cpw/mods/fml/client/config/GuiConfig.java +++ b/fml/src/main/java/cpw/mods/fml/client/config/GuiConfig.java @@ -49,9 +49,9 @@ public class GuiConfig extends GuiScreen public String title = "Config GUI"; public String titleLine2; @SuppressWarnings("rawtypes") - public final List configElements; + public final List configElements; @SuppressWarnings("rawtypes") - public final List initEntries; + public final List initEntries; public GuiConfigEntries entryList; private GuiButtonExt btnDefaultAll; private GuiButtonExt btnUndoAll; @@ -88,7 +88,7 @@ public class GuiConfig extends GuiScreen * edited. */ @SuppressWarnings("rawtypes") - public GuiConfig(GuiScreen parentScreen, List configElements, String modID, String configID, + public GuiConfig(GuiScreen parentScreen, List configElements, String modID, String configID, boolean allRequireWorldRestart, boolean allRequireMcRestart, String title) { this(parentScreen, configElements, modID, configID, allRequireWorldRestart, allRequireMcRestart, title, null); @@ -107,7 +107,7 @@ public class GuiConfig extends GuiScreen * edited. */ @SuppressWarnings("rawtypes") - public GuiConfig(GuiScreen parentScreen, List configElements, String modID, + public GuiConfig(GuiScreen parentScreen, List configElements, String modID, boolean allRequireWorldRestart, boolean allRequireMcRestart, String title) { this(parentScreen, configElements, modID, null, allRequireWorldRestart, allRequireMcRestart, title, null); @@ -128,7 +128,7 @@ public class GuiConfig extends GuiScreen * currently being edited. */ @SuppressWarnings("rawtypes") - public GuiConfig(GuiScreen parentScreen, List configElements, String modID, + public GuiConfig(GuiScreen parentScreen, List configElements, String modID, boolean allRequireWorldRestart, boolean allRequireMcRestart, String title, String titleLine2) { this(parentScreen, configElements, modID, null, allRequireWorldRestart, allRequireMcRestart, title, titleLine2); @@ -152,7 +152,7 @@ public class GuiConfig extends GuiScreen * currently being edited. */ @SuppressWarnings("rawtypes") - public GuiConfig(GuiScreen parentScreen, List configElements, String modID, String configID, + public GuiConfig(GuiScreen parentScreen, List configElements, String modID, String configID, boolean allRequireWorldRestart, boolean allRequireMcRestart, String title, String titleLine2) { this.mc = Minecraft.getMinecraft(); @@ -182,7 +182,7 @@ public class GuiConfig extends GuiScreen } @SuppressWarnings("unchecked") - @Override + @Override public void initGui() { Keyboard.enableRepeatEvents(true); @@ -345,7 +345,7 @@ public class GuiConfig extends GuiScreen } @SuppressWarnings("rawtypes") - public void drawToolTip(List stringList, int x, int y) + public void drawToolTip(List stringList, int x, int y) { this.func_146283_a(stringList, x, y); } diff --git a/fml/src/main/java/cpw/mods/fml/client/config/GuiConfigEntries.java b/fml/src/main/java/cpw/mods/fml/client/config/GuiConfigEntries.java index b96dbf1e77..47dc244e32 100644 --- a/fml/src/main/java/cpw/mods/fml/client/config/GuiConfigEntries.java +++ b/fml/src/main/java/cpw/mods/fml/client/config/GuiConfigEntries.java @@ -45,7 +45,7 @@ public class GuiConfigEntries extends GuiListExtended public final GuiConfig owningScreen; public final Minecraft mc; @SuppressWarnings("rawtypes") - public List listEntries; + public List listEntries; /** * The max width of the label of all IConfigEntry objects. */ @@ -76,7 +76,7 @@ public class GuiConfigEntries extends GuiListExtended public int scrollBarX; @SuppressWarnings({ "rawtypes", "unchecked" }) - public GuiConfigEntries(GuiConfig parent, Minecraft mc) + public GuiConfigEntries(GuiConfig parent, Minecraft mc) { super(mc, parent.width, parent.height, parent.titleLine2 != null ? 33 : 23, parent.height - 32, 20); this.owningScreen = parent; @@ -169,7 +169,7 @@ public class GuiConfigEntries extends GuiListExtended } @SuppressWarnings("rawtypes") - protected void initGui() + protected void initGui() { this.width = owningScreen.width; this.height = owningScreen.height; @@ -207,7 +207,7 @@ public class GuiConfigEntries extends GuiListExtended * Gets the IGuiListEntry object for the given index */ @SuppressWarnings("rawtypes") - @Override + @Override public IConfigEntry getListEntry(int index) { return this.listEntries.get(index); @@ -232,7 +232,7 @@ public class GuiConfigEntries extends GuiListExtended * This method is a pass-through for IConfigEntry objects that require keystrokes. Called from the parent GuiConfig screen. */ @SuppressWarnings("rawtypes") - public void keyTyped(char eventChar, int eventKey) + public void keyTyped(char eventChar, int eventKey) { for (IConfigEntry entry : this.listEntries) entry.keyTyped(eventChar, eventKey); @@ -243,7 +243,7 @@ public class GuiConfigEntries extends GuiListExtended * screen. */ @SuppressWarnings("rawtypes") - public void updateScreen() + public void updateScreen() { for (IConfigEntry entry : this.listEntries) entry.updateCursorCounter(); @@ -254,7 +254,7 @@ public class GuiConfigEntries extends GuiListExtended * screen. */ @SuppressWarnings("rawtypes") - public void mouseClicked(int mouseX, int mouseY, int mouseEvent) + public void mouseClicked(int mouseX, int mouseY, int mouseEvent) { for (IConfigEntry entry : this.listEntries) entry.mouseClicked(mouseX, mouseY, mouseEvent); @@ -264,7 +264,7 @@ 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. */ @SuppressWarnings("rawtypes") - public void onGuiClosed() + public void onGuiClosed() { for (IConfigEntry entry : this.listEntries) entry.onGuiClosed(); @@ -275,7 +275,7 @@ public class GuiConfigEntries extends GuiListExtended * a restart for proper handling. */ @SuppressWarnings("rawtypes") - public boolean saveConfigElements() + public boolean saveConfigElements() { boolean requiresRestart = false; for (IConfigEntry entry : this.listEntries) @@ -290,7 +290,7 @@ public class GuiConfigEntries extends GuiListExtended * objects are checked as well. */ @SuppressWarnings("rawtypes") - public boolean areAllEntriesDefault(boolean includeChildren) + public boolean areAllEntriesDefault(boolean includeChildren) { for (IConfigEntry entry : this.listEntries) if ((includeChildren || !(entry instanceof CategoryEntry)) && !entry.isDefault()) @@ -304,7 +304,7 @@ public class GuiConfigEntries extends GuiListExtended * well. */ @SuppressWarnings("rawtypes") - public void setAllToDefault(boolean includeChildren) + public void setAllToDefault(boolean includeChildren) { for (IConfigEntry entry : this.listEntries) if ((includeChildren || !(entry instanceof CategoryEntry))) @@ -316,7 +316,7 @@ public class GuiConfigEntries extends GuiListExtended * are checked as well. */ @SuppressWarnings("rawtypes") - public boolean hasChangedEntry(boolean includeChildren) + public boolean hasChangedEntry(boolean includeChildren) { for (IConfigEntry entry : this.listEntries) if ((includeChildren || !(entry instanceof CategoryEntry)) && entry.isChanged()) @@ -330,7 +330,7 @@ public class GuiConfigEntries extends GuiListExtended * are checked as well. */ @SuppressWarnings("rawtypes") - public boolean areAnyEntriesEnabled(boolean includeChildren) + public boolean areAnyEntriesEnabled(boolean includeChildren) { for (IConfigEntry entry : this.listEntries) if ((includeChildren || !(entry instanceof CategoryEntry)) && entry.enabled()) @@ -344,7 +344,7 @@ public class GuiConfigEntries extends GuiListExtended * reverted as well. */ @SuppressWarnings("rawtypes") - public void undoAllChanges(boolean includeChildren) + public void undoAllChanges(boolean includeChildren) { for (IConfigEntry entry : this.listEntries) if ((includeChildren || !(entry instanceof CategoryEntry))) @@ -356,7 +356,7 @@ public class GuiConfigEntries extends GuiListExtended * after drawing all other elements. */ @SuppressWarnings("rawtypes") - public void drawScreenPost(int mouseX, int mouseY, float partialTicks) + public void drawScreenPost(int mouseX, int mouseY, float partialTicks) { for (IConfigEntry entry : this.listEntries) entry.drawToolTip(mouseX, mouseY); @@ -428,7 +428,7 @@ public class GuiConfigEntries extends GuiListExtended } @SuppressWarnings("unchecked") - @Override + @Override public boolean saveConfigElement() { if (enabled() && isChanged()) @@ -536,7 +536,7 @@ public class GuiConfigEntries extends GuiListExtended } @SuppressWarnings("unchecked") - @Override + @Override public boolean saveConfigElement() { if (enabled() && isChanged()) @@ -670,7 +670,7 @@ public class GuiConfigEntries extends GuiListExtended } @SuppressWarnings("unchecked") - @Override + @Override public boolean saveConfigElement() { if (enabled() && isChanged()) @@ -706,7 +706,7 @@ public class GuiConfigEntries extends GuiListExtended protected Object[] currentValues; @SuppressWarnings("rawtypes") - public ArrayEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) + public ArrayEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) { super(owningScreen, owningEntryList, configElement); beforeValues = configElement.getList(); @@ -772,7 +772,7 @@ public class GuiConfigEntries extends GuiListExtended } @SuppressWarnings("unchecked") - @Override + @Override public boolean saveConfigElement() { if (enabled() && isChanged()) @@ -865,7 +865,7 @@ public class GuiConfigEntries extends GuiListExtended } @SuppressWarnings("unchecked") - @Override + @Override public boolean saveConfigElement() { if (this.enabled() && this.isChanged()) @@ -987,7 +987,7 @@ public class GuiConfigEntries extends GuiListExtended protected final int beforeValue; @SuppressWarnings("rawtypes") - public IntegerEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) + public IntegerEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) { super(owningScreen, owningEntryList, configElement); this.beforeValue = Integer.valueOf(configElement.get().toString()); @@ -1047,7 +1047,7 @@ public class GuiConfigEntries extends GuiListExtended } @SuppressWarnings("unchecked") - @Override + @Override public boolean saveConfigElement() { if (enabled()) @@ -1094,7 +1094,7 @@ public class GuiConfigEntries extends GuiListExtended protected final double beforeValue; @SuppressWarnings("rawtypes") - public DoubleEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) + public DoubleEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) { super(owningScreen, owningEntryList, configElement); this.beforeValue = Double.valueOf(configElement.get().toString()); @@ -1155,7 +1155,7 @@ public class GuiConfigEntries extends GuiListExtended } @SuppressWarnings("unchecked") - @Override + @Override public boolean saveConfigElement() { if (enabled()) @@ -1281,7 +1281,7 @@ public class GuiConfigEntries extends GuiListExtended } @SuppressWarnings("unchecked") - @Override + @Override public boolean saveConfigElement() { if (enabled()) @@ -1325,7 +1325,7 @@ public class GuiConfigEntries extends GuiListExtended protected final GuiButtonExt btnSelectCategory; @SuppressWarnings("rawtypes") - public CategoryEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) + public CategoryEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) { super(owningScreen, owningEntryList, configElement); @@ -1341,7 +1341,7 @@ public class GuiConfigEntries extends GuiListExtended * This method is called in the constructor and is used to set the childScreen field. */ @SuppressWarnings("unchecked") - protected GuiScreen buildChildScreen() + protected GuiScreen buildChildScreen() { return new GuiConfig(this.owningScreen, this.configElement.getChildElements(), this.owningScreen.modID, owningScreen.allRequireWorldRestart || this.configElement.requiresWorldRestart(), @@ -1487,18 +1487,18 @@ 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. */ @SuppressWarnings("rawtypes") - public static abstract class ListEntryBase implements IConfigEntry + 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; @@ -1506,7 +1506,7 @@ public class GuiConfigEntries extends GuiListExtended protected boolean drawLabel; @SuppressWarnings({ "unchecked" }) - public ListEntryBase(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) + public ListEntryBase(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) { this.owningScreen = owningScreen; this.owningEntryList = owningEntryList; @@ -1702,7 +1702,7 @@ public class GuiConfigEntries extends GuiListExtended * @return */ @SuppressWarnings("rawtypes") - public IConfigElement getConfigElement(); + public IConfigElement getConfigElement(); /** * Gets the name of the ConfigElement owned by this entry. diff --git a/fml/src/main/java/cpw/mods/fml/client/config/GuiEditArray.java b/fml/src/main/java/cpw/mods/fml/client/config/GuiEditArray.java index f4d15f8c38..a86dfe4ba2 100644 --- a/fml/src/main/java/cpw/mods/fml/client/config/GuiEditArray.java +++ b/fml/src/main/java/cpw/mods/fml/client/config/GuiEditArray.java @@ -37,7 +37,7 @@ public class GuiEditArray extends GuiScreen { protected GuiScreen parentScreen; @SuppressWarnings("rawtypes") - protected IConfigElement configElement; + protected IConfigElement configElement; private GuiEditArrayEntries entryList; private GuiButtonExt btnUndoChanges, btnDefault, btnDone; private String title; @@ -48,11 +48,11 @@ public class GuiEditArray extends GuiScreen private Object[] currentValues; private HoverChecker tooltipHoverChecker; @SuppressWarnings("rawtypes") - private List toolTip; + private List toolTip; protected boolean enabled; @SuppressWarnings("rawtypes") - public GuiEditArray(GuiScreen parentScreen, IConfigElement configElement, int slotIndex, Object[] currentValues, boolean enabled) + public GuiEditArray(GuiScreen parentScreen, IConfigElement configElement, int slotIndex, Object[] currentValues, boolean enabled) { this.mc = Minecraft.getMinecraft(); this.parentScreen = parentScreen; @@ -98,7 +98,7 @@ public class GuiEditArray extends GuiScreen } @SuppressWarnings("unchecked") - @Override + @Override public void initGui() { this.entryList = new GuiEditArrayEntries(this, this.mc, this.configElement, this.beforeValues, this.currentValues); @@ -202,7 +202,7 @@ public class GuiEditArray extends GuiScreen } @SuppressWarnings("rawtypes") - public void drawToolTip(List stringList, int x, int y) + public void drawToolTip(List stringList, int x, int y) { this.func_146283_a(stringList, x, y); } diff --git a/fml/src/main/java/cpw/mods/fml/client/config/GuiEditArrayEntries.java b/fml/src/main/java/cpw/mods/fml/client/config/GuiEditArrayEntries.java index de1f3e388e..ddabd56123 100644 --- a/fml/src/main/java/cpw/mods/fml/client/config/GuiEditArrayEntries.java +++ b/fml/src/main/java/cpw/mods/fml/client/config/GuiEditArrayEntries.java @@ -42,7 +42,7 @@ public class GuiEditArrayEntries extends GuiListExtended { private GuiEditArray owningGui; public Minecraft mc; - public IConfigElement configElement; + public IConfigElement configElement; public List listEntries; public boolean isDefault; public boolean isChanged; @@ -52,7 +52,7 @@ public class GuiEditArrayEntries extends GuiListExtended public Object[] currentValues; @SuppressWarnings("unchecked") - public GuiEditArrayEntries(GuiEditArray parent, Minecraft mc, IConfigElement configElement, Object[] beforeValues, Object[] currentValues) + 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; @@ -222,7 +222,7 @@ public class GuiEditArrayEntries extends GuiListExtended } @SuppressWarnings("unchecked") - protected void saveListChanges() + protected void saveListChanges() { int listLength = configElement.isListLengthFixed() ? listEntries.size() : listEntries.size() - 1; @@ -544,7 +544,7 @@ public class GuiEditArrayEntries extends GuiListExtended protected boolean isValidated = false; @SuppressWarnings({ "unchecked" }) - public BaseEntry(GuiEditArray owningScreen, GuiEditArrayEntries owningEntryList, IConfigElement configElement) + public BaseEntry(GuiEditArray owningScreen, GuiEditArrayEntries owningEntryList, IConfigElement configElement) { this.owningScreen = owningScreen; this.owningEntryList = owningEntryList; diff --git a/fml/src/main/java/cpw/mods/fml/client/config/GuiSelectString.java b/fml/src/main/java/cpw/mods/fml/client/config/GuiSelectString.java index 410339b699..6f1109938a 100644 --- a/fml/src/main/java/cpw/mods/fml/client/config/GuiSelectString.java +++ b/fml/src/main/java/cpw/mods/fml/client/config/GuiSelectString.java @@ -34,7 +34,7 @@ public class GuiSelectString extends GuiScreen { protected GuiScreen parentScreen; @SuppressWarnings("rawtypes") - protected IConfigElement configElement; + protected IConfigElement configElement; private GuiSelectStringEntries entriesList; private GuiButtonExt btnUndoChanges, btnDefault, btnDone; private String title; @@ -46,11 +46,11 @@ public class GuiSelectString extends GuiScreen public Object currentValue; private HoverChecker tooltipHoverChecker; @SuppressWarnings("rawtypes") - private List toolTip; + private List toolTip; protected boolean enabled; @SuppressWarnings("rawtypes") - public GuiSelectString(GuiScreen parentScreen, IConfigElement configElement, int slotIndex, Map selectableValues, Object currentValue, boolean enabled) + public GuiSelectString(GuiScreen parentScreen, IConfigElement configElement, int slotIndex, Map selectableValues, Object currentValue, boolean enabled) { this.mc = Minecraft.getMinecraft(); this.parentScreen = parentScreen; @@ -93,7 +93,7 @@ public class GuiSelectString extends GuiScreen } @SuppressWarnings("unchecked") - @Override + @Override public void initGui() { this.entriesList = new GuiSelectStringEntries(this, this.mc, this.configElement, this.selectableValues); @@ -170,7 +170,7 @@ public class GuiSelectString extends GuiScreen } @SuppressWarnings("rawtypes") - public void drawToolTip(List stringList, int x, int y) + public void drawToolTip(List stringList, int x, int y) { this.func_146283_a(stringList, x, y); } diff --git a/fml/src/main/java/cpw/mods/fml/client/config/GuiSelectStringEntries.java b/fml/src/main/java/cpw/mods/fml/client/config/GuiSelectStringEntries.java index e16db6ea5d..b4640a1695 100644 --- a/fml/src/main/java/cpw/mods/fml/client/config/GuiSelectStringEntries.java +++ b/fml/src/main/java/cpw/mods/fml/client/config/GuiSelectStringEntries.java @@ -35,14 +35,14 @@ public class GuiSelectStringEntries extends GuiListExtended public GuiSelectString owningScreen; public Minecraft mc; @SuppressWarnings("rawtypes") - public IConfigElement configElement; + public IConfigElement configElement; public List listEntries; public final Map selectableValues; public int selectedIndex = -1; public int maxEntryWidth = 0; @SuppressWarnings("rawtypes") - public GuiSelectStringEntries(GuiSelectString owningScreen, Minecraft mc, IConfigElement configElement, Map selectableValues) + public GuiSelectStringEntries(GuiSelectString owningScreen, Minecraft mc, IConfigElement configElement, Map selectableValues) { super(mc, owningScreen.width, owningScreen.height, owningScreen.titleLine2 != null ? (owningScreen.titleLine3 != null ? 43 : 33) : 23, owningScreen.height - 32, 11); @@ -144,7 +144,7 @@ public class GuiSelectStringEntries extends GuiListExtended } @SuppressWarnings("unchecked") - public void saveChanges() + public void saveChanges() { if (owningScreen.slotIndex != -1 && owningScreen.parentScreen != null && owningScreen.parentScreen instanceof GuiConfig diff --git a/fml/src/main/java/cpw/mods/fml/client/config/IConfigElement.java b/fml/src/main/java/cpw/mods/fml/client/config/IConfigElement.java index e6a262ec7c..c1a792c16b 100644 --- a/fml/src/main/java/cpw/mods/fml/client/config/IConfigElement.java +++ b/fml/src/main/java/cpw/mods/fml/client/config/IConfigElement.java @@ -35,7 +35,7 @@ public interface IConfigElement * provide a constructor with the following parameter types: {@code GuiConfig}, {@code GuiConfigEntries}, {@code IConfigElement} */ @SuppressWarnings("rawtypes") - public Class getConfigEntryClass(); + public Class getConfigEntryClass(); /** * This method returns a class that implements {@code IArrayEntry}. This class MUST provide a constructor with the @@ -69,7 +69,7 @@ public interface IConfigElement * [Category] Gets this category's child categories/properties. */ @SuppressWarnings("rawtypes") - public List getChildElements(); + public List getChildElements(); /** * [Property, Category] Gets the ConfigGuiType value corresponding to the type of this property object, or CONFIG_CATEGORY if this is a diff --git a/fml/src/main/java/cpw/mods/fml/common/eventhandler/ASMEventHandler.java b/fml/src/main/java/cpw/mods/fml/common/eventhandler/ASMEventHandler.java index 73a6c3f151..fd63de2b9f 100644 --- a/fml/src/main/java/cpw/mods/fml/common/eventhandler/ASMEventHandler.java +++ b/fml/src/main/java/cpw/mods/fml/common/eventhandler/ASMEventHandler.java @@ -22,7 +22,7 @@ public class ASMEventHandler implements IEventListener private static final String HANDLER_FUNC_DESC = Type.getMethodDescriptor(IEventListener.class.getDeclaredMethods()[0]); private static final ASMClassLoader LOADER = new ASMClassLoader(); private static final HashMap> cache = Maps.newHashMap(); - private static final boolean GETCONTEXT = Boolean.parseBoolean(System.getProperty("fml.LogContext", "false")); + private static final boolean GETCONTEXT = Boolean.parseBoolean(System.getProperty("fml.LogContext", "false")); private final IEventListener handler; private final SubscribeEvent subInfo; @@ -53,7 +53,7 @@ public class ASMEventHandler implements IEventListener } } if (GETCONTEXT) - ThreadContext.remove("mod"); + ThreadContext.remove("mod"); } public EventPriority getPriority() diff --git a/fml/src/main/java/cpw/mods/fml/common/network/internal/FMLMessage.java b/fml/src/main/java/cpw/mods/fml/common/network/internal/FMLMessage.java index 9847272480..0da5dcd509 100644 --- a/fml/src/main/java/cpw/mods/fml/common/network/internal/FMLMessage.java +++ b/fml/src/main/java/cpw/mods/fml/common/network/internal/FMLMessage.java @@ -194,7 +194,7 @@ public abstract class FMLMessage { entity.getDataWatcher().func_151509_a(pb); } catch (IOException e) { - FMLLog.log(Level.FATAL,e,"Encountered fatal exception trying to send entity spawn data watchers"); + FMLLog.log(Level.FATAL,e,"Encountered fatal exception trying to send entity spawn data watchers"); throw Throwables.propagate(e); } buf.writeBytes(tmpBuf); diff --git a/fml/src/main/java/cpw/mods/fml/common/registry/FMLControlledNamespacedRegistry.java b/fml/src/main/java/cpw/mods/fml/common/registry/FMLControlledNamespacedRegistry.java index 6375e64d13..78adb35f9c 100644 --- a/fml/src/main/java/cpw/mods/fml/common/registry/FMLControlledNamespacedRegistry.java +++ b/fml/src/main/java/cpw/mods/fml/common/registry/FMLControlledNamespacedRegistry.java @@ -425,4 +425,8 @@ public class FMLControlledNamespacedRegistry extends RegistryNamespaced { { return optionalDefaultObject; } + + public RegistryDelegate getDelegate(I thing, Class clazz) { + return GameData.buildDelegate(thing, clazz); + } } diff --git a/fml/src/main/java/cpw/mods/fml/common/registry/GameData.java b/fml/src/main/java/cpw/mods/fml/common/registry/GameData.java index aa52b74f57..e701bad010 100644 --- a/fml/src/main/java/cpw/mods/fml/common/registry/GameData.java +++ b/fml/src/main/java/cpw/mods/fml/common/registry/GameData.java @@ -797,7 +797,7 @@ public class GameData { // block the Block Registry slot with the same id useSlot(itemId); - + ((RegistryDelegate.Delegate) item.delegate).setName(name); return itemId; } @@ -841,7 +841,7 @@ public class GameData { } useSlot(blockId); - + ((RegistryDelegate.Delegate) block.delegate).setName(name); return blockId; } @@ -948,4 +948,9 @@ public class GameData { FMLLog.fine("Registry consistency check successful"); } + + static RegistryDelegate buildDelegate(T referant, Class type) + { + return new RegistryDelegate.Delegate(referant, type); + } } diff --git a/fml/src/main/java/cpw/mods/fml/common/registry/RegistryDelegate.java b/fml/src/main/java/cpw/mods/fml/common/registry/RegistryDelegate.java new file mode 100644 index 0000000000..8112286053 --- /dev/null +++ b/fml/src/main/java/cpw/mods/fml/common/registry/RegistryDelegate.java @@ -0,0 +1,52 @@ +package cpw.mods.fml.common.registry; + + +/** + * A registry delegate for holding references to items or blocks + * + * @author cpw + * + * @param the type of thing we're holding onto + */ +public interface RegistryDelegate { + T get(); + String name(); + Class type(); + + final class Delegate implements RegistryDelegate + { + private T referant; + private String name; + private final Class type; + + public Delegate(T referant, Class type) { + this.referant = referant; + this.type = type; + } + + @Override + public T get() { + return referant; + } + + @Override + public String name() { + return name; + } + + public Class type() + { + return this.type; + } + + void changeReference(T newTarget) + { + this.referant = newTarget; + } + + void setName(String name) + { + this.name = name; + } + } +} diff --git a/fml/src/main/java/cpw/mods/fml/common/versioning/VersionRange.java b/fml/src/main/java/cpw/mods/fml/common/versioning/VersionRange.java index 4953c5d197..6af8307afa 100644 --- a/fml/src/main/java/cpw/mods/fml/common/versioning/VersionRange.java +++ b/fml/src/main/java/cpw/mods/fml/common/versioning/VersionRange.java @@ -94,7 +94,7 @@ public class VersionRange */ public static VersionRange newRange(ArtifactVersion version, List restrictions) { - return new VersionRange(version, restrictions); + return new VersionRange(version, restrictions); } /** * Create a version range from a string representation diff --git a/fml/src/main/java/cpw/mods/fml/relauncher/CoreModManager.java b/fml/src/main/java/cpw/mods/fml/relauncher/CoreModManager.java index 8704b22c1b..8b9d0f53f2 100644 --- a/fml/src/main/java/cpw/mods/fml/relauncher/CoreModManager.java +++ b/fml/src/main/java/cpw/mods/fml/relauncher/CoreModManager.java @@ -233,11 +233,11 @@ public class CoreModManager { File[] derplist = coreMods.listFiles(derpfilter); if (derplist != null && derplist.length > 0) { - FMLRelaunchLog.severe("FML has detected several badly downloaded jar files, which have been named as zip files. You probably need to download them again, or they may not work properly"); - for (File f : derplist) - { - FMLRelaunchLog.severe("Problem file : %s", f.getName()); - } + FMLRelaunchLog.severe("FML has detected several badly downloaded jar files, which have been named as zip files. You probably need to download them again, or they may not work properly"); + for (File f : derplist) + { + FMLRelaunchLog.severe("Problem file : %s", f.getName()); + } } File[] coreModList = coreMods.listFiles(ff); File versionedModDir = new File(coreMods, FMLInjectionData.mccversion);