Jump to content

[1.7.10] Achievement Page Crashing


EsvDefcon

Recommended Posts

Hi,

 

So, I had an issue yesterday with achievements not being triggered. I fixed that, and had two working achievements. So, I decided to move on to adding more achievements, and I now have a total of 18 (they seem kinda pointless, in some cases, but they're part of a new levelling system in the mod). Anyway, when I went to test out the new achievement ingame, I loaded up the Minecraft achievements page, and hit my achievement page's button. Then, it crashed. I have the code, and the error report, and I'd be really grateful if anyone can help me. Also, you can't unlock the achievements yet, I've just registered them, although I doubt that this would make a difference.

 

//Achievement Code

 

There are registries before this code, i.e. public static Achievement achievementName;

 

I did this for every single achievement.

 

achievementTakeTheHelm = new Achievement("achievement.takeTheHelm", "takeTheHelm", 0, 0, new ItemStack(Skyline.blockMarkShip), (Achievement)null).initIndependentStat().registerStat();
	achievementCiviianCaptain = new Achievement("achievement.civilianCaptain", "civilianCaptain", 1, -2, Skyline.blockBalloon, achievementTakeTheHelm).registerStat();
	achievementTradeShipCaptain = new Achievement("achievement.tradeShipCaptain", "tradeShipCaptain", -2, -3, Skyline.blockMarkShip, achievementCivilianCaptain).registerStat();
	achievementCargoShipCaptain = new Achievement("achievement.cargoShipCaptain", "cargoShipCaptain", 0, -1, Skyline.blockBalloon, achievementTradeShipCaptain).registerStat();
	achievementFreighterCaptain = new Achievement("achievement.freighterCaptain", "freighterCaptain", -1, 2, Skyline.blockBalloon, achievementCargoShipCaptain).registerStat();
	achievementSmallShipCaptain = new Achievement("achievement.smallShipCaptain", "smallShipCaptain", 4, -2, Skyline.blockBalloon, achievementCivilianCaptain).registerStat();
	achievementMediumShipCaptain = new Achievement("achievement.mediumShipCaptain", "mediumShipCaptain", 2, 3, Skyline.blockBalloon, achievementSmallShipCaptain).registerStat();
	achievementLargeShipCaptain = new Achievement("achievement.largeShipCaptain", "largeShipCaptain", 1, 4, Skyline.blockBalloon, achievementMediumShipCaptain).registerStat();
	achievementAirshipCaptain = new Achievement("achievement.airshipCaptain", "arishipCaptain", 2, 3, Skyline.blockBalloon, achievementLargeShipCaptain).registerStat();
	achievementSkylinerCaptain = new Achievement("achievement.skylinerCaptain", "skylinerCaptain", 1, -2, Skyline.blockBalloon, achievementAirshipCaptain).registerStat();
	achievementMilitaryCaptain = new Achievement("achievement.militaryCaptain", "militaryCaptain", 2, -3, Skyline.blockMarkShip, achievementTakeTheHelm).registerStat();
	achievementFighterCaptain = new Achievement("achievement.fighterCaptain", "fighterCaptain", 2, -4, Skyline.blockMarkShip, achievementMilitaryCaptain).registerStat();
	achievementFrigateCaptain = new Achievement("achievement.frigateCaptain", "frigateCaptin", 3, -5, Skyline.blockMarkShip, achievementFighterCaptain).registerStat();
	achievementCruiserCaptain = new Achievement("achievement.cruiserCaptain", "cruiserCaptain", 1, -5, Skyline.blockMarkShip, achievementFrigateCaptain).registerStat();
	achievementDestroyerCaptain = new Achievement("achievement.destroyerCaptain", "destroyerCaptain", 2, 5, Skyline.blockMarkShip, achievementCruiserCaptain).registerStat();
	achievementBattlecruiserCaptain = new Achievement("achievement.battlecruiserCaptain", "battlecruiserCaptain", 5, -2, Skyline.blockMarkShip, achievementDestroyerCaptain).registerStat();
	achievementBattleshipCaptain = new Achievement("achievement.battleshipCaptain", "battleshipCaptain", 2, -2, Skyline.blockMarkShip, achievementBattlecruiserCaptain).registerStat();
	achievementDreadnoughtCaptain = new Achievement("achievement.dreadnoughtCaptain", "dreadnoughtCaptain", 3, 5, Skyline.blockMarkShip, achievementBattleshipCaptain).registerStat();

	//Achievement Page
	AchievementPage.registerAchievementPage(new AchievementPage("Skyline", new Achievement[]{achievementTakeTheHelm, achievementCivilianCaptain, achievementTradeShipCaptain, achievementCargoShipCaptain, achievementFreighterCaptain, achievementSmallShipCaptain, achievementMediumShipCaptain, achievementLargeShipCaptain, achievementAirshipCaptain, achievementSkylinerCaptain, achievementMilitaryCaptain, achievementFighterCaptain, achievementFrigateCaptain, achievementCruiserCaptain, achievementDestroyerCaptain, achievementBattlecruiserCaptain, achievementBattleshipCaptain, achievementDreadnoughtCaptain}));

 

And here is the crash report:

 

---- Minecraft Crash Report ----

// Don't be sad. I'll do better next time, I promise!

 

Time: 27/08/14 10:00

Description: Rendering screen

 

java.lang.NullPointerException: Rendering screen

at net.minecraft.client.gui.achievement.GuiAchievements.func_146552_b(GuiAchievements.java:385)

at net.minecraft.client.gui.achievement.GuiAchievements.drawScreen(GuiAchievements.java:219)

at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1145)

at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1067)

at net.minecraft.client.Minecraft.run(Minecraft.java:961)

at net.minecraft.client.main.Main.main(Main.java:164)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at GradleStart.bounce(GradleStart.java:107)

at GradleStart.startClient(GradleStart.java:100)

at GradleStart.main(GradleStart.java:55)

 

 

A detailed walkthrough of the error, its code path and all known details is as follows:

---------------------------------------------------------------------------------------

 

-- Head --

Stacktrace:

at net.minecraft.client.gui.achievement.GuiAchievements.func_146552_b(GuiAchievements.java:385)

at net.minecraft.client.gui.achievement.GuiAchievements.drawScreen(GuiAchievements.java:219)

 

-- Screen render details --

Details:

Screen name: net.minecraft.client.gui.achievement.GuiAchievements

Mouse location: Scaled: (177, 205). Absolute: (532, 130)

Screen size: Scaled: (456, 249). Absolute: (1366, 745). Scale factor of 3

 

-- Affected level --

Details:

Level name: MpServer

All players: 1 total; [EntityClientPlayerMP['ForgeDevName'/139, l='MpServer', x=260.24, y=10.18, z=603.38]]

Chunk stats: MultiplayerChunkCache: 570, 570

Level seed: 0

Level generator: ID 01 - flat, ver 0. Features enabled: false

Level generator options:

Level spawn location: World: (335,4,396), Chunk: (at 15,0,12 in 20,24; contains blocks 320,0,384 to 335,255,399), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)

Level time: 23502 game time, 8865 day time

Level dimension: 0

Level storage version: 0x00000 - Unknown?

Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)

Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false

