Add a delegate to every item and block. this should help with renaming fun stuffs. Also, fix all the tabs from my previous commits. *sigh*
This commit is contained in:
parent
7ac077ed36
commit
f5bcb6f0ca
19 changed files with 172 additions and 93 deletions
|
@ -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<Block> 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_);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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<Item> 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_);
|
||||
|
|
|
@ -31,7 +31,7 @@ public class FMLConfigGuiFactory implements IModGuiFactory
|
|||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
private static List<IConfigElement> getConfigElements()
|
||||
private static List<IConfigElement> getConfigElements()
|
||||
{
|
||||
List<IConfigElement> list = new ArrayList<IConfigElement>();
|
||||
List<IConfigElement> listsList = new ArrayList<IConfigElement>();
|
||||
|
|
|
@ -50,9 +50,9 @@ public class DummyConfigElement<T> implements IConfigElement<T>
|
|||
protected boolean isListFixedLength = false;
|
||||
protected int maxListLength = -1;
|
||||
@SuppressWarnings("rawtypes")
|
||||
protected List<IConfigElement> childElements;
|
||||
protected List<IConfigElement> childElements;
|
||||
@SuppressWarnings("rawtypes")
|
||||
protected Class<? extends IConfigEntry> configEntryClass;
|
||||
protected Class<? extends IConfigEntry> configEntryClass;
|
||||
protected Class<? extends IArrayEntry> arrayEntryClass;
|
||||
|
||||
/**
|
||||
|
@ -62,19 +62,19 @@ public class DummyConfigElement<T> implements IConfigElement<T>
|
|||
public static class DummyCategoryElement<T> extends DummyConfigElement<T>
|
||||
{
|
||||
@SuppressWarnings("rawtypes")
|
||||
public DummyCategoryElement(String name, String langKey, List<IConfigElement> childElements)
|
||||
public DummyCategoryElement(String name, String langKey, List<IConfigElement> childElements)
|
||||
{
|
||||
this(name, langKey, childElements, (Class<? extends IConfigEntry>) null);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public DummyCategoryElement(String name, String langKey, Class<? extends IConfigEntry> customListEntryClass)
|
||||
public DummyCategoryElement(String name, String langKey, Class<? extends IConfigEntry> customListEntryClass)
|
||||
{
|
||||
this(name, langKey, new ArrayList<IConfigElement>(), customListEntryClass);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public DummyCategoryElement(String name, String langKey, List<IConfigElement> childElements, Class<? extends IConfigEntry> customListEntryClass)
|
||||
public DummyCategoryElement(String name, String langKey, List<IConfigElement> childElements, Class<? extends IConfigEntry> customListEntryClass)
|
||||
{
|
||||
super(name, (T) null, ConfigGuiType.CONFIG_CATEGORY, langKey);
|
||||
this.childElements = childElements;
|
||||
|
@ -150,7 +150,7 @@ public class DummyConfigElement<T> implements IConfigElement<T>
|
|||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public DummyListElement setCustomEditListEntryClass(Class<? extends IArrayEntry> clazz)
|
||||
public DummyListElement setCustomEditListEntryClass(Class<? extends IArrayEntry> clazz)
|
||||
{
|
||||
this.arrayEntryClass = clazz;
|
||||
return this;
|
||||
|
@ -164,7 +164,7 @@ public class DummyConfigElement<T> implements IConfigElement<T>
|
|||
}
|
||||
|
||||
@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<T> implements IConfigElement<T>
|
|||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public DummyConfigElement setCustomListEntryClass(Class<? extends IConfigEntry> clazz)
|
||||
public DummyConfigElement setCustomListEntryClass(Class<? extends IConfigEntry> clazz)
|
||||
{
|
||||
this.configEntryClass = clazz;
|
||||
return this;
|
||||
|
@ -227,21 +227,21 @@ public class DummyConfigElement<T> implements IConfigElement<T>
|
|||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public IConfigElement setConfigEntryClass(Class<? extends IConfigEntry> clazz)
|
||||
public IConfigElement setConfigEntryClass(Class<? extends IConfigEntry> clazz)
|
||||
{
|
||||
this.configEntryClass = clazz;
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
@Override
|
||||
public Class<? extends IConfigEntry> getConfigEntryClass()
|
||||
{
|
||||
return configEntryClass;
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public IConfigElement setArrayEntryClass(Class<? extends IArrayEntry> clazz)
|
||||
public IConfigElement setArrayEntryClass(Class<? extends IArrayEntry> clazz)
|
||||
{
|
||||
this.arrayEntryClass = clazz;
|
||||
return this;
|
||||
|
@ -278,7 +278,7 @@ public class DummyConfigElement<T> implements IConfigElement<T>
|
|||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
@Override
|
||||
public List<IConfigElement> getChildElements()
|
||||
{
|
||||
return childElements;
|
||||
|
|
|
@ -49,9 +49,9 @@ public class GuiConfig extends GuiScreen
|
|||
public String title = "Config GUI";
|
||||
public String titleLine2;
|
||||
@SuppressWarnings("rawtypes")
|
||||
public final List<IConfigElement> configElements;
|
||||
public final List<IConfigElement> configElements;
|
||||
@SuppressWarnings("rawtypes")
|
||||
public final List<IConfigEntry> initEntries;
|
||||
public final List<IConfigEntry> 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<IConfigElement> configElements, String modID, String configID,
|
||||
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);
|
||||
|
@ -107,7 +107,7 @@ public class GuiConfig extends GuiScreen
|
|||
* edited.
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
public GuiConfig(GuiScreen parentScreen, List<IConfigElement> configElements, String modID,
|
||||
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 +128,7 @@ public class GuiConfig extends GuiScreen
|
|||
* currently being edited.
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
public GuiConfig(GuiScreen parentScreen, List<IConfigElement> configElements, String modID,
|
||||
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);
|
||||
|
@ -152,7 +152,7 @@ public class GuiConfig extends GuiScreen
|
|||
* currently being edited.
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
public GuiConfig(GuiScreen parentScreen, List<IConfigElement> configElements, String modID, String configID,
|
||||
public GuiConfig(GuiScreen parentScreen, List<IConfigElement> 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);
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ public class GuiConfigEntries extends GuiListExtended
|
|||
public final GuiConfig owningScreen;
|
||||
public final Minecraft mc;
|
||||
@SuppressWarnings("rawtypes")
|
||||
public List<IConfigEntry> listEntries;
|
||||
public List<IConfigEntry> 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.
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ 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;
|
||||
|
@ -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;
|
||||
|
|
|
@ -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<Object, String> selectableValues, Object currentValue, boolean enabled)
|
||||
public GuiSelectString(GuiScreen parentScreen, IConfigElement configElement, int slotIndex, Map<Object, String> 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);
|
||||
}
|
||||
|
|
|
@ -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<IGuiSelectStringListEntry> listEntries;
|
||||
public final Map<Object, String> selectableValues;
|
||||
public int selectedIndex = -1;
|
||||
public int maxEntryWidth = 0;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public GuiSelectStringEntries(GuiSelectString owningScreen, Minecraft mc, IConfigElement configElement, Map<Object, String> selectableValues)
|
||||
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);
|
||||
|
@ -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
|
||||
|
|
|
@ -35,7 +35,7 @@ public interface IConfigElement<T>
|
|||
* provide a constructor with the following parameter types: {@code GuiConfig}, {@code GuiConfigEntries}, {@code IConfigElement}
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
public Class<? extends IConfigEntry> getConfigEntryClass();
|
||||
public Class<? extends IConfigEntry> 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<T>
|
|||
* [Category] Gets this category's child categories/properties.
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
public List<IConfigElement> getChildElements();
|
||||
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
|
||||
|
|
|
@ -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<Method, Class<?>> 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()
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -425,4 +425,8 @@ public class FMLControlledNamespacedRegistry<I> extends RegistryNamespaced {
|
|||
{
|
||||
return optionalDefaultObject;
|
||||
}
|
||||
|
||||
public RegistryDelegate<I> getDelegate(I thing, Class<I> clazz) {
|
||||
return GameData.buildDelegate(thing, clazz);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -797,7 +797,7 @@ public class GameData {
|
|||
|
||||
// block the Block Registry slot with the same id
|
||||
useSlot(itemId);
|
||||
|
||||
((RegistryDelegate.Delegate<Item>) item.delegate).setName(name);
|
||||
return itemId;
|
||||
}
|
||||
|
||||
|
@ -841,7 +841,7 @@ public class GameData {
|
|||
}
|
||||
|
||||
useSlot(blockId);
|
||||
|
||||
((RegistryDelegate.Delegate<Block>) block.delegate).setName(name);
|
||||
return blockId;
|
||||
}
|
||||
|
||||
|
@ -948,4 +948,9 @@ public class GameData {
|
|||
|
||||
FMLLog.fine("Registry consistency check successful");
|
||||
}
|
||||
|
||||
static <T> RegistryDelegate<T> buildDelegate(T referant, Class<T> type)
|
||||
{
|
||||
return new RegistryDelegate.Delegate<T>(referant, type);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
package cpw.mods.fml.common.registry;
|
||||
|
||||
|
||||
/**
|
||||
* A registry delegate for holding references to items or blocks
|
||||
*
|
||||
* @author cpw
|
||||
*
|
||||
* @param <T> the type of thing we're holding onto
|
||||
*/
|
||||
public interface RegistryDelegate<T> {
|
||||
T get();
|
||||
String name();
|
||||
Class<T> type();
|
||||
|
||||
final class Delegate<T> implements RegistryDelegate<T>
|
||||
{
|
||||
private T referant;
|
||||
private String name;
|
||||
private final Class<T> type;
|
||||
|
||||
public Delegate(T referant, Class<T> type) {
|
||||
this.referant = referant;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public T get() {
|
||||
return referant;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public Class<T> type()
|
||||
{
|
||||
return this.type;
|
||||
}
|
||||
|
||||
void changeReference(T newTarget)
|
||||
{
|
||||
this.referant = newTarget;
|
||||
}
|
||||
|
||||
void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -94,7 +94,7 @@ public class VersionRange
|
|||
*/
|
||||
public static VersionRange newRange(ArtifactVersion version, List<Restriction> restrictions)
|
||||
{
|
||||
return new VersionRange(version, restrictions);
|
||||
return new VersionRange(version, restrictions);
|
||||
}
|
||||
/**
|
||||
* Create a version range from a string representation
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue