Jump to content

Achievements [Solved]


Lua

Recommended Posts

Hi, I added achievements and in eclipse it works fine. However, after I've exported it and then got the achievement in REAL Minecraft and then closed the game and started the game up again. I get this crash log :

 

 

---- Minecraft Crash Report ----

// Uh... Did I do that?

 

Time: 23/09/13 23:08

Description: Initializing game

 

java.lang.RuntimeException: Duplicate stat id: "Unknown stat" and "achievement.ENTER_AC" at id 5244914

at net.minecraft.stats.StatBase.func_75971_g(SourceFile:32)

at net.minecraft.stats.Achievement.func_75985_c(SourceFile:51)

at arcticraft.main.AC_Achievements.initAchievements(AC_Achievements.java:19)

at arcticraft.main.MainRegistry.init(MainRegistry.java:201)

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

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:540)

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

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

at com.google.common.eventbus.EventBus.post(EventBus.java:267)

at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:193)

at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:173)

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

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

at com.google.common.eventbus.EventBus.post(EventBus.java:267)

at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:104)

at cpw.mods.fml.common.Loader.initializeMods(Loader.java:697)

at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:222)

at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:506)

at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:796)

at net.minecraft.client.main.Main.main(SourceFile:101)

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

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

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

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

 

 

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

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

 

-- Head --

Stacktrace:

at net.minecraft.stats.StatBase.func_75971_g(SourceFile:32)

at net.minecraft.stats.Achievement.func_75985_c(SourceFile:51)

at arcticraft.main.AC_Achievements.initAchievements(AC_Achievements.java:19)

at arcticraft.main.MainRegistry.init(MainRegistry.java:201)

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

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:540)

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

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

at com.google.common.eventbus.EventBus.post(EventBus.java:267)

at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:193)

at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:173)

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

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

at com.google.common.eventbus.EventBus.post(EventBus.java:267)

at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:104)

at cpw.mods.fml.common.Loader.initializeMods(Loader.java:697)

at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:222)

at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:506)

 

-- Initialization --

Details:

Stacktrace:

at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:796)

at net.minecraft.client.main.Main.main(SourceFile:101)

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

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

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

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

 

-- System Details --

Details:

Minecraft Version: 1.6.2

Operating System: Windows 7 (x86) version 6.1

Java Version: 1.7.0_25, Oracle Corporation

Java VM Version: Java HotSpot Client VM (mixed mode, sharing), Oracle Corporation

Memory: 34291200 bytes (32 MB) / 110559232 bytes (105 MB) up to 518979584 bytes (494 MB)

JVM Flags: 2 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx512M

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

Suspicious classes: FML and Forge are installed

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

FML: MCP v8.04 FML v6.2.19.789 Minecraft Forge 9.10.0.789 4 mods loaded, 4 mods active

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

FML{6.2.19.789} [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized

Forge{9.10.0.789} [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized

ac{Pre-Alpha} [Arcticraft] (Arcticraft Pre-Alpha.zip) Unloaded->Constructed->Pre-initialized->Errored

Launched Version: 1.6.2-Forge9.10.0.789

LWJGL: 2.9.0

OpenGL: AMD Radeon HD 7800 Series GL version 4.2.12217 Compatibility Profile Context 12.104.0.0, ATI Technologies Inc.

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

Type: Client (map_client.txt)

Resource Pack: Default

Current Language: English (US)

Profiler Position: N/A (disabled)

Vec3 Pool Size: ~~ERROR~~ NullPointerException: null

 

 

Heres my achievement code:

 

 

package arcticraft.main;

import net.minecraft.stats.Achievement;
import net.minecraftforge.common.AchievementPage;
import arcticraft.blocks.AC_Block;
import cpw.mods.fml.common.registry.LanguageRegistry;

public class AC_Achievements
{

public static AchievementPage AC_ACHIEVEMENT_PAGE;

public static Achievement AC_ENTER;
public static Achievement BACK_TO_BASICS;

public static void initAchievements()
{

	AC_ENTER = new Achievement(2034, "ENTER_AC", 0, 0, AC_Block.campfire, null).registerAchievement();
	BACK_TO_BASICS = new Achievement(2035, "BACK_TO_BASICS", 2, 0, AC_Block.frostLog, AC_ENTER).registerAchievement();

	addAchievementName("ENTER_AC", "BRRRRR.. It's cold!");
	addAchievementName("BACK_TO_BASICS", "Back To Basics");

	addAchievementDesc("ENTER_AC", "Enter The Arctic");
	addAchievementDesc("BACK_TO_BASICS", "Attack an Arctic tree until a block of wood comes out");

	AC_ACHIEVEMENT_PAGE = new AchievementPage("Achievements", AC_ENTER, 
			BACK_TO_BASICS
			);
	AchievementPage.registerAchievementPage(AC_ACHIEVEMENT_PAGE);
}

private static void addAchievementName(String ach, String name)
{
	LanguageRegistry.instance().addStringLocalization("achievement." + ach, "en_US", name);
}

private static void addAchievementDesc(String ach, String desc)
{
	LanguageRegistry.instance().addStringLocalization("achievement." + ach + ".desc", "en_US", desc);
}

}

 

 

I call the method in my init method.

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.

Announcements



×
×
  • Create New...

Important Information

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