Forced entities: 48 total; [EntitySlime['Slime'/141, l='MpServer', x=259.07, y=4.05, z=598.98], EntitySlime['Slime'/5, l='MpServer', x=193.26, y=4.00, z=563.21], EntitySlime['Slime'/140, l='MpServer', x=263.59, y=4.00, z=613.25], EntitySlime['Slime'/143, l='MpServer', x=287.82, y=4.00, z=602.10], EntitySlime['Slime'/142, l='MpServer', x=227.63, y=4.00, z=602.50], EntitySlime['Slime'/8, l='MpServer', x=217.06, y=4.00, z=523.78], EntitySlime['Slime'/9, l='MpServer', x=203.44, y=4.00, z=564.69], EntitySlime['Slime'/10, l='MpServer', x=206.75, y=4.00, z=580.44], EntitySlime['Slime'/13, l='MpServer', x=230.66, y=4.00, z=537.03], EntitySlime['Slime'/14, l='MpServer', x=230.67, y=4.00, z=534.21], EntitySlime['Slime'/15, l='MpServer', x=241.06, y=4.00, z=558.73], EntitySlime['Slime'/152, l='MpServer', x=212.69, y=4.02, z=639.26], EntitySlime['Slime'/17, l='MpServer', x=235.86, y=4.00, z=588.53], EntitySlime['Slime'/153, l='MpServer', x=313.97, y=4.00, z=648.88], EntitySlime['Slime'/16, l='MpServer', x=226.37, y=4.00, z=574.27], EntitySlime['Slime'/154, l='MpServer', x=323.38, y=4.00, z=630.23], EntitySlime['Slime'/19, l='MpServer', x=236.77, y=4.00, z=558.13], EntitySlime['Slime'/155, l='MpServer', x=321.92, y=4.65, z=633.57], EntitySlime['Slime'/156, l='MpServer', x=213.49, y=4.00, z=662.46], EntitySlime['Slime'/157, l='MpServer', x=215.38, y=4.00, z=657.78], EntitySlime['Slime'/158, l='MpServer', x=214.90, y=4.70, z=670.42], EntitySlime['Slime'/23, l='MpServer', x=259.01, y=4.00, z=565.02], EntitySlime['Slime'/22, l='MpServer', x=253.29, y=4.95, z=534.70], EntitySlime['Slime'/144, l='MpServer', x=274.00, y=4.00, z=625.00], EntitySlime['Slime'/25, l='MpServer', x=277.33, y=4.00, z=568.56], EntitySlime['Slime'/145, l='MpServer', x=231.65, y=4.00, z=620.92], EntitySlime['Slime'/24, l='MpServer', x=286.93, y=4.00, z=561.53], EntitySlime['Slime'/146, l='MpServer', x=276.76, y=4.00, z=628.65], EntitySlime['Slime'/27, l='MpServer', x=283.88, y=4.00, z=581.71], EntitySlime['Slime'/147, l='MpServer', x=225.59, y=4.00, z=628.00], EntitySlime['Slime'/26, l='MpServer', x=268.71, y=4.98, z=573.70], EntitySlime['Slime'/148, l='MpServer', x=293.14, y=4.00, z=634.73], EntitySlime['Slime'/149, l='MpServer', x=307.47, y=3.00, z=617.07], EntitySlime['Slime'/150, l='MpServer', x=334.06, y=4.00, z=590.06], EntitySlime['Slime'/31, l='MpServer', x=295.38, y=4.00, z=572.69], EntitySlime['Slime'/151, l='MpServer', x=256.41, y=4.00, z=659.48], EntitySlime['Slime'/30, l='MpServer', x=295.38, y=4.00, z=576.99], EntitySlime['Slime'/171, l='MpServer', x=333.79, y=4.00, z=681.52], EntitySlime['Slime'/42, l='MpServer', x=322.18, y=4.00, z=553.88], EntitySlime['Slime'/162, l='MpServer', x=263.72, y=4.00, z=678.91], EntitySlime['Slime'/43, l='MpServer', x=314.35, y=4.95, z=560.93], EntitySlime['Slime'/161, l='MpServer', x=254.58, y=4.00, z=670.44], EntitySlime['Slime'/166, l='MpServer', x=332.31, y=3.00, z=662.09], EntitySlime['Slime'/164, l='MpServer', x=183.93, y=4.00, z=630.02], EntitySlime['Slime'/77, l='MpServer', x=320.21, y=4.00, z=549.58], EntitySlime['Slime'/78, l='MpServer', x=323.35, y=4.82, z=582.44], EntitySlime['Slime'/79, l='MpServer', x=331.76, y=4.60, z=589.10], EntityClientPlayerMP['ForgeDevName'/139, l='MpServer', x=260.24, y=10.18, z=603.38]]

