Jump to content

Recommended Posts

Posted

Hello Guys,

 

My problem is when i try to open my Achievement Page it crashes:

 

 

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:1137)

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

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

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

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:135)

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

at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:78)

at GradleStart.main(GradleStart.java:45)

 

 

 

My AchievementHandler class:

 

 

public class AchievementHandler {

 

private static List<Achievement> list;

 

public static AchievementPage AgeAchievements;

public static Achievement Early_Stoneage = new Achievement("achievement.early_stoneage", "Early Stoneage", 0, -2, new ItemStack(Blocks.cobblestone), (Achievement)null).initIndependentStat().setSpecial().registerStat().parentAchievement;

public static Achievement Stoneage =  new Achievement("achievement.stoneage", "Stoneage", 1, -1, new ItemStack(Blocks.stone), Early_Stoneage).registerStat();

public static Achievement Copperage =  new Achievement("achievement.copperage", "Copperage", 2, 0, new ItemStack(ModItems.copperIngot), Stoneage).registerStat();

public static Achievement Bronzeage =  new Achievement("achievement.bronzeage", "Bronzeage", 0, 1, new ItemStack(ModItems.bronzeIngot), Copperage).registerStat();

public static Achievement Early_Middleage = new Achievement("achievement.early_middleage", "Early Middleage", 4, 2, new ItemStack(ModItems.messingIngot), Bronzeage).registerStat();

public static Achievement Middleage = new Achievement("achievement.middleage", "Middleage", 1, 3, new ItemStack(Items.iron_ingot), Early_Middleage).registerStat();

public static Achievement Renaissance = new Achievement("achievement.renaissance", "Renaissance", 2, 4, new ItemStack(Items.gold_ingot), Middleage).registerStat();

 

public static void registerAchievements(){

 

list = new ArrayList();

 

list.add(Early_Stoneage);

list.add(Stoneage);

list.add(Copperage);

list.add(Bronzeage);

list.add(Early_Middleage);

list.add(Middleage);

list.add(Renaissance);

 

 

}

 

public static void registerAchievementPage(){

 

AchievementPage.registerAchievementPage(new AchievementPage("CrystalRevolution", list.toArray(new Achievement[list.size()])));

 

}

 

public static Achievement getAchievementForItem(ItemStack stack)

{

if (stack == null)

{

return null;

}

 

for (Achievement ach : list)

{

ItemStack s = ach.theItemStack;

 

if (s.getItem() == stack.getItem() && s.getItemDamage() == stack.getItemDamage())

{

return ach;

}

}

 

return null;

}

 

}

 

 

 

The Initialization of my Achievements and the Page:

 

 

@EventHandler

public void preInit(FMLPreInitializationEvent e){

HarvestLevelHandler.HandleVanillaHarvestlvl();

 

LibMisc.logger.info("[Crystal Revolution]: Loading packets");

LibMisc.packetPipeLine.init();

LibMisc.logger.info("[Crystal Revolution]: Loading config");

CrystalConfig.initializeConfiguration(e.getModConfigurationDirectory().toString());

LibMisc.logger.info("[Crystal Revolution]: Removing recipes!");

RecipeRemover.RecipeRemove();

LibMisc.logger.info("[Crystal Revolution]: Loading blocks");

ModBlocks.ladeBloecke();

LibMisc.logger.info("[Crystal Revolution]: Loading items");

ModItems.ladeItems();

TileEntities.loadTileEntities();

AchievementHandler.registerAchievements();

LibMisc.logger.info("[Crystal Revolution]: Packets successfully loaded");

LibMisc.logger.info("[Crystal Revolution]: Config successfully loaded");

LibMisc.logger.info("[Crystal Revolution]: Recipes removed succesfully!");

LibMisc.logger.info("[Crystal Revolution]: Blocks successfully loaded");

LibMisc.logger.info("[Crystal Revolution]: Items successfully loaded");

LibMisc.logger.info("[Crystal Revolution]: Mod successfully loaded");

 

}

@EventHandler

public void Init(FMLInitializationEvent e){

NetworkRegistry.INSTANCE.registerGuiHandler(this, new GuiHandler());

RecipeManager.manageRecipes();

AchievementHandler.registerAchievementPage();

}

 

 

 

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.