Your sure you modified the right jar? If so try looking into those functions and seeing what needs to be changed.
The modpack client I have been making is finished and I managed to recompile and reobfuscate without and errors. The problem occurs once I have added the .class files into the modpack.jar and attempt to run it, it black screens and crashes. I managed to get this from the MinecraftLog.txt, something about a non-static method not being there or something, not really sure but here it is. Any help would be greatly appreciated as this is the only thing holding me back from releasing it.
Code:2013-08-27 12:19:05 [INFO] [STDERR] Exception in thread "Minecraft main thread" java.lang.IncompatibleClassChangeError: Expecting non-static method net.minecraft.client.gui.ScaledResolution.func_78326_a()I 2013-08-27 12:19:05 [INFO] [STDERR] at net.minecraft.client.Minecraft.func_71357_I(Minecraft.java:513) 2013-08-27 12:19:05 [INFO] [STDERR] at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:407) 2013-08-27 12:19:05 [INFO] [STDERR] at net.minecraft.client.MinecraftAppletImpl.func_71384_a(SourceFile:56) 2013-08-27 12:19:05 [INFO] [STDERR] at net.minecraft.client.Minecraft.run(Minecraft.java:733) 2013-08-27 12:19:05 [INFO] [STDERR] at java.lang.Thread.run(Unknown Source)
Last edited by Chris; 08-28-2013 at 04:20 AM.
Your sure you modified the right jar? If so try looking into those functions and seeing what needs to be changed.
I'm at a loss with this, I honestly don't know what to do. Here is the code in the Scaled Resolution class, your help will be greatly appreciated!
Code:package net.minecraft.client.gui; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.settings.GameSettings; import net.minecraft.util.MathHelper; @SideOnly(Side.CLIENT) public class ScaledResolution { private static int scaledWidth; private static int scaledHeight; private double scaledWidthD; private double scaledHeightD; private int scaleFactor; public ScaledResolution(GameSettings par1GameSettings, int par2, int par3) { this.scaledWidth = par2; this.scaledHeight = par3; this.scaleFactor = 1; int k = par1GameSettings.guiScale; if (k == 0) { k = 1000; } while (this.scaleFactor < k && this.scaledWidth / (this.scaleFactor + 1) >= 320 && this.scaledHeight / (this.scaleFactor + 1) >= 240) { ++this.scaleFactor; } this.scaledWidthD = (double)this.scaledWidth / (double)this.scaleFactor; this.scaledHeightD = (double)this.scaledHeight / (double)this.scaleFactor; this.scaledWidth = MathHelper.ceiling_double_int(this.scaledWidthD); this.scaledHeight = MathHelper.ceiling_double_int(this.scaledHeightD); } public static int getScaledWidth() { return scaledWidth; } public static int getScaledHeight() { return scaledHeight; } public double getScaledWidth_double() { return this.scaledWidthD; } public double getScaledHeight_double() { return this.scaledHeightD; } public int getScaleFactor() { return this.scaleFactor; } }
I think I have the got it.
Code:public static int getScaledWidth() { return scaledWidth; } public static int getScaledHeight() { return scaledHeight; }
However once I have removed the 'static' modifier I get errors to make them static again as I used them in my client to position things e.g.
I'm confused and don't know what to doCode:int line = 10; int line2 = 2; int width1 = ScaledResolution.getScaledWidth(); int height1 = ScaledResolution.getScaledHeight(); fontrenderer.drawStringWithShadow("Revolt v1.0", ScaledResolution.getScaledWidth() - fontrenderer.getStringWidth("Revolt v1.0") - 13, line2, 0xFF00FFFF);line2 += line;
Last edited by Chris; 08-30-2013 at 02:43 PM.
Make sure you can call the class in a non static manner so you can reference the variables in a non static way.
Code:private ScaledResolution scaledResolution; //in your class's constructor place this line of code this.scaledResolution = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight); //then you can use scaledResolution.getScaledHeight();//and anything else like that in the class.