Jump to content

[SOLVED][1.7.2] Achievement page error when loading it


MinecraftMart

Recommended Posts

Hey, every time when i load my achievement page it crashes. I dont know what causes the problem but i think my achievement page since that is pretty straight forward. Here is my code

 

Main class

package com.mart.achievements;



import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.Achievement;
import net.minecraft.stats.AchievementList;
import net.minecraftforge.common.AchievementPage;
import net.minecraftforge.common.MinecraftForge;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;


@Mod(modid = Achievements.modid, version = Achievements.version)
public class Achievements {

public static final String modid = "More Achievements!";
public static final String version = "Version 1.0";


@EventHandler
public void config(FMLPreInitializationEvent event)
{
}

//everything
public static Achievement Dirt;
public static Achievement Cobble;

@EventHandler
public void load(FMLInitializationEvent event)
{
	System.out.println("Loaded!");
	MinecraftForge.EVENT_BUS.register(new PickupHandler());
	AchievementPage.registerAchievementPage(page1);
}

@EventHandler
public void modsLoaded(FMLPostInitializationEvent event)
{

	Dirt = new Achievement("achievement.getDirt", "getDirt", 0, 0, Blocks.dirt, (Achievement)null).registerStat();
	this.addAchievementName("Dirt", "Dirt.. Really?");
	this.addAchievementDesc("Dirt", "You just found a piece of dirt..");

	Cobble = new Achievement("achievement.getCobble", "getCobble", 0, 1, Blocks.cobblestone, (Achievement)null).registerStat();
	this.addAchievementName("Cobble", "Well atleast its stone");
	this.addAchievementDesc("Dirt", "1st pieve of cobble! You must be so proud of yourself ");;

}

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

private void addAchievementDesc(String ach, String desc)
{
LanguageRegistry.instance().addStringLocalization("achievement." + ach + ".desc", "en_US", desc);
}
        //Okay it seems that , Dirt, Cobble makes the page crash. How other should i put it in?? Any ideas?
public static AchievementPage page1 = new AchievementPage("More Achievements!", Dirt, Cobble);






}

 

Crash log

[21:28:30] [Client thread/FATAL]: Reported exception thrown!
net.minecraft.util.ReportedException: Rendering screen
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1239) ~[EntityRenderer.class:?]
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1066) ~[Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:954) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:112) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_51]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_51]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_51]
at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_51]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]
Caused by: java.lang.NullPointerException
at net.minecraft.client.gui.achievement.GuiAchievements.func_146552_b(GuiAchievements.java:385) ~[GuiAchievements.class:?]
at net.minecraft.client.gui.achievement.GuiAchievements.drawScreen(GuiAchievements.java:219) ~[GuiAchievements.class:?]
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1209) ~[EntityRenderer.class:?]
... 9 more
---- Minecraft Crash Report ----
// I bet Cylons wouldn't have this problem.

Time: 27-2-14 21:28
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:1209)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1066)
at net.minecraft.client.Minecraft.run(Minecraft.java:954)
at net.minecraft.client.main.Main.main(Main.java:112)
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)


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: (191, 203). Absolute: (382, 72)
Screen size: Scaled: (427, 240). Absolute: (854, 480). Scale factor of 2

