Bonjour a tous ! Pour mon mod MGC , j'ai décidé d'ajouter des Achievements , et je consulte ce tutoriel :
http://forum.ironcraft.fr/topic/6359-152forgecréer-un-nouvel-achievement/
Mais , mon premier marche bien , je veux crafter une arme et la ça plante ...
Rapport d'erreur :
Code (cpp):
2013-09-04 15:18:37 [INFO] [ForgeModLoader] Forge Mod Loader version 5.2.23.738 for Minecraft 1.5.2 loading
2013-09-04 15:18:37 [INFO] [ForgeModLoader] Java is Java HotSpot(TM) Client VM, version 1.7.0_25, running on Windows 7:x86:6.1, installed at C:\Program Files (x86)\Java\jre7
2013-09-04 15:18:37 [INFO] [ForgeModLoader] Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
2013-09-04 15:18:38 [INFO] [STDOUT] 229 recipes
2013-09-04 15:18:38 [INFO] [STDOUT] 27 achievements
2013-09-04 15:18:38 [INFO] [Minecraft-Client] Setting user: Player873
2013-09-04 15:18:38 [INFO] [STDOUT] (Session ID is -)
2013-09-04 15:18:38 [INFO] [STDERR] Client asked for parameter: server
2013-09-04 15:18:38 [INFO] [Minecraft-Client] LWJGL Version: 2.4.2
2013-09-04 15:18:38 [INFO] [MinecraftForge] Attempting early MinecraftForge initialization
2013-09-04 15:18:38 [INFO] [STDOUT] MinecraftForge v7.8.1.738 Initialized
2013-09-04 15:18:38 [INFO] [ForgeModLoader] MinecraftForge v7.8.1.738 Initialized
2013-09-04 15:18:39 [INFO] [STDOUT] Replaced 85 ore recipies
2013-09-04 15:18:39 [INFO] [MinecraftForge] Completed early MinecraftForge initialization
2013-09-04 15:18:39 [INFO] [ForgeModLoader] Reading custom logging properties from D:\Forge\mcp\jars\config\logging.properties
2013-09-04 15:18:39 [OFF] [ForgeModLoader] Logging level for ForgeModLoader logging is set to ALL
2013-09-04 15:18:39 [INFO] [ForgeModLoader] Searching D:\Forge\mcp\jars\mods for mods
2013-09-04 15:18:40 [INFO] [ForgeModLoader] Forge Mod Loader has identified 4 mods to load
2013-09-04 15:18:40 [INFO] [mcp] Activating mod mcp
2013-09-04 15:18:40 [INFO] [FML] Activating mod FML
2013-09-04 15:18:40 [INFO] [Forge] Activating mod Forge
2013-09-04 15:18:40 [INFO] [MGS] Activating mod MGS
2013-09-04 15:18:40 [INFO] [ForgeModLoader] Registering Forge Packet Handler
2013-09-04 15:18:40 [INFO] [ForgeModLoader] Succeeded registering Forge Packet Handler
2013-09-04 15:18:40 [INFO] [ForgeModLoader] Configured a dormant chunk cache size of 0
2013-09-04 15:18:40 [INFO] [STDOUT]
2013-09-04 15:18:40 [INFO] [STDOUT] Starting up SoundSystem...
2013-09-04 15:18:41 [INFO] [STDOUT] Initializing LWJGL OpenAL
2013-09-04 15:18:41 [INFO] [STDOUT] (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org)
2013-09-04 15:18:41 [INFO] [STDOUT] OpenAL initialized.
2013-09-04 15:18:41 [INFO] [STDOUT]
2013-09-04 15:18:41 [INFO] [STDOUT] Les sons ont bien ete enregistres
2013-09-04 15:18:41 [INFO] [ForgeModLoader] Forge Mod Loader has detected an older LWJGL version, new advanced texture animation features are disabled
2013-09-04 15:18:41 [INFO] [ForgeModLoader] Not using advanced OpenGL 4.3 advanced capability for animations : OpenGL 4.3 is not available
2013-09-04 15:18:41 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/lava_flow.txt
2013-09-04 15:18:41 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/water_flow.txt
2013-09-04 15:18:41 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/fire_0.txt
2013-09-04 15:18:41 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/fire_1.txt
2013-09-04 15:18:41 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/lava.txt
2013-09-04 15:18:41 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/portal.txt
2013-09-04 15:18:41 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/water.txt
2013-09-04 15:18:41 [INFO] [Minecraft-Client] Found animation info for: textures/items/clock.txt
2013-09-04 15:18:41 [INFO] [Minecraft-Client] Found animation info for: textures/items/compass.txt
2013-09-04 15:18:42 [INFO] [ForgeModLoader] Forge Mod Loader has successfully loaded 4 mods
2013-09-04 15:18:42 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/lava_flow.txt
2013-09-04 15:18:42 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/water_flow.txt
2013-09-04 15:18:42 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/fire_0.txt
2013-09-04 15:18:42 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/fire_1.txt
2013-09-04 15:18:42 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/lava.txt
2013-09-04 15:18:42 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/portal.txt
2013-09-04 15:18:42 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/water.txt
2013-09-04 15:18:42 [INFO] [Minecraft-Client] Found animation info for: textures/items/clock.txt
2013-09-04 15:18:42 [INFO] [Minecraft-Client] Found animation info for: textures/items/compass.txt
2013-09-04 15:19:03 [INFO] [Minecraft-Server] Starting integrated minecraft server version 1.5.2
2013-09-04 15:19:03 [INFO] [Minecraft-Server] Generating keypair
2013-09-04 15:19:03 [INFO] [ForgeModLoader] Loading dimension 0 (Shadow Moses) (net.minecraft.server.integrated.IntegratedServer@b5d2c0)
2013-09-04 15:19:03 [INFO] [ForgeModLoader] Loading dimension 1 (Shadow Moses) (net.minecraft.server.integrated.IntegratedServer@b5d2c0)
2013-09-04 15:19:03 [INFO] [ForgeModLoader] Loading dimension -1 (Shadow Moses) (net.minecraft.server.integrated.IntegratedServer@b5d2c0)
2013-09-04 15:19:03 [INFO] [Minecraft-Server] Preparing start region for level 0
2013-09-04 15:19:04 [INFO] [STDOUT] loading single player
2013-09-04 15:19:04 [INFO] [Minecraft-Server] Player873[/127.0.0.1:0] logged in with entity id 245 at (351.69999998807907, 67.0, 216.78053096293465)
2013-09-04 15:19:04 [INFO] [Minecraft-Server] Saving and pausing game...
2013-09-04 15:19:04 [INFO] [Minecraft-Server] Saving chunks for level 'Shadow Moses'/Overworld
2013-09-04 15:19:05 [INFO] [Minecraft-Server] Saving chunks for level 'Shadow Moses'/Nether
2013-09-04 15:19:05 [INFO] [Minecraft-Server] Saving chunks for level 'Shadow Moses'/The End
2013-09-04 15:19:05 [INFO] [Minecraft-Server] Saving and pausing game...
2013-09-04 15:19:05 [INFO] [Minecraft-Server] Saving chunks for level 'Shadow Moses'/Overworld
2013-09-04 15:19:05 [INFO] [Minecraft-Server] Saving chunks for level 'Shadow Moses'/Nether
2013-09-04 15:19:05 [INFO] [Minecraft-Server] Saving chunks for level 'Shadow Moses'/The End
2013-09-04 15:19:09 [INFO] [Minecraft-Server] Saving and pausing game...
2013-09-04 15:19:09 [INFO] [Minecraft-Server] Saving chunks for level 'Shadow Moses'/Overworld
2013-09-04 15:19:09 [INFO] [Minecraft-Server] Saving chunks for level 'Shadow Moses'/Nether
2013-09-04 15:19:09 [INFO] [Minecraft-Server] Saving chunks for level 'Shadow Moses'/The End
2013-09-04 15:19:27 [INFO] [Minecraft-Server] Stopping server
2013-09-04 15:19:27 [INFO] [Minecraft-Server] Saving players
2013-09-04 15:19:27 [INFO] [Minecraft-Server] Saving worlds
2013-09-04 15:19:27 [INFO] [Minecraft-Server] Saving chunks for level 'Shadow Moses'/Overworld
2013-09-04 15:19:27 [INFO] [Minecraft-Server] Saving chunks for level 'Shadow Moses'/Nether
2013-09-04 15:19:27 [INFO] [Minecraft-Server] Saving chunks for level 'Shadow Moses'/The End
2013-09-04 15:19:27 [INFO] [ForgeModLoader] Unloading dimension 0
2013-09-04 15:19:27 [INFO] [ForgeModLoader] Unloading dimension -1
2013-09-04 15:19:27 [INFO] [ForgeModLoader] Unloading dimension 1
2013-09-04 15:19:27 [INFO] [STDERR] net.minecraft.util.ReportedException: Updating screen events
2013-09-04 15:19:27 [INFO] [STDERR] at net.minecraft.client.Minecraft.runTick(Minecraft.java:1507)
2013-09-04 15:19:27 [INFO] [STDERR] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:835)
2013-09-04 15:19:27 [INFO] [STDERR] at net.minecraft.client.Minecraft.run(Minecraft.java:760)
2013-09-04 15:19:27 [INFO] [STDERR] at java.lang.Thread.run(Unknown Source)
2013-09-04 15:19:27 [INFO] [STDERR] Caused by: java.lang.NullPointerException
2013-09-04 15:19:27 [INFO] [STDERR] at mods.nono.MGSmod.common.H_Crafting.onCrafting(H_Crafting.java:92)
2013-09-04 15:19:27 [INFO] [STDERR] at cpw.mods.fml.common.registry.GameRegistry.onItemCrafted(GameRegistry.java:321)
2013-09-04 15:19:27 [INFO] [STDERR] at net.minecraft.inventory.SlotCrafting.onPickupFromSlot(SlotCrafting.java:118)
2013-09-04 15:19:27 [INFO] [STDERR] at net.minecraft.inventory.Container.slotClick(Container.java:346)
2013-09-04 15:19:27 [INFO] [STDERR] at net.minecraft.client.multiplayer.PlayerControllerMP.windowClick(PlayerControllerMP.java:468)
2013-09-04 15:19:27 [INFO] [STDERR] at net.minecraft.client.gui.inventory.GuiContainer.handleMouseClick(GuiContainer.java:803)
2013-09-04 15:19:27 [INFO] [STDERR] at net.minecraft.client.gui.inventory.GuiContainer.mouseClicked(GuiContainer.java:546)
2013-09-04 15:19:27 [INFO] [STDERR] at net.minecraft.client.gui.GuiScreen.handleMouseInput(GuiScreen.java:203)
2013-09-04 15:19:27 [INFO] [STDERR] at net.minecraft.client.gui.GuiScreen.handleInput(GuiScreen.java:177)
2013-09-04 15:19:27 [INFO] [STDERR] at net.minecraft.client.Minecraft.runTick(Minecraft.java:1500)
2013-09-04 15:19:27 [INFO] [STDERR] ... 3 more
2013-09-04 15:19:35 [INFO] [STDERR] Someone is closing me!
H_Crafting :
Code (java):
package mods.nono.MGSmod.common;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.AchievementList;
import cpw.mods.fml.common.ICraftingHandler;
public class H_Crafting implements ICraftingHandler
{
@Override
public void onCrafting(EntityPlayer player, ItemStack item, IInventory craftMatrix) //Lors d'un craft
{
// Gun1
if (item.itemID == D_Items.CanonLong.itemID)
{
player.addStat(D_Achievement.Gun1, 1);
}
if (item.itemID == D_Items.CorpsBois.itemID)
{
player.addStat(D_Achievement.Gun1, 1);
}
if (item.itemID == D_Items.CorpsFer.itemID)
{
player.addStat(D_Achievement.Gun1, 1);
}
if (item.itemID == D_Items.CorpsRPG.itemID)
{
player.addStat(D_Achievement.Gun1, 1);
}
if (item.itemID == D_Items.GachetteFusil.itemID)
{
player.addStat(D_Achievement.Gun1, 1);
}
if (item.itemID == D_Items.GachettePisto.itemID)
{
player.addStat(D_Achievement.Gun1, 1);
}
if (item.itemID == D_Items.PoigneBoi.itemID)
{
player.addStat(D_Achievement.Gun1, 1);
}
if (item.itemID == D_Items.PoigneFer.itemID)
{
player.addStat(D_Achievement.Gun1, 1);
}
//Gun2
if (item.itemID == D_Items.Lunette.itemID)
{
player.addStat(D_Achievement.Gun2, 1);
}
if (item.itemID == D_Items.Silencieux.itemID)
{
player.addStat(D_Achievement.Gun2, 1);
}
if (item.itemID == D_Items.lumiere.itemID)
{
player.addStat(D_Achievement.Gun2, 1);
}
//Gun3
if (item.itemID == Main.Ak47.itemID)
{
player.addStat(D_Achievement.Gun3, 1);
}
if (item.itemID == Main.FAMAS.itemID)
{
player.addStat(D_Achievement.Gun3, 1);
}
if (item.itemID == Main.SOCOM.itemID)
{
player.addStat(D_Achievement.Gun3, 1);
}
if (item.itemID == Main.MK22.itemID)
{
player.addStat(D_Achievement.Gun3, 1);
}
if (item.itemID == Main.PKM.itemID)
{
player.addStat(D_Achievement.Gun3, 1);
}
if (item.itemID == Main.nikita.itemID)
{
player.addStat(D_Achievement.Gun3, 1);
}
if (item.itemID == Main.RPG.itemID)
{
player.addStat(D_Achievement.Gun3, 1);
}
if (item.itemID == Main.SVD.itemID)
{
player.addStat(D_Achievement.Gun3, 1);
}
if (item.itemID == Main.MosinNagant.itemID)
{
player.addStat(D_Achievement.Gun3, 1);
}
}
@Override
public void onSmelting(EntityPlayer player, ItemStack item) //Lors d'une recette au four
{
}
}
D_Achievements
Code (java):
package mods.nono.MGSmod.common;
import net.minecraft.stats.Achievement;
import net.minecraft.stats.AchievementList;
import cpw.mods.fml.common.registry.LanguageRegistry;
public class D_Achievement {
public static final Achievement Gun1 = new Achievement(50, "Gun1", -2, 0, D_Items.CanonLong , AchievementList.openInventory).registerAchievement();
public static final Achievement Gun2 = new Achievement(51, "Gun3", -2, -2, D_Items.Silencieux , Gun1).registerAchievement();
public static final Achievement Gun3 = new Achievement(52, "Gun2", -4, -2, Main.SOCOM , Gun2).registerAchievement();
public static void loadAchievement()
{
LanguageRegistry.instance().addStringLocalization("achievement.Gun1", "Le debut d'une longue série ...");
LanguageRegistry.instance().addStringLocalization("achievement.Gun1.desc", "Craftez un morceau d'arme");
LanguageRegistry.instance().addStringLocalization("achievement.Gun2", "Silencieux");
LanguageRegistry.instance().addStringLocalization("achievement.Gun2.desc", "Craftez un accessoire d'arme");
LanguageRegistry.instance().addStringLocalization("achievement.Gun3", "Pan Pan Pan");
LanguageRegistry.instance().addStringLocalization("achievement.Gun3.desc", "Craftez une arme");
/*AchievementPage.registerAchievementPage(MGS);*/
//LanguageRegistry.instance().addStringLocalization("achievement.SolidSun", "Solid Sun!");
//LanguageRegistry.instance().addStringLocalization("achievement.SolidSun.desc", "Vous avez vaincu Laughing Octopus");
}
}
Merci d'avance de vos réponses.