Retry entities: 0 total; []

Server brand: fml,forge

Server type: Integrated singleplayer server

Stacktrace:

at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:417)

at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2568)

at net.minecraft.client.Minecraft.run(Minecraft.java:982)

at net.minecraft.client.main.Main.main(Main.java:164)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at GradleStart.bounce(GradleStart.java:107)

at GradleStart.startClient(GradleStart.java:100)

at GradleStart.main(GradleStart.java:55)

 

-- System Details --

Details:

Minecraft Version: 1.7.10

Operating System: Windows 8 (amd64) version 6.2

Java Version: 1.7.0_25, Oracle Corporation

Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation

Memory: 930543432 bytes (887 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)

JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0

FML: MCP v9.05 FML v7.10.18.1180 Minecraft Forge 10.13.0.1180 4 mods loaded, 4 mods active

mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

FML{7.10.18.1180} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.0.1180.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

Forge{10.13.0.1180} [Minecraft Forge] (forgeSrc-1.7.10-10.13.0.1180.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

skyline{1.0.0 Pre-Alpha} [EsvDefcon's Skyline Mod] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

Launched Version: 1.7.10

LWJGL: 2.9.1

OpenGL: AMD Radeon HD 7500G GL version 4.2.11764 Compatibility Profile Context, ATI Technologies Inc.

GL Caps: Using GL 1.3 multitexturing.

Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.

Anisotropic filtering is supported and maximum anisotropy is 16.

Shaders are available because OpenGL 2.1 is supported.

 

Is Modded: Definitely; Client brand changed to 'fml,forge'

Type: Client (map_client.txt)

Resource Packs: []

Current Language: English (US)

Profiler Position: N/A (disabled)

Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

Anisotropic Filtering: Off (1)

 

If anyone knows how I can stop this from happening, please let me know! :)

Link to comment
Share on other sites

Please put error logs in code tags.

 

And it tells us the achievement it tries to get from the achievementlist is null.

So your achievements aren't registered correctly.

I can't see anything immediately wrong with the piece of code provided(though I can overlook something).

These are similar threads:

 

http://www.minecraftforge.net/forum/index.php/topic,16909.0.html

http://www.minecraftforge.net/forum/index.php?topic=20831.0

Link to comment
Share on other sites

Sorry about that, and thanks. So, the achievements aren't registered correctly, but I registered them in exactly the same way as the two which were working yesterday. I've obviously either missed something out somewhere, or there's something else causing them to not register. I'll read those threads, and take a look through my code again.

Link to comment
Share on other sites

I tried switching my .registerAchievementPage to the PostInit method, but with no luck. It worked yesterday when it was in the Init method along with the achievements, although I don't have a reference for it. Do I need to reference the achievement page, something like this?

 

public static AchievementPage skylineAchievementPage;

 

And then define it in init?

 

skylineAchievementPage = new AchievementPage("Skyline", new Achievement[]{achievements});

 

Or just use

 

AchievementPage.registerAchievementPage(new AchievementPage("Skyline", new Achievement[]{achievements});

 

Aside from this, I don't think that this is causing the error. Maybe some of the prerequisite achievements are incorrect. I'll check that everything makes sens and then post if it is fixed or not.

Link to comment
Share on other sites

Sorry about all of the posts, but I can't believe that I missed this.

 

I had a reference of one of the achievements with the wrong spelling. I didn't notice it because I had registered the correct reference, but I'd used the incorrect reference as the prerequisite achievement for other achievements. This didn't throw an error, but crashed because the incorrect reference was null. Thanks again :)

Link to comment
Share on other sites

Sorry about all of the posts, but I can't believe that I missed this.

 

I had a reference of one of the achievements with the wrong spelling. I didn't notice it because I had registered the correct reference, but I'd used the incorrect reference as the prerequisite achievement for other achievements. This didn't throw an error, but crashed because the incorrect reference was null. Thanks again :)

If you're using it properly, Eclipse catches and displays errors for all spelling errors. Thus, it never would occur to me that was your problem.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.