diff --git a/fml/build.gradle b/fml/build.gradle index 2a1160bc9..82b758dcd 100644 --- a/fml/build.gradle +++ b/fml/build.gradle @@ -12,7 +12,7 @@ buildscript { } } dependencies { - classpath 'net.minecraftforge.gradle:ForgeGradle:1.1-SNAPSHOT' + classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT' } } diff --git a/fml/patches/minecraft/net/minecraft/client/Minecraft.java.patch b/fml/patches/minecraft/net/minecraft/client/Minecraft.java.patch index 00d133e9b..e34d86186 100644 --- a/fml/patches/minecraft/net/minecraft/client/Minecraft.java.patch +++ b/fml/patches/minecraft/net/minecraft/client/Minecraft.java.patch @@ -65,7 +65,7 @@ Display.setVSyncEnabled(this.field_71474_y.field_74352_v); } -@@ -916,9 +926,11 @@ +@@ -915,9 +925,11 @@ if (!this.field_71454_w) { @@ -77,7 +77,7 @@ } GL11.glFlush(); -@@ -1496,6 +1508,8 @@ +@@ -1495,6 +1507,8 @@ --this.field_71467_ac; } @@ -86,7 +86,7 @@ this.field_71424_I.func_76320_a("gui"); if (!this.field_71445_n) -@@ -1646,6 +1660,7 @@ +@@ -1645,6 +1659,7 @@ this.field_71462_r.func_146274_d(); } } @@ -94,7 +94,7 @@ } if (this.field_71429_W > 0) -@@ -1787,6 +1802,7 @@ +@@ -1786,6 +1801,7 @@ } } } @@ -102,7 +102,7 @@ } } -@@ -1978,12 +1994,15 @@ +@@ -1977,12 +1993,15 @@ this.field_71453_ak.func_74428_b(); } @@ -118,7 +118,7 @@ this.func_71403_a((WorldClient)null); System.gc(); ISaveHandler isavehandler = this.field_71469_aa.func_75804_a(p_71371_1_, false); -@@ -2094,6 +2113,7 @@ +@@ -2093,6 +2112,7 @@ this.field_110448_aq.func_148529_f(); this.func_71351_a((ServerData)null); this.field_71455_al = false; diff --git a/fml/patches/minecraft/net/minecraft/client/network/OldServerPinger.java.patch b/fml/patches/minecraft/net/minecraft/client/network/OldServerPinger.java.patch index 22e10b3f4..73bd3298f 100644 --- a/fml/patches/minecraft/net/minecraft/client/network/OldServerPinger.java.patch +++ b/fml/patches/minecraft/net/minecraft/client/network/OldServerPinger.java.patch @@ -8,7 +8,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import io.netty.bootstrap.Bootstrap; -@@ -148,6 +149,7 @@ +@@ -147,6 +148,7 @@ p_147224_1_.func_147407_a((String)null); } diff --git a/fml/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch b/fml/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch index 50652e5ec..5970b575f 100644 --- a/fml/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch +++ b/fml/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch @@ -11,7 +11,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import io.netty.buffer.ByteBuf; -@@ -385,6 +389,7 @@ +@@ -381,6 +385,7 @@ { if (this.func_71197_b()) { @@ -19,7 +19,7 @@ long i = func_130071_aq(); long l = 0L; this.field_147147_p.func_151315_a(new ChatComponentText(this.field_71286_C)); -@@ -429,6 +434,7 @@ +@@ -425,6 +430,7 @@ Thread.sleep(1L); this.field_71296_Q = true; } @@ -27,7 +27,7 @@ } else { -@@ -466,7 +472,10 @@ +@@ -462,7 +468,10 @@ { try { @@ -38,7 +38,7 @@ this.field_71316_v = true; } catch (Throwable throwable) -@@ -475,6 +484,8 @@ +@@ -471,6 +480,8 @@ } finally { @@ -47,7 +47,7 @@ this.func_71240_o(); } } -@@ -517,6 +528,7 @@ +@@ -513,6 +524,7 @@ { long i = System.nanoTime(); AxisAlignedBB.func_72332_a().func_72298_a(); @@ -55,7 +55,7 @@ ++this.field_71315_w; if (this.field_71295_T) -@@ -570,6 +582,7 @@ +@@ -566,6 +578,7 @@ this.field_71304_b.func_76319_b(); this.field_71304_b.func_76319_b(); @@ -63,7 +63,7 @@ } public void func_71190_q() -@@ -597,6 +610,7 @@ +@@ -593,6 +606,7 @@ } this.field_71304_b.func_76320_a("tick"); @@ -71,7 +71,7 @@ CrashReport crashreport; try -@@ -621,6 +635,7 @@ +@@ -617,6 +631,7 @@ throw new ReportedException(crashreport); } @@ -79,7 +79,7 @@ this.field_71304_b.func_76319_b(); this.field_71304_b.func_76320_a("tracker"); worldserver.func_73039_n().func_72788_a(); -@@ -699,7 +714,7 @@ +@@ -695,7 +710,7 @@ public String getServerModName() { diff --git a/fml/patches/minecraft/net/minecraft/server/gui/MinecraftServerGui.java.patch b/fml/patches/minecraft/net/minecraft/server/gui/MinecraftServerGui.java.patch index 70be448a3..fe1cb7236 100644 --- a/fml/patches/minecraft/net/minecraft/server/gui/MinecraftServerGui.java.patch +++ b/fml/patches/minecraft/net/minecraft/server/gui/MinecraftServerGui.java.patch @@ -16,7 +16,7 @@ } public MinecraftServerGui(DedicatedServer p_i2362_1_) -@@ -165,8 +167,15 @@ +@@ -164,8 +166,15 @@ return jpanel; } diff --git a/fml/src/main/java/cpw/mods/fml/client/FMLClientHandler.java b/fml/src/main/java/cpw/mods/fml/client/FMLClientHandler.java index 975be3c77..06c2c8161 100644 --- a/fml/src/main/java/cpw/mods/fml/client/FMLClientHandler.java +++ b/fml/src/main/java/cpw/mods/fml/client/FMLClientHandler.java @@ -175,7 +175,7 @@ public class FMLClientHandler implements IFMLSidedHandler this.resourcePackList = resourcePackList; this.resourceManager = resourceManager; this.resourcePackMap = Maps.newHashMap(); - if (minecraft.func_71355_q()) + if (minecraft.isDemo()) { FMLLog.severe("DEMO MODE DETECTED, FML will not work. Finishing now."); haltGame("FML will not run in demo mode", new RuntimeException()); @@ -247,7 +247,7 @@ public class FMLClientHandler implements IFMLSidedHandler @Override public void haltGame(String message, Throwable t) { - client.func_71377_b(new CrashReport(message, t)); + client.displayCrashReport(new CrashReport(message, t)); throw Throwables.propagate(t); } /** @@ -279,8 +279,8 @@ public class FMLClientHandler implements IFMLSidedHandler } // Reload resources - client.func_110436_a(); - RenderingRegistry.instance().loadEntityRenderers((Map, Render>)RenderManager.field_78727_a.field_78729_o); + client.refreshResources(); + RenderingRegistry.instance().loadEntityRenderers((Map, Render>)RenderManager.instance.entityRenderMap); guiFactories = HashBiMap.create(); for (ModContainer mc : Loader.instance().getActiveModList()) { @@ -302,7 +302,7 @@ public class FMLClientHandler implements IFMLSidedHandler } } loading = false; - client.field_71474_y.func_74300_a(); //Reload options to load any mod added keybindings. + client.gameSettings.loadOptions(); //Reload options to load any mod added keybindings. } @SuppressWarnings("unused") @@ -380,8 +380,8 @@ public class FMLClientHandler implements IFMLSidedHandler */ public void displayGuiScreen(EntityPlayer player, GuiScreen gui) { - if (client.field_71439_g==player && gui != null) { - client.func_147108_a(gui); + if (client.thePlayer==player && gui != null) { + client.displayGuiScreen(gui); } } @@ -421,17 +421,17 @@ public class FMLClientHandler implements IFMLSidedHandler public void showGuiScreen(Object clientGuiElement) { GuiScreen gui = (GuiScreen) clientGuiElement; - client.func_147108_a(gui); + client.displayGuiScreen(gui); } public WorldClient getWorldClient() { - return client.field_71441_e; + return client.theWorld; } public EntityClientPlayerMP getClientPlayerEntity() { - return client.field_71439_g; + return client.thePlayer; } @Override @@ -450,7 +450,7 @@ public class FMLClientHandler implements IFMLSidedHandler @Override public MinecraftServer getServer() { - return client.func_71401_C(); + return client.getIntegratedServer(); } public void displayMissingMods(Object modMissingPacket) @@ -480,7 +480,7 @@ public class FMLClientHandler implements IFMLSidedHandler */ public boolean isGUIOpen(Class gui) { - return client.field_71462_r != null && client.field_71462_r.getClass().equals(gui); + return client.currentScreen != null && client.currentScreen.getClass().equals(gui); } @@ -513,7 +513,7 @@ public class FMLClientHandler implements IFMLSidedHandler @Override public void updateResourcePackList() { - client.func_110436_a(); + client.refreshResources(); } public IResourcePack getResourcePackFor(String modId) @@ -524,7 +524,7 @@ public class FMLClientHandler implements IFMLSidedHandler @Override public String getCurrentLanguage() { - return client.func_135016_M().func_135041_c().func_135034_a(); + return client.getLanguageManager().getCurrentLanguage().getLanguageCode(); } @Override @@ -533,7 +533,7 @@ public class FMLClientHandler implements IFMLSidedHandler // If the server crashes during startup, it might hang the client- reset the client so it can abend properly. MinecraftServer server = getServer(); - if (server != null && !server.func_71200_ad()) + if (server != null && !server.serverIsInRunLoop()) { ObfuscationReflectionHelper.setPrivateValue(MinecraftServer.class, server, true, "field_71296"+"_Q","serverIs"+"Running"); } @@ -547,14 +547,14 @@ public class FMLClientHandler implements IFMLSidedHandler @Override public NetworkManager getClientToServerNetworkManager() { - return this.client.func_147114_u()!=null ? this.client.func_147114_u().func_147298_b() : null; + return this.client.getNetHandler()!=null ? this.client.getNetHandler().getNetworkManager() : null; } public void handleClientWorldClosing(WorldClient world) { NetworkManager client = getClientToServerNetworkManager(); // ONLY revert a non-local connection - if (client != null && !client.func_150731_c()) + if (client != null && !client.isLocalChannel()) { GameData.revertToFrozen(); } @@ -567,7 +567,7 @@ public class FMLClientHandler implements IFMLSidedHandler public File getSavesDir() { - return new File(client.field_71412_D, "saves"); + return new File(client.mcDataDir, "saves"); } public void tryLoadExistingWorld(GuiSelectWorld selectWorldGUI, String dirName, String saveName) { @@ -575,13 +575,13 @@ public class FMLClientHandler implements IFMLSidedHandler NBTTagCompound leveldat; try { - leveldat = CompressedStreamTools.func_74796_a(new FileInputStream(new File(dir, "level.dat"))); + leveldat = CompressedStreamTools.readCompressed(new FileInputStream(new File(dir, "level.dat"))); } catch (Exception e) { try { - leveldat = CompressedStreamTools.func_74796_a(new FileInputStream(new File(dir, "level.dat_old"))); + leveldat = CompressedStreamTools.readCompressed(new FileInputStream(new File(dir, "level.dat_old"))); } catch (Exception e1) { @@ -589,8 +589,8 @@ public class FMLClientHandler implements IFMLSidedHandler return; } } - NBTTagCompound fmlData = leveldat.func_74775_l("FML"); - if (fmlData.func_74764_b("ModItemData")) + NBTTagCompound fmlData = leveldat.getCompoundTag("FML"); + if (fmlData.hasKey("ModItemData")) { showGuiScreen(new GuiOldSaveLoadConfirm(dirName, saveName, selectWorldGUI)); } @@ -614,7 +614,7 @@ public class FMLClientHandler implements IFMLSidedHandler Thread.interrupted(); gameReleaseLatch = new CountDownLatch(1); clientWaiter = Thread.currentThread(); - client.func_71371_a(dirName, saveName, (WorldSettings)null); + client.launchIntegratedServer(dirName, saveName, (WorldSettings)null); System.out.printf("POKEE %b\n", Thread.currentThread().isInterrupted()); gameReleaseLatch.await(); } @@ -626,7 +626,7 @@ public class FMLClientHandler implements IFMLSidedHandler } catch (GameRegistryException gre) { - client.func_71403_a(null); + client.loadWorld(null); showGuiScreen(new GuiModItemsMissing(gre.getItems(), gre.getMessage())); } Thread.interrupted(); @@ -676,7 +676,7 @@ public class FMLClientHandler implements IFMLSidedHandler } else { - String serverDescription = data.field_78843_d; + String serverDescription = data.serverMOTD; boolean moddedClientAllowed = true; if (!Strings.isNullOrEmpty(serverDescription)) { @@ -729,7 +729,7 @@ public class FMLClientHandler implements IFMLSidedHandler { return null; } - this.client.func_110434_K().func_110577_a(iconSheet); + this.client.getTextureManager().bindTexture(iconSheet); Gui.func_146110_a(x + width - 18, y + 10, 0, (float)idx, 16, 16, 256.0f, 256.0f); if (blocked) { @@ -874,7 +874,7 @@ public class FMLClientHandler implements IFMLSidedHandler public boolean handlingCrash(CrashReport report) { - return report.func_71505_b() instanceof GameRegistryException; + return report.getCrashCause() instanceof GameRegistryException; } @Override diff --git a/fml/src/main/java/cpw/mods/fml/client/FMLConfigGuiFactory.java b/fml/src/main/java/cpw/mods/fml/client/FMLConfigGuiFactory.java index aec548d08..dce15f4af 100644 --- a/fml/src/main/java/cpw/mods/fml/client/FMLConfigGuiFactory.java +++ b/fml/src/main/java/cpw/mods/fml/client/FMLConfigGuiFactory.java @@ -20,26 +20,26 @@ public class FMLConfigGuiFactory implements IModGuiFactory { @SuppressWarnings("unchecked") @Override - public void func_73866_w_() + public void initGui() { - this.field_146292_n.add(new GuiButton(1, this.field_146294_l / 2 - 75, this.field_146295_m - 38, I18n.func_135052_a("gui.done"))); + this.buttonList.add(new GuiButton(1, this.width / 2 - 75, this.height - 38, I18n.format("gui.done"))); } @Override - protected void func_146284_a(GuiButton p_73875_1_) + protected void actionPerformed(GuiButton p_73875_1_) { - if (p_73875_1_.field_146124_l && p_73875_1_.field_146127_k == 1) + if (p_73875_1_.enabled && p_73875_1_.id == 1) { FMLClientHandler.instance().showGuiScreen(parent); } } @Override - public void func_73863_a(int p_73863_1_, int p_73863_2_, float p_73863_3_) + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { - this.func_146276_q_(); - this.func_73732_a(this.field_146289_q, "Forge Mod Loader test config screen", this.field_146294_l / 2, 40, 0xFFFFFF); - super.func_73863_a(p_73863_1_, p_73863_2_, p_73863_3_); + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, "Forge Mod Loader test config screen", this.width / 2, 40, 0xFFFFFF); + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); } } diff --git a/fml/src/main/java/cpw/mods/fml/client/FMLFileResourcePack.java b/fml/src/main/java/cpw/mods/fml/client/FMLFileResourcePack.java index a28de4249..50ad1b144 100644 --- a/fml/src/main/java/cpw/mods/fml/client/FMLFileResourcePack.java +++ b/fml/src/main/java/cpw/mods/fml/client/FMLFileResourcePack.java @@ -26,16 +26,16 @@ public class FMLFileResourcePack extends FileResourcePack { } @Override - public String func_130077_b() + public String getPackName() { return "FMLFileResourcePack:"+container.getName(); } @Override - protected InputStream func_110591_a(String resourceName) throws IOException + protected InputStream getInputStreamByName(String resourceName) throws IOException { try { - return super.func_110591_a(resourceName); + return super.getInputStreamByName(resourceName); } catch (IOException ioe) { @@ -54,8 +54,8 @@ public class FMLFileResourcePack extends FileResourcePack { } @Override - public BufferedImage func_110586_a() throws IOException + public BufferedImage getPackImage() throws IOException { - return ImageIO.read(func_110591_a(container.getMetadata().logoFile)); + return ImageIO.read(getInputStreamByName(container.getMetadata().logoFile)); } } diff --git a/fml/src/main/java/cpw/mods/fml/client/FMLFolderResourcePack.java b/fml/src/main/java/cpw/mods/fml/client/FMLFolderResourcePack.java index b82417b9a..cdb7fcac7 100644 --- a/fml/src/main/java/cpw/mods/fml/client/FMLFolderResourcePack.java +++ b/fml/src/main/java/cpw/mods/fml/client/FMLFolderResourcePack.java @@ -26,21 +26,21 @@ public class FMLFolderResourcePack extends FolderResourcePack { } @Override - protected boolean func_110593_b(String p_110593_1_) + protected boolean hasResourceName(String p_110593_1_) { - return super.func_110593_b(p_110593_1_); + return super.hasResourceName(p_110593_1_); } @Override - public String func_130077_b() + public String getPackName() { return "FMLFileResourcePack:"+container.getName(); } @Override - protected InputStream func_110591_a(String resourceName) throws IOException + protected InputStream getInputStreamByName(String resourceName) throws IOException { try { - return super.func_110591_a(resourceName); + return super.getInputStreamByName(resourceName); } catch (IOException ioe) { @@ -59,9 +59,9 @@ public class FMLFolderResourcePack extends FolderResourcePack { } @Override - public BufferedImage func_110586_a() throws IOException + public BufferedImage getPackImage() throws IOException { - return ImageIO.read(func_110591_a(container.getMetadata().logoFile)); + return ImageIO.read(getInputStreamByName(container.getMetadata().logoFile)); } } diff --git a/fml/src/main/java/cpw/mods/fml/client/GuiAccessDenied.java b/fml/src/main/java/cpw/mods/fml/client/GuiAccessDenied.java index 5d1615641..1951353ba 100644 --- a/fml/src/main/java/cpw/mods/fml/client/GuiAccessDenied.java +++ b/fml/src/main/java/cpw/mods/fml/client/GuiAccessDenied.java @@ -29,27 +29,27 @@ public class GuiAccessDenied extends GuiScreen @SuppressWarnings("unchecked") @Override - public void func_73866_w_() + public void initGui() { - this.field_146292_n.add(new GuiButton(1, this.field_146294_l / 2 - 75, this.field_146295_m - 38, I18n.func_135052_a("gui.done"))); + this.buttonList.add(new GuiButton(1, this.width / 2 - 75, this.height - 38, I18n.format("gui.done"))); } @Override - protected void func_146284_a(GuiButton p_73875_1_) + protected void actionPerformed(GuiButton p_73875_1_) { - if (p_73875_1_.field_146124_l && p_73875_1_.field_146127_k == 1) + if (p_73875_1_.enabled && p_73875_1_.id == 1) { FMLClientHandler.instance().showGuiScreen(parent); } } @Override - public void func_73863_a(int p_73863_1_, int p_73863_2_, float p_73863_3_) + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { - this.func_146276_q_(); + this.drawDefaultBackground(); int offset = Math.max(85 - 2 * 10, 10); - this.func_73732_a(this.field_146289_q, "Forge Mod Loader could not connect to this server", this.field_146294_l / 2, offset, 0xFFFFFF); + this.drawCenteredString(this.fontRendererObj, "Forge Mod Loader could not connect to this server", this.width / 2, offset, 0xFFFFFF); offset += 10; - this.func_73732_a(this.field_146289_q, String.format("The server %s has forbidden modded access", data.field_78847_a), this.field_146294_l / 2, offset, 0xFFFFFF); - super.func_73863_a(p_73863_1_, p_73863_2_, p_73863_3_); + this.drawCenteredString(this.fontRendererObj, String.format("The server %s has forbidden modded access", data.serverName), this.width / 2, offset, 0xFFFFFF); + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); } } diff --git a/fml/src/main/java/cpw/mods/fml/client/GuiBackupFailed.java b/fml/src/main/java/cpw/mods/fml/client/GuiBackupFailed.java index 87bb221c7..fa0624aee 100644 --- a/fml/src/main/java/cpw/mods/fml/client/GuiBackupFailed.java +++ b/fml/src/main/java/cpw/mods/fml/client/GuiBackupFailed.java @@ -29,27 +29,27 @@ public class GuiBackupFailed extends GuiScreen @SuppressWarnings("unchecked") @Override - public void func_73866_w_() + public void initGui() { - this.field_146292_n.add(new GuiButton(1, this.field_146294_l / 2 - 75, this.field_146295_m - 38, I18n.func_135052_a("gui.done"))); + this.buttonList.add(new GuiButton(1, this.width / 2 - 75, this.height - 38, I18n.format("gui.done"))); } @Override - protected void func_146284_a(GuiButton p_73875_1_) + protected void actionPerformed(GuiButton p_73875_1_) { - if (p_73875_1_.field_146124_l && p_73875_1_.field_146127_k == 1) + if (p_73875_1_.enabled && p_73875_1_.id == 1) { FMLClientHandler.instance().showGuiScreen(parent); } } @Override - public void func_73863_a(int p_73863_1_, int p_73863_2_, float p_73863_3_) + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { - this.func_146276_q_(); + this.drawDefaultBackground(); int offset = Math.max(85 - 2 * 10, 10); - this.func_73732_a(this.field_146289_q, String.format("There was an error saving the archive %s", zipName.getName()), this.field_146294_l / 2, offset, 0xFFFFFF); + this.drawCenteredString(this.fontRendererObj, String.format("There was an error saving the archive %s", zipName.getName()), this.width / 2, offset, 0xFFFFFF); offset += 10; - this.func_73732_a(this.field_146289_q, String.format("Please fix the problem and try again"), this.field_146294_l / 2, offset, 0xFFFFFF); - super.func_73863_a(p_73863_1_, p_73863_2_, p_73863_3_); + this.drawCenteredString(this.fontRendererObj, String.format("Please fix the problem and try again"), this.width / 2, offset, 0xFFFFFF); + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); } } diff --git a/fml/src/main/java/cpw/mods/fml/client/GuiCustomModLoadingErrorScreen.java b/fml/src/main/java/cpw/mods/fml/client/GuiCustomModLoadingErrorScreen.java index a9f66fffc..8eab99af9 100644 --- a/fml/src/main/java/cpw/mods/fml/client/GuiCustomModLoadingErrorScreen.java +++ b/fml/src/main/java/cpw/mods/fml/client/GuiCustomModLoadingErrorScreen.java @@ -23,15 +23,15 @@ public class GuiCustomModLoadingErrorScreen extends GuiErrorScreen this.customException = customException; } @Override - public void func_73866_w_() + public void initGui() { - super.func_73866_w_(); - this.customException.initGui(this, field_146289_q); + super.initGui(); + this.customException.initGui(this, fontRendererObj); } @Override - public void func_73863_a(int p_73863_1_, int p_73863_2_, float p_73863_3_) + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { - this.func_146276_q_(); - this.customException.drawScreen(this, field_146289_q, p_73863_1_, p_73863_2_, p_73863_3_); + this.drawDefaultBackground(); + this.customException.drawScreen(this, fontRendererObj, p_73863_1_, p_73863_2_, p_73863_3_); } } diff --git a/fml/src/main/java/cpw/mods/fml/client/GuiDupesFound.java b/fml/src/main/java/cpw/mods/fml/client/GuiDupesFound.java index 5eb90d40f..7d3f129c3 100644 --- a/fml/src/main/java/cpw/mods/fml/client/GuiDupesFound.java +++ b/fml/src/main/java/cpw/mods/fml/client/GuiDupesFound.java @@ -31,25 +31,25 @@ public class GuiDupesFound extends GuiErrorScreen } @Override - public void func_73866_w_() + public void initGui() { - super.func_73866_w_(); + super.initGui(); } @Override - public void func_73863_a(int p_73863_1_, int p_73863_2_, float p_73863_3_) + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { - this.func_146276_q_(); + this.drawDefaultBackground(); int offset = Math.max(85 - dupes.dupes.size() * 10, 10); - this.func_73732_a(this.field_146289_q, "Forge Mod Loader has found a problem with your minecraft installation", this.field_146294_l / 2, offset, 0xFFFFFF); + this.drawCenteredString(this.fontRendererObj, "Forge Mod Loader has found a problem with your minecraft installation", this.width / 2, offset, 0xFFFFFF); offset+=10; - this.func_73732_a(this.field_146289_q, "You have mod sources that are duplicate within your system", this.field_146294_l / 2, offset, 0xFFFFFF); + this.drawCenteredString(this.fontRendererObj, "You have mod sources that are duplicate within your system", this.width / 2, offset, 0xFFFFFF); offset+=10; - this.func_73732_a(this.field_146289_q, "Mod Id : File name", this.field_146294_l / 2, offset, 0xFFFFFF); + this.drawCenteredString(this.fontRendererObj, "Mod Id : File name", this.width / 2, offset, 0xFFFFFF); offset+=5; for (Entry mc : dupes.dupes.entries()) { offset+=10; - this.func_73732_a(this.field_146289_q, String.format("%s : %s", mc.getKey().getModId(), mc.getValue().getName()), this.field_146294_l / 2, offset, 0xEEEEEE); + this.drawCenteredString(this.fontRendererObj, String.format("%s : %s", mc.getKey().getModId(), mc.getValue().getName()), this.width / 2, offset, 0xEEEEEE); } } } diff --git a/fml/src/main/java/cpw/mods/fml/client/GuiIngameModOptions.java b/fml/src/main/java/cpw/mods/fml/client/GuiIngameModOptions.java index 1d261e900..2b65d83f5 100644 --- a/fml/src/main/java/cpw/mods/fml/client/GuiIngameModOptions.java +++ b/fml/src/main/java/cpw/mods/fml/client/GuiIngameModOptions.java @@ -18,38 +18,38 @@ public class GuiIngameModOptions extends GuiScreen @SuppressWarnings("unchecked") @Override - public void func_73866_w_() + public void initGui() { this.optionList=new GuiModOptionList(this); - this.optionList.registerScrollButtons(this.field_146292_n, 7, 8); - this.field_146292_n.add(new GuiButton(200, this.field_146294_l / 2 - 100, this.field_146295_m / 6 + 168, I18n.func_135052_a("gui.done", new Object[0]))); + this.optionList.registerScrollButtons(this.buttonList, 7, 8); + this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.format("gui.done", new Object[0]))); } @Override - protected void func_146284_a(GuiButton p_146284_1_) + protected void actionPerformed(GuiButton p_146284_1_) { - if (p_146284_1_.field_146124_l) + if (p_146284_1_.enabled) { - if (p_146284_1_.field_146127_k == 200) + if (p_146284_1_.id == 200) { - this.field_146297_k.field_71474_y.func_74303_b(); - this.field_146297_k.func_147108_a(this.parentScreen); + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(this.parentScreen); } } } @Override - public void func_73863_a(int p_73863_1_, int p_73863_2_, float p_73863_3_) + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { // force a non-transparent background - this.func_146276_q_(); + this.drawDefaultBackground(); this.optionList.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); - this.func_73732_a(this.field_146289_q, this.title, this.field_146294_l / 2, 15, 0xFFFFFF); - super.func_73863_a(p_73863_1_, p_73863_2_, p_73863_3_); + this.drawCenteredString(this.fontRendererObj, this.title, this.width / 2, 15, 0xFFFFFF); + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); } FontRenderer getFontRenderer() { - return field_146289_q; + return fontRendererObj; } -} \ No newline at end of file +} diff --git a/fml/src/main/java/cpw/mods/fml/client/GuiModItemsMissing.java b/fml/src/main/java/cpw/mods/fml/client/GuiModItemsMissing.java index 202f7081f..4335bfc91 100644 --- a/fml/src/main/java/cpw/mods/fml/client/GuiModItemsMissing.java +++ b/fml/src/main/java/cpw/mods/fml/client/GuiModItemsMissing.java @@ -30,29 +30,29 @@ public class GuiModItemsMissing extends GuiScreen @SuppressWarnings("unchecked") @Override - public void func_73866_w_() + public void initGui() { - this.field_146292_n.add(new GuiButton(1, this.field_146294_l / 2 - 75, this.field_146295_m - 38, I18n.func_135052_a("gui.done"))); + this.buttonList.add(new GuiButton(1, this.width / 2 - 75, this.height - 38, I18n.format("gui.done"))); } @Override - protected void func_146284_a(GuiButton p_73875_1_) + protected void actionPerformed(GuiButton p_73875_1_) { - if (p_73875_1_.field_146124_l && p_73875_1_.field_146127_k == 1) + if (p_73875_1_.enabled && p_73875_1_.id == 1) { FMLClientHandler.instance().showGuiScreen(null); } } @Override - public void func_73863_a(int p_73863_1_, int p_73863_2_, float p_73863_3_) + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { - this.func_146276_q_(); + this.drawDefaultBackground(); int offset = 85; - this.func_73732_a(this.field_146289_q, "Forge Mod Loader could load this save", this.field_146294_l / 2, offset, 0xFFFFFF); + this.drawCenteredString(this.fontRendererObj, "Forge Mod Loader could load this save", this.width / 2, offset, 0xFFFFFF); offset += 10; - this.func_73732_a(this.field_146289_q, String.format("There are %d unassigned blocks and items in this save", missingItems.size()), this.field_146294_l / 2, offset, 0xFFFFFF); + this.drawCenteredString(this.fontRendererObj, String.format("There are %d unassigned blocks and items in this save", missingItems.size()), this.width / 2, offset, 0xFFFFFF); offset += 10; - this.func_73732_a(this.field_146289_q, "You will not be able to load until they are present again", this.field_146294_l / 2, offset, 0xFFFFFF); - super.func_73863_a(p_73863_1_, p_73863_2_, p_73863_3_); + this.drawCenteredString(this.fontRendererObj, "You will not be able to load until they are present again", this.width / 2, offset, 0xFFFFFF); + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); } } diff --git a/fml/src/main/java/cpw/mods/fml/client/GuiModList.java b/fml/src/main/java/cpw/mods/fml/client/GuiModList.java index 19e3fed52..cd37cba03 100644 --- a/fml/src/main/java/cpw/mods/fml/client/GuiModList.java +++ b/fml/src/main/java/cpw/mods/fml/client/GuiModList.java @@ -89,37 +89,37 @@ public class GuiModList extends GuiScreen @SuppressWarnings("unchecked") @Override - public void func_73866_w_() + public void initGui() { for (ModContainer mod : mods) { - listWidth=Math.max(listWidth,getFontRenderer().func_78256_a(mod.getName()) + 10); - listWidth=Math.max(listWidth,getFontRenderer().func_78256_a(mod.getVersion()) + 10); + listWidth=Math.max(listWidth,getFontRenderer().getStringWidth(mod.getName()) + 10); + listWidth=Math.max(listWidth,getFontRenderer().getStringWidth(mod.getVersion()) + 10); } listWidth=Math.min(listWidth, 150); - this.field_146292_n.add(new GuiButton(6, this.field_146294_l / 2 - 75, this.field_146295_m - 38, I18n.func_135052_a("gui.done"))); - configModButton = new GuiButton(20, 10, this.field_146295_m - 60, this.listWidth, 20, "Config"); - disableModButton = new GuiButton(21, 10, this.field_146295_m - 38, this.listWidth, 20, "Disable"); - this.field_146292_n.add(configModButton); - this.field_146292_n.add(disableModButton); + this.buttonList.add(new GuiButton(6, this.width / 2 - 75, this.height - 38, I18n.format("gui.done"))); + configModButton = new GuiButton(20, 10, this.height - 60, this.listWidth, 20, "Config"); + disableModButton = new GuiButton(21, 10, this.height - 38, this.listWidth, 20, "Disable"); + this.buttonList.add(configModButton); + this.buttonList.add(disableModButton); this.modList=new GuiSlotModList(this, mods, listWidth); - this.modList.registerScrollButtons(this.field_146292_n, 7, 8); + this.modList.registerScrollButtons(this.buttonList, 7, 8); } @Override - protected void func_146284_a(GuiButton button) { - if (button.field_146124_l) + protected void actionPerformed(GuiButton button) { + if (button.enabled) { - switch (button.field_146127_k) + switch (button.id) { case 6: - this.field_146297_k.func_147108_a(this.mainMenu); + this.mc.displayGuiScreen(this.mainMenu); return; case 20: try { IModGuiFactory guiFactory = FMLClientHandler.instance().getGuiFactoryFor(selectedMod); GuiScreen newScreen = guiFactory.mainConfigGuiClass().getConstructor(GuiScreen.class).newInstance(this); - this.field_146297_k.func_147108_a(newScreen); + this.mc.displayGuiScreen(newScreen); } catch (Exception e) { @@ -128,34 +128,34 @@ public class GuiModList extends GuiScreen return; } } - super.func_146284_a(button); + super.actionPerformed(button); } public int drawLine(String line, int offset, int shifty) { - this.field_146289_q.func_78276_b(line, offset, shifty, 0xd7edea); + this.fontRendererObj.drawString(line, offset, shifty, 0xd7edea); return shifty + 10; } @Override - public void func_73863_a(int p_571_1_, int p_571_2_, float p_571_3_) + public void drawScreen(int p_571_1_, int p_571_2_, float p_571_3_) { this.modList.drawScreen(p_571_1_, p_571_2_, p_571_3_); - this.func_73732_a(this.field_146289_q, "Mod List", this.field_146294_l / 2, 16, 0xFFFFFF); + this.drawCenteredString(this.fontRendererObj, "Mod List", this.width / 2, 16, 0xFFFFFF); int offset = this.listWidth + 20; if (selectedMod != null) { GL11.glEnable(GL11.GL_BLEND); if (!selectedMod.getMetadata().autogenerated) { - configModButton.field_146125_m = true; - disableModButton.field_146125_m = true; + configModButton.visible = true; + disableModButton.visible = true; disableModButton.packedFGColour = 0xFF3377; - configModButton.field_146124_l = false; + configModButton.enabled = false; int shifty = 35; String logoFile = selectedMod.getMetadata().logoFile; if (!logoFile.isEmpty()) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - TextureManager tm = field_146297_k.func_110434_K(); + TextureManager tm = mc.getTextureManager(); IResourcePack pack = FMLClientHandler.instance().getResourcePackFor(selectedMod.getModId()); try { @@ -164,7 +164,7 @@ public class GuiModList extends GuiScreen BufferedImage logo = null; if (pack!=null) { - logo = pack.func_110586_a(); + logo = pack.getPackImage(); } else { @@ -176,13 +176,13 @@ public class GuiModList extends GuiScreen } if (logo != null) { - cachedLogo = tm.func_110578_a("modlogo", new DynamicTexture(logo)); + cachedLogo = tm.getDynamicTextureLocation("modlogo", new DynamicTexture(logo)); cachedLogoDimensions = new Dimension(logo.getWidth(), logo.getHeight()); } } if (cachedLogo != null) { - this.field_146297_k.field_71446_o.func_110577_a(cachedLogo); + this.mc.renderEngine.bindTexture(cachedLogo); double scaleX = cachedLogoDimensions.width / 200.0; double scaleY = cachedLogoDimensions.height / 65.0; double scale = 1.0; @@ -193,13 +193,13 @@ public class GuiModList extends GuiScreen cachedLogoDimensions.width *= scale; cachedLogoDimensions.height *= scale; int top = 32; - Tessellator tess = Tessellator.field_78398_a; - tess.func_78382_b(); - tess.func_78374_a(offset, top + cachedLogoDimensions.height, field_73735_i, 0, 1); - tess.func_78374_a(offset + cachedLogoDimensions.width, top + cachedLogoDimensions.height, field_73735_i, 1, 1); - tess.func_78374_a(offset + cachedLogoDimensions.width, top, field_73735_i, 1, 0); - tess.func_78374_a(offset, top, field_73735_i, 0, 0); - tess.func_78381_a(); + Tessellator tess = Tessellator.instance; + tess.startDrawingQuads(); + tess.addVertexWithUV(offset, top + cachedLogoDimensions.height, zLevel, 0, 1); + tess.addVertexWithUV(offset + cachedLogoDimensions.width, top + cachedLogoDimensions.height, zLevel, 1, 1); + tess.addVertexWithUV(offset + cachedLogoDimensions.width, top, zLevel, 1, 0); + tess.addVertexWithUV(offset, top, zLevel, 0, 0); + tess.draw(); shifty += 65; } @@ -209,7 +209,7 @@ public class GuiModList extends GuiScreen ; } } - this.field_146289_q.func_78261_a(selectedMod.getMetadata().name, offset, shifty, 0xFFFFFF); + this.fontRendererObj.drawStringWithShadow(selectedMod.getMetadata().name, offset, shifty, 0xFFFFFF); shifty += 12; shifty = drawLine(String.format("Version: %s (%s)", selectedMod.getDisplayVersion(), selectedMod.getVersion()), offset, shifty); @@ -220,67 +220,67 @@ public class GuiModList extends GuiScreen shifty = drawLine(String.format("Authors: %s", selectedMod.getMetadata().getAuthorList()), offset, shifty); shifty = drawLine(String.format("URL: %s", selectedMod.getMetadata().url), offset, shifty); shifty = drawLine(selectedMod.getMetadata().childMods.isEmpty() ? "No child mods for this mod" : String.format("Child mods: %s", selectedMod.getMetadata().getChildModList()), offset, shifty); - int rightSide = this.field_146294_l - offset - 20; + int rightSide = this.width - offset - 20; if (rightSide > 20) { - this.getFontRenderer().func_78279_b(selectedMod.getMetadata().description, offset, shifty + 10, rightSide, 0xDDDDDD); + this.getFontRenderer().drawSplitString(selectedMod.getMetadata().description, offset, shifty + 10, rightSide, 0xDDDDDD); } Disableable disableable = selectedMod.canBeDisabled(); if (disableable == Disableable.RESTART) { - disableModButton.field_146124_l = true; - disableModButton.field_146125_m = true; + disableModButton.enabled = true; + disableModButton.visible = true; disableModButton.packedFGColour = 0xFF3377; } else if (disableable == Disableable.YES) { - disableModButton.field_146124_l = true; - disableModButton.field_146125_m = true; + disableModButton.enabled = true; + disableModButton.visible = true; disableModButton.packedFGColour = 0; } else { disableModButton.packedFGColour = 0; - disableModButton.field_146125_m = true; - disableModButton.field_146124_l = false; + disableModButton.visible = true; + disableModButton.enabled = false; } IModGuiFactory guiFactory = FMLClientHandler.instance().getGuiFactoryFor(selectedMod); if (guiFactory == null || guiFactory.mainConfigGuiClass() == null) { - configModButton.field_146125_m = true; - configModButton.field_146124_l = false; + configModButton.visible = true; + configModButton.enabled = false; } else { - configModButton.field_146125_m = true; - configModButton.field_146124_l = true; + configModButton.visible = true; + configModButton.enabled = true; } } else { - offset = ( this.listWidth + this.field_146294_l ) / 2; - this.func_73732_a(this.field_146289_q, selectedMod.getName(), offset, 35, 0xFFFFFF); - this.func_73732_a(this.field_146289_q, String.format("Version: %s",selectedMod.getVersion()), offset, 45, 0xFFFFFF); - this.func_73732_a(this.field_146289_q, String.format("Mod State: %s",Loader.instance().getModState(selectedMod)), offset, 55, 0xFFFFFF); - this.func_73732_a(this.field_146289_q, "No mod information found", offset, 65, 0xDDDDDD); - this.func_73732_a(this.field_146289_q, "Ask your mod author to provide a mod mcmod.info file", offset, 75, 0xDDDDDD); - configModButton.field_146125_m = false; - disableModButton.field_146125_m = false; + offset = ( this.listWidth + this.width ) / 2; + this.drawCenteredString(this.fontRendererObj, selectedMod.getName(), offset, 35, 0xFFFFFF); + this.drawCenteredString(this.fontRendererObj, String.format("Version: %s",selectedMod.getVersion()), offset, 45, 0xFFFFFF); + this.drawCenteredString(this.fontRendererObj, String.format("Mod State: %s",Loader.instance().getModState(selectedMod)), offset, 55, 0xFFFFFF); + this.drawCenteredString(this.fontRendererObj, "No mod information found", offset, 65, 0xDDDDDD); + this.drawCenteredString(this.fontRendererObj, "Ask your mod author to provide a mod mcmod.info file", offset, 75, 0xDDDDDD); + configModButton.visible = false; + disableModButton.visible = false; } GL11.glDisable(GL11.GL_BLEND); } else { - configModButton.field_146125_m = false; - disableModButton.field_146125_m = false; + configModButton.visible = false; + disableModButton.visible = false; } - super.func_73863_a(p_571_1_, p_571_2_, p_571_3_); + super.drawScreen(p_571_1_, p_571_2_, p_571_3_); } Minecraft getMinecraftInstance() { - return field_146297_k; + return mc; } FontRenderer getFontRenderer() { - return field_146289_q; + return fontRendererObj; } /** diff --git a/fml/src/main/java/cpw/mods/fml/client/GuiModOptionList.java b/fml/src/main/java/cpw/mods/fml/client/GuiModOptionList.java index 58198d621..e0b4bb646 100644 --- a/fml/src/main/java/cpw/mods/fml/client/GuiModOptionList.java +++ b/fml/src/main/java/cpw/mods/fml/client/GuiModOptionList.java @@ -8,7 +8,7 @@ public class GuiModOptionList extends GuiScrollingList { public GuiModOptionList(GuiIngameModOptions parent) { - super(parent.field_146297_k, 150, parent.field_146295_m, 32, parent.field_146295_m - 65 + 4, 10, 35); + super(parent.mc, 150, parent.height, 32, parent.height - 65 + 4, 10, 35); this.parent = parent; } @@ -39,9 +39,9 @@ public class GuiModOptionList extends GuiScrollingList { @Override protected void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5) { - this.parent.getFontRenderer().func_78276_b(this.parent.getFontRenderer().func_78269_a("Test 1", listWidth - 10), this.left + 3 , var3 + 2, 0xFF2222); - this.parent.getFontRenderer().func_78276_b(this.parent.getFontRenderer().func_78269_a("TEST 2", listWidth - 10), this.left + 3 , var3 + 12, 0xFF2222); - this.parent.getFontRenderer().func_78276_b(this.parent.getFontRenderer().func_78269_a("DISABLED", listWidth - 10), this.left + 3 , var3 + 22, 0xFF2222); + this.parent.getFontRenderer().drawString(this.parent.getFontRenderer().trimStringToWidth("Test 1", listWidth - 10), this.left + 3 , var3 + 2, 0xFF2222); + this.parent.getFontRenderer().drawString(this.parent.getFontRenderer().trimStringToWidth("TEST 2", listWidth - 10), this.left + 3 , var3 + 12, 0xFF2222); + this.parent.getFontRenderer().drawString(this.parent.getFontRenderer().trimStringToWidth("DISABLED", listWidth - 10), this.left + 3 , var3 + 22, 0xFF2222); } } diff --git a/fml/src/main/java/cpw/mods/fml/client/GuiModsMissing.java b/fml/src/main/java/cpw/mods/fml/client/GuiModsMissing.java index b81370f85..c2631f634 100644 --- a/fml/src/main/java/cpw/mods/fml/client/GuiModsMissing.java +++ b/fml/src/main/java/cpw/mods/fml/client/GuiModsMissing.java @@ -29,18 +29,18 @@ public class GuiModsMissing extends GuiErrorScreen } @Override - public void func_73866_w_() + public void initGui() { - super.func_73866_w_(); + super.initGui(); } @Override - public void func_73863_a(int p_73863_1_, int p_73863_2_, float p_73863_3_) + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { - this.func_146276_q_(); + this.drawDefaultBackground(); int offset = Math.max(85 - modsMissing.missingMods.size() * 10, 10); - this.func_73732_a(this.field_146289_q, "Forge Mod Loader has found a problem with your minecraft installation", this.field_146294_l / 2, offset, 0xFFFFFF); + this.drawCenteredString(this.fontRendererObj, "Forge Mod Loader has found a problem with your minecraft installation", this.width / 2, offset, 0xFFFFFF); offset+=10; - this.func_73732_a(this.field_146289_q, "The mods and versions listed below could not be found", this.field_146294_l / 2, offset, 0xFFFFFF); + this.drawCenteredString(this.fontRendererObj, "The mods and versions listed below could not be found", this.width / 2, offset, 0xFFFFFF); offset+=5; for (ArtifactVersion v : modsMissing.missingMods) { @@ -50,13 +50,13 @@ public class GuiModsMissing extends GuiErrorScreen DefaultArtifactVersion dav = (DefaultArtifactVersion)v; if (dav.getRange() != null && dav.getRange().isUnboundedAbove()) { - this.func_73732_a(this.field_146289_q, String.format("%s : minimum version required is %s", v.getLabel(), dav.getRange().getLowerBoundString()), this.field_146294_l / 2, offset, 0xEEEEEE); + this.drawCenteredString(this.fontRendererObj, String.format("%s : minimum version required is %s", v.getLabel(), dav.getRange().getLowerBoundString()), this.width / 2, offset, 0xEEEEEE); continue; } } - this.func_73732_a(this.field_146289_q, String.format("%s : %s", v.getLabel(), v.getRangeString()), this.field_146294_l / 2, offset, 0xEEEEEE); + this.drawCenteredString(this.fontRendererObj, String.format("%s : %s", v.getLabel(), v.getRangeString()), this.width / 2, offset, 0xEEEEEE); } offset+=20; - this.func_73732_a(this.field_146289_q, "The file 'ForgeModLoader-client-0.log' contains more information", this.field_146294_l / 2, offset, 0xFFFFFF); + this.drawCenteredString(this.fontRendererObj, "The file 'ForgeModLoader-client-0.log' contains more information", this.width / 2, offset, 0xFFFFFF); } } diff --git a/fml/src/main/java/cpw/mods/fml/client/GuiModsMissingForServer.java b/fml/src/main/java/cpw/mods/fml/client/GuiModsMissingForServer.java index a719812a3..69d4f1646 100644 --- a/fml/src/main/java/cpw/mods/fml/client/GuiModsMissingForServer.java +++ b/fml/src/main/java/cpw/mods/fml/client/GuiModsMissingForServer.java @@ -29,35 +29,35 @@ public class GuiModsMissingForServer extends GuiScreen @SuppressWarnings("unchecked") @Override - public void func_73866_w_() + public void initGui() { - this.field_146292_n.add(new GuiButton(1, this.field_146294_l / 2 - 75, this.field_146295_m - 38, I18n.func_135052_a("gui.done"))); + this.buttonList.add(new GuiButton(1, this.width / 2 - 75, this.height - 38, I18n.format("gui.done"))); } @Override - protected void func_146284_a(GuiButton p_73875_1_) + protected void actionPerformed(GuiButton p_73875_1_) { - if (p_73875_1_.field_146124_l && p_73875_1_.field_146127_k == 1) + if (p_73875_1_.enabled && p_73875_1_.id == 1) { FMLClientHandler.instance().showGuiScreen(null); } } @Override - public void func_73863_a(int p_73863_1_, int p_73863_2_, float p_73863_3_) + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { - this.func_146276_q_(); + this.drawDefaultBackground(); int offset = Math.max(85 - modsMissing.missingMods.size() * 10, 10); - this.func_73732_a(this.field_146289_q, "Forge Mod Loader could not connect to this server", this.field_146294_l / 2, offset, 0xFFFFFF); + this.drawCenteredString(this.fontRendererObj, "Forge Mod Loader could not connect to this server", this.width / 2, offset, 0xFFFFFF); offset += 10; - this.func_73732_a(this.field_146289_q, "The mods and versions listed below could not be found", this.field_146294_l / 2, offset, 0xFFFFFF); + this.drawCenteredString(this.fontRendererObj, "The mods and versions listed below could not be found", this.width / 2, offset, 0xFFFFFF); offset += 10; - this.func_73732_a(this.field_146289_q, "They are required to play on this server", this.field_146294_l / 2, offset, 0xFFFFFF); + this.drawCenteredString(this.fontRendererObj, "They are required to play on this server", this.width / 2, offset, 0xFFFFFF); offset += 5; for (ArtifactVersion v : modsMissing.missingMods) { offset += 10; - this.func_73732_a(this.field_146289_q, String.format("%s : %s", v.getLabel(), v.getRangeString()), this.field_146294_l / 2, offset, 0xEEEEEE); + this.drawCenteredString(this.fontRendererObj, String.format("%s : %s", v.getLabel(), v.getRangeString()), this.width / 2, offset, 0xEEEEEE); } - super.func_73863_a(p_73863_1_, p_73863_2_, p_73863_3_); + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); } } diff --git a/fml/src/main/java/cpw/mods/fml/client/GuiOldSaveLoadConfirm.java b/fml/src/main/java/cpw/mods/fml/client/GuiOldSaveLoadConfirm.java index 7bb9d0a5f..922a554b5 100644 --- a/fml/src/main/java/cpw/mods/fml/client/GuiOldSaveLoadConfirm.java +++ b/fml/src/main/java/cpw/mods/fml/client/GuiOldSaveLoadConfirm.java @@ -22,35 +22,35 @@ public class GuiOldSaveLoadConfirm extends GuiYesNo { super(parent, "", "", 0); this.dirName = dirName; this.saveName = saveName; - this.zip = new File(FMLClientHandler.instance().getClient().field_71412_D,String.format("%s-%2$td%2$tm%2$ty%2$tH%2$tM%2$tS.zip", saveName, System.currentTimeMillis())); + this.zip = new File(FMLClientHandler.instance().getClient().mcDataDir,String.format("%s-%2$td%2$tm%2$ty%2$tH%2$tM%2$tS.zip", saveName, System.currentTimeMillis())); } @Override - public void func_73863_a(int p_73863_1_, int p_73863_2_, float p_73863_3_) + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { - this.func_146276_q_(); - this.func_73732_a(this.field_146289_q, String.format("The world %s contains pre-update modding data", saveName), this.field_146294_l / 2, 50, 16777215); - this.func_73732_a(this.field_146289_q, String.format("There may be problems updating it to this version"), this.field_146294_l / 2, 70, 16777215); - this.func_73732_a(this.field_146289_q, String.format("FML will save a zip to %s", zip.getName()), this.field_146294_l / 2, 90, 16777215); - this.func_73732_a(this.field_146289_q, String.format("Do you wish to continue loading?"), this.field_146294_l / 2, 110, 16777215); + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, String.format("The world %s contains pre-update modding data", saveName), this.width / 2, 50, 16777215); + this.drawCenteredString(this.fontRendererObj, String.format("There may be problems updating it to this version"), this.width / 2, 70, 16777215); + this.drawCenteredString(this.fontRendererObj, String.format("FML will save a zip to %s", zip.getName()), this.width / 2, 90, 16777215); + this.drawCenteredString(this.fontRendererObj, String.format("Do you wish to continue loading?"), this.width / 2, 110, 16777215); int k; - for (k = 0; k < this.field_146292_n.size(); ++k) + for (k = 0; k < this.buttonList.size(); ++k) { - ((GuiButton)this.field_146292_n.get(k)).func_146112_a(this.field_146297_k, p_73863_1_, p_73863_2_); + ((GuiButton)this.buttonList.get(k)).drawButton(this.mc, p_73863_1_, p_73863_2_); } - for (k = 0; k < this.field_146293_o.size(); ++k) + for (k = 0; k < this.labelList.size(); ++k) { - ((GuiLabel)this.field_146293_o.get(k)).func_146159_a(this.field_146297_k, p_73863_1_, p_73863_2_); + ((GuiLabel)this.labelList.get(k)).func_146159_a(this.mc, p_73863_1_, p_73863_2_); } } @Override - protected void func_146284_a(GuiButton p_146284_1_) + protected void actionPerformed(GuiButton p_146284_1_) { - if (p_146284_1_.field_146127_k == 1) + if (p_146284_1_.id == 1) { - ObfuscationReflectionHelper.setPrivateValue(GuiSelectWorld.class, (GuiSelectWorld)field_146355_a, false, "field_"+"146634_i"); - FMLClientHandler.instance().showGuiScreen(field_146355_a); + ObfuscationReflectionHelper.setPrivateValue(GuiSelectWorld.class, (GuiSelectWorld)parentScreen, false, "field_"+"146634_i"); + FMLClientHandler.instance().showGuiScreen(parentScreen); } else { @@ -61,7 +61,7 @@ public class GuiOldSaveLoadConfirm extends GuiYesNo { } catch (IOException e) { FMLLog.log(Level.WARN, e, "There was a problem saving the backup %s. Please fix and try again", zip.getName()); - FMLClientHandler.instance().showGuiScreen(new GuiBackupFailed(field_146355_a, zip)); + FMLClientHandler.instance().showGuiScreen(new GuiBackupFailed(parentScreen, zip)); return; } FMLClientHandler.instance().showGuiScreen(null); diff --git a/fml/src/main/java/cpw/mods/fml/client/GuiScrollingList.java b/fml/src/main/java/cpw/mods/fml/client/GuiScrollingList.java index 90dbaf19d..e1d053874 100644 --- a/fml/src/main/java/cpw/mods/fml/client/GuiScrollingList.java +++ b/fml/src/main/java/cpw/mods/fml/client/GuiScrollingList.java @@ -133,15 +133,15 @@ public abstract class GuiScrollingList public void actionPerformed(GuiButton button) { - if (button.field_146124_l) + if (button.enabled) { - if (button.field_146127_k == this.scrollUpActionId) + if (button.id == this.scrollUpActionId) { this.scrollDistance -= (float)(this.slotHeight * 2 / 3); this.initialMouseClickY = -2.0F; this.applyScrollLimits(); } - else if (button.field_146127_k == this.scrollDownActionId) + else if (button.id == this.scrollDownActionId) { this.scrollDistance += (float)(this.slotHeight * 2 / 3); this.initialMouseClickY = -2.0F; @@ -263,8 +263,8 @@ public abstract class GuiScrollingList } this.applyScrollLimits(); - Tessellator var18 = Tessellator.field_78398_a; - if (this.client.field_71441_e != null) + Tessellator var18 = Tessellator.instance; + if (this.client.theWorld != null) { this.drawGradientRect(this.left, this.top, this.right, this.bottom, -1072689136, -804253680); } @@ -272,16 +272,16 @@ public abstract class GuiScrollingList { GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_FOG); - this.client.field_71446_o.func_110577_a(Gui.field_110325_k); + this.client.renderEngine.bindTexture(Gui.optionsBackground); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); float var17 = 32.0F; - var18.func_78382_b(); - var18.func_78378_d(2105376); - var18.func_78374_a((double)this.left, (double)this.bottom, 0.0D, (double)((float)this.left / var17), (double)((float)(this.bottom + (int)this.scrollDistance) / var17)); - var18.func_78374_a((double)this.right, (double)this.bottom, 0.0D, (double)((float)this.right / var17), (double)((float)(this.bottom + (int)this.scrollDistance) / var17)); - var18.func_78374_a((double)this.right, (double)this.top, 0.0D, (double)((float)this.right / var17), (double)((float)(this.top + (int)this.scrollDistance) / var17)); - var18.func_78374_a((double)this.left, (double)this.top, 0.0D, (double)((float)this.left / var17), (double)((float)(this.top + (int)this.scrollDistance) / var17)); - var18.func_78381_a(); + var18.startDrawingQuads(); + var18.setColorOpaque_I(2105376); + var18.addVertexWithUV((double)this.left, (double)this.bottom, 0.0D, (double)((float)this.left / var17), (double)((float)(this.bottom + (int)this.scrollDistance) / var17)); + var18.addVertexWithUV((double)this.right, (double)this.bottom, 0.0D, (double)((float)this.right / var17), (double)((float)(this.bottom + (int)this.scrollDistance) / var17)); + var18.addVertexWithUV((double)this.right, (double)this.top, 0.0D, (double)((float)this.right / var17), (double)((float)(this.top + (int)this.scrollDistance) / var17)); + var18.addVertexWithUV((double)this.left, (double)this.top, 0.0D, (double)((float)this.left / var17), (double)((float)(this.top + (int)this.scrollDistance) / var17)); + var18.draw(); } // boxRight = this.listWidth / 2 - 92 - 16; var10 = this.top + 4 - (int)this.scrollDistance; @@ -306,18 +306,18 @@ public abstract class GuiScrollingList int var15 = boxRight; GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glDisable(GL11.GL_TEXTURE_2D); - var18.func_78382_b(); - var18.func_78378_d(8421504); - var18.func_78374_a((double)var14, (double)(var19 + var13 + 2), 0.0D, 0.0D, 1.0D); - var18.func_78374_a((double)var15, (double)(var19 + var13 + 2), 0.0D, 1.0D, 1.0D); - var18.func_78374_a((double)var15, (double)(var19 - 2), 0.0D, 1.0D, 0.0D); - var18.func_78374_a((double)var14, (double)(var19 - 2), 0.0D, 0.0D, 0.0D); - var18.func_78378_d(0); - var18.func_78374_a((double)(var14 + 1), (double)(var19 + var13 + 1), 0.0D, 0.0D, 1.0D); - var18.func_78374_a((double)(var15 - 1), (double)(var19 + var13 + 1), 0.0D, 1.0D, 1.0D); - var18.func_78374_a((double)(var15 - 1), (double)(var19 - 1), 0.0D, 1.0D, 0.0D); - var18.func_78374_a((double)(var14 + 1), (double)(var19 - 1), 0.0D, 0.0D, 0.0D); - var18.func_78381_a(); + var18.startDrawingQuads(); + var18.setColorOpaque_I(8421504); + var18.addVertexWithUV((double)var14, (double)(var19 + var13 + 2), 0.0D, 0.0D, 1.0D); + var18.addVertexWithUV((double)var15, (double)(var19 + var13 + 2), 0.0D, 1.0D, 1.0D); + var18.addVertexWithUV((double)var15, (double)(var19 - 2), 0.0D, 1.0D, 0.0D); + var18.addVertexWithUV((double)var14, (double)(var19 - 2), 0.0D, 0.0D, 0.0D); + var18.setColorOpaque_I(0); + var18.addVertexWithUV((double)(var14 + 1), (double)(var19 + var13 + 1), 0.0D, 0.0D, 1.0D); + var18.addVertexWithUV((double)(var15 - 1), (double)(var19 + var13 + 1), 0.0D, 1.0D, 1.0D); + var18.addVertexWithUV((double)(var15 - 1), (double)(var19 - 1), 0.0D, 1.0D, 0.0D); + var18.addVertexWithUV((double)(var14 + 1), (double)(var19 - 1), 0.0D, 0.0D, 0.0D); + var18.draw(); GL11.glEnable(GL11.GL_TEXTURE_2D); } @@ -327,7 +327,7 @@ public abstract class GuiScrollingList GL11.glDisable(GL11.GL_DEPTH_TEST); byte var20 = 4; - if (this.client.field_71441_e == null) + if (this.client.theWorld == null) { this.overlayBackground(0, this.top, 255, 255); this.overlayBackground(this.bottom, this.listHeight, 255, 255); @@ -337,22 +337,22 @@ public abstract class GuiScrollingList GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glShadeModel(GL11.GL_SMOOTH); GL11.glDisable(GL11.GL_TEXTURE_2D); - var18.func_78382_b(); - var18.func_78384_a(0, 0); - var18.func_78374_a((double)this.left, (double)(this.top + var20), 0.0D, 0.0D, 1.0D); - var18.func_78374_a((double)this.right, (double)(this.top + var20), 0.0D, 1.0D, 1.0D); - var18.func_78384_a(0, 255); - var18.func_78374_a((double)this.right, (double)this.top, 0.0D, 1.0D, 0.0D); - var18.func_78374_a((double)this.left, (double)this.top, 0.0D, 0.0D, 0.0D); - var18.func_78381_a(); - var18.func_78382_b(); - var18.func_78384_a(0, 255); - var18.func_78374_a((double)this.left, (double)this.bottom, 0.0D, 0.0D, 1.0D); - var18.func_78374_a((double)this.right, (double)this.bottom, 0.0D, 1.0D, 1.0D); - var18.func_78384_a(0, 0); - var18.func_78374_a((double)this.right, (double)(this.bottom - var20), 0.0D, 1.0D, 0.0D); - var18.func_78374_a((double)this.left, (double)(this.bottom - var20), 0.0D, 0.0D, 0.0D); - var18.func_78381_a(); + var18.startDrawingQuads(); + var18.setColorRGBA_I(0, 0); + var18.addVertexWithUV((double)this.left, (double)(this.top + var20), 0.0D, 0.0D, 1.0D); + var18.addVertexWithUV((double)this.right, (double)(this.top + var20), 0.0D, 1.0D, 1.0D); + var18.setColorRGBA_I(0, 255); + var18.addVertexWithUV((double)this.right, (double)this.top, 0.0D, 1.0D, 0.0D); + var18.addVertexWithUV((double)this.left, (double)this.top, 0.0D, 0.0D, 0.0D); + var18.draw(); + var18.startDrawingQuads(); + var18.setColorRGBA_I(0, 255); + var18.addVertexWithUV((double)this.left, (double)this.bottom, 0.0D, 0.0D, 1.0D); + var18.addVertexWithUV((double)this.right, (double)this.bottom, 0.0D, 1.0D, 1.0D); + var18.setColorRGBA_I(0, 0); + var18.addVertexWithUV((double)this.right, (double)(this.bottom - var20), 0.0D, 1.0D, 0.0D); + var18.addVertexWithUV((double)this.left, (double)(this.bottom - var20), 0.0D, 0.0D, 0.0D); + var18.draw(); var19 = this.getContentHeight() - (this.bottom - this.top - 4); if (var19 > 0) @@ -376,27 +376,27 @@ public abstract class GuiScrollingList var14 = this.top; } - var18.func_78382_b(); - var18.func_78384_a(0, 255); - var18.func_78374_a((double)scrollBarXStart, (double)this.bottom, 0.0D, 0.0D, 1.0D); - var18.func_78374_a((double)scrollBarXEnd, (double)this.bottom, 0.0D, 1.0D, 1.0D); - var18.func_78374_a((double)scrollBarXEnd, (double)this.top, 0.0D, 1.0D, 0.0D); - var18.func_78374_a((double)scrollBarXStart, (double)this.top, 0.0D, 0.0D, 0.0D); - var18.func_78381_a(); - var18.func_78382_b(); - var18.func_78384_a(8421504, 255); - var18.func_78374_a((double)scrollBarXStart, (double)(var14 + var13), 0.0D, 0.0D, 1.0D); - var18.func_78374_a((double)scrollBarXEnd, (double)(var14 + var13), 0.0D, 1.0D, 1.0D); - var18.func_78374_a((double)scrollBarXEnd, (double)var14, 0.0D, 1.0D, 0.0D); - var18.func_78374_a((double)scrollBarXStart, (double)var14, 0.0D, 0.0D, 0.0D); - var18.func_78381_a(); - var18.func_78382_b(); - var18.func_78384_a(12632256, 255); - var18.func_78374_a((double)scrollBarXStart, (double)(var14 + var13 - 1), 0.0D, 0.0D, 1.0D); - var18.func_78374_a((double)(scrollBarXEnd - 1), (double)(var14 + var13 - 1), 0.0D, 1.0D, 1.0D); - var18.func_78374_a((double)(scrollBarXEnd - 1), (double)var14, 0.0D, 1.0D, 0.0D); - var18.func_78374_a((double)scrollBarXStart, (double)var14, 0.0D, 0.0D, 0.0D); - var18.func_78381_a(); + var18.startDrawingQuads(); + var18.setColorRGBA_I(0, 255); + var18.addVertexWithUV((double)scrollBarXStart, (double)this.bottom, 0.0D, 0.0D, 1.0D); + var18.addVertexWithUV((double)scrollBarXEnd, (double)this.bottom, 0.0D, 1.0D, 1.0D); + var18.addVertexWithUV((double)scrollBarXEnd, (double)this.top, 0.0D, 1.0D, 0.0D); + var18.addVertexWithUV((double)scrollBarXStart, (double)this.top, 0.0D, 0.0D, 0.0D); + var18.draw(); + var18.startDrawingQuads(); + var18.setColorRGBA_I(8421504, 255); + var18.addVertexWithUV((double)scrollBarXStart, (double)(var14 + var13), 0.0D, 0.0D, 1.0D); + var18.addVertexWithUV((double)scrollBarXEnd, (double)(var14 + var13), 0.0D, 1.0D, 1.0D); + var18.addVertexWithUV((double)scrollBarXEnd, (double)var14, 0.0D, 1.0D, 0.0D); + var18.addVertexWithUV((double)scrollBarXStart, (double)var14, 0.0D, 0.0D, 0.0D); + var18.draw(); + var18.startDrawingQuads(); + var18.setColorRGBA_I(12632256, 255); + var18.addVertexWithUV((double)scrollBarXStart, (double)(var14 + var13 - 1), 0.0D, 0.0D, 1.0D); + var18.addVertexWithUV((double)(scrollBarXEnd - 1), (double)(var14 + var13 - 1), 0.0D, 1.0D, 1.0D); + var18.addVertexWithUV((double)(scrollBarXEnd - 1), (double)var14, 0.0D, 1.0D, 0.0D); + var18.addVertexWithUV((double)scrollBarXStart, (double)var14, 0.0D, 0.0D, 0.0D); + var18.draw(); } this.func_27257_b(mouseX, mouseY); @@ -408,18 +408,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.field_78398_a; - this.client.field_71446_o.func_110577_a(Gui.field_110325_k); + Tessellator var5 = Tessellator.instance; + this.client.renderEngine.bindTexture(Gui.optionsBackground); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); float var6 = 32.0F; - var5.func_78382_b(); - var5.func_78384_a(4210752, p_22239_4_); - var5.func_78374_a(0.0D, (double)p_22239_2_, 0.0D, 0.0D, (double)((float)p_22239_2_ / var6)); - var5.func_78374_a((double)this.listWidth + 30, (double)p_22239_2_, 0.0D, (double)((float)(this.listWidth + 30) / var6), (double)((float)p_22239_2_ / var6)); - var5.func_78384_a(4210752, p_22239_3_); - var5.func_78374_a((double)this.listWidth + 30, (double)p_22239_1_, 0.0D, (double)((float)(this.listWidth + 30) / var6), (double)((float)p_22239_1_ / var6)); - var5.func_78374_a(0.0D, (double)p_22239_1_, 0.0D, 0.0D, (double)((float)p_22239_1_ / var6)); - var5.func_78381_a(); + var5.startDrawingQuads(); + var5.setColorRGBA_I(4210752, p_22239_4_); + var5.addVertexWithUV(0.0D, (double)p_22239_2_, 0.0D, 0.0D, (double)((float)p_22239_2_ / var6)); + var5.addVertexWithUV((double)this.listWidth + 30, (double)p_22239_2_, 0.0D, (double)((float)(this.listWidth + 30) / var6), (double)((float)p_22239_2_ / var6)); + var5.setColorRGBA_I(4210752, p_22239_3_); + var5.addVertexWithUV((double)this.listWidth + 30, (double)p_22239_1_, 0.0D, (double)((float)(this.listWidth + 30) / var6), (double)((float)p_22239_1_ / var6)); + var5.addVertexWithUV(0.0D, (double)p_22239_1_, 0.0D, 0.0D, (double)((float)p_22239_1_ / var6)); + var5.draw(); } protected void drawGradientRect(int par1, int par2, int par3, int par4, int par5, int par6) @@ -435,17 +435,17 @@ public abstract class GuiScrollingList GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_ALPHA_TEST); - OpenGlHelper.func_148821_a(770, 771, 1, 0); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); GL11.glShadeModel(GL11.GL_SMOOTH); - Tessellator tessellator = Tessellator.field_78398_a; - tessellator.func_78382_b(); - tessellator.func_78369_a(f1, f2, f3, f); - tessellator.func_78377_a((double)par3, (double)par2, 0.0D); - tessellator.func_78377_a((double)par1, (double)par2, 0.0D); - tessellator.func_78369_a(f5, f6, f7, f4); - tessellator.func_78377_a((double)par1, (double)par4, 0.0D); - tessellator.func_78377_a((double)par3, (double)par4, 0.0D); - tessellator.func_78381_a(); + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.setColorRGBA_F(f1, f2, f3, f); + tessellator.addVertex((double)par3, (double)par2, 0.0D); + tessellator.addVertex((double)par1, (double)par2, 0.0D); + tessellator.setColorRGBA_F(f5, f6, f7, f4); + tessellator.addVertex((double)par1, (double)par4, 0.0D); + tessellator.addVertex((double)par3, (double)par4, 0.0D); + tessellator.draw(); GL11.glShadeModel(GL11.GL_FLAT); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_ALPHA_TEST); diff --git a/fml/src/main/java/cpw/mods/fml/client/GuiSlotModList.java b/fml/src/main/java/cpw/mods/fml/client/GuiSlotModList.java index 316dbb571..021d4ed6f 100644 --- a/fml/src/main/java/cpw/mods/fml/client/GuiSlotModList.java +++ b/fml/src/main/java/cpw/mods/fml/client/GuiSlotModList.java @@ -31,7 +31,7 @@ public class GuiSlotModList extends GuiScrollingList public GuiSlotModList(GuiModList parent, ArrayList mods, int listWidth) { - super(parent.getMinecraftInstance(), listWidth, parent.field_146295_m, 32, parent.field_146295_m - 66 + 4, 10, 35); + super(parent.getMinecraftInstance(), listWidth, parent.height, 32, parent.height - 66 + 4, 10, 35); this.parent=parent; this.mods=mods; } @@ -57,7 +57,7 @@ public class GuiSlotModList extends GuiScrollingList @Override protected void drawBackground() { - this.parent.func_146276_q_(); + this.parent.drawDefaultBackground(); } @Override @@ -72,15 +72,15 @@ public class GuiSlotModList extends GuiScrollingList ModContainer mc=mods.get(listIndex); if (Loader.instance().getModState(mc)==ModState.DISABLED) { - this.parent.getFontRenderer().func_78276_b(this.parent.getFontRenderer().func_78269_a(mc.getName(), listWidth - 10), this.left + 3 , var3 + 2, 0xFF2222); - this.parent.getFontRenderer().func_78276_b(this.parent.getFontRenderer().func_78269_a(mc.getDisplayVersion(), listWidth - 10), this.left + 3 , var3 + 12, 0xFF2222); - this.parent.getFontRenderer().func_78276_b(this.parent.getFontRenderer().func_78269_a("DISABLED", listWidth - 10), this.left + 3 , var3 + 22, 0xFF2222); + this.parent.getFontRenderer().drawString(this.parent.getFontRenderer().trimStringToWidth(mc.getName(), listWidth - 10), this.left + 3 , var3 + 2, 0xFF2222); + this.parent.getFontRenderer().drawString(this.parent.getFontRenderer().trimStringToWidth(mc.getDisplayVersion(), listWidth - 10), this.left + 3 , var3 + 12, 0xFF2222); + this.parent.getFontRenderer().drawString(this.parent.getFontRenderer().trimStringToWidth("DISABLED", listWidth - 10), this.left + 3 , var3 + 22, 0xFF2222); } else { - this.parent.getFontRenderer().func_78276_b(this.parent.getFontRenderer().func_78269_a(mc.getName(), listWidth - 10), this.left + 3 , var3 + 2, 0xFFFFFF); - this.parent.getFontRenderer().func_78276_b(this.parent.getFontRenderer().func_78269_a(mc.getDisplayVersion(), listWidth - 10), this.left + 3 , var3 + 12, 0xCCCCCC); - this.parent.getFontRenderer().func_78276_b(this.parent.getFontRenderer().func_78269_a(mc.getMetadata() !=null ? mc.getMetadata().getChildModCountString() : "Metadata not found", listWidth - 10), this.left + 3 , var3 + 22, 0xCCCCCC); + this.parent.getFontRenderer().drawString(this.parent.getFontRenderer().trimStringToWidth(mc.getName(), listWidth - 10), this.left + 3 , var3 + 2, 0xFFFFFF); + this.parent.getFontRenderer().drawString(this.parent.getFontRenderer().trimStringToWidth(mc.getDisplayVersion(), listWidth - 10), this.left + 3 , var3 + 12, 0xCCCCCC); + this.parent.getFontRenderer().drawString(this.parent.getFontRenderer().trimStringToWidth(mc.getMetadata() !=null ? mc.getMetadata().getChildModCountString() : "Metadata not found", listWidth - 10), this.left + 3 , var3 + 22, 0xCCCCCC); } } diff --git a/fml/src/main/java/cpw/mods/fml/client/GuiSortingProblem.java b/fml/src/main/java/cpw/mods/fml/client/GuiSortingProblem.java index 627b55759..bd9a1936e 100644 --- a/fml/src/main/java/cpw/mods/fml/client/GuiSortingProblem.java +++ b/fml/src/main/java/cpw/mods/fml/client/GuiSortingProblem.java @@ -14,31 +14,31 @@ public class GuiSortingProblem extends GuiScreen { } @Override - public void func_73866_w_() + public void initGui() { - super.func_73866_w_(); + super.initGui(); } @Override - public void func_73863_a(int p_73863_1_, int p_73863_2_, float p_73863_3_) + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { - this.func_146276_q_(); + this.drawDefaultBackground(); int offset = Math.max(85 - (failedList.getVisitedNodes().size() + 3) * 10, 10); - this.func_73732_a(this.field_146289_q, "Forge Mod Loader has found a problem with your minecraft installation", this.field_146294_l / 2, offset, 0xFFFFFF); + this.drawCenteredString(this.fontRendererObj, "Forge Mod Loader has found a problem with your minecraft installation", this.width / 2, offset, 0xFFFFFF); offset+=10; - this.func_73732_a(this.field_146289_q, "A mod sorting cycle was detected and loading cannot continue", this.field_146294_l / 2, offset, 0xFFFFFF); + this.drawCenteredString(this.fontRendererObj, "A mod sorting cycle was detected and loading cannot continue", this.width / 2, offset, 0xFFFFFF); offset+=10; - this.func_73732_a(this.field_146289_q, String.format("The first mod in the cycle is %s", failedList.getFirstBadNode()), this.field_146294_l / 2, offset, 0xFFFFFF); + this.drawCenteredString(this.fontRendererObj, String.format("The first mod in the cycle is %s", failedList.getFirstBadNode()), this.width / 2, offset, 0xFFFFFF); offset+=10; - this.func_73732_a(this.field_146289_q, "The remainder of the cycle involves these mods", this.field_146294_l / 2, offset, 0xFFFFFF); + this.drawCenteredString(this.fontRendererObj, "The remainder of the cycle involves these mods", this.width / 2, offset, 0xFFFFFF); offset+=5; for (ModContainer mc : failedList.getVisitedNodes()) { offset+=10; - this.func_73732_a(this.field_146289_q, String.format("%s : before: %s, after: %s", mc.toString(), mc.getDependants(), mc.getDependencies()), this.field_146294_l / 2, offset, 0xEEEEEE); + this.drawCenteredString(this.fontRendererObj, String.format("%s : before: %s, after: %s", mc.toString(), mc.getDependants(), mc.getDependencies()), this.width / 2, offset, 0xEEEEEE); } offset+=20; - this.func_73732_a(this.field_146289_q, "The file 'ForgeModLoader-client-0.log' contains more information", this.field_146294_l / 2, offset, 0xFFFFFF); + this.drawCenteredString(this.fontRendererObj, "The file 'ForgeModLoader-client-0.log' contains more information", this.width / 2, offset, 0xFFFFFF); } } diff --git a/fml/src/main/java/cpw/mods/fml/client/GuiWrongMinecraft.java b/fml/src/main/java/cpw/mods/fml/client/GuiWrongMinecraft.java index 8f460fc7f..b26fcecd9 100644 --- a/fml/src/main/java/cpw/mods/fml/client/GuiWrongMinecraft.java +++ b/fml/src/main/java/cpw/mods/fml/client/GuiWrongMinecraft.java @@ -25,22 +25,22 @@ public class GuiWrongMinecraft extends GuiErrorScreen this.wrongMC = wrongMC; } @Override - public void func_73866_w_() + public void initGui() { - super.func_73866_w_(); + super.initGui(); } @Override - public void func_73863_a(int p_73863_1_, int p_73863_2_, float p_73863_3_) + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { - this.func_146276_q_(); + this.drawDefaultBackground(); int offset = 75; - this.func_73732_a(this.field_146289_q, "Forge Mod Loader has found a problem with your minecraft installation", this.field_146294_l / 2, offset, 0xFFFFFF); + this.drawCenteredString(this.fontRendererObj, "Forge Mod Loader has found a problem with your minecraft installation", this.width / 2, offset, 0xFFFFFF); offset+=10; - this.func_73732_a(this.field_146289_q, String.format("The mod listed below does not want to run in Minecraft version %s", Loader.instance().getMinecraftModContainer().getVersion()), this.field_146294_l / 2, offset, 0xFFFFFF); + this.drawCenteredString(this.fontRendererObj, String.format("The mod listed below does not want to run in Minecraft version %s", Loader.instance().getMinecraftModContainer().getVersion()), this.width / 2, offset, 0xFFFFFF); offset+=5; offset+=10; - this.func_73732_a(this.field_146289_q, String.format("%s (%s) wants Minecraft %s", wrongMC.mod.getName(), wrongMC.mod.getModId(), wrongMC.mod.acceptableMinecraftVersionRange()), this.field_146294_l / 2, offset, 0xEEEEEE); + this.drawCenteredString(this.fontRendererObj, String.format("%s (%s) wants Minecraft %s", wrongMC.mod.getName(), wrongMC.mod.getModId(), wrongMC.mod.acceptableMinecraftVersionRange()), this.width / 2, offset, 0xEEEEEE); offset+=20; - this.func_73732_a(this.field_146289_q, "The file 'ForgeModLoader-client-0.log' contains more information", this.field_146294_l / 2, offset, 0xFFFFFF); + this.drawCenteredString(this.fontRendererObj, "The file 'ForgeModLoader-client-0.log' contains more information", this.width / 2, offset, 0xFFFFFF); } } diff --git a/fml/src/main/java/cpw/mods/fml/client/registry/ClientRegistry.java b/fml/src/main/java/cpw/mods/fml/client/registry/ClientRegistry.java index 63902a67b..82e1da31d 100644 --- a/fml/src/main/java/cpw/mods/fml/client/registry/ClientRegistry.java +++ b/fml/src/main/java/cpw/mods/fml/client/registry/ClientRegistry.java @@ -40,12 +40,12 @@ public class ClientRegistry @SuppressWarnings("unchecked") public static void bindTileEntitySpecialRenderer(Class tileEntityClass, TileEntitySpecialRenderer specialRenderer) { - TileEntityRendererDispatcher.field_147556_a.field_147559_m.put(tileEntityClass, specialRenderer); - specialRenderer.func_147497_a(TileEntityRendererDispatcher.field_147556_a); + TileEntityRendererDispatcher.instance.mapSpecialRenderers.put(tileEntityClass, specialRenderer); + specialRenderer.func_147497_a(TileEntityRendererDispatcher.instance); } public static void registerKeyBinding(KeyBinding key) { - Minecraft.func_71410_x().field_71474_y.field_74324_K = ArrayUtils.add(Minecraft.func_71410_x().field_71474_y.field_74324_K, key); + Minecraft.getMinecraft().gameSettings.keyBindings = ArrayUtils.add(Minecraft.getMinecraft().gameSettings.keyBindings, key); } } diff --git a/fml/src/main/java/cpw/mods/fml/client/registry/RenderingRegistry.java b/fml/src/main/java/cpw/mods/fml/client/registry/RenderingRegistry.java index a1fd1b249..65e1ce2a1 100644 --- a/fml/src/main/java/cpw/mods/fml/client/registry/RenderingRegistry.java +++ b/fml/src/main/java/cpw/mods/fml/client/registry/RenderingRegistry.java @@ -48,8 +48,8 @@ public class RenderingRegistry */ public static int addNewArmourRendererPrefix(String armor) { - RenderBiped.field_82424_k = ObjectArrays.concat(RenderBiped.field_82424_k, armor); - return RenderBiped.field_82424_k.length - 1; + RenderBiped.bipedArmorFilenamePrefix = ObjectArrays.concat(RenderBiped.bipedArmorFilenamePrefix, armor); + return RenderBiped.bipedArmorFilenamePrefix.length - 1; } /** @@ -136,7 +136,7 @@ public class RenderingRegistry for (EntityRendererInfo info : entityRenderers) { rendererMap.put(info.target, info.renderer); - info.renderer.func_76976_a(RenderManager.field_78727_a); + info.renderer.setRenderManager(RenderManager.instance); } } } diff --git a/fml/src/main/java/cpw/mods/fml/common/FMLCommonHandler.java b/fml/src/main/java/cpw/mods/fml/common/FMLCommonHandler.java index 113b87fde..2c57a4eca 100644 --- a/fml/src/main/java/cpw/mods/fml/common/FMLCommonHandler.java +++ b/fml/src/main/java/cpw/mods/fml/common/FMLCommonHandler.java @@ -341,7 +341,7 @@ public class FMLCommonHandler { for (ICrashCallable call: crashCallables) { - category.func_71500_a(call.getLabel(), call); + category.addCrashSectionCallable(call.getLabel(), call); } } @@ -355,7 +355,7 @@ public class FMLCommonHandler if (wac != null) { NBTTagCompound dataForWriting = wac.getDataForWriting(handler, worldInfo); - tagCompound.func_74782_a(mc.getModId(), dataForWriting); + tagCompound.setTag(mc.getModId(), dataForWriting); } } } @@ -383,7 +383,7 @@ public class FMLCommonHandler { try { - wac.readData(handler, worldInfo, additionalProperties, tagCompound.func_74775_l(mc.getModId())); + wac.readData(handler, worldInfo, additionalProperties, tagCompound.getCompoundTag(mc.getModId())); } catch (RuntimeException ex) { diff --git a/fml/src/main/java/cpw/mods/fml/common/FMLContainer.java b/fml/src/main/java/cpw/mods/fml/common/FMLContainer.java index da426d94c..1f8d54ada 100644 --- a/fml/src/main/java/cpw/mods/fml/common/FMLContainer.java +++ b/fml/src/main/java/cpw/mods/fml/common/FMLContainer.java @@ -90,36 +90,36 @@ public class FMLContainer extends DummyModContainer implements WorldAccessContai for (ModContainer mc : Loader.instance().getActiveModList()) { NBTTagCompound mod = new NBTTagCompound(); - mod.func_74778_a("ModId", mc.getModId()); - mod.func_74778_a("ModVersion", mc.getVersion()); - list.func_74742_a(mod); + mod.setString("ModId", mc.getModId()); + mod.setString("ModVersion", mc.getVersion()); + list.appendTag(mod); } - fmlData.func_74782_a("ModList", list); + fmlData.setTag("ModList", list); NBTTagList dataList = new NBTTagList(); - FMLLog.fine("Gathering id map for writing to world save %s", info.func_76065_j()); + FMLLog.fine("Gathering id map for writing to world save %s", info.getWorldName()); Map itemList = GameData.buildItemDataList(); for (Entry item : itemList.entrySet()) { NBTTagCompound tag = new NBTTagCompound(); - tag.func_74778_a("K",item.getKey()); - tag.func_74768_a("V",item.getValue()); - dataList.func_74742_a(tag); + tag.setString("K",item.getKey()); + tag.setInteger("V",item.getValue()); + dataList.appendTag(tag); } - fmlData.func_74782_a("ItemData", dataList); + fmlData.setTag("ItemData", dataList); return fmlData; } @Override public void readData(SaveHandler handler, WorldInfo info, Map propertyMap, NBTTagCompound tag) { - if (tag.func_74764_b("ModList")) + if (tag.hasKey("ModList")) { - NBTTagList modList = tag.func_150295_c("ModList", (byte)10); - for (int i = 0; i < modList.func_74745_c(); i++) + NBTTagList modList = tag.getTagList("ModList", (byte)10); + for (int i = 0; i < modList.tagCount(); i++) { - NBTTagCompound mod = modList.func_150305_b(i); - String modId = mod.func_74779_i("ModId"); - String modVersion = mod.func_74779_i("ModVersion"); + NBTTagCompound mod = modList.getCompoundTagAt(i); + String modId = mod.getString("ModId"); + String modVersion = mod.getString("ModVersion"); ModContainer container = Loader.instance().getIndexedModList().get(modId); if (container == null) { @@ -132,20 +132,20 @@ public class FMLContainer extends DummyModContainer implements WorldAccessContai } } } - if (tag.func_74764_b("ModItemData")) + if (tag.hasKey("ModItemData")) { FMLLog.info("Attempting to convert old world data to new system. This may be trouble!"); - NBTTagList modList = tag.func_150295_c("ModItemData", (byte)10); + NBTTagList modList = tag.getTagList("ModItemData", (byte)10); Map dataList = Maps.newLinkedHashMap(); - for (int i = 0; i < modList.func_74745_c(); i++) + for (int i = 0; i < modList.tagCount(); i++) { - NBTTagCompound itemTag = modList.func_150305_b(i); - String modId = itemTag.func_74779_i("ModId"); - String itemType = itemTag.func_74779_i("ItemType"); - int itemId = itemTag.func_74762_e("ItemId"); - int ordinal = itemTag.func_74762_e("ordinal"); - String forcedModId = itemTag.func_74764_b("ForcedModId") ? itemTag.func_74779_i("ForcedModId") : null; - String forcedName = itemTag.func_74764_b("ForcedName") ? itemTag.func_74779_i("ForcedName") : null; + NBTTagCompound itemTag = modList.getCompoundTagAt(i); + String modId = itemTag.getString("ModId"); + String itemType = itemTag.getString("ItemType"); + int itemId = itemTag.getInteger("ItemId"); + int ordinal = itemTag.getInteger("ordinal"); + String forcedModId = itemTag.hasKey("ForcedModId") ? itemTag.getString("ForcedModId") : null; + String forcedName = itemTag.hasKey("ForcedName") ? itemTag.getString("ForcedName") : null; if (forcedName == null) { FMLLog.warning("Found unlabelled item in world save, this may cause problems. The item type %s:%d will not be present", itemType, ordinal); @@ -178,14 +178,14 @@ public class FMLContainer extends DummyModContainer implements WorldAccessContai throw new GameRegistryException("Failed to load the world - there are fatal block and item id issues", failedElements); } } - else if (tag.func_74764_b("ItemData")) + else if (tag.hasKey("ItemData")) { - NBTTagList list = tag.func_150295_c("ItemData", (byte)10); + NBTTagList list = tag.getTagList("ItemData", (byte)10); Map dataList = Maps.newLinkedHashMap(); - for (int i = 0; i < list.func_74745_c(); i++) + for (int i = 0; i < list.tagCount(); i++) { - NBTTagCompound dataTag = list.func_150305_b(i); - dataList.put(dataTag.func_74779_i("K"), dataTag.func_74762_e("V")); + NBTTagCompound dataTag = list.getCompoundTagAt(i); + dataList.put(dataTag.getString("K"), dataTag.getInteger("V")); } List failedElements = GameData.injectWorldIDMap(dataList, true, true); if (!failedElements.isEmpty()) diff --git a/fml/src/main/java/cpw/mods/fml/common/ILanguageAdapter.java b/fml/src/main/java/cpw/mods/fml/common/ILanguageAdapter.java index 9b0c4381b..11921ad6f 100644 --- a/fml/src/main/java/cpw/mods/fml/common/ILanguageAdapter.java +++ b/fml/src/main/java/cpw/mods/fml/common/ILanguageAdapter.java @@ -193,4 +193,4 @@ public interface ILanguageAdapter { // Nothing to do here. } } -} \ No newline at end of file +} diff --git a/fml/src/main/java/cpw/mods/fml/common/event/FMLServerStartingEvent.java b/fml/src/main/java/cpw/mods/fml/common/event/FMLServerStartingEvent.java index 957dc8915..c63c54c6d 100644 --- a/fml/src/main/java/cpw/mods/fml/common/event/FMLServerStartingEvent.java +++ b/fml/src/main/java/cpw/mods/fml/common/event/FMLServerStartingEvent.java @@ -40,7 +40,7 @@ public class FMLServerStartingEvent extends FMLStateEvent public void registerServerCommand(ICommand command) { - CommandHandler ch = (CommandHandler) getServer().func_71187_D(); - ch.func_71560_a(command); + CommandHandler ch = (CommandHandler) getServer().getCommandManager(); + ch.registerCommand(command); } } diff --git a/fml/src/main/java/cpw/mods/fml/common/functions/ArtifactVersionNameFunction.java b/fml/src/main/java/cpw/mods/fml/common/functions/ArtifactVersionNameFunction.java index f71817748..bc67706cf 100644 --- a/fml/src/main/java/cpw/mods/fml/common/functions/ArtifactVersionNameFunction.java +++ b/fml/src/main/java/cpw/mods/fml/common/functions/ArtifactVersionNameFunction.java @@ -10,4 +10,4 @@ public class ArtifactVersionNameFunction implements Function extends Event { public final String connectionType; public ClientConnectedToServerEvent(NetworkManager manager, String connectionType) { - super((INetHandlerPlayClient) manager.func_150729_e(), INetHandlerPlayClient.class, manager); - this.isLocal = manager.func_150731_c(); + super((INetHandlerPlayClient) manager.getNetHandler(), INetHandlerPlayClient.class, manager); + this.isLocal = manager.isLocalChannel(); this.connectionType = connectionType; } } @@ -48,8 +48,8 @@ public class FMLNetworkEvent extends Event { public final boolean isLocal; public ServerConnectionFromClientEvent(NetworkManager manager) { - super((INetHandlerPlayServer) manager.func_150729_e(), INetHandlerPlayServer.class, manager); - this.isLocal = manager.func_150731_c(); + super((INetHandlerPlayServer) manager.getNetHandler(), INetHandlerPlayServer.class, manager); + this.isLocal = manager.isLocalChannel(); } } /** @@ -61,7 +61,7 @@ public class FMLNetworkEvent extends Event { public static class ServerDisconnectionFromClientEvent extends FMLNetworkEvent { public ServerDisconnectionFromClientEvent(NetworkManager manager) { - super((INetHandlerPlayServer) manager.func_150729_e(), INetHandlerPlayServer.class, manager); + super((INetHandlerPlayServer) manager.getNetHandler(), INetHandlerPlayServer.class, manager); } } /** @@ -73,7 +73,7 @@ public class FMLNetworkEvent extends Event { public static class ClientDisconnectionFromServerEvent extends FMLNetworkEvent { public ClientDisconnectionFromServerEvent(NetworkManager manager) { - super((INetHandlerPlayClient) manager.func_150729_e(), INetHandlerPlayClient.class, manager); + super((INetHandlerPlayClient) manager.getNetHandler(), INetHandlerPlayClient.class, manager); } } @@ -90,7 +90,7 @@ public class FMLNetworkEvent extends Event { public final Side side; public CustomPacketRegistrationEvent(NetworkManager manager, Set registrations, String operation, Side side, Class type) { - super(type.cast(manager.func_150729_e()), type, manager); + super(type.cast(manager.getNetHandler()), type, manager); this.registrations = ImmutableSet.copyOf(registrations); this.side = side; this.operation = operation; @@ -124,7 +124,7 @@ public class FMLNetworkEvent extends Event { public static class ClientCustomPacketEvent extends CustomPacketEvent { public ClientCustomPacketEvent(NetworkManager manager, FMLProxyPacket packet) { - super((INetHandlerPlayClient) manager.func_150729_e(), INetHandlerPlayClient.class, manager, packet); + super((INetHandlerPlayClient) manager.getNetHandler(), INetHandlerPlayClient.class, manager, packet); } @Override @@ -142,7 +142,7 @@ public class FMLNetworkEvent extends Event { public static class ServerCustomPacketEvent extends CustomPacketEvent { public ServerCustomPacketEvent(NetworkManager manager, FMLProxyPacket packet) { - super((INetHandlerPlayServer) manager.func_150729_e(), INetHandlerPlayServer.class, manager, packet); + super((INetHandlerPlayServer) manager.getNetHandler(), INetHandlerPlayServer.class, manager, packet); } @Override diff --git a/fml/src/main/java/cpw/mods/fml/common/network/FMLOutboundHandler.java b/fml/src/main/java/cpw/mods/fml/common/network/FMLOutboundHandler.java index 9165e2049..9166eb503 100644 --- a/fml/src/main/java/cpw/mods/fml/common/network/FMLOutboundHandler.java +++ b/fml/src/main/java/cpw/mods/fml/common/network/FMLOutboundHandler.java @@ -106,7 +106,7 @@ public class FMLOutboundHandler extends ChannelOutboundHandlerAdapter { public List selectNetworks(Object args, ChannelHandlerContext context, FMLProxyPacket packet) { EntityPlayerMP player = (EntityPlayerMP) args; - NetworkDispatcher dispatcher = player.field_71135_a.field_147371_a.channel().attr(NetworkDispatcher.FML_DISPATCHER).get(); + NetworkDispatcher dispatcher = player.playerNetServerHandler.netManager.channel().attr(NetworkDispatcher.FML_DISPATCHER).get(); return ImmutableList.of(dispatcher); } }, @@ -126,9 +126,9 @@ public class FMLOutboundHandler extends ChannelOutboundHandlerAdapter { public List selectNetworks(Object args, ChannelHandlerContext context, FMLProxyPacket packet) { ImmutableList.Builder builder = ImmutableList.builder(); - for (EntityPlayerMP player : (List)FMLCommonHandler.instance().getMinecraftServerInstance().func_71203_ab().field_72404_b) + for (EntityPlayerMP player : (List)FMLCommonHandler.instance().getMinecraftServerInstance().getConfigurationManager().playerEntityList) { - NetworkDispatcher dispatcher = player.field_71135_a.field_147371_a.channel().attr(NetworkDispatcher.FML_DISPATCHER).get(); + NetworkDispatcher dispatcher = player.playerNetServerHandler.netManager.channel().attr(NetworkDispatcher.FML_DISPATCHER).get(); builder.add(dispatcher); } return builder.build(); @@ -155,11 +155,11 @@ public class FMLOutboundHandler extends ChannelOutboundHandlerAdapter { { int dimension = (Integer)args; ImmutableList.Builder builder = ImmutableList.builder(); - for (EntityPlayerMP player : (List)FMLCommonHandler.instance().getMinecraftServerInstance().func_71203_ab().field_72404_b) + for (EntityPlayerMP player : (List)FMLCommonHandler.instance().getMinecraftServerInstance().getConfigurationManager().playerEntityList) { - if (dimension == player.field_71093_bK) + if (dimension == player.dimension) { - NetworkDispatcher dispatcher = player.field_71135_a.field_147371_a.channel().attr(NetworkDispatcher.FML_DISPATCHER).get(); + NetworkDispatcher dispatcher = player.playerNetServerHandler.netManager.channel().attr(NetworkDispatcher.FML_DISPATCHER).get(); builder.add(dispatcher); } } @@ -189,17 +189,17 @@ public class FMLOutboundHandler extends ChannelOutboundHandlerAdapter { { TargetPoint tp = (TargetPoint)args; ImmutableList.Builder builder = ImmutableList.builder(); - for (EntityPlayerMP player : (List)FMLCommonHandler.instance().getMinecraftServerInstance().func_71203_ab().field_72404_b) + for (EntityPlayerMP player : (List)FMLCommonHandler.instance().getMinecraftServerInstance().getConfigurationManager().playerEntityList) { - if (player.field_71093_bK == tp.dimension) + if (player.dimension == tp.dimension) { - double d4 = tp.x - player.field_70165_t; - double d5 = tp.y - player.field_70163_u; - double d6 = tp.z - player.field_70161_v; + double d4 = tp.x - player.posX; + double d5 = tp.y - player.posY; + double d6 = tp.z - player.posZ; if (d4 * d4 + d5 * d5 + d6 * d6 < tp.range * tp.range) { - NetworkDispatcher dispatcher = player.field_71135_a.field_147371_a.channel().attr(NetworkDispatcher.FML_DISPATCHER).get(); + NetworkDispatcher dispatcher = player.playerNetServerHandler.netManager.channel().attr(NetworkDispatcher.FML_DISPATCHER).get(); builder.add(dispatcher); } } diff --git a/fml/src/main/java/cpw/mods/fml/common/network/handshake/FMLHandshakeClientState.java b/fml/src/main/java/cpw/mods/fml/common/network/handshake/FMLHandshakeClientState.java index bad38a51e..d463939ec 100644 --- a/fml/src/main/java/cpw/mods/fml/common/network/handshake/FMLHandshakeClientState.java +++ b/fml/src/main/java/cpw/mods/fml/common/network/handshake/FMLHandshakeClientState.java @@ -136,4 +136,4 @@ enum FMLHandshakeClientState implements IHandshakeState return this; } }; -} \ No newline at end of file +} diff --git a/fml/src/main/java/cpw/mods/fml/common/network/handshake/FMLHandshakeServerState.java b/fml/src/main/java/cpw/mods/fml/common/network/handshake/FMLHandshakeServerState.java index 2badf7968..766e334b3 100644 --- a/fml/src/main/java/cpw/mods/fml/common/network/handshake/FMLHandshakeServerState.java +++ b/fml/src/main/java/cpw/mods/fml/common/network/handshake/FMLHandshakeServerState.java @@ -91,4 +91,4 @@ enum FMLHandshakeServerState implements IHandshakeState return this; } }; -} \ No newline at end of file +} diff --git a/fml/src/main/java/cpw/mods/fml/common/network/handshake/NetworkDispatcher.java b/fml/src/main/java/cpw/mods/fml/common/network/handshake/NetworkDispatcher.java index bcd1b36da..770ca21a1 100644 --- a/fml/src/main/java/cpw/mods/fml/common/network/handshake/NetworkDispatcher.java +++ b/fml/src/main/java/cpw/mods/fml/common/network/handshake/NetworkDispatcher.java @@ -89,7 +89,7 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler imple this.handshakeChannel.attr(FML_DISPATCHER).set(this); this.handshakeChannel.attr(NetworkRegistry.CHANNEL_SOURCE).set(Side.SERVER); this.handshakeChannel.attr(NetworkRegistry.FML_CHANNEL).set("FML|HS"); - this.handshakeChannel.attr(IS_LOCAL).set(manager.func_150731_c()); + this.handshakeChannel.attr(IS_LOCAL).set(manager.isLocalChannel()); } public NetworkDispatcher(NetworkManager manager, ServerConfigurationManager scm) @@ -102,7 +102,7 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler imple this.handshakeChannel.attr(FML_DISPATCHER).set(this); this.handshakeChannel.attr(NetworkRegistry.CHANNEL_SOURCE).set(Side.CLIENT); this.handshakeChannel.attr(NetworkRegistry.FML_CHANNEL).set("FML|HS"); - this.handshakeChannel.attr(IS_LOCAL).set(manager.func_150731_c()); + this.handshakeChannel.attr(IS_LOCAL).set(manager.isLocalChannel()); } public void serverToClientHandshake(EntityPlayerMP player) @@ -139,17 +139,17 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler imple this.state = ConnectionState.AWAITING_HANDSHAKE; this.manager.channel().pipeline().addFirst("fml:vanilla_detector", new VanillaTimeoutWaiter()); // Need to start the handler here, so we can send custompayload packets - serverHandler = new NetHandlerPlayServer(scm.func_72365_p(), manager, player); + serverHandler = new NetHandlerPlayServer(scm.getServerInstance(), manager, player); this.netHandler = serverHandler; // NULL the play server here - we restore it further on. If not, there are packets sent before the login - player.field_71135_a = null; + player.playerNetServerHandler = null; // manually for the manager into the PLAY state, so we can send packets later - this.manager.func_150723_a(EnumConnectionState.PLAY); + this.manager.setConnectionState(EnumConnectionState.PLAY); } void clientListenForServerHandshake() { - manager.func_150723_a(EnumConnectionState.PLAY); + manager.setConnectionState(EnumConnectionState.PLAY); FMLCommonHandler.instance().waitForPlayClient(); this.netHandler = FMLCommonHandler.instance().getClientPlayHandler(); this.state = ConnectionState.AWAITING_HANDSHAKE; @@ -169,7 +169,7 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler imple FMLLog.info("[%s] Server side %s connection established", Thread.currentThread().getName(), this.connectionType.name().toLowerCase(Locale.ENGLISH)); this.state = ConnectionState.CONNECTED; FMLCommonHandler.instance().bus().post(new FMLNetworkEvent.ServerConnectionFromClientEvent(manager)); - scm.func_72355_a(manager, player, serverHandler); + scm.initializeConnectionToPlayer(manager, player, serverHandler); } @Override protected void channelRead0(ChannelHandlerContext ctx, Packet msg) throws Exception @@ -228,12 +228,12 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler imple private void kickWithMessage(String message) { final ChatComponentText chatcomponenttext = new ChatComponentText(message); - manager.func_150725_a(new S40PacketDisconnect(chatcomponenttext), new GenericFutureListener>() + manager.scheduleOutboundPacket(new S40PacketDisconnect(chatcomponenttext), new GenericFutureListener>() { @Override public void operationComplete(Future result) { - manager.func_150718_a(chatcomponenttext); + manager.closeChannel(chatcomponenttext); } }); manager.channel().config().setAutoRead(false); @@ -337,7 +337,7 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler imple public void sendProxy(FMLProxyPacket msg) { - manager.func_150725_a(msg); + manager.scheduleOutboundPacket(msg); } public void rejectHandshake(String result) diff --git a/fml/src/main/java/cpw/mods/fml/common/network/internal/EntitySpawnHandler.java b/fml/src/main/java/cpw/mods/fml/common/network/internal/EntitySpawnHandler.java index c17c2060d..5faf82e27 100644 --- a/fml/src/main/java/cpw/mods/fml/common/network/internal/EntitySpawnHandler.java +++ b/fml/src/main/java/cpw/mods/fml/common/network/internal/EntitySpawnHandler.java @@ -41,12 +41,12 @@ public class EntitySpawnHandler extends SimpleChannelInboundHandler) spawnMsg.dataWatcherList); + entity.getDataWatcher().updateWatchedObjectsFromList((List) spawnMsg.dataWatcherList); } if (spawnMsg.throwerId > 0) { - entity.func_70016_h(spawnMsg.speedScaledX, spawnMsg.speedScaledY, spawnMsg.speedScaledZ); + entity.setVelocity(spawnMsg.speedScaledX, spawnMsg.speedScaledY, spawnMsg.speedScaledZ); } if (entity instanceof IEntityAdditionalSpawnData) { ((IEntityAdditionalSpawnData) entity).readSpawnData(spawnMsg.dataStream); } - wc.func_73027_a(spawnMsg.entityId, entity); + wc.addEntityToWorld(spawnMsg.entityId, entity); System.out.println("Entity spawned on client"); } catch (Exception e) { diff --git a/fml/src/main/java/cpw/mods/fml/common/network/internal/FMLMessage.java b/fml/src/main/java/cpw/mods/fml/common/network/internal/FMLMessage.java index 445163bd2..0430d2a0d 100644 --- a/fml/src/main/java/cpw/mods/fml/common/network/internal/FMLMessage.java +++ b/fml/src/main/java/cpw/mods/fml/common/network/internal/FMLMessage.java @@ -94,7 +94,7 @@ public abstract class FMLMessage { @Override void toBytes(ByteBuf buf) { - buf.writeInt(entity.func_145782_y()); + buf.writeInt(entity.getEntityId()); } @Override @@ -170,23 +170,23 @@ public abstract class FMLMessage { ByteBufUtils.writeUTF8String(buf, modId); buf.writeInt(modEntityTypeId); // posX, posY, posZ - buf.writeInt(MathHelper.func_76128_c(entity.field_70165_t * 32D)); - buf.writeInt(MathHelper.func_76128_c(entity.field_70163_u * 32D)); - buf.writeInt(MathHelper.func_76128_c(entity.field_70161_v * 32D)); + buf.writeInt(MathHelper.floor_double(entity.posX * 32D)); + buf.writeInt(MathHelper.floor_double(entity.posY * 32D)); + buf.writeInt(MathHelper.floor_double(entity.posZ * 32D)); // yaw, pitch - buf.writeByte((byte)(entity.field_70177_z * 256.0F / 360.0F)); - buf.writeByte((byte) (entity.field_70125_A * 256.0F / 360.0F)); + buf.writeByte((byte)(entity.rotationYaw * 256.0F / 360.0F)); + buf.writeByte((byte) (entity.rotationPitch * 256.0F / 360.0F)); // head yaw if (entity instanceof EntityLivingBase) { - buf.writeByte((byte) (((EntityLivingBase)entity).field_70759_as * 256.0F / 360.0F)); + buf.writeByte((byte) (((EntityLivingBase)entity).rotationYawHead * 256.0F / 360.0F)); } ByteBuf tmpBuf = Unpooled.buffer(); PacketBuffer pb = new PacketBuffer(tmpBuf); try { - entity.func_70096_w().func_151509_a(pb); + entity.getDataWatcher().func_151509_a(pb); } catch (IOException e) { // Sigh @@ -196,11 +196,11 @@ public abstract class FMLMessage { if (entity instanceof IThrowableEntity) { Entity owner = ((IThrowableEntity)entity).getThrower(); - buf.writeInt(owner == null ? entity.func_145782_y() : owner.func_145782_y()); + buf.writeInt(owner == null ? entity.getEntityId() : owner.getEntityId()); double maxVel = 3.9D; - double mX = entity.field_70159_w; - double mY = entity.field_70181_x; - double mZ = entity.field_70179_y; + double mX = entity.motionX; + double mY = entity.motionY; + double mZ = entity.motionZ; if (mX < -maxVel) mX = -maxVel; if (mY < -maxVel) mY = -maxVel; if (mZ < -maxVel) mZ = -maxVel; @@ -239,7 +239,7 @@ public abstract class FMLMessage { scaledHeadYaw = dat.readByte() * 360F / 256F; try { - dataWatcherList = DataWatcher.func_151508_b(new PacketBuffer(dat)); + dataWatcherList = DataWatcher.readWatchedListFromPacketBuffer(new PacketBuffer(dat)); } catch (IOException e) { // Sigh diff --git a/fml/src/main/java/cpw/mods/fml/common/network/internal/FMLNetworkHandler.java b/fml/src/main/java/cpw/mods/fml/common/network/internal/FMLNetworkHandler.java index 78f0de742..d51c3ecf8 100644 --- a/fml/src/main/java/cpw/mods/fml/common/network/internal/FMLNetworkHandler.java +++ b/fml/src/main/java/cpw/mods/fml/common/network/internal/FMLNetworkHandler.java @@ -75,17 +75,17 @@ public class FMLNetworkHandler Container remoteGuiContainer = NetworkRegistry.INSTANCE.getRemoteGuiContainer(mc, entityPlayerMP, modGuiId, world, x, y, z); if (remoteGuiContainer != null) { - entityPlayerMP.func_71117_bO(); - entityPlayerMP.func_71128_l(); - int windowId = entityPlayerMP.field_71139_cq; + entityPlayerMP.getNextWindowId(); + entityPlayerMP.closeContainer(); + int windowId = entityPlayerMP.currentWindowId; FMLMessage.OpenGui openGui = new FMLMessage.OpenGui(windowId, mc.getModId(), modGuiId, x, y, z); EmbeddedChannel embeddedChannel = channelPair.get(Side.SERVER); embeddedChannel.attr(FMLOutboundHandler.FML_MESSAGETARGET).set(OutboundTarget.PLAYER); embeddedChannel.attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(entityPlayerMP); embeddedChannel.writeOutbound(openGui); - entityPlayerMP.field_71070_bA = remoteGuiContainer; - entityPlayerMP.field_71070_bA.field_75152_c = windowId; - entityPlayerMP.field_71070_bA.func_75132_a(entityPlayerMP); + entityPlayerMP.openContainer = remoteGuiContainer; + entityPlayerMP.openContainer.windowId = windowId; + entityPlayerMP.openContainer.addCraftingToCrafters(entityPlayerMP); } } else if (FMLCommonHandler.instance().getSide().equals(Side.CLIENT)) diff --git a/fml/src/main/java/cpw/mods/fml/common/network/internal/FMLProxyPacket.java b/fml/src/main/java/cpw/mods/fml/common/network/internal/FMLProxyPacket.java index af1e97596..a732518ff 100644 --- a/fml/src/main/java/cpw/mods/fml/common/network/internal/FMLProxyPacket.java +++ b/fml/src/main/java/cpw/mods/fml/common/network/internal/FMLProxyPacket.java @@ -47,19 +47,19 @@ public class FMLProxyPacket extends Packet { this.payload = payload; } @Override - public void func_148837_a(PacketBuffer packetbuffer) throws IOException + public void readPacketData(PacketBuffer packetbuffer) throws IOException { // NOOP - we are not built this way } @Override - public void func_148840_b(PacketBuffer packetbuffer) throws IOException + public void writePacketData(PacketBuffer packetbuffer) throws IOException { // NOOP - we are not built this way } @Override - public void func_148833_a(INetHandler inethandler) + public void processPacket(INetHandler inethandler) { this.netHandler = inethandler; EmbeddedChannel internalChannel = NetworkRegistry.INSTANCE.getChannel(this.channel, this.target); diff --git a/fml/src/main/java/cpw/mods/fml/common/network/internal/OpenGuiHandler.java b/fml/src/main/java/cpw/mods/fml/common/network/internal/OpenGuiHandler.java index bacf9ff17..f45206f45 100644 --- a/fml/src/main/java/cpw/mods/fml/common/network/internal/OpenGuiHandler.java +++ b/fml/src/main/java/cpw/mods/fml/common/network/internal/OpenGuiHandler.java @@ -12,9 +12,9 @@ public class OpenGuiHandler extends SimpleChannelInboundHandlerTo get a packet suitable for presenting to the rest of minecraft, you can call {@link #getPacketFrom(IMessage)}. The return result - * is suitable for returning from things like {@link TileEntity#func_145844_m()} for example. + * is suitable for returning from things like {@link TileEntity#func_145844_m} for example. *
  • Finally, use the sendXXX to send unsolicited messages to various classes of recipients. * * @@ -87,7 +87,7 @@ public class SimpleNetworkWrapper { /** * Construct a minecraft packet from the supplied message. Can be used where minecraft packets are required, such as - * {@link TileEntity#func_145844_m()}. + * {@link TileEntity#func_145844_m}. * * @param message The message to translate into packet form * @return A minecraft {@link Packet} suitable for use in minecraft APIs diff --git a/fml/src/main/java/cpw/mods/fml/common/registry/EntityRegistry.java b/fml/src/main/java/cpw/mods/fml/common/registry/EntityRegistry.java index f7aaa178c..5d346d094 100644 --- a/fml/src/main/java/cpw/mods/fml/common/registry/EntityRegistry.java +++ b/fml/src/main/java/cpw/mods/fml/common/registry/EntityRegistry.java @@ -127,7 +127,7 @@ public class EntityRegistry { availableIndicies = new BitSet(256); availableIndicies.set(1,255); - for (Object id : EntityList.field_75623_d.keySet()) + for (Object id : EntityList.IDtoClassMapping.keySet()) { availableIndicies.clear((Integer)id); } @@ -158,11 +158,11 @@ public class EntityRegistry { entityClassRegistrations.put(entityClass, er); entityNames.put(entityName, mc); - if (!EntityList.field_75626_c.containsKey(entityClass)) + if (!EntityList.classToStringMapping.containsKey(entityClass)) { String entityModName = String.format("%s.%s", mc.getModId(), entityName); - EntityList.field_75626_c.put(entityClass, entityModName); - EntityList.field_75625_b.put(entityModName, entityClass); + EntityList.classToStringMapping.put(entityClass, entityModName); + EntityList.stringToClassMapping.put(entityModName, entityClass); FMLLog.finer("Automatically registered mod %s entity %s as %s", mc.getModId(), entityName, entityModName); } else @@ -180,7 +180,7 @@ public class EntityRegistry public static void registerGlobalEntityID(Class entityClass, String entityName, int id) { - if (EntityList.field_75626_c.containsKey(entityClass)) + if (EntityList.classToStringMapping.containsKey(entityClass)) { ModContainer activeModContainer = Loader.instance().activeModContainer(); String modId = "unknown"; @@ -196,7 +196,7 @@ public class EntityRegistry return; } id = instance().validateAndClaimId(id); - EntityList.func_75618_a(entityClass, entityName, id); + EntityList.addMapping(entityClass, entityName, id); } private int validateAndClaimId(int id) @@ -232,7 +232,7 @@ public class EntityRegistry public static void registerGlobalEntityID(Class entityClass, String entityName, int id, int backgroundEggColour, int foregroundEggColour) { - if (EntityList.field_75626_c.containsKey(entityClass)) + if (EntityList.classToStringMapping.containsKey(entityClass)) { ModContainer activeModContainer = Loader.instance().activeModContainer(); String modId = "unknown"; @@ -248,7 +248,7 @@ public class EntityRegistry return; } instance().validateAndClaimId(id); - EntityList.func_75614_a(entityClass, entityName, id, backgroundEggColour, foregroundEggColour); + EntityList.addMapping(entityClass, entityName, id, backgroundEggColour, foregroundEggColour); } public static void addSpawn(Class entityClass, int weightedProb, int min, int max, EnumCreatureType typeOfCreature, BiomeGenBase... biomes) @@ -256,16 +256,16 @@ public class EntityRegistry for (BiomeGenBase biome : biomes) { @SuppressWarnings("unchecked") - List spawns = biome.func_76747_a(typeOfCreature); + List spawns = biome.getSpawnableList(typeOfCreature); for (SpawnListEntry entry : spawns) { //Adjusting an existing spawn entry - if (entry.field_76300_b == entityClass) + if (entry.entityClass == entityClass) { - entry.field_76292_a = weightedProb; - entry.field_76301_c = min; - entry.field_76299_d = max; + entry.itemWeight = weightedProb; + entry.minGroupCount = min; + entry.maxGroupCount = max; break; } } @@ -277,7 +277,7 @@ public class EntityRegistry @SuppressWarnings("unchecked") public static void addSpawn(String entityName, int weightedProb, int min, int max, EnumCreatureType spawnList, BiomeGenBase... biomes) { - Class entityClazz = (Class) EntityList.field_75625_b.get(entityName); + Class entityClazz = (Class) EntityList.stringToClassMapping.get(entityName); if (EntityLiving.class.isAssignableFrom(entityClazz)) { @@ -290,12 +290,12 @@ public class EntityRegistry for (BiomeGenBase biome : biomes) { @SuppressWarnings("unchecked") - Iterator spawns = biome.func_76747_a(typeOfCreature).iterator(); + Iterator spawns = biome.getSpawnableList(typeOfCreature).iterator(); while (spawns.hasNext()) { SpawnListEntry entry = spawns.next(); - if (entry.field_76300_b == entityClass) + if (entry.entityClass == entityClass) { spawns.remove(); } @@ -306,7 +306,7 @@ public class EntityRegistry @SuppressWarnings("unchecked") public static void removeSpawn(String entityName, EnumCreatureType spawnList, BiomeGenBase... biomes) { - Class entityClazz = (Class) EntityList.field_75625_b.get(entityName); + Class entityClazz = (Class) EntityList.stringToClassMapping.get(entityName); if (EntityLiving.class.isAssignableFrom(entityClazz)) { @@ -361,7 +361,7 @@ public class EntityRegistry EntityRegistration er = lookupModSpawn(entity.getClass(), true); if (er != null) { - entityTracker.func_72785_a(entity, er.getTrackingRange(), er.getUpdateFrequency(), er.sendsVelocityUpdates()); + entityTracker.addEntityToTracker(entity, er.getTrackingRange(), er.getUpdateFrequency(), er.sendsVelocityUpdates()); return true; } return false; diff --git a/fml/src/main/java/cpw/mods/fml/common/registry/FMLControlledNamespacedRegistry.java b/fml/src/main/java/cpw/mods/fml/common/registry/FMLControlledNamespacedRegistry.java index b5cc9f16b..65595ee0a 100644 --- a/fml/src/main/java/cpw/mods/fml/common/registry/FMLControlledNamespacedRegistry.java +++ b/fml/src/main/java/cpw/mods/fml/common/registry/FMLControlledNamespacedRegistry.java @@ -119,11 +119,11 @@ public class FMLControlledNamespacedRegistry extends RegistryNamespaced { this.availabilityMap = new BitSet(maxIdValue); this.maxId = maxIdValue; this.minId = minIdValue; - this.field_148759_a = new FMLObjectIntIdentityMap(); + this.underlyingIntegerMap = new FMLObjectIntIdentityMap(); } @Override - public void func_148756_a(int id, String name, Object thing) + public void addObject(int id, String name, Object thing) { FMLLog.finer("Add : %s %d %s", name, id, thing); add(id, name, superType.cast(thing)); @@ -145,7 +145,7 @@ public class FMLControlledNamespacedRegistry extends RegistryNamespaced { throw new RuntimeException(String.format("Invalid id %s - not accepted",id)); } - namedIds.forcePut(func_148755_c(name),idToUse); + namedIds.forcePut(ensureNamespaced(name),idToUse); reassignMapping(name, idToUse); useSlot(idToUse); availabilityMap = temporary; @@ -175,37 +175,37 @@ public class FMLControlledNamespacedRegistry extends RegistryNamespaced { String prefix = mc.getModId(); name = prefix + ":"+ name; } - namedIds.forcePut(func_148755_c(name),idToUse); - super.func_148756_a(idToUse, name, thing); + namedIds.forcePut(ensureNamespaced(name),idToUse); + super.addObject(idToUse, name, thing); useSlot(idToUse); FMLLog.finer("Add : %s %d %s", name, idToUse, thing); return idToUse; } @Override - public I func_82594_a(String name) + public I getObject(String name) { - I object = superType.cast(super.func_82594_a(name)); + I object = superType.cast(super.getObject(name)); return object == null ? this.optionalDefaultObject : object; } @Override - public I func_148754_a(int id) + public I getObjectById(int id) { - I object = superType.cast(super.func_148754_a(id)); + I object = superType.cast(super.getObjectById(id)); return object == null ? this.optionalDefaultObject : object; } private FMLObjectIntIdentityMap idMap() { - return (FMLObjectIntIdentityMap) field_148759_a; + return (FMLObjectIntIdentityMap) underlyingIntegerMap; } @SuppressWarnings("unchecked") private BiMap nameMap() { - return (BiMap) field_82596_a; + return (BiMap) registryObjects; } void beginIdSwap() @@ -258,17 +258,17 @@ public class FMLControlledNamespacedRegistry extends RegistryNamespaced { public I get(int id) { - return func_148754_a(id); + return getObjectById(id); } public I get(String name) { - return func_82594_a(name); + return getObject(name); } public int getId(I thing) { - return func_148757_b(thing); + return getIDForObject(thing); } public void serializeInto(Map idMapping) @@ -287,7 +287,7 @@ public class FMLControlledNamespacedRegistry extends RegistryNamespaced { List usedIds() { - return ((FMLObjectIntIdentityMap)field_148759_a).usedIds(); + return ((FMLObjectIntIdentityMap)underlyingIntegerMap).usedIds(); } public int getId(String itemName) diff --git a/fml/src/main/java/cpw/mods/fml/common/registry/GameData.java b/fml/src/main/java/cpw/mods/fml/common/registry/GameData.java index c245791ab..1682c2653 100644 --- a/fml/src/main/java/cpw/mods/fml/common/registry/GameData.java +++ b/fml/src/main/java/cpw/mods/fml/common/registry/GameData.java @@ -60,13 +60,13 @@ public class GameData { static Item findItem(String modId, String name) { - return (Item) itemRegistry.func_82594_a(modId + ":" + name); + return (Item) itemRegistry.getObject(modId + ":" + name); } static Block findBlock(String modId, String name) { String key = modId + ":" + name; - return blockRegistry.contains(key) ? blockRegistry.func_82594_a(key) : null; + return blockRegistry.contains(key) ? blockRegistry.getObject(key) : null; } static ItemStack findItemStack(String modId, String name) @@ -127,7 +127,7 @@ public class GameData { static UniqueIdentifier getUniqueName(Block block) { if (block == null) return null; - String name = blockRegistry.func_148750_c(block); + String name = blockRegistry.getNameForObject(block); UniqueIdentifier ui = new UniqueIdentifier(name); if (customItemStacks.contains(ui.modId, ui.name)) { @@ -140,7 +140,7 @@ public class GameData { static UniqueIdentifier getUniqueName(Item item) { if (item == null) return null; - String name = itemRegistry.func_148750_c(item); + String name = itemRegistry.getNameForObject(item); UniqueIdentifier ui = new UniqueIdentifier(name); if (customItemStacks.contains(ui.modId, ui.name)) { diff --git a/fml/src/main/java/cpw/mods/fml/common/registry/GameRegistry.java b/fml/src/main/java/cpw/mods/fml/common/registry/GameRegistry.java index 21da07b34..b2a752997 100644 --- a/fml/src/main/java/cpw/mods/fml/common/registry/GameRegistry.java +++ b/fml/src/main/java/cpw/mods/fml/common/registry/GameRegistry.java @@ -90,7 +90,7 @@ public class GameRegistry { computeSortedGeneratorList(); } - long worldSeed = world.func_72905_C(); + long worldSeed = world.getSeed(); Random fmlRandom = new Random(worldSeed); long xSeed = fmlRandom.nextLong() >> 2 + 1L; long zSeed = fmlRandom.nextLong() >> 2 + 1L; @@ -216,38 +216,38 @@ public class GameRegistry public static IRecipe addShapedRecipe(ItemStack output, Object... params) { - return CraftingManager.func_77594_a().func_92103_a(output, params); + return CraftingManager.getInstance().addRecipe(output, params); } public static void addShapelessRecipe(ItemStack output, Object... params) { - CraftingManager.func_77594_a().func_77596_b(output, params); + CraftingManager.getInstance().addShapelessRecipe(output, params); } @SuppressWarnings("unchecked") public static void addRecipe(IRecipe recipe) { - CraftingManager.func_77594_a().func_77592_b().add(recipe); + CraftingManager.getInstance().getRecipeList().add(recipe); } public static void addSmelting(Block input, ItemStack output, float xp) { - FurnaceRecipes.func_77602_a().func_151393_a(input, output, xp); + FurnaceRecipes.smelting().func_151393_a(input, output, xp); } public static void addSmelting(Item input, ItemStack output, float xp) { - FurnaceRecipes.func_77602_a().func_151396_a(input, output, xp); + FurnaceRecipes.smelting().func_151396_a(input, output, xp); } public static void addSmelting(ItemStack input, ItemStack output, float xp) { - FurnaceRecipes.func_77602_a().func_151394_a(input, output, xp); + FurnaceRecipes.smelting().func_151394_a(input, output, xp); } public static void registerTileEntity(Class tileEntityClass, String id) { - TileEntity.func_145826_a(tileEntityClass, id); + TileEntity.addMapping(tileEntityClass, id); } /** @@ -260,8 +260,8 @@ public class GameRegistry */ public static void registerTileEntityWithAlternatives(Class tileEntityClass, String id, String... alternatives) { - TileEntity.func_145826_a(tileEntityClass, id); - Map> teMappings = ObfuscationReflectionHelper.getPrivateValue(TileEntity.class, null, "field_" + "145855_i", "field_145855_i"); + TileEntity.addMapping(tileEntityClass, id); + Map> teMappings = ObfuscationReflectionHelper.getPrivateValue(TileEntity.class, null, "field_" + "145855_i", "nameToClassMap"); for (String s: alternatives) { if (!teMappings.containsKey(s)) @@ -336,8 +336,8 @@ public class GameRegistry ItemStack foundStack = GameData.findItemStack(modId, name); if (foundStack != null) { - ItemStack is = foundStack.func_77946_l(); - is.field_77994_a = Math.min(stackSize, is.func_77976_d()); + ItemStack is = foundStack.copy(); + is.stackSize = Math.min(stackSize, is.getMaxStackSize()); return is; } return null; diff --git a/fml/src/main/java/cpw/mods/fml/common/registry/LanguageRegistry.java b/fml/src/main/java/cpw/mods/fml/common/registry/LanguageRegistry.java index 4cc00c8dd..640682380 100644 --- a/fml/src/main/java/cpw/mods/fml/common/registry/LanguageRegistry.java +++ b/fml/src/main/java/cpw/mods/fml/common/registry/LanguageRegistry.java @@ -127,11 +127,11 @@ public class LanguageRegistry { String objectName; if (objectToName instanceof Item) { - objectName=((Item)objectToName).func_77658_a(); + objectName=((Item)objectToName).getUnlocalizedName(); } else if (objectToName instanceof Block) { - objectName=((Block)objectToName).func_149739_a(); + objectName=((Block)objectToName).getUnlocalizedName(); } else if (objectToName instanceof ItemStack) { - objectName=((ItemStack)objectToName).func_77973_b().func_77667_c((ItemStack)objectToName); + objectName=((ItemStack)objectToName).getItem().getUnlocalizedName((ItemStack)objectToName); } else { throw new IllegalArgumentException(String.format("Illegal object for naming %s",objectToName)); } diff --git a/fml/src/main/java/cpw/mods/fml/common/registry/VillagerRegistry.java b/fml/src/main/java/cpw/mods/fml/common/registry/VillagerRegistry.java index f6f0b58f3..0f509895c 100644 --- a/fml/src/main/java/cpw/mods/fml/common/registry/VillagerRegistry.java +++ b/fml/src/main/java/cpw/mods/fml/common/registry/VillagerRegistry.java @@ -217,7 +217,7 @@ public class VillagerRegistry public static Object getVillageComponent(StructureVillagePieces.PieceWeight villagePiece, StructureVillagePieces.Start startPiece, @SuppressWarnings("rawtypes") List pieces, Random random, int p1, int p2, int p3, int p4, int p5) { - return instance().villageCreationHandlers.get(villagePiece.field_75090_a).buildComponent(villagePiece, startPiece, pieces, random, p1, p2, p3, p4, p5); + return instance().villageCreationHandlers.get(villagePiece.villagePieceClass).buildComponent(villagePiece, startPiece, pieces, random, p1, p2, p3, p4, p5); } @@ -226,7 +226,7 @@ public class VillagerRegistry { if (min > 0 && max > 0) { - EntityVillager.field_70958_bB.put(item, new Tuple(min, max)); + EntityVillager.villagersSellingList.put(item, new Tuple(min, max)); } EntityVillager.func_146091_a(list, item, random, chance); } @@ -236,7 +236,7 @@ public class VillagerRegistry { if (min > 0 && max > 0) { - EntityVillager.field_70960_bC.put(item, new Tuple(min, max)); + EntityVillager.blacksmithSellingList.put(item, new Tuple(min, max)); } EntityVillager.func_146089_b(list, item, random, chance); } @@ -245,6 +245,6 @@ public class VillagerRegistry { int extra = instance().newVillagerIds.size(); int trade = rand.nextInt(5 + extra); - villager.func_70938_b(trade < 5 ? trade : instance().newVillagerIds.get(trade - 5)); + villager.setProfession(trade < 5 ? trade : instance().newVillagerIds.get(trade - 5)); } } diff --git a/fml/src/main/resources/fml.exc b/fml/src/main/resources/fml.exc new file mode 100644 index 000000000..860fdd9ba --- /dev/null +++ b/fml/src/main/resources/fml.exc @@ -0,0 +1 @@ +net/minecraft/server/management/ServerConfigurationManager.initializeConnectionToPlayer(Lnet/minecraft/network/NetworkManager;Lnet/minecraft/entity/player/EntityPlayerMP;Lnet/minecraft/network/NetHandlerPlayServer;)V=|p_72355_1_,p_72355_2_,nethandlerplayserver diff --git a/fml/src/main/resources/fml.srg b/fml/src/main/resources/fml.srg new file mode 100644 index 000000000..e8eb7d47b --- /dev/null +++ b/fml/src/main/resources/fml.srg @@ -0,0 +1 @@ +MD: net/minecraft/server/management/ServerConfigurationManager/initializeConnectionToPlayer (Lnet/minecraft/network/NetworkManager;Lnet/minecraft/entity/player/EntityPlayerMP;Lnet/minecraft/network/NetHandlerPlayServer;)V net/minecraft/server/management/ServerConfigurationManager/func_72355_a (Lnet/minecraft/network/NetworkManager;Lnet/minecraft/entity/player/EntityPlayerMP;Lnet/minecraft/network/NetHandlerPlayServer;)V