-- Affected level --
Details:
Level name: MpServer
All players: 1 total; [EntityClientPlayerMP['Player125'/419, l='MpServer', x=128,44, y=73,62, z=-208,36]]
Chunk stats: MultiplayerChunkCache: 225, 225
Level seed: 0
Level generator: ID 00 - default, ver 1. Features enabled: false
Level generator options: 
Level spawn location: World: (120,64,-200), Chunk: (at 8,4,8 in 7,-13; contains blocks 112,0,-208 to 127,255,-193), Region: (0,-1; contains chunks 0,-32 to 31,-1, blocks 0,0,-512 to 511,255,-1)
Level time: 589 game time, 589 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: survival (ID 0). Hardcore: false. Cheats: false
Forced entities: 120 total; [EntitySquid['Squid'/273, l='MpServer', x=151,43, y=51,39, z=-158,62], EntitySquid['Squid'/272, l='MpServer', x=150,28, y=56,09, z=-144,10], EntityBat['Bat'/258, l='MpServer', x=153,98, y=27,46, z=-207,85], EntityBat['Bat'/259, l='MpServer', x=151,17, y=18,71, z=-211,99], EntityZombie['Zombie'/256, l='MpServer', x=154,53, y=21,00, z=-213,72], EntityCreeper['Creeper'/257, l='MpServer', x=159,53, y=24,00, z=-208,28], EntityZombie['Zombie'/262, l='MpServer', x=144,50, y=13,00, z=-176,50], EntityZombie['Zombie'/263, l='MpServer', x=147,25, y=13,00, z=-182,47], EntityZombie['Zombie'/260, l='MpServer', x=149,56, y=40,00, z=-203,59], EntityCreeper['Creeper'/261, l='MpServer', x=148,69, y=13,00, z=-176,63], EntityItem['item.item.arrow'/266, l='MpServer', x=145,28, y=17,13, z=-180,88], EntityHorse['Horse'/267, l='MpServer', x=144,78, y=70,00, z=-187,22], EntitySkeleton['Skeleton'/264, l='MpServer', x=148,50, y=13,00, z=-179,97], EntityItem['item.item.bone'/265, l='MpServer', x=144,13, y=13,13, z=-176,13], EntitySquid['Squid'/270, l='MpServer', x=148,82, y=56,32, z=-147,05], EntitySquid['Squid'/271, l='MpServer', x=145,78, y=53,34, z=-150,39], EntitySpider['Spider'/268, l='MpServer', x=151,19, y=16,00, z=-170,00], EntitySkeleton['Skeleton'/269, l='MpServer', x=150,88, y=16,00, z=-167,56], EntityZombie['Zombie'/305, l='MpServer', x=171,59, y=57,00, z=-164,31], EntityZombie['Zombie'/304, l='MpServer', x=174,47, y=58,00, z=-165,94], EntityZombie['Zombie'/306, l='MpServer', x=174,50, y=36,00, z=-156,50], EntityHorse['Horse'/289, l='MpServer', x=162,50, y=72,00, z=-279,09], EntityHorse['Donkey'/292, l='MpServer', x=163,09, y=69,00, z=-238,97], EntityCreeper['Creeper'/293, l='MpServer', x=162,50, y=13,00, z=-217,50], EntityCreeper['Creeper'/294, l='MpServer', x=162,83, y=13,00, z=-214,40], EntityCreeper['Creeper'/295, l='MpServer', x=175,94, y=22,00, z=-219,53], EntitySkeleton['Skeleton'/296, l='MpServer', x=162,00, y=26,00, z=-210,69], EntitySkeleton['Skeleton'/297, l='MpServer', x=160,46, y=24,00, z=-210,56], EntitySkeleton['Skeleton'/298, l='MpServer', x=174,50, y=46,00, z=-215,50], EntitySkeleton['Skeleton'/299, l='MpServer', x=175,50, y=46,00, z=-215,50], EntityCreeper['Creeper'/300, l='MpServer', x=173,25, y=46,00, z=-200,41], EntityWitch['Witch'/301, l='MpServer', x=175,50, y=31,00, z=-186,81], EntitySpider['Spider'/302, l='MpServer', x=172,71, y=24,17, z=-169,54], EntitySkeleton['Skeleton'/303, l='MpServer', x=172,31, y=24,00, z=-167,47], EntityZombie['Zombie'/343, l='MpServer', x=187,87, y=21,00, z=-147,19], EntitySkeleton['Skeleton'/342, l='MpServer', x=177,88, y=26,00, z=-148,47], EntitySkeleton['Skeleton'/341, l='MpServer', x=179,28, y=25,00, z=-153,50], EntitySkeleton['Skeleton'/340, l='MpServer', x=176,50, y=24,00, z=-164,50], EntitySquid['Squid'/339, l='MpServer', x=189,78, y=47,00, z=-188,36], EntityCreeper['Creeper'/338, l='MpServer', x=178,78, y=30,00, z=-183,91], EntitySpider['Spider'/337, l='MpServer', x=189,31, y=28,91, z=-183,28], EntitySquid['Squid'/336, l='MpServer', x=183,52, y=48,00, z=-195,09], EntityCow['Cow'/78, l='MpServer', x=63,09, y=69,00, z=-287,63], EntityCow['Cow'/79, l='MpServer', x=50,31, y=67,00, z=-281,53], EntitySquid['Squid'/346, l='MpServer', x=189,64, y=47,44, z=-144,87], EntityCreeper['Creeper'/345, l='MpServer', x=178,54, y=36,24, z=-157,49], EntityZombie['Zombie'/344, l='MpServer', x=188,50, y=21,00, z=-149,50], EntityHorse['Donkey'/326, l='MpServer', x=181,16, y=72,00, z=-253,03], EntitySkeleton['Skeleton'/327, l='MpServer', x=189,35, y=46,00, z=-209,18], EntityHorse['Donkey'/324, l='MpServer', x=179,72, y=72,00, z=-250,97], EntityHorse['Donkey'/325, l='MpServer', x=177,03, y=73,00, z=-255,97], EntityHorse['Donkey'/322, l='MpServer', x=178,72, y=74,00, z=-256,72], EntityCow['Cow'/80, l='MpServer', x=60,48, y=69,00, z=-281,11], EntityHorse['Donkey'/323, l='MpServer', x=182,28, y=72,00, z=-251,19], EntityHorse['Horse'/321, l='MpServer', x=190,00, y=73,00, z=-274,00], EntitySpider['Spider'/334, l='MpServer', x=181,59, y=47,00, z=-203,91], EntityBat['Bat'/335, l='MpServer', x=182,67, y=47,63, z=-204,93], EntityCreeper['Creeper'/332, l='MpServer', x=176,50, y=46,00, z=-207,50], EntityCreeper['Creeper'/333, l='MpServer', x=181,50, y=46,00, z=-206,38], EntityCreeper['Creeper'/330, l='MpServer', x=186,50, y=42,00, z=-206,50], EntityCreeper['Creeper'/331, l='MpServer', x=179,50, y=46,00, z=-205,50], EntitySkeleton['Skeleton'/328, l='MpServer', x=190,31, y=25,00, z=-195,22], EntitySkeleton['Skeleton'/329, l='MpServer', x=189,31, y=25,00, z=-197,50], EntityBat['Bat'/368, l='MpServer', x=193,13, y=21,72, z=-155,53], EntityHorse['Horse'/356, l='MpServer', x=192,78, y=75,00, z=-275,22], EntitySkeleton['Skeleton'/357, l='MpServer', x=197,50, y=26,00, z=-196,50], EntityZombie['Zombie'/358, l='MpServer', x=203,50, y=38,00, z=-202,50], EntityCreeper['Creeper'/359, l='MpServer', x=200,85, y=45,00, z=-201,50], EntityHorse['Horse'/355, l='MpServer', x=196,50, y=75,00, z=-275,50], EntityBat['Bat'/364, l='MpServer', x=193,75, y=45,10, z=-202,59], EntitySkeleton['Skeleton'/366, l='MpServer', x=197,78, y=17,00, z=-154,41], EntitySquid['Squid'/124, l='MpServer', x=71,32, y=48,94, z=-218,24], EntityEnderman['Enderman'/367, l='MpServer', x=198,00, y=23,00, z=-147,16], EntityCow['Cow'/123, l='MpServer', x=66,69, y=70,00, z=-284,28], EntityBat['Bat'/360, l='MpServer', x=200,59, y=43,10, z=-200,94], EntityZombie['Zombie'/361, l='MpServer', x=199,98, y=45,00, z=-201,49], EntityBat['Bat'/362, l='MpServer', x=192,75, y=46,10, z=-202,56], EntitySkeleton['Skeleton'/363, l='MpServer', x=194,91, y=47,00, z=-202,47], EntityBat['Bat'/149, l='MpServer', x=90,72, y=34,10, z=-244,33], EntityZombie['Zombie'/163, l='MpServer', x=111,50, y=41,00, z=-211,50], EntitySkeleton['Skeleton'/162, l='MpServer', x=104,46, y=35,00, z=-251,50], EntityBat['Bat'/161, l='MpServer', x=104,92, y=39,28, z=-251,09], EntitySkeleton['Skeleton'/167, l='MpServer', x=100,50, y=23,00, z=-170,50], EntityZombie['Zombie'/166, l='MpServer', x=102,50, y=40,00, z=-212,50], EntityCreeper['Creeper'/165, l='MpServer', x=101,25, y=40,00, z=-213,25], EntityCreeper['Creeper'/164, l='MpServer', x=103,50, y=40,00, z=-212,00], EntityCreeper['Creeper'/186, l='MpServer', x=117,38, y=42,00, z=-209,31], EntityCreeper['Creeper'/187, l='MpServer', x=114,09, y=42,00, z=-208,53], EntityCreeper['Creeper'/190, l='MpServer', x=120,06, y=26,00, z=-176,50], EntitySkeleton['Skeleton'/191, l='MpServer', x=119,78, y=26,00, z=-178,31], EntityBat['Bat'/188, l='MpServer', x=125,75, y=18,10, z=-193,47], EntityCreeper['Creeper'/189, l='MpServer', x=124,69, y=12,00, z=-181,91], EntityClientPlayerMP['Player125'/419, l='MpServer', x=128,44, y=73,62, z=-208,36], EntitySquid['Squid'/201, l='MpServer', x=118,63, y=51,25, z=-147,88], EntityBat['Bat'/200, l='MpServer', x=118,70, y=29,06, z=-174,76], EntitySkeleton['Skeleton'/197, l='MpServer', x=118,28, y=26,00, z=-171,41], EntityZombie['Zombie'/196, l='MpServer', x=118,53, y=26,00, z=-170,47], EntityCreeper['Creeper'/199, l='MpServer', x=120,60, y=26,00, z=-170,56], EntitySkeleton['Skeleton'/198, l='MpServer', x=124,25, y=26,00, z=-167,69], EntityZombie['Zombie'/193, l='MpServer', x=120,50, y=26,00, z=-172,50], EntityZombie['Zombie'/192, l='MpServer', x=121,47, y=27,00, z=-176,98], EntitySkeleton['Skeleton'/195, l='MpServer', x=122,28, y=26,00, z=-170,44], EntityZombie['Zombie'/194, l='MpServer', x=117,50, y=26,00, z=-172,50], EntitySquid['Squid'/235, l='MpServer', x=141,70, y=57,31, z=-160,87], EntitySlime['Slime'/234, l='MpServer', x=136,84, y=15,00, z=-166,00], EntityCreeper['Creeper'/233, l='MpServer', x=133,44, y=30,12, z=-164,30], EntityWitch['Witch'/232, l='MpServer', x=130,50, y=29,00, z=-169,50], EntityHorse['Horse'/231, l='MpServer', x=138,00, y=64,00, z=-182,00], EntityCreeper['Creeper'/230, l='MpServer', x=142,97, y=13,00, z=-186,47], EntityBat['Bat'/229, l='MpServer', x=135,78, y=15,02, z=-190,22], EntityBat['Bat'/228, l='MpServer', x=137,31, y=14,13, z=-208,81], EntityHorse['Horse'/227, l='MpServer', x=140,19, y=73,00, z=-212,81], EntityHorse['Horse'/226, l='MpServer', x=135,19, y=73,00, z=-216,50], EntitySkeleton['Skeleton'/225, l='MpServer', x=136,50, y=16,00, z=-218,50], EntityHorse['Donkey'/254, l='MpServer', x=156,00, y=69,00, z=-235,75], EntityHorse['Donkey'/255, l='MpServer', x=156,00, y=69,00, z=-239,97], EntityHorse['Donkey'/252, l='MpServer', x=157,78, y=69,00, z=-234,72], EntityHorse['Donkey'/253, l='MpServer', x=153,78, y=69,00, z=-236,22], EntityHorse['Horse'/250, l='MpServer', x=157,16, y=76,00, z=-282,13], EntityBat['Bat'/251, l='MpServer', x=154,60, y=15,53, z=-230,20]]
Retry entities: 0 total; []
Server brand: fml,forge
Server type: Integrated singleplayer server
Stacktrace:
at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:418)
at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2559)
at net.minecraft.client.Minecraft.run(Minecraft.java:976)
at net.minecraft.client.main.Main.main(Main.java:112)
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)

