Merge pull request #527 from bspkrs/1.8

Update Config Gui stuff for 1.8
This commit is contained in:
LexManos 2014-09-30 13:05:00 -07:00
commit 27ea6bb6fa
25 changed files with 286 additions and 334 deletions

View file

@ -31,7 +31,7 @@ repositories {
minecraft {
version = '1.8'
mcpVersion = '9.10'
mappings = 'snapshot_nodoc_20140916'
mappings = 'snapshot_nodoc_20140930'
fmlDir = projectDir.getAbsolutePath();
mainClass = 'net.minecraftforge.fml.relauncher.ServerLaunchWrapper'
tweakClass = 'net.minecraftforge.fml.common.launcher.FMLTweaker'

View file

@ -40,12 +40,9 @@ import net.minecraft.client.multiplayer.ServerData;
import net.minecraft.client.multiplayer.WorldClient;
import net.minecraft.client.network.NetHandlerPlayClient;
import net.minecraft.client.network.OldServerPinger;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.resources.IReloadableResourceManager;
import net.minecraft.client.resources.IResourcePack;
import net.minecraft.crash.CrashReport;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.launchwrapper.Launch;
import net.minecraft.nbt.CompressedStreamTools;
@ -58,7 +55,6 @@ import net.minecraft.server.MinecraftServer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.WorldSettings;
import net.minecraft.world.storage.SaveFormatOld;
import net.minecraftforge.fml.client.registry.RenderingRegistry;
import net.minecraftforge.fml.common.DummyModContainer;
import net.minecraftforge.fml.common.DuplicateModsFoundException;
import net.minecraftforge.fml.common.FMLCommonHandler;
@ -130,8 +126,10 @@ public class FMLClientHandler implements IFMLSidedHandler
private DummyModContainer optifineContainer;
@SuppressWarnings("unused")
private boolean guiLoaded;
@SuppressWarnings("unused")
private boolean serverIsRunning;
private MissingModsException modsMissing;
@ -150,6 +148,7 @@ public class FMLClientHandler implements IFMLSidedHandler
private List<IResourcePack> resourcePackList;
@SuppressWarnings("unused")
private IReloadableResourceManager resourceManager;
private Map<String, IResourcePack> resourcePackMap;
@ -273,7 +272,6 @@ public class FMLClientHandler implements IFMLSidedHandler
* Also initializes key bindings
*
*/
@SuppressWarnings({ "deprecation", "unchecked" })
public void finishMinecraftLoading()
{
if (modsMissing != null || wrongMC != null || customError!=null || dupesFound!=null || modSorting!=null)

View file

@ -30,7 +30,6 @@ public class FMLConfigGuiFactory implements IModGuiFactory
super(parent, getConfigElements(), "FML", false, false, I18n.format("fml.config.sample.title"));
}
@SuppressWarnings({ "rawtypes", "unchecked" })
private static List<IConfigElement> getConfigElements()
{
List<IConfigElement> list = new ArrayList<IConfigElement>();
@ -40,46 +39,46 @@ public class FMLConfigGuiFactory implements IModGuiFactory
Pattern commaDelimitedPattern = Pattern.compile("([A-Za-z]+((,){1}( )*|$))+?");
// Top Level Settings
list.add(new DummyConfigElement<Boolean>("imABoolean", true, ConfigGuiType.BOOLEAN, "fml.config.sample.imABoolean").setRequiresMcRestart(true));
list.add(new DummyConfigElement<Integer>("imAnInteger", 42, ConfigGuiType.INTEGER, "fml.config.sample.imAnInteger", -1, 256).setRequiresMcRestart(true));
list.add(new DummyConfigElement<Double>("imADouble", 42.4242D, ConfigGuiType.DOUBLE, "fml.config.sample.imADouble", -1.0D, 256.256D).setRequiresMcRestart(true));
list.add(new DummyConfigElement<String>("imAString", "http://www.montypython.net/scripts/string.php", ConfigGuiType.STRING, "fml.config.sample.imAString").setRequiresMcRestart(true));
list.add(new DummyConfigElement("imABoolean", true, ConfigGuiType.BOOLEAN, "fml.config.sample.imABoolean").setRequiresMcRestart(true));
list.add(new DummyConfigElement("imAnInteger", 42, ConfigGuiType.INTEGER, "fml.config.sample.imAnInteger", -1, 256).setRequiresMcRestart(true));
list.add(new DummyConfigElement("imADouble", 42.4242D, ConfigGuiType.DOUBLE, "fml.config.sample.imADouble", -1.0D, 256.256D).setRequiresMcRestart(true));
list.add(new DummyConfigElement("imAString", "http://www.montypython.net/scripts/string.php", ConfigGuiType.STRING, "fml.config.sample.imAString").setRequiresMcRestart(true));
// Lists category
listsList.add(new DummyListElement<Boolean>("booleanList", new Boolean[] {true, false, true, false, true, false, true, false}, ConfigGuiType.BOOLEAN, "fml.config.sample.booleanList"));
listsList.add(new DummyListElement<Boolean>("booleanListFixed", new Boolean[] {true, false, true, false, true, false, true, false}, ConfigGuiType.BOOLEAN, "fml.config.sample.booleanListFixed", true));
listsList.add(new DummyListElement<Boolean>("booleanListMax", new Boolean[] {true, false, true, false, true, false, true, false}, ConfigGuiType.BOOLEAN, "fml.config.sample.booleanListMax", 10));
listsList.add(new DummyListElement<Double>("doubleList", new Double[] {0.0D, 1.1D, 2.2D, 3.3D, 4.4D, 5.5D, 6.6D, 7.7D, 8.8D, 9.9D}, ConfigGuiType.DOUBLE, "fml.config.sample.doubleList"));
listsList.add(new DummyListElement<Double>("doubleListFixed", new Double[] {0.0D, 1.1D, 2.2D, 3.3D, 4.4D, 5.5D, 6.6D, 7.7D, 8.8D, 9.9D}, ConfigGuiType.DOUBLE, "fml.config.sample.doubleListFixed", true));
listsList.add(new DummyListElement<Double>("doubleListMax", new Double[] {0.0D, 1.1D, 2.2D, 3.3D, 4.4D, 5.5D, 6.6D, 7.7D, 8.8D, 9.9D}, ConfigGuiType.DOUBLE, "fml.config.sample.doubleListMax", 15));
listsList.add(new DummyListElement<Double>("doubleListBounded", new Double[] {0.0D, 1.1D, 2.2D, 3.3D, 4.4D, 5.5D, 6.6D, 7.7D, 8.8D, 9.9D}, ConfigGuiType.DOUBLE, "fml.config.sample.doubleListBounded", -1.0D, 10.0D));
listsList.add(new DummyListElement<Integer>("integerList", new Integer[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, ConfigGuiType.INTEGER, "fml.config.sample.integerList"));
listsList.add(new DummyListElement<Integer>("integerListFixed", new Integer[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, ConfigGuiType.INTEGER, "fml.config.sample.integerListFixed", true));
listsList.add(new DummyListElement<Integer>("integerListMax", new Integer[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, ConfigGuiType.INTEGER, "fml.config.sample.integerListMax", 15));
listsList.add(new DummyListElement<Integer>("integerListBounded", new Integer[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, ConfigGuiType.INTEGER, "fml.config.sample.integerListBounded", -1, 10));
listsList.add(new DummyListElement<String>("stringList", new String[] {"An", "array", "of", "string", "values"}, ConfigGuiType.STRING, "fml.config.sample.stringList"));
listsList.add(new DummyListElement<String>("stringListFixed", new String[] {"A", "fixed", "length", "array", "of", "string", "values"}, ConfigGuiType.STRING, "fml.config.sample.stringListFixed", true));
listsList.add(new DummyListElement<String>("stringListMax", new String[] {"An", "array", "of", "string", "values", "with", "a", "max", "length", "of", "15"}, ConfigGuiType.STRING, "fml.config.sample.stringListMax", 15));
listsList.add(new DummyListElement<String>("stringListPattern", new String[] {"Valid", "Not Valid", "Is, Valid", "Comma, Separated, Value"}, ConfigGuiType.STRING, "fml.config.sample.stringListPattern", commaDelimitedPattern));
listsList.add(new DummyListElement("booleanList", new Boolean[] {true, false, true, false, true, false, true, false}, ConfigGuiType.BOOLEAN, "fml.config.sample.booleanList"));
listsList.add(new DummyListElement("booleanListFixed", new Boolean[] {true, false, true, false, true, false, true, false}, ConfigGuiType.BOOLEAN, "fml.config.sample.booleanListFixed", true));
listsList.add(new DummyListElement("booleanListMax", new Boolean[] {true, false, true, false, true, false, true, false}, ConfigGuiType.BOOLEAN, "fml.config.sample.booleanListMax", 10));
listsList.add(new DummyListElement("doubleList", new Double[] {0.0D, 1.1D, 2.2D, 3.3D, 4.4D, 5.5D, 6.6D, 7.7D, 8.8D, 9.9D}, ConfigGuiType.DOUBLE, "fml.config.sample.doubleList"));
listsList.add(new DummyListElement("doubleListFixed", new Double[] {0.0D, 1.1D, 2.2D, 3.3D, 4.4D, 5.5D, 6.6D, 7.7D, 8.8D, 9.9D}, ConfigGuiType.DOUBLE, "fml.config.sample.doubleListFixed", true));
listsList.add(new DummyListElement("doubleListMax", new Double[] {0.0D, 1.1D, 2.2D, 3.3D, 4.4D, 5.5D, 6.6D, 7.7D, 8.8D, 9.9D}, ConfigGuiType.DOUBLE, "fml.config.sample.doubleListMax", 15));
listsList.add(new DummyListElement("doubleListBounded", new Double[] {0.0D, 1.1D, 2.2D, 3.3D, 4.4D, 5.5D, 6.6D, 7.7D, 8.8D, 9.9D}, ConfigGuiType.DOUBLE, "fml.config.sample.doubleListBounded", -1.0D, 10.0D));
listsList.add(new DummyListElement("integerList", new Integer[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, ConfigGuiType.INTEGER, "fml.config.sample.integerList"));
listsList.add(new DummyListElement("integerListFixed", new Integer[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, ConfigGuiType.INTEGER, "fml.config.sample.integerListFixed", true));
listsList.add(new DummyListElement("integerListMax", new Integer[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, ConfigGuiType.INTEGER, "fml.config.sample.integerListMax", 15));
listsList.add(new DummyListElement("integerListBounded", new Integer[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, ConfigGuiType.INTEGER, "fml.config.sample.integerListBounded", -1, 10));
listsList.add(new DummyListElement("stringList", new String[] {"An", "array", "of", "string", "values"}, ConfigGuiType.STRING, "fml.config.sample.stringList"));
listsList.add(new DummyListElement("stringListFixed", new String[] {"A", "fixed", "length", "array", "of", "string", "values"}, ConfigGuiType.STRING, "fml.config.sample.stringListFixed", true));
listsList.add(new DummyListElement("stringListMax", new String[] {"An", "array", "of", "string", "values", "with", "a", "max", "length", "of", "15"}, ConfigGuiType.STRING, "fml.config.sample.stringListMax", 15));
listsList.add(new DummyListElement("stringListPattern", new String[] {"Valid", "Not Valid", "Is, Valid", "Comma, Separated, Value"}, ConfigGuiType.STRING, "fml.config.sample.stringListPattern", commaDelimitedPattern));
list.add(new DummyCategoryElement("lists", "fml.config.sample.ctgy.lists", listsList));
// Strings category
stringsList.add(new DummyConfigElement<String>("basicString", "Just a regular String value, anything goes.", ConfigGuiType.STRING, "fml.config.sample.basicString"));
stringsList.add(new DummyConfigElement<String>("cycleString", "this", ConfigGuiType.STRING, "fml.config.sample.cycleString", new String[] {"this", "property", "cycles", "through", "a", "list", "of", "valid", "choices"}));
stringsList.add(new DummyConfigElement<String>("patternString", "only, comma, separated, words, can, be, entered, in, this, box", ConfigGuiType.STRING, "fml.config.sample.patternString", commaDelimitedPattern));
stringsList.add(new DummyConfigElement<String>("chatColorPicker", "c", ConfigGuiType.COLOR, "fml.config.sample.chatColorPicker", new String[] {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"}));
stringsList.add(new DummyConfigElement<String>("modIDSelector", "FML", ConfigGuiType.MOD_ID, "fml.config.sample.modIDSelector"));
stringsList.add(new DummyConfigElement("basicString", "Just a regular String value, anything goes.", ConfigGuiType.STRING, "fml.config.sample.basicString"));
stringsList.add(new DummyConfigElement("cycleString", "this", ConfigGuiType.STRING, "fml.config.sample.cycleString", new String[] {"this", "property", "cycles", "through", "a", "list", "of", "valid", "choices"}));
stringsList.add(new DummyConfigElement("patternString", "only, comma, separated, words, can, be, entered, in, this, box", ConfigGuiType.STRING, "fml.config.sample.patternString", commaDelimitedPattern));
stringsList.add(new DummyConfigElement("chatColorPicker", "c", ConfigGuiType.COLOR, "fml.config.sample.chatColorPicker", new String[] {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"}));
stringsList.add(new DummyConfigElement("modIDSelector", "FML", ConfigGuiType.MOD_ID, "fml.config.sample.modIDSelector"));
list.add(new DummyCategoryElement("strings", "fml.config.sample.ctgy.strings", stringsList));
// Numbers category
numbersList.add((new DummyConfigElement<Integer>("basicInteger", 42, ConfigGuiType.INTEGER, "fml.config.sample.basicInteger")));
numbersList.add((new DummyConfigElement<Integer>("boundedInteger", 42, ConfigGuiType.INTEGER, "fml.config.sample.boundedInteger", -1, 256)));
numbersList.add((new DummyConfigElement<Integer>("sliderInteger", 2000, ConfigGuiType.INTEGER, "fml.config.sample.sliderInteger", 100, 10000)).setCustomListEntryClass(NumberSliderEntry.class));
numbersList.add(new DummyConfigElement<Double>("basicDouble", 42.4242D, ConfigGuiType.DOUBLE, "fml.config.sample.basicDouble"));
numbersList.add(new DummyConfigElement<Double>("boundedDouble", 42.4242D, ConfigGuiType.DOUBLE, "fml.config.sample.boundedDouble", -1.0D, 256.256D));
numbersList.add(new DummyConfigElement<Double>("sliderDouble", 42.4242D, ConfigGuiType.DOUBLE, "fml.config.sample.sliderDouble", -1.0D, 256.256D).setCustomListEntryClass(NumberSliderEntry.class));
numbersList.add((new DummyConfigElement("basicInteger", 42, ConfigGuiType.INTEGER, "fml.config.sample.basicInteger")));
numbersList.add((new DummyConfigElement("boundedInteger", 42, ConfigGuiType.INTEGER, "fml.config.sample.boundedInteger", -1, 256)));
numbersList.add((new DummyConfigElement("sliderInteger", 2000, ConfigGuiType.INTEGER, "fml.config.sample.sliderInteger", 100, 10000)).setCustomListEntryClass(NumberSliderEntry.class));
numbersList.add(new DummyConfigElement("basicDouble", 42.4242D, ConfigGuiType.DOUBLE, "fml.config.sample.basicDouble"));
numbersList.add(new DummyConfigElement("boundedDouble", 42.4242D, ConfigGuiType.DOUBLE, "fml.config.sample.boundedDouble", -1.0D, 256.256D));
numbersList.add(new DummyConfigElement("sliderDouble", 42.4242D, ConfigGuiType.DOUBLE, "fml.config.sample.sliderDouble", -1.0D, 256.256D).setCustomListEntryClass(NumberSliderEntry.class));
list.add(new DummyCategoryElement("numbers", "fml.config.sample.ctgy.numbers", numbersList));

View file

@ -168,6 +168,7 @@ public class GuiModList extends GuiScreen
}
else
{
@SuppressWarnings("resource")
InputStream logoResource = getClass().getResourceAsStream(logoFile);
if (logoResource != null)
{
@ -193,13 +194,13 @@ public class GuiModList extends GuiScreen
cachedLogoDimensions.width *= scale;
cachedLogoDimensions.height *= scale;
int top = 32;
Tessellator tess = Tessellator.func_178181_a();
WorldRenderer world = tess.func_178180_c();
world.func_178970_b();
world.func_178985_a(offset, top + cachedLogoDimensions.height, zLevel, 0, 1);
world.func_178985_a(offset + cachedLogoDimensions.width, top + cachedLogoDimensions.height, zLevel, 1, 1);
world.func_178985_a(offset + cachedLogoDimensions.width, top, zLevel, 1, 0);
world.func_178985_a(offset, top, zLevel, 0, 0);
Tessellator tess = Tessellator.getInstance();
WorldRenderer world = tess.getWorldRenderer();
world.startDrawingQuads();
world.addVertexWithUV(offset, top + cachedLogoDimensions.height, zLevel, 0, 1);
world.addVertexWithUV(offset + cachedLogoDimensions.width, top + cachedLogoDimensions.height, zLevel, 1, 1);
world.addVertexWithUV(offset + cachedLogoDimensions.width, top, zLevel, 1, 0);
world.addVertexWithUV(offset, top, zLevel, 0, 0);
tess.draw();
shifty += 65;

View file

@ -264,8 +264,8 @@ public abstract class GuiScrollingList
}
this.applyScrollLimits();
Tessellator tess = Tessellator.func_178181_a();
WorldRenderer worldr = tess.func_178180_c();
Tessellator tess = Tessellator.getInstance();
WorldRenderer worldr = tess.getWorldRenderer();
if (this.client.theWorld != null)
{
this.drawGradientRect(this.left, this.top, this.right, this.bottom, -1072689136, -804253680);
@ -277,12 +277,12 @@ public abstract class GuiScrollingList
this.client.renderEngine.bindTexture(Gui.optionsBackground);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
float var17 = 32.0F;
worldr.func_178970_b();
worldr.startDrawingQuads();
worldr.func_178991_c(2105376);
worldr.func_178985_a((double)this.left, (double)this.bottom, 0.0D, (double)((float)this.left / var17), (double)((float)(this.bottom + (int)this.scrollDistance) / var17));
worldr.func_178985_a((double)this.right, (double)this.bottom, 0.0D, (double)((float)this.right / var17), (double)((float)(this.bottom + (int)this.scrollDistance) / var17));
worldr.func_178985_a((double)this.right, (double)this.top, 0.0D, (double)((float)this.right / var17), (double)((float)(this.top + (int)this.scrollDistance) / var17));
worldr.func_178985_a((double)this.left, (double)this.top, 0.0D, (double)((float)this.left / var17), (double)((float)(this.top + (int)this.scrollDistance) / var17));
worldr.addVertexWithUV((double)this.left, (double)this.bottom, 0.0D, (double)((float)this.left / var17), (double)((float)(this.bottom + (int)this.scrollDistance) / var17));
worldr.addVertexWithUV((double)this.right, (double)this.bottom, 0.0D, (double)((float)this.right / var17), (double)((float)(this.bottom + (int)this.scrollDistance) / var17));
worldr.addVertexWithUV((double)this.right, (double)this.top, 0.0D, (double)((float)this.right / var17), (double)((float)(this.top + (int)this.scrollDistance) / var17));
worldr.addVertexWithUV((double)this.left, (double)this.top, 0.0D, (double)((float)this.left / var17), (double)((float)(this.top + (int)this.scrollDistance) / var17));
tess.draw();
}
// boxRight = this.listWidth / 2 - 92 - 16;
@ -308,17 +308,17 @@ public abstract class GuiScrollingList
int var15 = boxRight;
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glDisable(GL11.GL_TEXTURE_2D);
worldr.func_178970_b();
worldr.startDrawingQuads();
worldr.func_178991_c(8421504);
worldr.func_178985_a((double)var14, (double)(var19 + var13 + 2), 0.0D, 0.0D, 1.0D);
worldr.func_178985_a((double)var15, (double)(var19 + var13 + 2), 0.0D, 1.0D, 1.0D);
worldr.func_178985_a((double)var15, (double)(var19 - 2), 0.0D, 1.0D, 0.0D);
worldr.func_178985_a((double)var14, (double)(var19 - 2), 0.0D, 0.0D, 0.0D);
worldr.addVertexWithUV((double)var14, (double)(var19 + var13 + 2), 0.0D, 0.0D, 1.0D);
worldr.addVertexWithUV((double)var15, (double)(var19 + var13 + 2), 0.0D, 1.0D, 1.0D);
worldr.addVertexWithUV((double)var15, (double)(var19 - 2), 0.0D, 1.0D, 0.0D);
worldr.addVertexWithUV((double)var14, (double)(var19 - 2), 0.0D, 0.0D, 0.0D);
worldr.func_178991_c(0);
worldr.func_178985_a((double)(var14 + 1), (double)(var19 + var13 + 1), 0.0D, 0.0D, 1.0D);
worldr.func_178985_a((double)(var15 - 1), (double)(var19 + var13 + 1), 0.0D, 1.0D, 1.0D);
worldr.func_178985_a((double)(var15 - 1), (double)(var19 - 1), 0.0D, 1.0D, 0.0D);
worldr.func_178985_a((double)(var14 + 1), (double)(var19 - 1), 0.0D, 0.0D, 0.0D);
worldr.addVertexWithUV((double)(var14 + 1), (double)(var19 + var13 + 1), 0.0D, 0.0D, 1.0D);
worldr.addVertexWithUV((double)(var15 - 1), (double)(var19 + var13 + 1), 0.0D, 1.0D, 1.0D);
worldr.addVertexWithUV((double)(var15 - 1), (double)(var19 - 1), 0.0D, 1.0D, 0.0D);
worldr.addVertexWithUV((double)(var14 + 1), (double)(var19 - 1), 0.0D, 0.0D, 0.0D);
tess.draw();
GL11.glEnable(GL11.GL_TEXTURE_2D);
}
@ -339,21 +339,21 @@ public abstract class GuiScrollingList
GL11.glDisable(GL11.GL_ALPHA_TEST);
GL11.glShadeModel(GL11.GL_SMOOTH);
GL11.glDisable(GL11.GL_TEXTURE_2D);
worldr.func_178970_b();
worldr.startDrawingQuads();
worldr.func_178974_a(0, 0);
worldr.func_178985_a((double)this.left, (double)(this.top + var20), 0.0D, 0.0D, 1.0D);
worldr.func_178985_a((double)this.right, (double)(this.top + var20), 0.0D, 1.0D, 1.0D);
worldr.addVertexWithUV((double)this.left, (double)(this.top + var20), 0.0D, 0.0D, 1.0D);
worldr.addVertexWithUV((double)this.right, (double)(this.top + var20), 0.0D, 1.0D, 1.0D);
worldr.func_178974_a(0, 255);
worldr.func_178985_a((double)this.right, (double)this.top, 0.0D, 1.0D, 0.0D);
worldr.func_178985_a((double)this.left, (double)this.top, 0.0D, 0.0D, 0.0D);
worldr.addVertexWithUV((double)this.right, (double)this.top, 0.0D, 1.0D, 0.0D);
worldr.addVertexWithUV((double)this.left, (double)this.top, 0.0D, 0.0D, 0.0D);
tess.draw();
worldr.func_178970_b();
worldr.startDrawingQuads();
worldr.func_178974_a(0, 255);
worldr.func_178985_a((double)this.left, (double)this.bottom, 0.0D, 0.0D, 1.0D);
worldr.func_178985_a((double)this.right, (double)this.bottom, 0.0D, 1.0D, 1.0D);
worldr.addVertexWithUV((double)this.left, (double)this.bottom, 0.0D, 0.0D, 1.0D);
worldr.addVertexWithUV((double)this.right, (double)this.bottom, 0.0D, 1.0D, 1.0D);
worldr.func_178974_a(0, 0);
worldr.func_178985_a((double)this.right, (double)(this.bottom - var20), 0.0D, 1.0D, 0.0D);
worldr.func_178985_a((double)this.left, (double)(this.bottom - var20), 0.0D, 0.0D, 0.0D);
worldr.addVertexWithUV((double)this.right, (double)(this.bottom - var20), 0.0D, 1.0D, 0.0D);
worldr.addVertexWithUV((double)this.left, (double)(this.bottom - var20), 0.0D, 0.0D, 0.0D);
tess.draw();
var19 = this.getContentHeight() - (this.bottom - this.top - 4);
@ -378,26 +378,26 @@ public abstract class GuiScrollingList
var14 = this.top;
}
worldr.func_178970_b();
worldr.startDrawingQuads();
worldr.func_178974_a(0, 255);
worldr.func_178985_a((double)scrollBarXStart, (double)this.bottom, 0.0D, 0.0D, 1.0D);
worldr.func_178985_a((double)scrollBarXEnd, (double)this.bottom, 0.0D, 1.0D, 1.0D);
worldr.func_178985_a((double)scrollBarXEnd, (double)this.top, 0.0D, 1.0D, 0.0D);
worldr.func_178985_a((double)scrollBarXStart, (double)this.top, 0.0D, 0.0D, 0.0D);
worldr.addVertexWithUV((double)scrollBarXStart, (double)this.bottom, 0.0D, 0.0D, 1.0D);
worldr.addVertexWithUV((double)scrollBarXEnd, (double)this.bottom, 0.0D, 1.0D, 1.0D);
worldr.addVertexWithUV((double)scrollBarXEnd, (double)this.top, 0.0D, 1.0D, 0.0D);
worldr.addVertexWithUV((double)scrollBarXStart, (double)this.top, 0.0D, 0.0D, 0.0D);
tess.draw();
worldr.func_178970_b();
worldr.startDrawingQuads();
worldr.func_178974_a(8421504, 255);
worldr.func_178985_a((double)scrollBarXStart, (double)(var14 + var13), 0.0D, 0.0D, 1.0D);
worldr.func_178985_a((double)scrollBarXEnd, (double)(var14 + var13), 0.0D, 1.0D, 1.0D);
worldr.func_178985_a((double)scrollBarXEnd, (double)var14, 0.0D, 1.0D, 0.0D);
worldr.func_178985_a((double)scrollBarXStart, (double)var14, 0.0D, 0.0D, 0.0D);
worldr.addVertexWithUV((double)scrollBarXStart, (double)(var14 + var13), 0.0D, 0.0D, 1.0D);
worldr.addVertexWithUV((double)scrollBarXEnd, (double)(var14 + var13), 0.0D, 1.0D, 1.0D);
worldr.addVertexWithUV((double)scrollBarXEnd, (double)var14, 0.0D, 1.0D, 0.0D);
worldr.addVertexWithUV((double)scrollBarXStart, (double)var14, 0.0D, 0.0D, 0.0D);
tess.draw();
worldr.func_178970_b();
worldr.startDrawingQuads();
worldr.func_178974_a(12632256, 255);
worldr.func_178985_a((double)scrollBarXStart, (double)(var14 + var13 - 1), 0.0D, 0.0D, 1.0D);
worldr.func_178985_a((double)(scrollBarXEnd - 1), (double)(var14 + var13 - 1), 0.0D, 1.0D, 1.0D);
worldr.func_178985_a((double)(scrollBarXEnd - 1), (double)var14, 0.0D, 1.0D, 0.0D);
worldr.func_178985_a((double)scrollBarXStart, (double)var14, 0.0D, 0.0D, 0.0D);
worldr.addVertexWithUV((double)scrollBarXStart, (double)(var14 + var13 - 1), 0.0D, 0.0D, 1.0D);
worldr.addVertexWithUV((double)(scrollBarXEnd - 1), (double)(var14 + var13 - 1), 0.0D, 1.0D, 1.0D);
worldr.addVertexWithUV((double)(scrollBarXEnd - 1), (double)var14, 0.0D, 1.0D, 0.0D);
worldr.addVertexWithUV((double)scrollBarXStart, (double)var14, 0.0D, 0.0D, 0.0D);
tess.draw();
}
@ -410,18 +410,18 @@ public abstract class GuiScrollingList
private void overlayBackground(int p_22239_1_, int p_22239_2_, int p_22239_3_, int p_22239_4_)
{
Tessellator var5 = Tessellator.func_178181_a();
WorldRenderer worldr = var5.func_178180_c();
Tessellator var5 = Tessellator.getInstance();
WorldRenderer worldr = var5.getWorldRenderer();
this.client.renderEngine.bindTexture(Gui.optionsBackground);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
float var6 = 32.0F;
worldr.func_178970_b();
worldr.startDrawingQuads();
worldr.func_178974_a(4210752, p_22239_4_);
worldr.func_178985_a(0.0D, (double)p_22239_2_, 0.0D, 0.0D, (double)((float)p_22239_2_ / var6));
worldr.func_178985_a((double)this.listWidth + 30, (double)p_22239_2_, 0.0D, (double)((float)(this.listWidth + 30) / var6), (double)((float)p_22239_2_ / var6));
worldr.addVertexWithUV(0.0D, (double)p_22239_2_, 0.0D, 0.0D, (double)((float)p_22239_2_ / var6));
worldr.addVertexWithUV((double)this.listWidth + 30, (double)p_22239_2_, 0.0D, (double)((float)(this.listWidth + 30) / var6), (double)((float)p_22239_2_ / var6));
worldr.func_178974_a(4210752, p_22239_3_);
worldr.func_178985_a((double)this.listWidth + 30, (double)p_22239_1_, 0.0D, (double)((float)(this.listWidth + 30) / var6), (double)((float)p_22239_1_ / var6));
worldr.func_178985_a(0.0D, (double)p_22239_1_, 0.0D, 0.0D, (double)((float)p_22239_1_ / var6));
worldr.addVertexWithUV((double)this.listWidth + 30, (double)p_22239_1_, 0.0D, (double)((float)(this.listWidth + 30) / var6), (double)((float)p_22239_1_ / var6));
worldr.addVertexWithUV(0.0D, (double)p_22239_1_, 0.0D, 0.0D, (double)((float)p_22239_1_ / var6));
var5.draw();
}
@ -440,15 +440,15 @@ public abstract class GuiScrollingList
GL11.glDisable(GL11.GL_ALPHA_TEST);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
GL11.glShadeModel(GL11.GL_SMOOTH);
Tessellator tessellator = Tessellator.func_178181_a();
WorldRenderer worldrenderer = tessellator.func_178180_c();
worldrenderer.func_178970_b();
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
worldrenderer.startDrawingQuads();
worldrenderer.func_178960_a(f1, f2, f3, f);
worldrenderer.func_178984_b((double)par3, (double)par2, 0.0D);
worldrenderer.func_178984_b((double)par1, (double)par2, 0.0D);
worldrenderer.addVertex((double)par3, (double)par2, 0.0D);
worldrenderer.addVertex((double)par1, (double)par2, 0.0D);
worldrenderer.func_178960_a(f5, f6, f7, f4);
worldrenderer.func_178984_b((double)par1, (double)par4, 0.0D);
worldrenderer.func_178984_b((double)par3, (double)par4, 0.0D);
worldrenderer.addVertex((double)par1, (double)par4, 0.0D);
worldrenderer.addVertex((double)par3, (double)par4, 0.0D);
tessellator.draw();
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glDisable(GL11.GL_BLEND);

View file

@ -29,7 +29,7 @@ import net.minecraftforge.fml.client.config.GuiEditArrayEntries.IArrayEntry;
*
* @author bspkrs
*/
public class DummyConfigElement<T> implements IConfigElement<T>
public class DummyConfigElement implements IConfigElement
{
protected boolean isProperty = true;
protected boolean isList = false;
@ -38,19 +38,17 @@ public class DummyConfigElement<T> implements IConfigElement<T>
protected String langKey;
protected Object value;
protected Object defaultValue;
protected T[] values;
protected T[] defaultValues;
protected Object[] values;
protected Object[] defaultValues;
protected String[] validValues;
protected Pattern validStringPattern;
protected T minValue;
protected T maxValue;
protected Object minValue;
protected Object maxValue;
protected boolean requiresWorldRestart = false;
protected boolean requiresMcRestart = false;
protected boolean isListFixedLength = false;
protected int maxListLength = -1;
@SuppressWarnings("rawtypes")
protected List<IConfigElement> childElements;
@SuppressWarnings("rawtypes")
protected Class<? extends IConfigEntry> configEntryClass;
protected Class<? extends IArrayEntry> arrayEntryClass;
@ -58,24 +56,21 @@ public class DummyConfigElement<T> implements IConfigElement<T>
* This class provides a Dummy Category IConfigElement. It can be used to define a custom list of GUI entries that will
* appear on the child screen or to specify a custom IGuiConfigListEntryfor a special category.
*/
public static class DummyCategoryElement<T> extends DummyConfigElement<T>
public static class DummyCategoryElement extends DummyConfigElement
{
@SuppressWarnings("rawtypes")
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)
{
this(name, langKey, new ArrayList<IConfigElement>(), customListEntryClass);
}
@SuppressWarnings("rawtypes")
public DummyCategoryElement(String name, String langKey, List<IConfigElement> childElements, Class<? extends IConfigEntry> customListEntryClass)
{
super(name, (T) null, ConfigGuiType.CONFIG_CATEGORY, langKey);
super(name, (Object) null, ConfigGuiType.CONFIG_CATEGORY, langKey);
this.childElements = childElements;
this.configEntryClass = customListEntryClass;
isProperty = false;
@ -85,11 +80,11 @@ public class DummyConfigElement<T> implements IConfigElement<T>
/**
* This class provides a dummy array-type IConfigElement.
*/
public static class DummyListElement<T> extends DummyConfigElement<T>
public static class DummyListElement extends DummyConfigElement
{
public DummyListElement(String name, T[] defaultValues, ConfigGuiType type, String langKey, boolean isListFixedLength, int maxListLength, Pattern validStringPattern, T minValue, T maxValue)
public DummyListElement(String name, Object[] defaultValues, ConfigGuiType type, String langKey, boolean isListFixedLength, int maxListLength, Pattern validStringPattern, Object minValue, Object maxValue)
{
super(name, (T) null, type, langKey, minValue, maxValue);
super(name, (Object) null, type, langKey, minValue, maxValue);
this.defaultValues = defaultValues;
this.values = defaultValues;
this.isListFixedLength = isListFixedLength;
@ -98,57 +93,56 @@ public class DummyConfigElement<T> implements IConfigElement<T>
isList = true;
}
public DummyListElement(String name, T[] defaultValues, ConfigGuiType type, String langKey)
public DummyListElement(String name, Object[] defaultValues, ConfigGuiType type, String langKey)
{
this(name, defaultValues, type, langKey, false, -1, (Pattern) null, (T) null, (T) null);
this(name, defaultValues, type, langKey, false, -1, (Pattern) null, (Object) null, (Object) null);
}
public DummyListElement(String name, T[] defaultValues, ConfigGuiType type, String langKey, boolean isListFixedLength)
public DummyListElement(String name, Object[] defaultValues, ConfigGuiType type, String langKey, boolean isListFixedLength)
{
this(name, defaultValues, type, langKey, isListFixedLength, -1, (Pattern) null, (T) null, (T) null);
this(name, defaultValues, type, langKey, isListFixedLength, -1, (Pattern) null, (Object) null, (Object) null);
}
public DummyListElement(String name, T[] defaultValues, ConfigGuiType type, String langKey, int maxListLength)
public DummyListElement(String name, Object[] defaultValues, ConfigGuiType type, String langKey, int maxListLength)
{
this(name, defaultValues, type, langKey, false, maxListLength, (Pattern) null, (T) null, (T) null);
this(name, defaultValues, type, langKey, false, maxListLength, (Pattern) null, (Object) null, (Object) null);
}
public DummyListElement(String name, T[] defaultValues, ConfigGuiType type, String langKey, T minValue, T maxValue)
public DummyListElement(String name, Object[] defaultValues, ConfigGuiType type, String langKey, Object minValue, Object maxValue)
{
this(name, defaultValues, type, langKey, false, -1, (Pattern) null, minValue, maxValue);
}
public DummyListElement(String name, T[] defaultValues, ConfigGuiType type, String langKey, boolean isListFixedLength, T minValue, T maxValue)
public DummyListElement(String name, Object[] defaultValues, ConfigGuiType type, String langKey, boolean isListFixedLength, Object minValue, Object maxValue)
{
this(name, defaultValues, type, langKey, isListFixedLength, -1, (Pattern) null, minValue, maxValue);
}
public DummyListElement(String name, T[] defaultValues, ConfigGuiType type, String langKey, int maxListLength, T minValue, T maxValue)
public DummyListElement(String name, Object[] defaultValues, ConfigGuiType type, String langKey, int maxListLength, Object minValue, Object maxValue)
{
this(name, defaultValues, type, langKey, false, maxListLength, (Pattern) null, minValue, maxValue);
}
public DummyListElement(String name, T[] defaultValues, ConfigGuiType type, String langKey, boolean isListFixedLength, int maxListLength, T minValue, T maxValue)
public DummyListElement(String name, Object[] defaultValues, ConfigGuiType type, String langKey, boolean isListFixedLength, int maxListLength, Object minValue, Object maxValue)
{
this(name, defaultValues, type, langKey, isListFixedLength, maxListLength, (Pattern) null, minValue, maxValue);
}
public DummyListElement(String name, T[] defaultValues, ConfigGuiType type, String langKey, Pattern validStringPattern)
public DummyListElement(String name, Object[] defaultValues, ConfigGuiType type, String langKey, Pattern validStringPattern)
{
this(name, defaultValues, type, langKey, false, -1, validStringPattern, (T) null, (T) null);
this(name, defaultValues, type, langKey, false, -1, validStringPattern, (Object) null, (Object) null);
}
public DummyListElement(String name, T[] defaultValues, ConfigGuiType type, String langKey, boolean isListFixedLength, Pattern validStringPattern)
public DummyListElement(String name, Object[] defaultValues, ConfigGuiType type, String langKey, boolean isListFixedLength, Pattern validStringPattern)
{
this(name, defaultValues, type, langKey, isListFixedLength, -1, validStringPattern, (T) null, (T) null);
this(name, defaultValues, type, langKey, isListFixedLength, -1, validStringPattern, (Object) null, (Object) null);
}
public DummyListElement(String name, T[] defaultValues, ConfigGuiType type, String langKey, int maxListLength, Pattern validStringPattern)
public DummyListElement(String name, Object[] defaultValues, ConfigGuiType type, String langKey, int maxListLength, Pattern validStringPattern)
{
this(name, defaultValues, type, langKey, false, maxListLength, validStringPattern, (T) null, (T) null);
this(name, defaultValues, type, langKey, false, maxListLength, validStringPattern, (Object) null, (Object) null);
}
@SuppressWarnings("rawtypes")
public DummyListElement setCustomEditListEntryClass(Class<? extends IArrayEntry> clazz)
{
this.arrayEntryClass = clazz;
@ -162,8 +156,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, Object defaultValue, ConfigGuiType type, String langKey, String[] validValues, Pattern validStringPattern, Object minValue, Object maxValue)
{
this.name = name;
this.defaultValue = defaultValue;
@ -175,44 +168,43 @@ public class DummyConfigElement<T> implements IConfigElement<T>
if (minValue == null)
{
if (type == ConfigGuiType.INTEGER)
this.minValue = (T) (Integer) Integer.MIN_VALUE;
this.minValue = (Integer) Integer.MIN_VALUE;
else if (type == ConfigGuiType.DOUBLE)
this.minValue = (T) (Double) (-Double.MAX_VALUE);
this.minValue = (Double) (-Double.MAX_VALUE);
}
else
this.minValue = minValue;
if (maxValue == null)
{
if (type == ConfigGuiType.INTEGER)
this.maxValue = (T) (Integer) Integer.MAX_VALUE;
this.maxValue = (Integer) Integer.MAX_VALUE;
else if (type == ConfigGuiType.DOUBLE)
this.maxValue = (T) (Double) Double.MAX_VALUE;
this.maxValue = (Double) Double.MAX_VALUE;
}
else
this.maxValue = maxValue;
}
public DummyConfigElement(String name, T defaultValue, ConfigGuiType type, String langKey, Pattern validStringPattern)
public DummyConfigElement(String name, Object defaultValue, ConfigGuiType type, String langKey, Pattern validStringPattern)
{
this(name, defaultValue, type, langKey, (String[]) null, validStringPattern, (T) null, (T) null);
this(name, defaultValue, type, langKey, (String[]) null, validStringPattern, (Object) null, (Object) null);
}
public DummyConfigElement(String name, T defaultValue, ConfigGuiType type, String langKey, String[] validValues)
public DummyConfigElement(String name, Object defaultValue, ConfigGuiType type, String langKey, String[] validValues)
{
this(name, defaultValue, type, langKey, validValues, (Pattern) null, (T) null, (T) null);
this(name, defaultValue, type, langKey, validValues, (Pattern) null, (Object) null, (Object) null);
}
public DummyConfigElement(String name, T defaultValue, ConfigGuiType type, String langKey)
public DummyConfigElement(String name, Object defaultValue, ConfigGuiType type, String langKey)
{
this(name, defaultValue, type, langKey, (String[]) null, (Pattern) null, (T) null, (T) null);
this(name, defaultValue, type, langKey, (String[]) null, (Pattern) null, (Object) null, (Object) null);
}
public DummyConfigElement(String name, T defaultValue, ConfigGuiType type, String langKey, T minValue, T maxValue)
public DummyConfigElement(String name, Object defaultValue, ConfigGuiType type, String langKey, Object minValue, Object maxValue)
{
this(name, defaultValue, type, langKey, (String[]) null, (Pattern) null, minValue, maxValue);
}
@SuppressWarnings("rawtypes")
public DummyConfigElement setCustomListEntryClass(Class<? extends IConfigEntry> clazz)
{
this.configEntryClass = clazz;
@ -225,21 +217,18 @@ public class DummyConfigElement<T> implements IConfigElement<T>
return isProperty;
}
@SuppressWarnings("rawtypes")
public IConfigElement setConfigEntryClass(Class<? extends IConfigEntry> clazz)
{
this.configEntryClass = clazz;
return this;
}
@SuppressWarnings("rawtypes")
@Override
public Class<? extends IConfigEntry> getConfigEntryClass()
{
return configEntryClass;
}
@SuppressWarnings("rawtypes")
public IConfigElement setArrayEntryClass(Class<? extends IArrayEntry> clazz)
{
this.arrayEntryClass = clazz;
@ -276,7 +265,6 @@ public class DummyConfigElement<T> implements IConfigElement<T>
return I18n.format(langKey + ".tooltip");
}
@SuppressWarnings("rawtypes")
@Override
public List<IConfigElement> getChildElements()
{
@ -335,7 +323,7 @@ public class DummyConfigElement<T> implements IConfigElement<T>
}
@Override
public T[] getDefaults()
public Object[] getDefaults()
{
return defaultValues;
}
@ -349,7 +337,7 @@ public class DummyConfigElement<T> implements IConfigElement<T>
this.value = defaultValue;
}
public IConfigElement<T> setRequiresWorldRestart(boolean requiresWorldRestart)
public IConfigElement setRequiresWorldRestart(boolean requiresWorldRestart)
{
this.requiresWorldRestart = requiresWorldRestart;
return this;
@ -367,7 +355,7 @@ public class DummyConfigElement<T> implements IConfigElement<T>
return true;
}
public IConfigElement<T> setRequiresMcRestart(boolean requiresMcRestart)
public IConfigElement setRequiresMcRestart(boolean requiresMcRestart)
{
this.requiresMcRestart = this.requiresWorldRestart = requiresMcRestart;
return this;
@ -398,31 +386,31 @@ public class DummyConfigElement<T> implements IConfigElement<T>
}
@Override
public T[] getList()
public Object[] getList()
{
return values;
}
@Override
public void set(T value)
public void set(Object value)
{
defaultValue = value;
}
@Override
public void set(T[] aVal)
public void set(Object[] aVal)
{
defaultValues = aVal;
}
@Override
public T getMinValue()
public Object getMinValue()
{
return minValue;
}
@Override
public T getMaxValue()
public Object getMaxValue()
{
return maxValue;
}

View file

@ -48,14 +48,12 @@ public class GuiConfig extends GuiScreen
public final GuiScreen parentScreen;
public String title = "Config GUI";
public String titleLine2;
@SuppressWarnings("rawtypes")
public final List<IConfigElement> configElements;
@SuppressWarnings("rawtypes")
public final List<IConfigEntry> initEntries;
public GuiConfigEntries entryList;
private GuiButtonExt btnDefaultAll;
private GuiButtonExt btnUndoAll;
private GuiCheckBox chkApplyGlobally;
protected GuiButtonExt btnDefaultAll;
protected GuiButtonExt btnUndoAll;
protected GuiCheckBox chkApplyGlobally;
public final String modID;
/**
* When set to a non-null value the OnConfigChanged and PostConfigChanged events will be posted when the Done button is pressed
@ -67,9 +65,9 @@ public class GuiConfig extends GuiScreen
public final boolean allRequireWorldRestart;
public final boolean allRequireMcRestart;
public boolean needsRefresh = true;
private HoverChecker undoHoverChecker;
private HoverChecker resetHoverChecker;
private HoverChecker checkBoxHoverChecker;
protected HoverChecker undoHoverChecker;
protected HoverChecker resetHoverChecker;
protected HoverChecker checkBoxHoverChecker;
/**
* GuiConfig constructor that will use ConfigChangedEvent when editing is concluded. If a non-null value is passed for configID,
@ -87,7 +85,6 @@ 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.
*/
@SuppressWarnings("rawtypes")
public GuiConfig(GuiScreen parentScreen, List<IConfigElement> configElements, String modID, String configID,
boolean allRequireWorldRestart, boolean allRequireMcRestart, String title)
{
@ -106,7 +103,6 @@ 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.
*/
@SuppressWarnings("rawtypes")
public GuiConfig(GuiScreen parentScreen, List<IConfigElement> configElements, String modID,
boolean allRequireWorldRestart, boolean allRequireMcRestart, String title)
{
@ -127,7 +123,6 @@ 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.
*/
@SuppressWarnings("rawtypes")
public GuiConfig(GuiScreen parentScreen, List<IConfigElement> configElements, String modID,
boolean allRequireWorldRestart, boolean allRequireMcRestart, String title, String titleLine2)
{
@ -151,7 +146,6 @@ 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.
*/
@SuppressWarnings("rawtypes")
public GuiConfig(GuiScreen parentScreen, List<IConfigElement> configElements, String modID, String configID,
boolean allRequireWorldRestart, boolean allRequireMcRestart, String title, String titleLine2)
{
@ -280,6 +274,12 @@ public class GuiConfig extends GuiScreen
}
}
public void handleMouseInput() throws IOException
{
super.handleMouseInput();
this.entryList.func_178039_p();
}
@Override
protected void mouseClicked(int x, int y, int mouseEvent) throws IOException
{

View file

@ -24,7 +24,6 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiListExtended;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.resources.I18n;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.fml.common.FMLLog;
@ -43,7 +42,6 @@ public class GuiConfigEntries extends GuiListExtended
{
public final GuiConfig owningScreen;
public final Minecraft mc;
@SuppressWarnings("rawtypes")
public List<IConfigEntry> listEntries;
/**
* The max width of the label of all IConfigEntry objects.
@ -74,7 +72,6 @@ public class GuiConfigEntries extends GuiListExtended
*/
public int scrollBarX;
@SuppressWarnings({ "rawtypes", "unchecked" })
public GuiConfigEntries(GuiConfig parent, Minecraft mc)
{
super(mc, parent.width, parent.height, parent.titleLine2 != null ? 33 : 23, parent.height - 32, 20);
@ -82,8 +79,6 @@ public class GuiConfigEntries extends GuiListExtended
this.setShowSelectionBox(false);
this.mc = mc;
this.listEntries = new ArrayList<IConfigEntry>();
// int i = 0;
// String s = null;
for (IConfigElement configElement : parent.configElements)
{
@ -133,17 +128,17 @@ public class GuiConfigEntries extends GuiListExtended
if (configElement.isList())
this.listEntries.add(new GuiConfigEntries.ArrayEntry(this.owningScreen, this, configElement));
else if (configElement.getType() == ConfigGuiType.BOOLEAN)
this.listEntries.add(new GuiConfigEntries.BooleanEntry(this.owningScreen, this, (IConfigElement<Boolean>) configElement));
this.listEntries.add(new GuiConfigEntries.BooleanEntry(this.owningScreen, this, configElement));
else if (configElement.getType() == ConfigGuiType.INTEGER)
this.listEntries.add(new GuiConfigEntries.IntegerEntry(this.owningScreen, this, (IConfigElement<Integer>) configElement));
this.listEntries.add(new GuiConfigEntries.IntegerEntry(this.owningScreen, this, configElement));
else if (configElement.getType() == ConfigGuiType.DOUBLE)
this.listEntries.add(new GuiConfigEntries.DoubleEntry(this.owningScreen, this, (IConfigElement<Double>) configElement));
this.listEntries.add(new GuiConfigEntries.DoubleEntry(this.owningScreen, this, configElement));
else if (configElement.getType() == ConfigGuiType.COLOR)
{
if (configElement.getValidValues() != null && configElement.getValidValues().length > 0)
this.listEntries.add(new GuiConfigEntries.ChatColorEntry(this.owningScreen, this, (IConfigElement<String>) configElement));
this.listEntries.add(new GuiConfigEntries.ChatColorEntry(this.owningScreen, this, configElement));
else
this.listEntries.add(new GuiConfigEntries.StringEntry(this.owningScreen, this, (IConfigElement<String>) configElement));
this.listEntries.add(new GuiConfigEntries.StringEntry(this.owningScreen, this, configElement));
}
else if (configElement.getType() == ConfigGuiType.MOD_ID)
{
@ -151,14 +146,14 @@ public class GuiConfigEntries extends GuiListExtended
for (ModContainer mod : Loader.instance().getActiveModList())
values.put(mod.getModId(), mod.getName());
values.put("minecraft", "Minecraft");
this.listEntries.add(new SelectValueEntry(this.owningScreen, this, (IConfigElement<String>) configElement, values));
this.listEntries.add(new SelectValueEntry(this.owningScreen, this, configElement, values));
}
else if (configElement.getType() == ConfigGuiType.STRING)
{
if (configElement.getValidValues() != null && configElement.getValidValues().length > 0)
this.listEntries.add(new GuiConfigEntries.CycleValueEntry(this.owningScreen, this, (IConfigElement<String>) configElement));
this.listEntries.add(new GuiConfigEntries.CycleValueEntry(this.owningScreen, this, configElement));
else
this.listEntries.add(new GuiConfigEntries.StringEntry(this.owningScreen, this, (IConfigElement<String>) configElement));
this.listEntries.add(new GuiConfigEntries.StringEntry(this.owningScreen, this, configElement));
}
}
else if (configElement.getType() == ConfigGuiType.CONFIG_CATEGORY)
@ -167,7 +162,6 @@ public class GuiConfigEntries extends GuiListExtended
}
}
@SuppressWarnings("rawtypes")
protected void initGui()
{
this.width = owningScreen.width;
@ -205,7 +199,6 @@ public class GuiConfigEntries extends GuiListExtended
/**
* Gets the IGuiListEntry object for the given index
*/
@SuppressWarnings("rawtypes")
@Override
public IConfigEntry getListEntry(int index)
{
@ -230,7 +223,6 @@ 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)
{
for (IConfigEntry entry : this.listEntries)
@ -241,7 +233,6 @@ public class GuiConfigEntries extends GuiListExtended
* This method is a pass-through for IConfigEntry objects that contain GuiTextField elements. Called from the parent GuiConfig
* screen.
*/
@SuppressWarnings("rawtypes")
public void updateScreen()
{
for (IConfigEntry entry : this.listEntries)
@ -252,7 +243,6 @@ public class GuiConfigEntries extends GuiListExtended
* This method is a pass-through for IConfigEntry objects that contain GuiTextField elements. Called from the parent GuiConfig
* screen.
*/
@SuppressWarnings("rawtypes")
public void mouseClicked(int mouseX, int mouseY, int mouseEvent)
{
for (IConfigEntry entry : this.listEntries)
@ -262,7 +252,6 @@ 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()
{
for (IConfigEntry entry : this.listEntries)
@ -273,7 +262,6 @@ 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.
*/
@SuppressWarnings("rawtypes")
public boolean saveConfigElements()
{
boolean requiresRestart = false;
@ -288,7 +276,6 @@ 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.
*/
@SuppressWarnings("rawtypes")
public boolean areAllEntriesDefault(boolean includeChildren)
{
for (IConfigEntry entry : this.listEntries)
@ -302,7 +289,6 @@ 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.
*/
@SuppressWarnings("rawtypes")
public void setAllToDefault(boolean includeChildren)
{
for (IConfigEntry entry : this.listEntries)
@ -314,7 +300,6 @@ 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.
*/
@SuppressWarnings("rawtypes")
public boolean hasChangedEntry(boolean includeChildren)
{
for (IConfigEntry entry : this.listEntries)
@ -328,7 +313,6 @@ 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.
*/
@SuppressWarnings("rawtypes")
public boolean areAnyEntriesEnabled(boolean includeChildren)
{
for (IConfigEntry entry : this.listEntries)
@ -342,7 +326,6 @@ 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.
*/
@SuppressWarnings("rawtypes")
public void undoAllChanges(boolean includeChildren)
{
for (IConfigEntry entry : this.listEntries)
@ -354,7 +337,6 @@ 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.
*/
@SuppressWarnings("rawtypes")
public void drawScreenPost(int mouseX, int mouseY, float partialTicks)
{
for (IConfigEntry entry : this.listEntries)
@ -371,7 +353,7 @@ public class GuiConfigEntries extends GuiListExtended
protected final boolean beforeValue;
protected boolean currentValue;
private BooleanEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement<Boolean> configElement)
private BooleanEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement)
{
super(owningScreen, owningEntryList, configElement);
this.beforeValue = Boolean.valueOf(configElement.get().toString());
@ -426,7 +408,6 @@ public class GuiConfigEntries extends GuiListExtended
}
}
@SuppressWarnings("unchecked")
@Override
public boolean saveConfigElement()
{
@ -463,7 +444,7 @@ public class GuiConfigEntries extends GuiListExtended
protected final int defaultIndex;
protected int currentIndex;
private CycleValueEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement<String> configElement)
private CycleValueEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement)
{
super(owningScreen, owningEntryList, configElement);
beforeIndex = getIndex(configElement.get().toString());
@ -534,7 +515,6 @@ public class GuiConfigEntries extends GuiListExtended
}
}
@SuppressWarnings("unchecked")
@Override
public boolean saveConfigElement()
{
@ -566,7 +546,7 @@ public class GuiConfigEntries extends GuiListExtended
*/
public static class ChatColorEntry extends CycleValueEntry
{
ChatColorEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement<String> configElement)
ChatColorEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement)
{
super(owningScreen, owningEntryList, configElement);
this.btnValue.enabled = enabled();
@ -574,10 +554,10 @@ public class GuiConfigEntries extends GuiListExtended
}
@Override
public void func_180790_a(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected)
public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected)
{
this.btnValue.packedFGColour = GuiUtils.getColorCode(this.configElement.getValidValues()[currentIndex].charAt(0), true);
super.func_180790_a(slotIndex, x, y, listWidth, slotHeight, mouseX, mouseY, isSelected);
super.drawEntry(slotIndex, x, y, listWidth, slotHeight, mouseX, mouseY, isSelected);
}
@Override
@ -600,7 +580,7 @@ public class GuiConfigEntries extends GuiListExtended
protected Object currentValue;
protected Map<Object, String> selectableValues;
public SelectValueEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement<String> configElement, Map<Object, String> selectableValues)
public SelectValueEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement, Map<Object, String> selectableValues)
{
super(owningScreen, owningEntryList, configElement);
beforeValue = configElement.get().toString();
@ -668,7 +648,6 @@ public class GuiConfigEntries extends GuiListExtended
}
}
@SuppressWarnings("unchecked")
@Override
public boolean saveConfigElement()
{
@ -704,7 +683,6 @@ public class GuiConfigEntries extends GuiListExtended
protected final Object[] beforeValues;
protected Object[] currentValues;
@SuppressWarnings("rawtypes")
public ArrayEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement)
{
super(owningScreen, owningEntryList, configElement);
@ -770,7 +748,6 @@ public class GuiConfigEntries extends GuiListExtended
}
}
@SuppressWarnings("unchecked")
@Override
public boolean saveConfigElement()
{
@ -804,7 +781,7 @@ public class GuiConfigEntries extends GuiListExtended
{
protected final double beforeValue;
public NumberSliderEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement<?> configElement)
public NumberSliderEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement)
{
super(owningScreen, owningEntryList, configElement, new GuiSlider(0, owningEntryList.controlX, 0, owningEntryList.controlWidth, 18,
"", "", Double.valueOf(configElement.getMinValue().toString()), Double.valueOf(configElement.getMaxValue().toString()),
@ -863,7 +840,6 @@ public class GuiConfigEntries extends GuiListExtended
}
}
@SuppressWarnings("unchecked")
@Override
public boolean saveConfigElement()
{
@ -903,13 +879,13 @@ public class GuiConfigEntries extends GuiListExtended
{
protected final GuiButtonExt btnValue;
public ButtonEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement<?> configElement)
public ButtonEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement)
{
this(owningScreen, owningEntryList, configElement, new GuiButtonExt(0, owningEntryList.controlX, 0, owningEntryList.controlWidth, 18,
configElement.get() != null ? I18n.format(String.valueOf(configElement.get())) : ""));
}
public ButtonEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement<?> configElement, GuiButtonExt button)
public ButtonEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement, GuiButtonExt button)
{
super(owningScreen, owningEntryList, configElement);
this.btnValue = button;
@ -926,9 +902,9 @@ public class GuiConfigEntries extends GuiListExtended
public abstract void valueButtonPressed(int slotIndex);
@Override
public void func_180790_a(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected)
public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected)
{
super.func_180790_a(slotIndex, x, y, listWidth, slotHeight, mouseX, mouseY, isSelected);
super.drawEntry(slotIndex, x, y, listWidth, slotHeight, mouseX, mouseY, isSelected);
this.btnValue.width = this.owningEntryList.controlWidth;
this.btnValue.xPosition = this.owningScreen.entryList.controlX;
this.btnValue.yPosition = y;
@ -985,7 +961,6 @@ public class GuiConfigEntries extends GuiListExtended
{
protected final int beforeValue;
@SuppressWarnings("rawtypes")
public IntegerEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement)
{
super(owningScreen, owningEntryList, configElement);
@ -1045,7 +1020,6 @@ public class GuiConfigEntries extends GuiListExtended
this.textFieldValue.setText(String.valueOf(beforeValue));
}
@SuppressWarnings("unchecked")
@Override
public boolean saveConfigElement()
{
@ -1092,7 +1066,6 @@ public class GuiConfigEntries extends GuiListExtended
{
protected final double beforeValue;
@SuppressWarnings("rawtypes")
public DoubleEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement)
{
super(owningScreen, owningEntryList, configElement);
@ -1153,7 +1126,6 @@ public class GuiConfigEntries extends GuiListExtended
this.textFieldValue.setText(String.valueOf(beforeValue));
}
@SuppressWarnings("unchecked")
@Override
public boolean saveConfigElement()
{
@ -1200,7 +1172,7 @@ public class GuiConfigEntries extends GuiListExtended
protected final GuiTextField textFieldValue;
protected final String beforeValue;
public StringEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement<?> configElement)
public StringEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement)
{
super(owningScreen, owningEntryList, configElement);
beforeValue = configElement.get().toString();
@ -1210,9 +1182,9 @@ public class GuiConfigEntries extends GuiListExtended
}
@Override
public void func_180790_a(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected)
public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected)
{
super.func_180790_a(slotIndex, x, y, listWidth, slotHeight, mouseX, mouseY, isSelected);
super.drawEntry(slotIndex, x, y, listWidth, slotHeight, mouseX, mouseY, isSelected);
this.textFieldValue.xPosition = this.owningEntryList.controlX + 2;
this.textFieldValue.yPosition = y + 1;
this.textFieldValue.width = this.owningEntryList.controlWidth - 4;
@ -1279,7 +1251,6 @@ public class GuiConfigEntries extends GuiListExtended
this.textFieldValue.setText(beforeValue);
}
@SuppressWarnings("unchecked")
@Override
public boolean saveConfigElement()
{
@ -1323,7 +1294,6 @@ public class GuiConfigEntries extends GuiListExtended
protected GuiScreen childScreen;
protected final GuiButtonExt btnSelectCategory;
@SuppressWarnings("rawtypes")
public CategoryEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement)
{
super(owningScreen, owningEntryList, configElement);
@ -1339,7 +1309,6 @@ 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()
{
return new GuiConfig(this.owningScreen, this.configElement.getChildElements(), this.owningScreen.modID,
@ -1349,14 +1318,14 @@ public class GuiConfigEntries extends GuiListExtended
}
@Override
public void func_180790_a(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected)
public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected)
{
this.btnSelectCategory.xPosition = listWidth / 2 - 150;
this.btnSelectCategory.yPosition = y;
this.btnSelectCategory.enabled = enabled();
this.btnSelectCategory.drawButton(this.mc, mouseX, mouseY);
super.func_180790_a(slotIndex, x, y, listWidth, slotHeight, mouseX, mouseY, isSelected);
super.drawEntry(slotIndex, x, y, listWidth, slotHeight, mouseX, mouseY, isSelected);
}
@Override
@ -1554,7 +1523,7 @@ public class GuiConfigEntries extends GuiListExtended
}
@Override
public void func_180790_a(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected)
public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected)
{
boolean isChanged = isChanged();
@ -1652,7 +1621,7 @@ public class GuiConfigEntries extends GuiListExtended
public abstract boolean saveConfigElement();
@Override
public void func_178011_a(int p_178011_1_, int p_178011_2_, int p_178011_3_){}
public void setSelected(int p_178011_1_, int p_178011_2_, int p_178011_3_){}
@Override
public boolean enabled()
@ -1696,15 +1665,14 @@ public class GuiConfigEntries extends GuiListExtended
}
/**
* Provides an interface for defining GuiPropertyList.listEntry objects.
* Provides an interface for defining GuiConfigEntry.listEntry objects.
*/
public static interface IConfigEntry<T> extends GuiListExtended.IGuiListEntry
public static interface IConfigEntry extends GuiListExtended.IGuiListEntry
{
/**
* Gets the IConfigElement object owned by this entry.
* @return
*/
@SuppressWarnings("rawtypes")
public IConfigElement getConfigElement();
/**
@ -1713,14 +1681,14 @@ public class GuiConfigEntries extends GuiListExtended
public String getName();
/**
* Gets the current value of this entry as a String.
* Gets the current value of this entry.
*/
public T getCurrentValue();
public Object getCurrentValue();
/**
* Gets the current values of this list entry as a String[].
* Gets the current values of this list entry.
*/
public T[] getCurrentValues();
public Object[] getCurrentValues();
/**
* Is this list entry enabled?

View file

@ -36,19 +36,18 @@ import org.lwjgl.input.Keyboard;
public class GuiEditArray extends GuiScreen
{
protected GuiScreen parentScreen;
@SuppressWarnings("rawtypes")
protected IConfigElement configElement;
private GuiEditArrayEntries entryList;
private GuiButtonExt btnUndoChanges, btnDefault, btnDone;
private String title;
protected GuiEditArrayEntries entryList;
protected GuiButtonExt btnUndoChanges, btnDefault, btnDone;
protected String title;
protected String titleLine2;
protected String titleLine3;
protected int slotIndex;
private final Object[] beforeValues;
private Object[] currentValues;
private HoverChecker tooltipHoverChecker;
protected final Object[] beforeValues;
protected Object[] currentValues;
protected HoverChecker tooltipHoverChecker;
@SuppressWarnings("rawtypes")
private List toolTip;
protected List toolTip;
protected boolean enabled;
@SuppressWarnings("rawtypes")
@ -143,6 +142,12 @@ public class GuiEditArray extends GuiScreen
}
}
public void handleMouseInput() throws IOException
{
super.handleMouseInput();
this.entryList.func_178039_p();
}
@Override
protected void mouseClicked(int x, int y, int mouseEvent) throws IOException
{

View file

@ -19,7 +19,6 @@ import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiListExtended;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.resources.I18n;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.fml.client.config.GuiConfigEntries.ArrayEntry;
@ -39,7 +38,7 @@ import static net.minecraftforge.fml.client.config.GuiUtils.VALID;
@SuppressWarnings("rawtypes")
public class GuiEditArrayEntries extends GuiListExtended
{
private GuiEditArray owningGui;
protected GuiEditArray owningGui;
public Minecraft mc;
public IConfigElement configElement;
public List<IArrayEntry> listEntries;
@ -50,7 +49,6 @@ public class GuiEditArrayEntries extends GuiListExtended
public final Object[] beforeValues;
public 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);
@ -220,7 +218,6 @@ public class GuiEditArrayEntries extends GuiListExtended
return true;
}
@SuppressWarnings("unchecked")
protected void saveListChanges()
{
int listLength = configElement.isListLengthFixed() ? listEntries.size() : listEntries.size() - 1;
@ -419,9 +416,9 @@ public class GuiEditArrayEntries extends GuiListExtended
}
@Override
public void func_180790_a(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected)
public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected)
{
super.func_180790_a(slotIndex, x, y, listWidth, slotHeight, mouseX, mouseY, isSelected);
super.drawEntry(slotIndex, x, y, listWidth, slotHeight, mouseX, mouseY, isSelected);
if (configElement.isListLengthFixed() || slotIndex != owningEntryList.listEntries.size() - 1)
{
this.textFieldValue.setVisible(true);
@ -485,9 +482,9 @@ public class GuiEditArrayEntries extends GuiListExtended
}
@Override
public void func_180790_a(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected)
public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected)
{
super.func_180790_a(slotIndex, x, y, listWidth, slotHeight, mouseX, mouseY, isSelected);
super.drawEntry(slotIndex, x, y, listWidth, slotHeight, mouseX, mouseY, isSelected);
this.btnValue.xPosition = listWidth / 4;
this.btnValue.yPosition = y;
@ -563,7 +560,7 @@ public class GuiEditArrayEntries extends GuiListExtended
}
@Override
public void func_180790_a(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected)
public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected)
{
if (this.getValue() != null && this.isValidated)
owningEntryList.mc.fontRendererObj.drawString(
@ -657,7 +654,7 @@ public class GuiEditArrayEntries extends GuiListExtended
}
@Override
public void func_178011_a(int p_178011_1_, int p_178011_2_, int p_178011_3_){}
public void setSelected(int p_178011_1_, int p_178011_2_, int p_178011_3_){}
}
public static interface IArrayEntry extends GuiListExtended.IGuiListEntry

View file

@ -8,7 +8,7 @@ import net.minecraft.util.IChatComponent;
public class GuiMessageDialog extends GuiDisconnected
{
private String buttonText;
protected String buttonText;
public GuiMessageDialog(GuiScreen nextScreen, String title, IChatComponent message, String buttonText)
{

View file

@ -12,6 +12,7 @@
package net.minecraftforge.fml.client.config;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ -32,20 +33,19 @@ import static net.minecraftforge.fml.client.config.GuiUtils.UNDO_CHAR;
public class GuiSelectString extends GuiScreen
{
protected GuiScreen parentScreen;
@SuppressWarnings("rawtypes")
protected IConfigElement configElement;
private GuiSelectStringEntries entriesList;
private GuiButtonExt btnUndoChanges, btnDefault, btnDone;
private String title;
protected GuiSelectStringEntries entryList;
protected GuiButtonExt btnUndoChanges, btnDefault, btnDone;
protected String title;
protected String titleLine2;
protected String titleLine3;
protected int slotIndex;
private final Map<Object, String> selectableValues;
protected final Map<Object, String> selectableValues;
public final Object beforeValue;
public Object currentValue;
private HoverChecker tooltipHoverChecker;
protected HoverChecker tooltipHoverChecker;
@SuppressWarnings("rawtypes")
private List toolTip;
protected List toolTip;
protected boolean enabled;
@SuppressWarnings("rawtypes")
@ -95,7 +95,7 @@ public class GuiSelectString extends GuiScreen
@Override
public void initGui()
{
this.entriesList = new GuiSelectStringEntries(this, this.mc, this.configElement, this.selectableValues);
this.entryList = new GuiSelectStringEntries(this, this.mc, this.configElement, this.selectableValues);
int undoGlyphWidth = mc.fontRendererObj.getStringWidth(UNDO_CHAR) * 2;
int resetGlyphWidth = mc.fontRendererObj.getStringWidth(RESET_CHAR) * 2;
@ -117,7 +117,7 @@ public class GuiSelectString extends GuiScreen
{
try
{
this.entriesList.saveChanges();
this.entryList.saveChanges();
}
catch (Throwable e)
{
@ -128,19 +128,25 @@ public class GuiSelectString extends GuiScreen
else if (button.id == 2001)
{
this.currentValue = configElement.getDefault();
this.entriesList = new GuiSelectStringEntries(this, this.mc, this.configElement, this.selectableValues);
this.entryList = new GuiSelectStringEntries(this, this.mc, this.configElement, this.selectableValues);
}
else if (button.id == 2002)
{
this.currentValue = beforeValue;
this.entriesList = new GuiSelectStringEntries(this, this.mc, this.configElement, this.selectableValues);
this.entryList = new GuiSelectStringEntries(this, this.mc, this.configElement, this.selectableValues);
}
}
public void handleMouseInput() throws IOException
{
super.handleMouseInput();
this.entryList.func_178039_p();
}
@Override
protected void mouseReleased(int x, int y, int mouseEvent)
{
if (mouseEvent != 0 || !this.entriesList.func_148181_b(x, y, mouseEvent))
if (mouseEvent != 0 || !this.entryList.func_148181_b(x, y, mouseEvent))
{
super.mouseReleased(x, y, mouseEvent);
}
@ -150,7 +156,7 @@ public class GuiSelectString extends GuiScreen
public void drawScreen(int par1, int par2, float par3)
{
this.drawDefaultBackground();
this.entriesList.drawScreen(par1, par2, par3);
this.entryList.drawScreen(par1, par2, par3);
this.drawCenteredString(this.fontRendererObj, this.title, this.width / 2, 8, 16777215);
if (this.titleLine2 != null)
@ -160,8 +166,8 @@ public class GuiSelectString extends GuiScreen
this.drawCenteredString(this.fontRendererObj, this.titleLine3, this.width / 2, 28, 16777215);
this.btnDone.enabled = currentValue != null;
this.btnDefault.enabled = enabled && !this.entriesList.isDefault();
this.btnUndoChanges.enabled = enabled && this.entriesList.isChanged();
this.btnDefault.enabled = enabled && !this.entryList.isDefault();
this.btnUndoChanges.enabled = enabled && this.entryList.isChanged();
super.drawScreen(par1, par2, par3);
if (this.tooltipHoverChecker != null && this.tooltipHoverChecker.checkHover(par1, par2))

View file

@ -22,7 +22,6 @@ import java.util.Map.Entry;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiListExtended;
import net.minecraft.client.renderer.Tessellator;
import net.minecraftforge.fml.client.config.GuiConfigEntries.SelectValueEntry;
/**
@ -34,14 +33,12 @@ public class GuiSelectStringEntries extends GuiListExtended
{
public GuiSelectString owningScreen;
public Minecraft mc;
@SuppressWarnings("rawtypes")
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)
{
super(mc, owningScreen.width, owningScreen.height, owningScreen.titleLine2 != null ? (owningScreen.titleLine3 != null ? 43 : 33) : 23,
@ -143,7 +140,6 @@ public class GuiSelectStringEntries extends GuiListExtended
return owningScreen.currentValue != null ? owningScreen.currentValue.equals(configElement.getDefault()) : configElement.getDefault() == null;
}
@SuppressWarnings("unchecked")
public void saveChanges()
{
if (owningScreen.slotIndex != -1 && owningScreen.parentScreen != null
@ -170,7 +166,7 @@ public class GuiSelectStringEntries extends GuiListExtended
}
@Override
public void func_180790_a(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected)
public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected)
{
owningList.mc.fontRendererObj.drawString(value.getValue(), x + 1, y, slotIndex == owningList.selectedIndex ? 16777215 : 14737632);
}
@ -192,7 +188,7 @@ public class GuiSelectStringEntries extends GuiListExtended
}
@Override
public void func_178011_a(int p_178011_1_, int p_178011_2_, int p_178011_3_){}
public void setSelected(int p_178011_1_, int p_178011_2_, int p_178011_3_){}
}
public static interface IGuiSelectStringListEntry extends GuiListExtended.IGuiListEntry

View file

@ -32,7 +32,7 @@ public class GuiUtils
public static final String VALID = "\u2714";
public static final String INVALID = "\u2715";
private static int[] colorCodes = new int[] { 0, 170, 43520, 43690, 11141120, 11141290, 16755200, 11184810, 5592405, 5592575, 5635925, 5636095, 16733525, 16733695, 16777045, 16777215,
public static int[] colorCodes = new int[] { 0, 170, 43520, 43690, 11141120, 11141290, 16755200, 11184810, 5592405, 5592575, 5635925, 5636095, 16733525, 16733695, 16777045, 16777215,
0, 42, 10752, 10794, 2752512, 2752554, 2763264, 2763306, 1381653, 1381695, 1392405, 1392447, 4134165, 4134207, 4144917, 4144959 };
public static int getColorCode(char c, boolean isLighter)
@ -183,13 +183,13 @@ public class GuiUtils
{
float var7 = 0.00390625F;
float var8 = 0.00390625F;
Tessellator tessellator = Tessellator.func_178181_a();
WorldRenderer worldr = tessellator.func_178180_c();
worldr.func_178970_b();
worldr.func_178985_a((x + 0), (y + height), zLevel, ((u + 0) * var7), ((v + height) * var8));
worldr.func_178985_a((x + width), (y + height), zLevel, ((u + width) * var7), ((v + height) * var8));
worldr.func_178985_a((x + width), (y + 0), zLevel, ((u + width) * var7), ((v + 0) * var8));
worldr.func_178985_a((x + 0), (y + 0), zLevel, ((u + 0) * var7), ((v + 0) * var8));
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldr = tessellator.getWorldRenderer();
worldr.startDrawingQuads();
worldr.addVertexWithUV((x + 0), (y + height), zLevel, ((u + 0) * var7), ((v + height) * var8));
worldr.addVertexWithUV((x + width), (y + height), zLevel, ((u + width) * var7), ((v + height) * var8));
worldr.addVertexWithUV((x + width), (y + 0), zLevel, ((u + width) * var7), ((v + 0) * var8));
worldr.addVertexWithUV((x + 0), (y + 0), zLevel, ((u + 0) * var7), ((v + 0) * var8));
tessellator.draw();
}

View file

@ -23,7 +23,7 @@ import net.minecraftforge.fml.client.config.GuiEditArrayEntries.IArrayEntry;
*
* @author bspkrs
*/
public interface IConfigElement<T>
public interface IConfigElement
{
/**
* [Property, Category] Is this object a property object?
@ -34,7 +34,6 @@ 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}
*/
@SuppressWarnings("rawtypes")
public Class<? extends IConfigEntry> getConfigEntryClass();
/**
@ -68,7 +67,6 @@ public interface IConfigElement<T>
/**
* [Category] Gets this category's child categories/properties.
*/
@SuppressWarnings("rawtypes")
public List<IConfigElement> getChildElements();
/**
@ -142,12 +140,12 @@ public interface IConfigElement<T>
/**
* [Property] Sets this property's value.
*/
public void set(T value);
public void set(Object value);
/**
* [Property] Sets this property's value to the specified array.
*/
public void set(T[] aVal);
public void set(Object[] aVal);
/**
* [Property] Gets a String array of valid values for this property. This is generally used for String properties to allow the user to
@ -158,12 +156,12 @@ public interface IConfigElement<T>
/**
* [Property] Gets this property's minimum value.
*/
public T getMinValue();
public Object getMinValue();
/**
* [Property] Gets this property's maximum value.
*/
public T getMaxValue();
public Object getMaxValue();
/**
* [Property] Gets a Pattern object used in String property input validation.

View file

@ -41,7 +41,7 @@ public class ClientRegistry
public static void bindTileEntitySpecialRenderer(Class <? extends TileEntity> tileEntityClass, TileEntitySpecialRenderer specialRenderer)
{
TileEntityRendererDispatcher.instance.mapSpecialRenderers.put(tileEntityClass, specialRenderer);
specialRenderer.func_147497_a(TileEntityRendererDispatcher.instance);
specialRenderer.setRendererDispatcher(TileEntityRendererDispatcher.instance);
}
public static void registerKeyBinding(KeyBinding key)

View file

@ -609,17 +609,17 @@ public class FMLCommonHandler
{
ChatComponentText text = new ChatComponentText("Server is still starting! Please wait before reconnecting.");
FMLLog.info("Disconnecting Player: " + text.getUnformattedText());
manager.func_179290_a(new S00PacketDisconnect(text));
manager.sendPacket(new S00PacketDisconnect(text));
manager.closeChannel(text);
return false;
}
if (packet.func_149594_c() == EnumConnectionState.LOGIN && (!NetworkRegistry.INSTANCE.isVanillaAccepted(Side.CLIENT) && !packet.hasFMLMarker()))
if (packet.getRequestedState() == EnumConnectionState.LOGIN && (!NetworkRegistry.INSTANCE.isVanillaAccepted(Side.CLIENT) && !packet.hasFMLMarker()))
{
manager.setConnectionState(EnumConnectionState.LOGIN);
ChatComponentText text = new ChatComponentText("This server requires FML/Forge to be installed. Contact your server admin for more details.");
FMLLog.info("Disconnecting Player: " + text.getUnformattedText());
manager.func_179290_a(new S00PacketDisconnect(text));
manager.sendPacket(new S00PacketDisconnect(text));
manager.closeChannel(text);
return false;
}

View file

@ -2,7 +2,6 @@ package net.minecraftforge.fml.common.network.handshake;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.channel.ChannelOutboundHandler;
import io.netty.channel.ChannelPromise;
import io.netty.channel.SimpleChannelInboundHandler;
@ -10,15 +9,12 @@ import io.netty.channel.embedded.EmbeddedChannel;
import io.netty.util.AttributeKey;
import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.GenericFutureListener;
import io.netty.util.concurrent.ScheduledFuture;
import java.io.IOException;
import java.net.SocketAddress;
import java.nio.channels.ClosedChannelException;
import java.util.List;
import java.util.Locale;
import java.util.concurrent.Callable;
import java.util.concurrent.TimeUnit;
import org.apache.logging.log4j.Level;
@ -260,7 +256,7 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet> imple
}
else
{
manager.func_179288_a(new S40PacketDisconnect(chatcomponenttext), new GenericFutureListener<Future<?>>()
manager.sendPacket(new S40PacketDisconnect(chatcomponenttext), new GenericFutureListener<Future<?>>()
{
@Override
public void operationComplete(Future<?> result)
@ -275,18 +271,18 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet> imple
private MultiPartCustomPayload multipart = null;
private boolean handleClientSideCustomPacket(S3FPacketCustomPayload msg, ChannelHandlerContext context)
{
String channelName = msg.func_149169_c();
String channelName = msg.getChannelName();
if ("FML|MP".equals(channelName))
{
try
{
if (multipart == null)
{
multipart = new MultiPartCustomPayload(msg.func_180735_b());
multipart = new MultiPartCustomPayload(msg.getBufferData());
}
else
{
multipart.processPart(msg.func_180735_b());
multipart.processPart(msg.getBufferData());
}
}
catch (IOException e)
@ -299,7 +295,7 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet> imple
if (multipart.isComplete())
{
msg = multipart;
channelName = msg.func_149169_c();
channelName = msg.getChannelName();
multipart = null;
}
else
@ -342,7 +338,7 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet> imple
{
state = ConnectionState.HANDSHAKING;
}
String channelName = msg.func_149559_c();
String channelName = msg.getChannelName();
if ("FML|HS".equals(channelName) || "REGISTER".equals(channelName) || "UNREGISTER".equals(channelName))
{
FMLProxyPacket proxy = new FMLProxyPacket(msg);
@ -373,7 +369,7 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet> imple
public void sendProxy(FMLProxyPacket msg)
{
manager.func_179290_a(msg);
manager.sendPacket(msg);
}
public void rejectHandshake(String result)
@ -559,13 +555,13 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet> imple
}
@Override
public String func_149169_c() // getChannel
public String getChannelName() // getChannel
{
return this.channel;
}
@Override
public PacketBuffer func_180735_b() // getData
public PacketBuffer getBufferData() // getData
{
return this.data_buf;
}

View file

@ -194,7 +194,7 @@ public abstract class FMLMessage {
PacketBuffer pb = new PacketBuffer(tmpBuf);
try
{
entity.getDataWatcher().func_151509_a(pb);
entity.getDataWatcher().writeTo(pb);
} catch (IOException e)
{
FMLLog.log(Level.FATAL,e,"Encountered fatal exception trying to send entity spawn data watchers");

View file

@ -39,13 +39,13 @@ public class FMLProxyPacket implements Packet {
public FMLProxyPacket(S3FPacketCustomPayload original)
{
this(original.func_180735_b(), original.func_149169_c());
this(original.getBufferData(), original.getChannelName());
this.target = Side.CLIENT;
}
public FMLProxyPacket(C17PacketCustomPayload original)
{
this(original.func_180760_b(), original.func_149559_c());
this(original.getBufferData(), original.getChannelName());
this.target = Side.SERVER;
}
@ -141,7 +141,7 @@ public class FMLProxyPacket implements Packet {
throw new IllegalArgumentException("Payload may not be larger than " + MAX_LENGTH + " bytes");
}
PacketBuffer preamble = new PacketBuffer(Unpooled.buffer());
preamble.func_180714_a(channel);
preamble.writeString(channel);
preamble.writeByte(parts);
preamble.writeInt(data.length);
ret.add(new S3FPacketCustomPayload("FML|MP", preamble));

View file

@ -126,7 +126,7 @@ public class EntityRegistry
{
availableIndicies = new BitSet(256);
availableIndicies.set(1,255);
for (Object id : EntityList.IDtoClassMapping.keySet())
for (Object id : EntityList.idToClassMapping.keySet())
{
availableIndicies.clear((Integer)id);
}

View file

@ -51,7 +51,7 @@ public class FMLControlledNamespacedRegistry<I> extends RegistryNamespacedDefaul
for (I obj : typeSafeIterable())
{
int id = getId(obj);
Object name = func_177774_c(obj);
Object name = getNameForObject(obj);
// name lookup failed -> obj is not in the obj<->name map
if (name == null) throw new IllegalStateException(String.format("Registry entry for %s %s, id %d, doesn't yield a name.", type, obj, id));
@ -81,7 +81,7 @@ public class FMLControlledNamespacedRegistry<I> extends RegistryNamespacedDefaul
if (obj instanceof ItemBlock)
{
Block block = ((ItemBlock) obj).blockInstance;
Block block = ((ItemBlock) obj).block;
// verify matching block entry
if (iBlockRegistry.getId(block) != id)
@ -109,7 +109,7 @@ public class FMLControlledNamespacedRegistry<I> extends RegistryNamespacedDefaul
for (I thing : registry.typeSafeIterable())
{
addObjectRaw(registry.getId(thing), registry.func_177774_c(thing), thing);
addObjectRaw(registry.getId(thing), registry.getNameForObject(thing), thing);
}
}
@ -122,7 +122,7 @@ public class FMLControlledNamespacedRegistry<I> extends RegistryNamespacedDefaul
*/
@Override
@Deprecated
public void func_177775_a(int id, Object name, Object thing)
public void register(int id, Object name, Object thing)
{
Validate.isInstanceOf(ResourceLocation.class, name);
GameData.getMain().register(thing, name.toString(), id);
@ -145,7 +145,7 @@ public class FMLControlledNamespacedRegistry<I> extends RegistryNamespacedDefaul
if (thing == null) throw new NullPointerException("Can't add null-object to the registry.");
name = new ResourceLocation(name).toString();
Object existingName = func_177774_c(thing);
Object existingName = getNameForObject(thing);
if (existingName == null)
{
@ -333,7 +333,7 @@ public class FMLControlledNamespacedRegistry<I> extends RegistryNamespacedDefaul
{
for (I thing : this.typeSafeIterable())
{
idMapping.put(discriminator+func_177774_c(thing).toString(), getId(thing));
idMapping.put(discriminator+getNameForObject(thing).toString(), getId(thing));
}
}
@ -388,7 +388,7 @@ public class FMLControlledNamespacedRegistry<I> extends RegistryNamespacedDefaul
{
int foundId = getId(thing);
Object otherThing = getRaw(foundId);
throw new IllegalArgumentException(String.format("The object %s{%x} has been registered twice, using the names %s and %s. (Other object at this id is %s{%x})", thing, System.identityHashCode(thing), func_177774_c(thing), name, otherThing, System.identityHashCode(otherThing)));
throw new IllegalArgumentException(String.format("The object %s{%x} has been registered twice, using the names %s and %s. (Other object at this id is %s{%x})", thing, System.identityHashCode(thing), getNameForObject(thing), name, otherThing, System.identityHashCode(otherThing)));
}
if (GameData.isFrozen(this))
{
@ -419,9 +419,9 @@ public class FMLControlledNamespacedRegistry<I> extends RegistryNamespacedDefaul
{
if (!registry.field_148758_b.containsKey(thing))
{
if (!registry.activeSubstitutions.containsKey(func_177774_c(thing).toString()))
if (!registry.activeSubstitutions.containsKey(getNameForObject(thing).toString()))
{
ret.put(func_177774_c(thing).toString(), getId(thing));
ret.put(getNameForObject(thing).toString(), getId(thing));
}
}
}
@ -444,7 +444,7 @@ public class FMLControlledNamespacedRegistry<I> extends RegistryNamespacedDefaul
for (int id : ids)
{
I thing = getRaw(id);
FMLLog.finer("Registry: %s %d %s", func_177774_c(thing), id, thing);
FMLLog.finer("Registry: %s %d %s", getNameForObject(thing), id, thing);
}
}
@ -457,7 +457,7 @@ public class FMLControlledNamespacedRegistry<I> extends RegistryNamespacedDefaul
if (thing == null) throw new NullPointerException("The object to be added to the registry is null. This can only happen with a corrupted registry state. Reflection/ASM hackery? Registry bug?");
if (!superType.isInstance(thing)) throw new IllegalArgumentException("The object to be added to the registry is not of the right type. Reflection/ASM hackery? Registry bug?");
underlyingIntegerMap.func_148746_a(thing, id); // obj <-> id
underlyingIntegerMap.put(thing, id); // obj <-> id
super.putObject(name, thing); // name <-> obj
}
@ -519,7 +519,7 @@ public class FMLControlledNamespacedRegistry<I> extends RegistryNamespacedDefaul
}
@Override
public void func_177776_a()
public void validateKey()
{
if (this.optionalDefaultKey != null)
Validate.notNull(this.optionalDefaultObject);

View file

@ -213,7 +213,7 @@ public class GameData {
static UniqueIdentifier getUniqueName(Block block)
{
if (block == null) return null;
Object name = getMain().iBlockRegistry.func_177774_c(block);
Object name = getMain().iBlockRegistry.getNameForObject(block);
UniqueIdentifier ui = new UniqueIdentifier(name);
if (customItemStacks.contains(ui.modId, ui.name))
{
@ -226,7 +226,7 @@ public class GameData {
static UniqueIdentifier getUniqueName(Item item)
{
if (item == null) return null;
Object name = getMain().iItemRegistry.func_177774_c(item);
Object name = getMain().iItemRegistry.getNameForObject(item);
UniqueIdentifier ui = new UniqueIdentifier(name);
if (customItemStacks.contains(ui.modId, ui.name))
{
@ -599,7 +599,7 @@ public class GameData {
if (remap.type == Type.BLOCK)
{
currId = getMain().iBlockRegistry.getId((Block) remap.getTarget());
newName = getMain().iBlockRegistry.func_177774_c(remap.getTarget()).toString();
newName = getMain().iBlockRegistry.getNameForObject(remap.getTarget()).toString();
FMLLog.fine("The Block %s is being remapped to %s.", remap.name, newName);
newId = gameData.registerBlock((Block) remap.getTarget(), newName, remap.id);
@ -608,7 +608,7 @@ public class GameData {
else
{
currId = getMain().iItemRegistry.getId((Item) remap.getTarget());
newName = getMain().iItemRegistry.func_177774_c(remap.getTarget()).toString();
newName = getMain().iItemRegistry.getNameForObject(remap.getTarget()).toString();
FMLLog.fine("The Item %s is being remapped to %s.", remap.name, newName);
newId = gameData.registerItem((Item) remap.getTarget(), newName, remap.id);
@ -797,7 +797,7 @@ public class GameData {
{
if (item instanceof ItemBlock) // ItemBlock, adjust id and clear the slot already occupied by the corresponding block
{
Block block = ((ItemBlock) item).blockInstance;
Block block = ((ItemBlock) item).block;
if (idHint != -1 && getMain().blockSubstitutions.containsKey(name))
{
block = getMain().blockSubstitutions.get(name);
@ -856,7 +856,7 @@ public class GameData {
for (Item item : iItemRegistry.typeSafeIterable()) // find matching ItemBlock
{
if (item instanceof ItemBlock && ((ItemBlock) item).blockInstance == block)
if (item instanceof ItemBlock && ((ItemBlock) item).block == block)
{
itemBlock = (ItemBlock) item;
break;
@ -958,8 +958,8 @@ public class GameData {
private void verifyItemBlockName(ItemBlock item)
{
Object blockName = iBlockRegistry.func_177774_c(item.blockInstance);
Object itemName = iItemRegistry.func_177774_c(item);
Object blockName = iBlockRegistry.getNameForObject(item.block);
Object itemName = iItemRegistry.getNameForObject(item);
//Vanilla has a mismatch:
//Block <-> ItemBlock name mismatch, block name minecraft:standing_banner, item name minecraft:banner

View file

@ -49,8 +49,8 @@ class ObjectHolderRef {
}
else
{
Object tmp = isBlock ? GameData.getBlockRegistry().func_177774_c(existing) :
isItem ? GameData.getItemRegistry().func_177774_c(existing) : null;
Object tmp = isBlock ? GameData.getBlockRegistry().getNameForObject(existing) :
isItem ? GameData.getItemRegistry().getNameForObject(existing) : null;
this.injectedObject = tmp != null ? tmp.toString() : null;
}
} catch (Exception e)

View file

@ -331,7 +331,7 @@ public class VillagerRegistry
{
new EmeraldForItems(Items.string, new PriceInfo(15, 20)),
new EmeraldForItems(Items.coal, new PriceInfo(16, 24)),
new ItemAndEmeraldToItem(Items.fish, new PriceInfo(6, 6), Items.field_179566_aV, new PriceInfo(6, 6))
new ItemAndEmeraldToItem(Items.fish, new PriceInfo(6, 6), Items.cooked_fish, new PriceInfo(6, 6))
},
{
new ListEnchantedItemForEmeralds(Items.fishing_rod, new PriceInfo(7, 8))
@ -407,7 +407,7 @@ public class VillagerRegistry
},
{
new ListItemForEmeralds(Items.redstone, new PriceInfo(-4, -1)),
new ListItemForEmeralds(new ItemStack(Items.dye, 1, EnumDyeColor.BLUE.func_176767_b()),
new ListItemForEmeralds(new ItemStack(Items.dye, 1, EnumDyeColor.BLUE.getDyeColorDamage()),
new PriceInfo(-2, -1))
},
{