-- System Details --
Details:
Minecraft Version: 1.7.2
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.7.0_51, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 711327256 bytes (678 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
AABB Pool Size: 12006 (672336 bytes; 0 MB) allocated, 12 (672 bytes; 0 MB) used
IntCache: cache: 11, tcache: 0, allocated: 13, tallocated: 95
FML: MCP v9.01-pre FML v7.2.125.1033 Minecraft Forge 10.12.0.1033 4 mods loaded, 4 mods active
mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
FML{7.2.125.1033} [Forge Mod Loader] (forgeSrc-1.7.2-10.12.0.1033.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
Forge{10.12.0.1033} [Minecraft Forge] (forgeSrc-1.7.2-10.12.0.1033.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
More Achievements!{Version 1.0} [More Achievements!] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
Launched Version: 1.6
LWJGL: 2.9.0
OpenGL: ATI Mobility Radeon HD 5470 GL version 3.2.9262 Compatibility Profile Context, ATI Technologies Inc.
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: 4826 (270256 bytes; 0 MB) allocated, 69 (3864 bytes; 0 MB) used
Anisotropic Filtering: Off (1)
#@!@# Game crashed! Crash report saved to: #@!@# C:\Users\Mart\Desktop\ForgeModding\eclipse\.\crash-reports\crash-2014-02-27_21.28.30-client.txt
AL lib: (EE) alc_cleanup: 1 device not closed

 

I hope you can help me :D

 

Okay it seems that , Dirt, Cobble makes the page crash. How other should i put it in?? Any ideas?

public static AchievementPage page1 = new AchievementPage("More Achievements!", Dirt, Cobble);

Is what i am talking about

Link to comment
Share on other sites

        @EventHandler
public void config(FMLPreInitializationEvent event)
{
}

//everything
public static Achievement Dirt;
public static Achievement Cobble;

@EventHandler
public void load(FMLInitializationEvent event)
{
	System.out.println("Loaded!");
	MinecraftForge.EVENT_BUS.register(new PickupHandler());
	AchievementPage.registerAchievementPage(page1);
}

@EventHandler
public void modsLoaded(FMLPostInitializationEvent event)
{

	Dirt = new Achievement("achievement.getDirt", "getDirt", 0, 0, Blocks.dirt, (Achievement)null).registerStat();
	this.addAchievementName("Dirt", "Dirt.. Really?");
	this.addAchievementDesc("Dirt", "You just found a piece of dirt..");

	Cobble = new Achievement("achievement.getCobble", "getCobble", 0, 1, Blocks.cobblestone, (Achievement)null).registerStat();
	this.addAchievementName("Cobble", "Well atleast its stone");
	this.addAchievementDesc("Dirt", "1st pieve of cobble! You must be so proud of yourself ");;

}

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

private void addAchievementDesc(String ach, String desc)
{
LanguageRegistry.instance().addStringLocalization("achievement." + ach + ".desc", "en_US", desc);
}
        //Okay it seems that , Dirt, Cobble makes the page crash. How other should i put it in?? Any ideas?
public static AchievementPage page1 = new AchievementPage("More Achievements!", Dirt, Cobble);
}

 

*Sigh* I thought it would pull a NPE. You do know post-init comes AFTER init right? You're rendering something that came after the achievement page was registered. To do it correctly, you should've done this:

 

public static AchievementPage page1;
public static Achievement Dirt;
public static Achievement Cobble;

@EventHandler
public void load(FMLInitializationEvent event) {

Dirt = new Achievement("achievement.getDirt", "getDirt", 0, 0, Blocks.dirt, (Achievement)null).registerStat();
this.addAchievementName("Dirt", "Dirt.. Really?");
this.addAchievementDesc("Dirt", "You just found a piece of dirt..");

Cobble = new Achievement("achievement.getCobble", "getCobble", 0, 1, Blocks.cobblestone, (Achievement)null).registerStat();
this.addAchievementName("Cobble", "Well atleast its stone");
this.addAchievementDesc("Dirt", "1st pieve of cobble! You must be so proud of yourself ");

page1 = new AchievementPage("More Achievements!", Dirt, Cobble);
}

@EventHandler 
public void postInit(FMLPostInitializationEvent event) {
System.out.println("Loaded!");
MinecraftForge.EVENT_BUS.register(new PickupHandler());
AchievementPage.registerAchievementPage(page1);
}


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

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

 

Enjoy!

-Mitchellbrine

 

Minecraft can do ANYTHING, it's coded in Java and you got the full power of Java behind you when you code. So nothing is impossible.

It may be freaking fucking hard though, but still possible ;)

 

If you create a topic on Modder Support, live by this motto:

I don't want your charity, I want your information
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Thank you! I have been looking for a solution to the problem for 3 months now, without finding an answer. The problem with displaying the skin was precisely on version 1.18.2, even in a single player game and only with Forge. Moreover, everything worked correctly on another computer. I'm already tired of looking for the problem. I deleted everything I could from the programs on my PC, nothing helped. I saw your post and unchecked IPv6 in the properties of my network connection and the problem disappeared! Thank you, you saved my nerve cells! Sorry for my English.
    • I once had a friend who shared a fascinating story about his spending habits. He was an avid World of Warcraft player, and his obsession with the game reached a new level when he decided to invest a substantial amount of money in amirdrassil the dream's hope boost services for his characters. Despite my initial shock at the expense, he explained that it was his way of enhancing his gaming experience. This memory serves as a reminder that people are willing to go to great lengths to pursue their passions, even if it means spending a significant sum.
    • I've been playing the ATFC modpack recently, however I've been having some performance issues. I tried to fix this by adding various performance mods - but it's only created more issues. This is my log file: https://pastebin.com/9a6r2ah4 I use PrismMC, an external launcher - separate from the Official Minecraft Launcher. I run ZorinOS 16.3 (A Linux Distro). I have 16Gb of RAM, I have an Intel Core i5-4570 CPU, and I have a NVIDIA GeForce GTX 1050 Ti GPU. This is the beginning of the error: [main/ERROR] [ne.mi.fm.lo.mo.ModDiscoverer/SCAN]: Failed to build unique mod list after mod discovery. net.minecraftforge.fml.loading.EarlyLoadingException: Duplicate mods found Help would be greatly appreciated! Sorry if my formatting is wrong - I'm very new here.
    • I believe I posted this topic in the wrong forum so I shall post it again. Hello, I am getting an error when trying to load into a personal modpack of mine. It's been giving this error ever since I started working on adding mods again, and I don't know what's causing it. I don't have a crash report since it is merely me getting kicked from my singleplayer world but I do have the error from the logs. I can provide the full log and debug.log on mclogs or pastebin if required. [26Sep2023 19:45:40.003] [Server thread/ERROR] [net.minecraft.server.network.ServerLoginPacketListenerImpl/]: Couldn't place player in world java.util.NoSuchElementException: No value present at java.util.Optional.orElseThrow(Optional.java:377) ~[?:?] at potionstudios.byg.common.world.LevelBiomeTracker.lambda$fromServer$6(LevelBiomeTracker.java:55) ~[Oh_The_Biomes_You'll_Go-forge-1.19.2-2.0.1.4.jar%23514!/:**.**.**.**] at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:178) ~[?:?] at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:992) ~[?:?] at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?] at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?] at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) ~[?:?] at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) ~[?:?] at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?] at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) ~[?:?] at potionstudios.byg.common.world.LevelBiomeTracker.fromServer(LevelBiomeTracker.java:55) ~[Oh_The_Biomes_You'll_Go-forge-1.19.2-2.0.1.4.jar%23514!/:**.**.**.**] at net.minecraft.server.level.ServerLevel.handler$bkb000$warnExperimentalBYG(ServerLevel.java:3269) ~[client-1.19.2-20220805.130853-srg.jar%23585!/:?] at net.minecraft.server.level.ServerLevel.m_8853_(ServerLevel.java) ~[client-1.19.2-20220805.130853-srg.jar%23585!/:?] at net.minecraft.server.level.ServerLevel.m_8834_(ServerLevel.java:780) ~[client-1.19.2-20220805.130853-srg.jar%23585!/:?] at net.minecraft.server.players.PlayerList.m_11261_(PlayerList.java:198) ~[client-1.19.2-20220805.130853-srg.jar%23585!/:?] at net.minecraft.server.network.ServerLoginPacketListenerImpl.m_143699_(ServerLoginPacketListenerImpl.java:156) ~[client-1.19.2-20220805.130853-srg.jar%23585!/:?] at net.minecraft.server.network.ServerLoginPacketListenerImpl.m_10055_(ServerLoginPacketListenerImpl.java:143) ~[client-1.19.2-20220805.130853-srg.jar%23585!/:?] at net.minecraft.server.network.ServerLoginPacketListenerImpl.m_9933_(ServerLoginPacketListenerImpl.java:75) ~[client-1.19.2-20220805.130853-srg.jar%23585!/:?] at net.minecraft.network.Connection.m_129483_(Connection.java:248) ~[client-1.19.2-20220805.130853-srg.jar%23585!/:?] at net.minecraft.server.network.ServerConnectionListener.m_9721_(ServerConnectionListener.java:143) ~[client-1.19.2-20220805.130853-srg.jar%23585!/:?] at net.minecraft.server.MinecraftServer.m_5703_(MinecraftServer.java:880) ~[client-1.19.2-20220805.130853-srg.jar%23585!/:?] at net.minecraft.server.MinecraftServer.m_5705_(MinecraftServer.java:806) ~[client-1.19.2-20220805.130853-srg.jar%23585!/:?] at net.minecraft.client.server.IntegratedServer.m_5705_(IntegratedServer.java:84) ~[client-1.19.2-20220805.130853-srg.jar%23585!/:?] at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:654) ~[client-1.19.2-20220805.130853-srg.jar%23585!/:?] at net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:244) ~[client-1.19.2-20220805.130853-srg.jar%23585!/:?]  
    • When trying to open Minecraft with the modpack installed it simply does not open and does not generate any crash-report, I only get the following log Forge 1.20.1 Server Log [#nhetr9s] - mclo.gs [27sep.2023 20:20:52.088] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--username, Raven, --version, 1.20.1-forge-47.2.0, --gameDir, C:\Users\ADMIN\AppData\Roaming\.minecraft, --assetsDir, C:\Users\ADMIN\AppData\Roaming\.minecraft\assets, --assetIndex, 5, --uuid, c133294fda623a7fb0c85f27d7f0f3fc, --accessToken, ????????, --clientId, 0, --xuid, 0, --userType, mojang, --versionType, release, --width, 854, --height, 480, --launchTarget, forgeclient, --fml.forgeVersion, 47.2.0, --fml.mcVersion, 1.20.1, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20230612.114412] [27sep.2023 20:20:52.095] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 10.0.9+10.0.9+main.dcd20f30 starting: java version 17.0.8 by Microsoft; OS Windows 10 arch amd64 version 10.0 [27sep.2023 20:20:54.925] [main/INFO] [net.minecraftforge.fml.loading.ImmediateWindowHandler/]: Loading ImmediateWindowProvider fmlearlywindow [27sep.2023 20:20:55.087] [main/INFO] [EARLYDISPLAY/]: Trying GL version 4.6 [27sep.2023 20:20:55.109] [main/INFO] [EARLYDISPLAY/]: Trying GL version 4.5 [27sep.2023 20:20:55.111] [main/INFO] [EARLYDISPLAY/]: Trying GL version 4.4 [27sep.2023 20:20:55.113] [main/INFO] [EARLYDISPLAY/]: Trying GL version 4.3 [27sep.2023 20:20:55.115] [main/INFO] [EARLYDISPLAY/]: Trying GL version 4.2 [27sep.2023 20:20:55.124] [main/INFO] [EARLYDISPLAY/]: Trying GL version 4.1 [27sep.2023 20:20:55.132] [main/INFO] [EARLYDISPLAY/]: Trying GL version 4.0 [27sep.2023 20:20:55.156] [main/INFO] [EARLYDISPLAY/]: Requested GL version 4.0 got version 4.0 [27sep.2023 20:20:55.345] [main/INFO] [mixin/]: SpongePowered MIXIN Subsystem Version=0.8.5 Source=union:/C:/Users/ADMIN/AppData/Roaming/.minecraft/libraries/org/spongepowered/mixin/0.8.5/mixin-0.8.5.jar%23100!/ Service=ModLauncher Env=CLIENT [27sep.2023 20:20:55.421] [pool-4-thread-1/INFO] [EARLYDISPLAY/]: GL info: Intel(R) HD Graphics 2500 GL version 4.0.0 - Build 10.18.10.5161, Intel [27sep.2023 20:20:56.983] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file C:\Users\ADMIN\AppData\Roaming\.minecraft\libraries\net\minecraftforge\fmlcore\1.20.1-47.2.0\fmlcore-1.20.1-47.2.0.jar is missing mods.toml file [27sep.2023 20:20:56.987] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file C:\Users\ADMIN\AppData\Roaming\.minecraft\libraries\net\minecraftforge\javafmllanguage\1.20.1-47.2.0\javafmllanguage-1.20.1-47.2.0.jar is missing mods.toml file [27sep.2023 20:20:56.991] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file C:\Users\ADMIN\AppData\Roaming\.minecraft\libraries\net\minecraftforge\lowcodelanguage\1.20.1-47.2.0\lowcodelanguage-1.20.1-47.2.0.jar is missing mods.toml file [27sep.2023 20:20:56.994] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file C:\Users\ADMIN\AppData\Roaming\.minecraft\libraries\net\minecraftforge\mclanguage\1.20.1-47.2.0\mclanguage-1.20.1-47.2.0.jar is missing mods.toml file [27sep.2023 20:20:58.045] [main/WARN] [net.minecraftforge.jarjar.selection.JarSelector/]: Attempted to select two dependency jars from JarJar which have the same identification: Mod File:  and Mod File: . Using Mod File:  [27sep.2023 20:20:58.047] [main/WARN] [net.minecraftforge.jarjar.selection.JarSelector/]: Attempted to select a dependency jar for JarJar which was passed in as source: geckolib. Using Mod File: C:\Users\ADMIN\AppData\Roaming\.minecraft\mods\geckolib-forge-1.20.1-4.2.3.jar [27sep.2023 20:20:58.047] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.JarInJarDependencyLocator/]: Found 40 dependencies adding them to mods collection [27sep.2023 20:20:58.639] [main/INFO] [org.groovymc.gml.mappings.MappingsProvider/]: Starting runtime mappings setup... [27sep.2023 20:20:58.669] [main/INFO] [org.groovymc.gml.internal.locator.ModLocatorInjector/]: Injecting ScriptModLocator candidates... [27sep.2023 20:20:58.686] [main/INFO] [org.groovymc.gml.scriptmods.ScriptModLocator/]: Injected Jimfs file system [27sep.2023 20:20:58.695] [main/INFO] [org.groovymc.gml.scriptmods.ScriptModLocator/]: Skipped loading script mods from directory C:\Users\ADMIN\AppData\Roaming\.minecraft\mods\scripts as it did not exist. [27sep.2023 20:20:58.704] [main/INFO] [org.groovymc.gml.internal.locator.ModLocatorInjector/]: Injected ScriptModLocator mod candidates. Found 0 valid mod candidates and 0 broken mod files. [27sep.2023 20:21:03.252] [GML Mappings Thread/INFO] [org.groovymc.gml.mappings.MappingsProvider/]: Loaded runtime mappings in 4271ms [27sep.2023 20:21:03.253] [GML Mappings Thread/INFO] [org.groovymc.gml.mappings.MappingsProvider/]: Finished runtime mappings setup.  
  • Topics

×
×
  • Create New...

Important Information

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