Jump to content

Achievement Id error


Dragonisser

Recommended Posts

Well, when i get a Achievement ingame and i restart Minecraft i'm getting this error:

 

 

---- Minecraft Crash Report ----
// Would you like a cupcake?

Time: 24.06.13 23:05
Description: Failed to start game

java.lang.RuntimeException: Duplicate stat id: "Unknown stat" and "achievement.cobaltachiev" at id 5247880
at net.minecraft.stats.StatBase.registerStat(StatBase.java:58)
at net.minecraft.stats.Achievement.registerAchievement(Achievement.java:116)
at cobaltmod.main.mod_Cobalt.load(mod_Cobalt.java:795)
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:494)
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:314)
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.propogateStateMessage(LoadController.java:165)
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:314)
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:98)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:690)
at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:206)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:448)
at net.minecraft.client.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:44)
at net.minecraft.client.Minecraft.run(Minecraft.java:733)
at java.lang.Thread.run(Unknown Source)


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

-- System Details --
Details:
Minecraft Version: 1.5.2
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.7.0_21, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 974288480 bytes (929 MB) / 1065025536 bytes (1015 MB) up to 1065025536 bytes (1015 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
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 v7.51 FML v5.2.6.696 Minecraft Forge 7.8.0.696 4 mods loaded, 4 mods active
mcp{7.44} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized
FML{5.2.6.696} [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized
Forge{7.8.0.696} [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized
mod_Cobalt{1.4} [Cobalt Mod] (bin) Unloaded->Constructed->Pre-initialized->Errored
LWJGL: 2.4.2
OpenGL: ATI Radeon HD 3600 Series GL version 3.3.11672 Compatibility Profile Context, ATI Technologies Inc.
Is Modded: Definitely; Client brand changed to 'fml,forge'
Type: Client (map_client.txt)
Texture Pack: Default
Profiler Position: N/A (disabled)
Vec3 Pool Size: ~~ERROR~~ NullPointerException: null

 

 

 

mod_Cobalt

 

package cobaltmod.main;

import java.util.Map;
import java.util.Random;

import cobaltmod.blocks.BlockAltarOfAssociation;
import cobaltmod.blocks.BlockBlueBerryBushEmpty;
import cobaltmod.blocks.BlockBlueBerryBushFull;
import cobaltmod.blocks.BlockBluishCrop;
import cobaltmod.blocks.BlockCobaltBlock;
import cobaltmod.blocks.BlockCobaltBrick;
import cobaltmod.blocks.BlockCobaltBrickStair;
import cobaltmod.blocks.BlockCobaltGrass;
import cobaltmod.blocks.BlockCobaltLeaves;
import cobaltmod.blocks.BlockCobaltLog;
import cobaltmod.blocks.BlockCobaltOre;
import cobaltmod.blocks.BlockCobaltSapling;
import cobaltmod.blocks.BlockCobaltSlab;
import cobaltmod.blocks.BlockCobaltStone;
import cobaltmod.blocks.BlockCobaltTorch;
import cobaltmod.blocks.BlockCobaltWood;
import cobaltmod.blocks.BlockCobaltWoodSlab;
import cobaltmod.blocks.BlockCobaltWoodStair;
import cobaltmod.blocks.BlockFlowerClematis;
import cobaltmod.blocks.BlockCobaltPortal;
import cobaltmod.blocks.BlockRitualStone;
import cobaltmod.dimension.WorldProviderCobalt;
import cobaltmod.entity.EntityCobaltArrow;
import cobaltmod.entity.EntityCobaltGuardian;
import cobaltmod.entity.EntityCobaltZombie;
import cobaltmod.gui.TileEntityAltar;
import cobaltmod.handler.CraftingHandler;
import cobaltmod.handler.CraftingHandlerCobalt;
import cobaltmod.handler.GuiHandler;
import cobaltmod.handler.pickupHandler;
import cobaltmod.items.CobaltArmor;
import cobaltmod.items.ItemAltarOfAssocitation;
import cobaltmod.items.ItemBlueBerry;
import cobaltmod.items.ItemBlueEssence;
import cobaltmod.items.ItemNjossStaff;
import cobaltmod.items.ItemCobaltNugget;
import cobaltmod.items.ItemCobaltStoneCrystal;
import cobaltmod.items.ItemCobaltStoneFragment;
import cobaltmod.items.ItemCobaltWoodAxe;
import cobaltmod.items.ItemCobaltWoodHoe;
import cobaltmod.items.ItemCobaltWoodPickAxe;
import cobaltmod.items.ItemBluishCockTail;
import cobaltmod.items.ItemBluishFruit;
import cobaltmod.items.ItemBluishSeeds;
import cobaltmod.items.ItemCobaltApple;
import cobaltmod.items.ItemCobaltArrow;
import cobaltmod.items.ItemCobaltAxe;
import cobaltmod.items.ItemCobaltBow;
import cobaltmod.items.ItemCobaltDust;
import cobaltmod.items.ItemCobaltHoe;
import cobaltmod.items.ItemCobaltIngot;
import cobaltmod.items.ItemCobaltPickaxe;
import cobaltmod.items.ItemCobaltShovel;
import cobaltmod.items.ItemCobaltStick;
import cobaltmod.items.ItemCobaltSword;
import cobaltmod.items.ItemCobaltWoodShovel;
import cobaltmod.items.ItemCobaltWoodSword;
import cobaltmod.items.ItemCocktailGlass;
import cobaltmod.items.ItemCobaltRecipeBook;
import cobaltmod.items.ItemFoenumCrystal;
import cobaltmod.items.ItemGreenEssence;
import cobaltmod.items.ItemFoenumStaff;
import cobaltmod.items.ItemNjossCrystal;
import cobaltmod.renderer.RenderItemAltar;
import cobaltmod.world.BiomeGenCobalt;
import cobaltmod.world.WorldGenCobaltTree;
import cobaltmod.world.WorldGenerator;

import net.minecraft.block.Block;
import net.minecraft.block.BlockFlower;
import net.minecraft.block.BlockHalfSlab;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityEggInfo;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraftforge.common.EnumHelper;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.Item;
import net.minecraft.item.ItemRecord;
import net.minecraft.item.ItemStack;
import net.minecraft.src.ModLoader;
import net.minecraft.stats.Achievement;
import net.minecraft.stats.AchievementList;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EntityDamageSourceIndirect;
import net.minecraft.world.World;
import net.minecraft.world.WorldProvider;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.common.AchievementPage;
import net.minecraftforge.common.ChestGenHooks;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.common.DungeonHooks;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.Property;

import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Mod.PostInit;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.SidedProxy;
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.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

@Mod(modid = "mod_Cobalt", name = "Cobalt Mod", version = "1.4")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class mod_Cobalt 
{
//Blocks
public static Block cobaltore;
public static Block cobaltgrass;
public static Block cobaltblock;
public static Block cobaltlog;
public static Block cobaltwood;
public static Block cobaltleaves;
public static Block cobaltsapling;
public static Block cobaltsingleslab;
public static Block cobaltdoubleslab;
public static Block clematisflower;
public static Block redcabbagecrop;
public static Block cobaltbrick;
public static Block cobaltbrickstair;
public static Block cobaltstone;
public static Block cobaltportal;
public static Block cobalttorch;
public static Block blueberrybushfull;
public static Block blueberrybushempty;
public static Block ritualstone;
public static Block altarofassociation;
public static Block cobaltwoodstair;
public static Block cobaltwoodsingleslab;
public static Block cobaltwooddoubleslab;

//test
//public static Block trapstone;


//Items
public static Item cobaltpickaxe;
public static Item cobaltaxe;
public static Item cobaltshovel;
public static Item cobaltsword;
public static Item cobalthoe;
public static Item cobaltingot;
public static Item cobaltapple;
public static Item cobaltdust;
public static Item cobaltstick;
public static Item cobaltbow;
public static Item cobaltarrow;
public static Item redcabbageseeds;
public static Item redcabbage;
public static Item redcabbagejuice;
public static Item cocktailglass;
public static Item cobalthelmet;
public static Item cobaltplate;
public static Item cobaltlegs;
public static Item cobaltboots;
public static Item cobaltnugget;
public static Item cobaltwoodpickaxe;
public static Item cobaltwoodaxe;
public static Item cobaltwoodshovel;
public static Item cobaltwoodsword;
public static Item cobaltwoodhoe;
public static Item recipebook;
public static Item foenumstaff;
public static Item njossstaff;
public static Item foenumcrystal;
public static Item njosscrystal;
public static Item cobaltstonefragment;
public static Item cobaltstonecrystal;
public static Item blueessence;
public static Item greenessence;
public static Item blueberry;
public static Item altarofassociation_i; 


//Achievements
public static Achievement cobaltachiev;
    public static Achievement cobaltachiev1;
    public static Achievement cobaltachiev2;
    public static Achievement cobaltachiev3;
    public static Achievement cobaltachiev4;
    public static Achievement cobaltachiev5;
    public static Achievement cobaltachiev6;
    public static Achievement cobaltachiev7;
    public static Achievement cobaltachiev8;
    public static Achievement cobaltachiev9;
    public static Achievement cobaltachiev10;
    public static Achievement cobaltachiev11;
    public static Achievement cobaltachiev12;
    public static Achievement cobaltachiev13;
    public static Achievement cobaltachiev14;
    public static Achievement cobaltachiev15;
    public static Achievement cobaltachiev16;
    public static Achievement cobaltachiev17;
    public static Achievement cobaltachiev18;
    
    
    public static AchievementPage cobaltachievpage1;
    
    //Biome
    public static BiomeGenBase biomecobalt;
    
    //CreativeTab
    public static CreativeTabs cobalttab;
    
    //Handler
    public static CraftingHandlerCobalt craftHandler = new CraftingHandlerCobalt();
    
    //Disc
    
    //Ids
    
	//Blocks
	int CobaltBlockID;
	int CobaltOreID;
	int CobaltGrassID;
	int CobaltLeavesID;
	int CobaltLogID;
	int CobaltSaplingID;
	int CobaltWoodID;
	int CobaltSingleSlabID;
	int CobaltDoubleSlabID;
	int BlueClematisID;
	int RedCabbageCropID;
	int CobaltBrickID;
	int CobaltBrickStairID;
	int CobaltStoneID;
	int CobaltPortalID;
	int CobaltTorchID;
	int BlueBerryBushFullID;
	int BlueBerryBushEmptyID;
	int AltarOfAssociationID;
	int RitualStoneID;
	int CobaltWoodStairID;
	int CobaltWoodSingleSlabID;
	int CobaltWoodDoubleSlabID;

	//Items
	int CobaltIngotID;
	int CobaltDustID;
	int CobaltAppleID;
	int CobaltPickAxeID;
	int CobaltAxeID;
	int CobaltHoeID;
	int CobaltShovelID;
	int CobaltSwordID;
	int CobaltStickID;
	int CobaltBowID;
	int CobaltArrowID;
	int RedCabbageSeedsID;
	int RedCabbageID;
	int RedCabbageJuiceID;
	int CocktailGlassID;
	int CobaltHelmetID;
	int CobaltPlateID;
	int CobaltLegsID;
	int CobaltBootsID;
	int CobaltNuggetID;
	int CobaltWoodPickAxeID;
	int CobaltWoodAxeID;
	int CobaltWoodShovelID;
	int CobaltWoodSwordID;
	int CobaltWoodHoeID;
	int RecipeBookID;
	int FoenumStaffID;
	int NjossStaffID;
	int FoenumCrystalID;
	int NjossCrystalID;
	int CobaltStoneFragmentID;
	int CobaltStoneCrystalID;
	int BlueEssenceID;
	int GreenEssenceID;
	int BlueBerryID;
	int AltarOfAssociation_IID;

	//Entity
	static int startEntityId = 300;;

	//Dimension
	public static int cobaltdimension = 20; 


public static ItemStack leer;

    @SidedProxy(clientSide = "cobaltmod.main.ClientProxyCobalt", serverSide = "cobaltmod.main.CommonProxyCobalt")
    public static CommonProxyCobalt proxy;
    
    @Instance("mod_Cobalt")
    public static mod_Cobalt instance;
    
    public static DamageSource causeCobaltArrowDamage(EntityCobaltArrow par0EntityArrow, Entity par1Entity) 
    {
        return (new EntityDamageSourceIndirect("cobaltarrow", par0EntityArrow, par1Entity)).setProjectile();
    }
    
    
     @PreInit
     public void preLoad(FMLPreInitializationEvent event) 
     {
    	Configuration config = new Configuration(event.getSuggestedConfigurationFile());
    	 
 	config.load();
 	//Blocks
 	CobaltOreID = config.get("Block Ids", "Cobalt Ore", 2200).getInt();
 	CobaltBlockID = config.get("Block Ids", "Cobalt Block", 2201).getInt();
 	CobaltGrassID = config.get("Block Ids", "Cobalt Grass", 170).getInt();
 	CobaltLogID = config.get("Block Ids", "Cobalt Log", 2203).getInt();
 	CobaltLeavesID = config.get("Block Ids", "Cobalt Leaf", 2204).getInt();
 	CobaltSaplingID = config.get("Block Ids", "Cobalt Sapling", 2205).getInt();
 	CobaltWoodID = config.get("Block Ids", "Cobalt Wood", 2206).getInt();
 	CobaltSingleSlabID = config.get("Block Ids", "Cobalt Single Slab", 2207).getInt();
 	CobaltDoubleSlabID = config.get("Block Ids", "Cobalt Double Slab", 2208).getInt();
 	BlueClematisID = config.get("Block Ids", "Blue Clematis", 2209).getInt();
 	RedCabbageCropID = config.get("Block Ids", "Red Cabbage Crop", 2210).getInt();
 	CobaltBrickID = config.get("Block Ids", "Cobalt Brick Stone", 2211).getInt();
 	CobaltBrickStairID = config.get("Block Ids", "Cobalt Brick Stair", 2212).getInt();
 	CobaltStoneID = config.get("Block Ids", "Cobalt Stone", 2213).getInt();
 	CobaltPortalID = config.get("Block Ids", "Cobalt Portal", 2214).getInt();
 	CobaltTorchID = config.get("Block Ids", "Cobalt Torch", 2215).getInt();
 	BlueBerryBushFullID = config.get("Block Ids", "Blue Berry Bush Full", 2216).getInt();
 	BlueBerryBushEmptyID = config.get("Block Ids", "Blue Berry Bush Empty", 2217).getInt();
 	AltarOfAssociationID = config.get("Block Ids", "Altar Of Association", 2218).getInt();
 	RitualStoneID = config.get("Block Ids", "Ritual Stone", 2219).getInt();
 	CobaltWoodStairID = config.get("Block Ids", "Block Wood Stair", 2220).getInt();
 	CobaltWoodSingleSlabID = config.get("Block Ids", "Block Wood Single Slab", 2221).getInt();
 	CobaltWoodDoubleSlabID = config.get("Block Ids", "Block Wood Double Slab", 2222).getInt();


 	//Items
 	CobaltIngotID = config.get("Item Ids", "Cobalt Ingot", 4110).getInt();
 	CobaltDustID = config.get("Item Ids", "Cobalt Dust", 4111).getInt();
 	CobaltAppleID = config.get("Item Ids", "Cobalt Apple", 4112).getInt();
        CobaltPickAxeID = config.get("Item Ids", "Cobalt Pickaxe", 4113).getInt();
        CobaltAxeID = config.get("Item Ids", "Cobalt Axe", 4114).getInt();
        CobaltHoeID = config.get("Item Ids", "Cobalt Hoe", 4115).getInt();
        CobaltShovelID = config.get("Item Ids", "Cobalt Shovel", 4116).getInt();
        CobaltSwordID = config.get("Item Ids", "Cobalt Sword", 4117).getInt();
        CobaltStickID = config.get("Item Ids", "Cobalt Stick", 4118).getInt();
        CobaltBowID = config.get("Item Ids", "Cobalt Bow", 4119).getInt();
        CobaltArrowID = config.get("Item Ids", "Cobalt Arrow", 4120).getInt();
        RedCabbageSeedsID = config.get("Item Ids", "Red Cabbage Seeds", 4121).getInt();
        RedCabbageID = config.get("Item Ids", "Red Cabbage", 4122).getInt();
        RedCabbageJuiceID = config.get("Item Ids", "Red Cabbage Juice", 4123).getInt();
        CocktailGlassID = config.get("Item Ids", "Cocktail Glass", 4124).getInt();
        CobaltHelmetID = config.get("Item Ids", "Cobalt Helmet", 4125).getInt();
        CobaltPlateID = config.get("Item Ids", "Cobalt Plate", 4126).getInt();
        CobaltLegsID = config.get("Item Ids", "Cobalt Legs", 4127).getInt();
        CobaltBootsID = config.get("Item Ids", "Cobalt Boots", 4128).getInt();
        CobaltNuggetID = config.get("Item Ids", "Cobalt Nugget", 4129).getInt();
        CobaltWoodPickAxeID = config.get("Item Ids", "Cobalt Wood Pickaxe", 4130).getInt();
	CobaltWoodAxeID = config.get("Item Ids", "Cobalt Wood Axe", 4131).getInt();
	CobaltWoodShovelID = config.get("Item Ids", "Cobalt Wood Shovel", 4132).getInt();
	CobaltWoodSwordID = config.get("Item Ids", "Cobalt Wood Sword", 4133).getInt();
	CobaltWoodHoeID = config.get("Item Ids", "Cobalt Wood Hoe", 4134).getInt();
	RecipeBookID = config.get("Item Ids", "Recipe Book", 4135).getInt();
	FoenumStaffID = config.get("Item Ids", "Foenum Staff", 4136).getInt();
	NjossStaffID = config.get("Item Ids", "Njoss Staff", 4137).getInt();
	FoenumCrystalID = config.get("Item Ids", "Foenum Crystal", 4138).getInt();
	NjossCrystalID = config.get("Item Ids", "Njoss Crystal", 4139).getInt();
	CobaltStoneFragmentID = config.get("Item Ids", "Cobalt Stone Fragment", 4140).getInt();
	CobaltStoneCrystalID  = config.get("Item Ids", "Cobalt Stone Crystal", 4141).getInt();
	BlueEssenceID  = config.get("Item Ids", "Blue Essence", 4142).getInt();
	GreenEssenceID  = config.get("Item Ids", "Green Essence", 4143).getInt();
	BlueBerryID = config.get("Item Ids", "Blue Berry", 4144).getInt();
	AltarOfAssociation_IID = config.get("Item Ids", "Altar of Association", 4145).getInt();



 	config.save();
 	proxy.registerClientStuff();

 	//Achievement
    
    
     }
     
     
 @Init
 public void load(FMLInitializationEvent event)
 {



	//Tab Definition
	cobalttab = new CreativeTabCobalt(CreativeTabs.getNextID(), "cobalttab"); 

	//EnumMaterial
	EnumArmorMaterial CobaltOreArmor = EnumHelper.addArmorMaterial("Cobalt Armor", 40, new int[]{4, 9, 7, 4}, 22);
	EnumToolMaterial CobaltOreTool = EnumHelper.addToolMaterial("CobaltOre Tool", 3, 2000, 15.0F, 3, 10);
	EnumToolMaterial CobaltWoodTool = EnumHelper.addToolMaterial("CobaltWood Tool", 1, 150, 4.0F, 4, 17); 
	EnumToolMaterial MagicRodTool = EnumHelper.addToolMaterial("MagicRod Tool", 1, 10, 1.0F, 1, 1);

	//Item / Block Definition

	//1.5.1 Pre1
	cobaltore = new BlockCobaltOre(CobaltOreID).setUnlocalizedName("Cobalt_Mod:cobaltore").setHardness(5F).setResistance(4F).setCreativeTab(mod_Cobalt.cobalttab).setStepSound(Block.soundStoneFootstep);
	cobaltblock = new BlockCobaltBlock(CobaltBlockID).setUnlocalizedName("Cobalt_Mod:cobaltblock").setHardness(5F).setResistance(4F).setCreativeTab(mod_Cobalt.cobalttab).setStepSound(Block.soundStoneFootstep);
	cobaltgrass = new BlockCobaltGrass(CobaltGrassID).setUnlocalizedName("Cobalt_Mod:cobaltgrassside").setHardness(1F).setResistance(2F).setCreativeTab(mod_Cobalt.cobalttab).setStepSound(Block.soundGrassFootstep);
	cobaltingot = new ItemCobaltIngot(CobaltIngotID).setUnlocalizedName("Cobalt_Mod:cobaltingot").setCreativeTab(mod_Cobalt.cobalttab);
	cobaltdust = new ItemCobaltDust(CobaltDustID).setUnlocalizedName("Cobalt_Mod:cobaltdust").setCreativeTab(mod_Cobalt.cobalttab);
	cobaltapple = new ItemCobaltApple(CobaltAppleID, 4, false).setUnlocalizedName("Cobalt_Mod:cobaltapple").setCreativeTab(mod_Cobalt.cobalttab);
	cobaltpickaxe = new ItemCobaltPickaxe(CobaltPickAxeID, CobaltOreTool).setUnlocalizedName("Cobalt_Mod:cobaltpickaxe").setCreativeTab(mod_Cobalt.cobalttab);
	cobaltaxe = new ItemCobaltAxe(CobaltAxeID, CobaltOreTool).setUnlocalizedName("Cobalt_Mod:cobaltaxe").setCreativeTab(mod_Cobalt.cobalttab);
	cobalthoe = new ItemCobaltHoe(CobaltHoeID, CobaltOreTool).setUnlocalizedName("Cobalt_Mod:cobalthoe").setCreativeTab(mod_Cobalt.cobalttab);
	cobaltshovel = new ItemCobaltShovel(CobaltShovelID, CobaltOreTool).setUnlocalizedName("Cobalt_Mod:cobaltshovel").setCreativeTab(mod_Cobalt.cobalttab);
	cobaltsword = new ItemCobaltSword(CobaltSwordID, CobaltOreTool).setUnlocalizedName("Cobalt_Mod:cobaltsword").setCreativeTab(mod_Cobalt.cobalttab);
	cobaltlog = new BlockCobaltLog(CobaltLogID).setUnlocalizedName("Cobalt_Mod:cobaltlog").setHardness(3F).setResistance(4F).setCreativeTab(mod_Cobalt.cobalttab).setStepSound(Block.soundWoodFootstep);
	cobaltleaves = new BlockCobaltLeaves(CobaltLeavesID).setUnlocalizedName("Cobalt_Mod:cobaltleaves").setHardness(0.3F).setResistance(2F).setCreativeTab(mod_Cobalt.cobalttab).setStepSound(Block.soundGrassFootstep);
	cobaltsapling = new BlockCobaltSapling(CobaltSaplingID).setStepSound(Block.soundGrassFootstep).setUnlocalizedName("Cobalt_Mod:cobaltsapling").setHardness(0.5F).setResistance(4F).setCreativeTab(mod_Cobalt.cobalttab);
	cobaltwood = new BlockCobaltWood(CobaltWoodID).setUnlocalizedName("Cobalt_Mod:cobaltwood").setHardness(3F).setResistance(2F).setCreativeTab(mod_Cobalt.cobalttab).setStepSound(Block.soundWoodFootstep);
	cobaltstick = new ItemCobaltStick(CobaltStickID).setUnlocalizedName("Cobalt_Mod:cobaltstick").setCreativeTab(mod_Cobalt.cobalttab);
	cobaltsingleslab = new BlockCobaltSlab(CobaltSingleSlabID, false).setUnlocalizedName("Cobalt_Mod:cobaltslabsingle").setHardness(5F).setResistance(4F).setCreativeTab(mod_Cobalt.cobalttab).setLightOpacity(1);
	cobaltdoubleslab = new BlockCobaltSlab(CobaltDoubleSlabID, true).setUnlocalizedName("Cobalt_Mod:cobaltslabdouble").setHardness(5F).setResistance(4F).setCreativeTab(mod_Cobalt.cobalttab).setLightOpacity(1);
	cobaltbow = new ItemCobaltBow(CobaltBowID).setUnlocalizedName("Cobalt_Mod:cobaltbow").setCreativeTab(mod_Cobalt.cobalttab);
	cobaltarrow = new ItemCobaltArrow(CobaltArrowID).setUnlocalizedName("Cobalt_Mod:cobaltarrow").setCreativeTab(mod_Cobalt.cobalttab);
	clematisflower = new BlockFlowerClematis(BlueClematisID).setStepSound(Block.soundGrassFootstep).setUnlocalizedName("Cobalt_Mod:clematisflower").setCreativeTab(mod_Cobalt.cobalttab);


	//1.5.1 Pre2
	redcabbagecrop = new BlockBluishCrop(RedCabbageCropID).setUnlocalizedName("Cobalt_Mod:redcabbagecrop").setHardness(0F).setStepSound(Block.soundGrassFootstep);
	redcabbageseeds = new ItemBluishSeeds(RedCabbageSeedsID,redcabbagecrop.blockID, Block.tilledField.blockID).setUnlocalizedName("Cobalt_Mod:redcabbageseeds").setCreativeTab(mod_Cobalt.cobalttab);
	redcabbage = new ItemBluishFruit(RedCabbageID,3,false).setUnlocalizedName("Cobalt_Mod:redcabbage").setCreativeTab(mod_Cobalt.cobalttab);
	redcabbagejuice = new ItemBluishCockTail(RedCabbageJuiceID, 4, false).setUnlocalizedName("Cobalt_Mod:redcabbagejuice").setCreativeTab(null);
	cocktailglass = new ItemCocktailGlass(CocktailGlassID).setUnlocalizedName("Cobalt_Mod:cocktailglass");


	//1.5.2 Pre1
	cobaltbrick = new BlockCobaltBrick(CobaltBrickID).setUnlocalizedName("Cobalt_Mod:cobaltbrick").setCreativeTab(mod_Cobalt.cobalttab).setHardness(5F).setResistance(4F).setStepSound(Block.soundStoneFootstep);
	cobaltbrickstair = new BlockCobaltBrickStair(CobaltBrickStairID, mod_Cobalt.cobaltbrick, 0).setUnlocalizedName("Cobalt_Mod:cobaltbrickstair").setCreativeTab(mod_Cobalt.cobalttab).setHardness(5F).setResistance(4F).setStepSound(Block.soundStoneFootstep).setLightOpacity(1);
	cobalthelmet = new CobaltArmor(CobaltHelmetID, CobaltOreArmor, proxy.addArmor("Cobalt"), 0).setUnlocalizedName("Cobalt_Mod:cobalthelmet").setCreativeTab(mod_Cobalt.cobalttab);
	cobaltplate = new CobaltArmor(CobaltPlateID, CobaltOreArmor, proxy.addArmor("Cobalt"), 1).setUnlocalizedName("Cobalt_Mod:cobaltplate").setCreativeTab(mod_Cobalt.cobalttab);
	cobaltlegs = new CobaltArmor(CobaltLegsID, CobaltOreArmor, proxy.addArmor("Cobalt"), 2).setUnlocalizedName("Cobalt_Mod:cobaltlegs").setCreativeTab(mod_Cobalt.cobalttab);
	cobaltboots = new CobaltArmor(CobaltBootsID, CobaltOreArmor, proxy.addArmor("Cobalt"), 3).setUnlocalizedName("Cobalt_Mod:cobaltboots").setCreativeTab(mod_Cobalt.cobalttab);
	cobaltnugget = new ItemCobaltNugget(CobaltNuggetID).setUnlocalizedName("Cobalt_Mod:cobaltnugget").setCreativeTab(mod_Cobalt.cobalttab);
	cobaltwoodpickaxe = new ItemCobaltWoodPickAxe(CobaltWoodPickAxeID, CobaltWoodTool).setUnlocalizedName("Cobalt_Mod:cobaltwoodpickaxe").setCreativeTab(mod_Cobalt.cobalttab);
	cobaltwoodaxe = new ItemCobaltWoodAxe(CobaltWoodAxeID, CobaltWoodTool).setUnlocalizedName("Cobalt_Mod:cobaltwoodaxe").setCreativeTab(mod_Cobalt.cobalttab);
	cobaltwoodhoe = new ItemCobaltWoodHoe(CobaltWoodHoeID, CobaltWoodTool).setUnlocalizedName("Cobalt_Mod:cobaltwoodhoe").setCreativeTab(mod_Cobalt.cobalttab);
	cobaltwoodshovel = new ItemCobaltWoodShovel(CobaltWoodShovelID, CobaltWoodTool).setUnlocalizedName("Cobalt_Mod:cobaltwoodshovel").setCreativeTab(mod_Cobalt.cobalttab);
	cobaltwoodsword = new ItemCobaltWoodSword(CobaltWoodSwordID, CobaltWoodTool).setUnlocalizedName("Cobalt_Mod:cobaltwoodsword").setCreativeTab(mod_Cobalt.cobalttab);


	//1.5.2 Pre2
	recipebook = new ItemCobaltRecipeBook(RecipeBookID).setUnlocalizedName("Cobalt_Mod:recipebook").setCreativeTab(mod_Cobalt.cobalttab);
	foenumstaff = new ItemFoenumStaff(FoenumStaffID, MagicRodTool).setUnlocalizedName("Cobalt_Mod:foenumstaff").setCreativeTab(mod_Cobalt.cobalttab);
	njossstaff = new ItemNjossStaff(NjossStaffID, MagicRodTool).setUnlocalizedName("Cobalt_Mod:njossstaff").setCreativeTab(mod_Cobalt.cobalttab);
	cobaltstone = new BlockCobaltStone(CobaltStoneID).setUnlocalizedName("Cobalt_Mod:cobaltstone").setCreativeTab(mod_Cobalt.cobalttab).setHardness(3F).setResistance(4F).setStepSound(Block.soundStoneFootstep);
	foenumcrystal = new ItemFoenumCrystal(FoenumCrystalID).setUnlocalizedName("Cobalt_Mod:foenumcrystal").setCreativeTab(mod_Cobalt.cobalttab);
	njosscrystal = new ItemNjossCrystal(NjossCrystalID).setUnlocalizedName("Cobalt_Mod:njosscrystal").setCreativeTab(mod_Cobalt.cobalttab);
	cobaltstonefragment = new ItemCobaltStoneFragment(CobaltStoneFragmentID).setUnlocalizedName("Cobalt_Mod:cobaltstonefragment").setCreativeTab(mod_Cobalt.cobalttab);
	cobaltstonecrystal = new ItemCobaltStoneCrystal(CobaltStoneCrystalID).setUnlocalizedName("Cobalt_Mod:cobaltstonecrystal").setCreativeTab(mod_Cobalt.cobalttab);
	blueessence = new ItemBlueEssence(BlueEssenceID).setUnlocalizedName("Cobalt_Mod:blueessence").setCreativeTab(mod_Cobalt.cobalttab);
	greenessence = new ItemGreenEssence(GreenEssenceID).setUnlocalizedName("Cobalt_Mod:greenessence").setCreativeTab(mod_Cobalt.cobalttab);
	cobalttorch = new BlockCobaltTorch(CobaltTorchID).setUnlocalizedName("Cobalt_Mod:cobalttorch").setCreativeTab(mod_Cobalt.cobalttab).setLightValue(0.6F);
	blueberrybushfull = new BlockBlueBerryBushFull(BlueBerryBushFullID).setUnlocalizedName("Cobalt_Mod:blueberrybushfull").setHardness(0.3F).setCreativeTab(mod_Cobalt.cobalttab).setStepSound(Block.soundGrassFootstep);;
	blueberrybushempty = new BlockBlueBerryBushEmpty(BlueBerryBushEmptyID).setUnlocalizedName("Cobalt_Mod:blueberrybushempty").setHardness(0.5F).setCreativeTab(mod_Cobalt.cobalttab).setStepSound(Block.soundGrassFootstep);;
	blueberry = new ItemBlueBerry(BlueBerryID, 2, false).setUnlocalizedName("Cobalt_Mod:blueberry").setCreativeTab(mod_Cobalt.cobalttab);
	altarofassociation = new BlockAltarOfAssociation(AltarOfAssociationID, Material.rock).setUnlocalizedName("Cobalt_Mod:altarofassociation").setHardness(3F).setResistance(4F).setStepSound(Block.soundStoneFootstep);
	altarofassociation_i = new ItemAltarOfAssocitation(AltarOfAssociation_IID, altarofassociation).setUnlocalizedName("Cobalt_Mod:altarofassociation").setCreativeTab(mod_Cobalt.cobalttab);
	ritualstone = new BlockRitualStone(RitualStoneID).setUnlocalizedName("Cobalt_Mod:ritualstone").setCreativeTab(mod_Cobalt.cobalttab).setHardness(3F).setResistance(4F).setStepSound(Block.soundStoneFootstep);
	cobaltwoodstair = new BlockCobaltWoodStair(CobaltWoodStairID, mod_Cobalt.cobaltwood, 0).setUnlocalizedName("Cobalt_Mod:cobaltwoodstair").setCreativeTab(mod_Cobalt.cobalttab).setHardness(3F).setResistance(4F).setStepSound(Block.soundWoodFootstep).setLightOpacity(1);
	cobaltwoodsingleslab = new BlockCobaltWoodSlab(CobaltWoodSingleSlabID, false).setUnlocalizedName("Cobalt_Mod:cobaltwood").setHardness(3F).setResistance(4F).setCreativeTab(mod_Cobalt.cobalttab).setLightOpacity(1);
	cobaltwooddoubleslab = new BlockCobaltWoodSlab(CobaltWoodDoubleSlabID, true).setUnlocalizedName("Cobalt_Mod:cobaltwood").setHardness(3F).setResistance(4F).setCreativeTab(mod_Cobalt.cobalttab).setLightOpacity(1);


	//Test

	leer = null;
	cobaltportal = new BlockCobaltPortal(CobaltPortalID).setUnlocalizedName("Cobalt_Mod:cobaltportal").setCreativeTab(this.cobalttab);
	//trapstone = new BlocktrapStone(2216).setUnlocalizedName("Cobalt_Mod:trapstone").setCreativeTab(this.cobalttab);


	//Block Registration
	GameRegistry.registerBlock(cobaltore, "Cobalt Ore");
	GameRegistry.registerBlock(cobaltgrass, "Cobalt Grass");
	GameRegistry.registerBlock(cobaltblock, "Cobalt Block");
	GameRegistry.registerBlock(cobaltlog, "Cobalt Log");
	GameRegistry.registerBlock(cobaltwood, "Cobalt Wood");
	GameRegistry.registerBlock(cobaltleaves, "Cobalt Leaves");
	GameRegistry.registerBlock(cobaltsapling, "Cobalt Sapling");
	GameRegistry.registerBlock(cobaltsingleslab, "Cobalt Singlelab");
	GameRegistry.registerBlock(cobaltdoubleslab, "Cobalt Doubleslab");
	GameRegistry.registerBlock(clematisflower, "Blue Clematis");
	GameRegistry.registerBlock(redcabbagecrop, "Red Cabbage Crop");
	GameRegistry.registerBlock(cobaltbrick, "Cobaltbrick");
	GameRegistry.registerBlock(cobaltbrickstair, "Cobaltbrick Stair");
	GameRegistry.registerBlock(cobaltstone, "Cobalt Stone");
	GameRegistry.registerBlock(cobaltportal, "Cobalt Portal");
	GameRegistry.registerBlock(cobalttorch, "Cobalt Torch");
	GameRegistry.registerBlock(blueberrybushfull, "Blue Berrie Bush Full");
	GameRegistry.registerBlock(blueberrybushempty, "Blue Berrie Bush Empty");
	GameRegistry.registerBlock(altarofassociation, "Altar Of Association");
	GameRegistry.registerBlock(ritualstone, "Ritual Stone");
	GameRegistry.registerBlock(cobaltwoodstair, "Cobalt Wood Stair");
	GameRegistry.registerBlock(cobaltwoodsingleslab, "Cobalt Wood Singlelab");
	GameRegistry.registerBlock(cobaltwooddoubleslab, "Cobalt Wood Doubleslab");


	//test
	//GameRegistry.registerBlock(trapstone, "Trap Stone");


	//Language Registration

	//1.5.1 Pre1
	LanguageRegistry.addName(cobaltore, "Cobalt Ore");
	LanguageRegistry.instance().addStringLocalization("tile.Cobalt_Mod:cobaltore.name", "de_DE", "Cobalterz");

	LanguageRegistry.addName(cobaltgrass, "Cobalt Grass");
	LanguageRegistry.instance().addStringLocalization("tile.Cobalt_Mod:cobaltgrassside.name", "de_DE", "Cobaltgras");

	LanguageRegistry.addName(cobaltblock, "Cobalt Block");
	LanguageRegistry.instance().addStringLocalization("tile.Cobalt_Mod:cobaltblock.name", "de_DE", "Cobaltblock");

	LanguageRegistry.addName(cobaltlog, "Cobalt Log");
	LanguageRegistry.instance().addStringLocalization("tile.Cobalt_Mod:cobaltlog.name", "de_DE", "Cobaltholz");

	LanguageRegistry.addName(cobaltwood, "Cobalt Wood");
	LanguageRegistry.instance().addStringLocalization("tile.Cobalt_Mod:cobaltwood.name", "de_DE", "Cobaltholzbretter");

	LanguageRegistry.addName(cobaltleaves, "Cobalt Leaves");
	LanguageRegistry.instance().addStringLocalization("tile.Cobalt_Mod:cobaltleaves.name", "de_DE", "Cobaltlaub");

	LanguageRegistry.addName(cobaltsapling, "Cobalt Sapling");
	LanguageRegistry.instance().addStringLocalization("tile.Cobalt_Mod:cobaltsapling.name", "de_DE", "Cobaltsetzling");

	LanguageRegistry.addName(cobaltsingleslab, "Cobalt Single Slab");
	LanguageRegistry.instance().addStringLocalization("tile.Cobalt_Mod:cobaltslabsingle.name", "de_DE", "Cobaltstufe");

  	LanguageRegistry.addName(cobaltdoubleslab, "Cobalt Double Slab");
  	LanguageRegistry.instance().addStringLocalization("tile.Cobalt_Mod:cobaltslabdouble.name", "de_DE", "Cobaltdoppelstufe");

	LanguageRegistry.addName(clematisflower, "Blue Clematis");
  	LanguageRegistry.instance().addStringLocalization("tile.Cobalt_Mod:clematisflower.name", "de_DE", "Blaue Clematis");
  	
  	LanguageRegistry.addName(cobaltpickaxe, "Cobalt Pickaxe");
	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:cobaltpickaxe.name", "de_DE", "Cobaltspitzhacke");

	LanguageRegistry.addName(cobaltaxe, "Cobalt Axe");
	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:cobaltaxe.name", "de_DE", "Cobaltaxt");

	LanguageRegistry.addName(cobaltshovel, "Cobalt Shovel");
	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:cobaltshovel.name", "de_DE", "Cobaltschaufel");

	LanguageRegistry.addName(cobaltsword, "Cobalt Sword");
	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:cobaltsword.name", "de_DE", "Cobaltschwert");

	LanguageRegistry.addName(cobalthoe, "Cobalt Hoe");
	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:cobalthoe.name", "de_DE", "Cobalthacke");

	LanguageRegistry.addName(cobaltingot, "Cobalt Ingot");
	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:cobaltingot.name", "de_DE", "Cobaltbarren");

	LanguageRegistry.addName(cobaltdust, "Cobalt Dust");
	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:cobaltdust.name", "de_DE", "Cobaltstaub");

	LanguageRegistry.addName(cobaltapple, "Cobalt Apple");
	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:cobaltapple.name", "de_DE", "Cobaltapfel");

	LanguageRegistry.addName(cobaltstick, "Cobalt Stick");
	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:cobaltstick.name", "de_DE", "Cobaltstock");
  	
  	LanguageRegistry.addName(cobaltbow, "Cobalt Bow");
  	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:cobaltbow.name", "de_DE", "Cobaltbogen");

  	LanguageRegistry.addName(cobaltarrow, "Cobalt Arrow");
  	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:cobaltarrow.name", "de_DE", "Cobaltpfeil");
  	
  	
	//1.5.1 Pre2
  	LanguageRegistry.addName(redcabbageseeds, "Red Cabbage Seeds");
  	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:bluishseeds.name", "de_DE", "Rotkohlsamen");
  	
  	LanguageRegistry.addName(redcabbage, "Red Cabbage");
  	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:bluish.name", "de_DE", "Rotkohl");
  	
  	LanguageRegistry.addName(redcabbagejuice, "Red Cabbage Juice");
  	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:bluiscocktail.name", "de_DE", "Rotkohl Saft");

  	LanguageRegistry.addName(cocktailglass, "Cocktail Glass");
  	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:cocktailglass.name", "de_DE", "Cocktailglas");
  	
  	
  	//1.5.2 Pre1
  	LanguageRegistry.addName(cobaltbrick, "Cobaltbrick");
  	LanguageRegistry.instance().addStringLocalization("tile.Cobalt_Mod:cobaltbrick.name", "de_DE", "Cobaltziegel");
  	
  	LanguageRegistry.addName(cobaltbrickstair, "Cobaltbrick Stair");
  	LanguageRegistry.instance().addStringLocalization("tile.Cobalt_Mod:cobaltbrickstair.name", "de_DE", "Cobaltziegeltreppe");
  	
  	LanguageRegistry.addName(cobaltnugget, "Cobalt Nugget");
  	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:cobaltnugget.name", "de_DE", "Cobaltnugget");
  	
  	
  	
  	LanguageRegistry.addName(cobalthelmet, "Cobalt Helmet");
  	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:cobalthelmet.name", "de_DE", "Cobalthelm");
  	
  	LanguageRegistry.addName(cobaltplate, "Cobalt Chestplate");
  	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:cobaltplate.name", "de_DE", "Cobaltharnisch ");
  	
  	LanguageRegistry.addName(cobaltlegs, "Cobalt Leggings");
  	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:cobaltlegs.name", "de_DE", "Cobaltbeinschutz");
  	
  	LanguageRegistry.addName(cobaltboots, "Cobalt Boots");
  	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:cobaltboots.name", "de_DE", "Cobaltstiefel");
  	
  	LanguageRegistry.addName(cobaltwoodpickaxe, "Cobaltwood Pickaxe");
  	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:cobaltwoodpickaxe.name", "de_DE", "Cobaltholzspitzhacke");
  	
  	LanguageRegistry.addName(cobaltwoodaxe, "Cobaltwood Axe");
  	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:cobaltwoodaxe.name", "de_DE", "Cobaltholzaxt");
  	
  	LanguageRegistry.addName(cobaltwoodshovel, "Cobaltwood Shovel");
  	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:cobaltwoodshovel.name", "de_DE", "Cobaltholzschaufel");
  	
  	LanguageRegistry.addName(cobaltwoodhoe, "Cobaltwood Hoe");
  	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:cobaltwoodhoe.name", "de_DE", "Cobaltholzhacke");
  	
  	LanguageRegistry.addName(cobaltwoodsword, "Cobaltwood Sword");
  	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:cobaltwoodsword.name", "de_DE", "Cobaltholzschwert");
  	
  	
  	//1.5.2 Pre2
  	LanguageRegistry.addName(recipebook, "Cobalt Recipe Book");
  	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:recipebook.name", "de_DE", "Cobalt Rezeptbuch");
  	
  	LanguageRegistry.addName(foenumstaff, "Foenum Staff");
  	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:grassrod.name", "de_DE", "Stab des Foenum");
  	
  	LanguageRegistry.addName(njossstaff, "Njoss Staff");
  	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:cobaltgrassrod.name", "de_DE", "Stab des Njoss");
  	
  	LanguageRegistry.addName(cobaltstone, "Cobalt Stone");
  	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:cobaltstone.name", "de_DE", "Cobaltstein");
  	
  	LanguageRegistry.addName(foenumcrystal, "Foenum Crystal");
  	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:foenumcrystal.name", "de_DE", "Kristall des Foenum");
  	
  	LanguageRegistry.addName(njosscrystal, "Njoss Crystal");
  	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:njosscrystal.name", "de_DE", "Kristall des Njoss");
  	
  	LanguageRegistry.addName(foenumcrystal, "Foenum Crystal");
  	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:foenumcrystal.name", "de_DE", "Kristall des Foenum");
  	
  	LanguageRegistry.addName(cobaltstonefragment, "Cobalt Stone Fragment");
  	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:cobaltstonefragment.name", "de_DE", "Cobalsteinsplitter");
  	
  	LanguageRegistry.addName(cobaltstonecrystal, "Cobalt Stone Crystal");
  	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:cobaltstonecrystal.name", "de_DE", "Cobaltsteinkristall");
  	
  	LanguageRegistry.addName(blueessence, "Blue Essence");
  	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:blueessence.name", "de_DE", "Blaue Essenz");
  	
  	LanguageRegistry.addName(greenessence, "Green Essence");
  	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:greenessence.name", "de_DE", "Gruene Essenz");
  	
  	LanguageRegistry.addName(cobalttorch, "Cobalt Wood Torch");
  	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:cobalttorch.name", "de_DE", "Cobaltholzfackel");
  	
  	LanguageRegistry.addName(blueberrybushempty, "Blue Berry Bush");
  	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:blueberrybushempty.name", "de_DE", "Blaubeerbusch");
  	
  	LanguageRegistry.addName(blueberry, "Blue Berry");
  	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:blueberry.name", "de_DE", "Blaubeere");
  	
  	LanguageRegistry.addName(altarofassociation, "Altar of Association");
  	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:altarofassociation.name", "de_DE", "Altar der Vereinigung");
  	
  	LanguageRegistry.addName(ritualstone, "Ritual Stone");
  	LanguageRegistry.instance().addStringLocalization("item.Cobalt_Mod:ritualstone.name", "de_DE", "Ritual Stein");
  	
  	LanguageRegistry.addName(cobaltwoodstair, "Cobalt Wood Stair");
	LanguageRegistry.instance().addStringLocalization("tile.Cobalt_Mod:cobaltwoodstair.name", "de_DE", "Cobaltholztreppe");
  	
  	LanguageRegistry.addName(cobaltwoodsingleslab, "Cobalt Wood Single Slab");
	LanguageRegistry.instance().addStringLocalization("tile.Cobalt_Mod:cobaltwoodslabsingle.name", "de_DE", "Cobaltholzstufe");

  	LanguageRegistry.addName(cobaltwooddoubleslab, "Cobalt Wood Double Slab");
  	LanguageRegistry.instance().addStringLocalization("tile.Cobalt_Mod:cobaltwoodslabdouble.name", "de_DE", "Cobaltholzdoppelstufe");
  	
  	
  	//CreativeTab
  	LanguageRegistry.instance().addStringLocalization("Cobaltmain.cobalttab", "en_US", "Cobalt Mod");
  	
  	
  	//Dimension
  	//DimensionManager.registerProviderType(dimension, WorldProviderTutorial.class, false);
  	DimensionManager.registerProviderType(cobaltdimension, WorldProviderCobalt.class, true);
    DimensionManager.registerDimension(cobaltdimension, cobaltdimension);
  	
  	
  	//Entity
  		
  		//CobaltZombie
  	EntityRegistry.registerModEntity(EntityCobaltZombie.class, "CobaltZombie", 1, this, 80, 3, true);
  	LanguageRegistry.instance().addStringLocalization("entity.mod_Cobalt.CobaltZombie.name", "Cobalt Zombie");
  	registerEntityEgg(EntityCobaltZombie.class, 0x006633, 0x0033CC);
  	
  		//CobaltArrow
  	EntityRegistry.registerModEntity(EntityCobaltArrow.class, "CobaltArrow", cpw.mods.fml.common.registry.EntityRegistry.findGlobalUniqueEntityId(), this, 64, 1, true);
  	LanguageRegistry.instance().addStringLocalization("entity.mod_Cobalt.CobaltArrow.name", "Cobalt Arrow");
  	
  		//Altar
  	GameRegistry.registerTileEntity(TileEntityAltar.class, "altarTileEntity");
  	MinecraftForgeClient.registerItemRenderer(mod_Cobalt.altarofassociation_i.itemID, (IItemRenderer)new RenderItemAltar());
  	
  		//CobaltGuardian
  	EntityRegistry.registerModEntity(EntityCobaltGuardian.class, "CobaltGuardian", 2, this, 50, 2, true);
  	LanguageRegistry.instance().addStringLocalization("entity.mod_Cobalt.CobaltGuardian.name", "Cobalt Guardian");
  	registerEntityEgg(EntityCobaltGuardian.class, 0x999999, 0x0033CC);
  	
  	//Recipe Registration
  	GameRegistry.addRecipe(new ItemStack(cobaltblock, 1), new Object [] {"###", "###", "###", Character.valueOf('#'), cobaltingot});
  	GameRegistry.addRecipe(new ItemStack(cobaltpickaxe, 1), new Object [] {"###", " % ", " % ", Character.valueOf('#'), cobaltingot, Character.valueOf('%'), cobaltstick});
  	GameRegistry.addRecipe(new ItemStack(cobaltaxe, 1), new Object [] {"## ", "#% ", " % ", Character.valueOf('#'), cobaltingot, Character.valueOf('%'), cobaltstick});
  	GameRegistry.addRecipe(new ItemStack(cobalthoe, 1), new Object [] {"## ", " % ", " % ", Character.valueOf('#'), cobaltingot, Character.valueOf('%'), cobaltstick});
  	GameRegistry.addRecipe(new ItemStack(cobaltshovel, 1), new Object [] {"#", "%", "%", Character.valueOf('#'), cobaltingot, Character.valueOf('%'), cobaltstick});
    GameRegistry.addRecipe(new ItemStack(cobaltsword, 1), new Object [] {"#", "#", "%", Character.valueOf('#'), cobaltingot, Character.valueOf('%'), cobaltstick});
  	GameRegistry.addRecipe(new ItemStack(cobaltingot, 9), new Object [] {"#", Character.valueOf('#'), cobaltblock});
    GameRegistry.addRecipe(new ItemStack(cobaltdust, 2), new Object [] {"#", Character.valueOf('#'), cobaltingot});
  	GameRegistry.addRecipe(new ItemStack(cobaltapple, 1), new Object [] {"###", "#%#", "###", Character.valueOf('#'), cobaltdust, Character.valueOf('%'), Item.appleRed});
  	GameRegistry.addRecipe(new ItemStack(cobaltstick, 4), new Object [] {"#", "#", Character.valueOf('#'), cobaltwood});
  	GameRegistry.addRecipe(new ItemStack(cobaltwood, 4), new Object [] {"#", Character.valueOf('#'), cobaltlog});
  	GameRegistry.addRecipe(new ItemStack(cobaltsingleslab, 3), new Object [] {"###", Character.valueOf('#'), cobaltingot});
  	GameRegistry.addRecipe(new ItemStack(cobaltbow, 1), new Object [] {" #%", "# %", " #%", Character.valueOf('#'), cobaltstick, Character.valueOf('%'), Item.silk});
  	GameRegistry.addRecipe(new ItemStack(cobaltarrow, 5), new Object [] {"%", "#", "$", Character.valueOf('#'), cobaltstick, Character.valueOf('%'), Item.flint, Character.valueOf('$'), Item.feather});
  	GameRegistry.addRecipe(new ItemStack(cobaltingot, 1), new Object [] {"###", "###", "###", Character.valueOf('#'), cobaltnugget});
  	GameRegistry.addRecipe(new ItemStack(cobaltwoodpickaxe, 1), new Object [] {"###", " % ", " % ", Character.valueOf('#'), cobaltwood, Character.valueOf('%'), cobaltstick});
  	GameRegistry.addRecipe(new ItemStack(cobaltwoodaxe, 1), new Object [] {"## ", "#% ", " % ", Character.valueOf('#'), cobaltwood, Character.valueOf('%'), cobaltstick});
  	GameRegistry.addRecipe(new ItemStack(cobaltwoodhoe, 1), new Object [] {"## ", " % ", " % ", Character.valueOf('#'), cobaltwood, Character.valueOf('%'), cobaltstick});
  	GameRegistry.addRecipe(new ItemStack(cobaltwoodshovel, 1), new Object [] {"#", "%", "%", Character.valueOf('#'), cobaltwood, Character.valueOf('%'), cobaltstick});
    GameRegistry.addRecipe(new ItemStack(cobaltwoodsword, 1), new Object [] {"#", "#", "%", Character.valueOf('#'), cobaltwood, Character.valueOf('%'), cobaltstick});
  	//GameRegistry.addRecipe(new ItemStack(cocktailglass, 1), new Object [] {"#l#", "l#l", "l#l", Character.valueOf('#'), Block.glass.blockID, Character.valueOf('l'), Cobaltmain.leer});
  	GameRegistry.addRecipe(new ItemStack(njossstaff, 1), new Object [] {" # ", " % ", " % ", Character.valueOf('#'), njosscrystal, Character.valueOf('%'), cobaltstick});
  	GameRegistry.addRecipe(new ItemStack(foenumstaff, 1), new Object [] {" # ", " % ", " % ", Character.valueOf('#'), foenumcrystal, Character.valueOf('%'), cobaltstick});
  	GameRegistry.addRecipe(new ItemStack(cobaltwoodsingleslab, 3), new Object [] {"###", Character.valueOf('#'), cobaltwood});
  	GameRegistry.addRecipe(new ItemStack(cobaltbrickstair, 4), new Object [] {"#  ", "## ", "###", Character.valueOf('#'), cobaltbrick});
  	GameRegistry.addRecipe(new ItemStack(cobaltwoodstair, 4), new Object [] {"#  ", "## ", "###", Character.valueOf('#'), cobaltwood});
  	GameRegistry.addRecipe(new ItemStack(cobalttorch, 4), new Object [] {"#", "%", Character.valueOf('#'), Item.coal, Character.valueOf('%'), cobaltstick});
  	GameRegistry.addRecipe(new ItemStack(cobalttorch, 4), new Object [] {"#", "%", Character.valueOf('#'), new ItemStack(Item.coal, 1, 1), Character.valueOf('%'), cobaltstick});
  	
  	//TODO
  	GameRegistry.addRecipe(new ItemStack(altarofassociation, 1), new Object [] {"#%# ", " # ", "###", Character.valueOf('#'), cobaltbrick, Character.valueOf('%'), cobaltblock});
  	
  	GameRegistry.addRecipe(new ItemStack(ritualstone, 1), new Object [] {"$ $", "#%#", "###", Character.valueOf('#'), cobaltbrick, Character.valueOf('%'), cobaltstonecrystal, Character.valueOf('$'), cobaltingot});
  	
  	
  	GameRegistry.addSmelting(cobaltore.blockID, new ItemStack(cobaltingot, 1), 1.0F);
  	
  	
  	//Mixxer Recipe
  	ItemStack[] bartendertest = new ItemStack[9];
  	bartendertest[1] = new ItemStack(this.redcabbage);
  	CraftingHandler.addRecipe(new ItemStack(mod_Cobalt.redcabbagejuice), new ItemStack(mod_Cobalt.cocktailglass), bartendertest);
  	
  	
  	//Biome Registration
  	biomecobalt = (new BiomeGenCobalt(50)).setBiomeName("Cobalt Plains");
  	GameRegistry.addBiome(biomecobalt);

  	//Achievement
  	
    GameRegistry.registerCraftingHandler(craftHandler);
    GameRegistry.registerPickupHandler(new pickupHandler());
    
    //rechts
    cobaltachiev  = new Achievement(1000, "cobaltachiev", 0, 0, cobaltgrass, null).setSpecial().registerAchievement(); 
    cobaltachiev1 = new Achievement(1001, "cobaltachiev1", 2, 0, cobaltore, cobaltachiev).registerAchievement();
    cobaltachiev2 = new Achievement(1002, "cobaltachiev2", 4, 2, cobaltapple, cobaltachiev1).registerAchievement();
    cobaltachiev3 = new Achievement(1003, "cobaltachiev3", 4, 0, cobaltblock, cobaltachiev1).registerAchievement();
    cobaltachiev4 = new Achievement(1004, "cobaltachiev4", 5, -2, cobaltstonefragment, cobaltachiev1).registerAchievement();
    cobaltachiev5 = new Achievement(1005, "cobaltachiev5", 5, -5, altarofassociation, cobaltachiev4).registerAchievement();
    cobaltachiev6 = new Achievement(1006, "cobaltachiev6", 7, -5, ritualstone, cobaltachiev5).registerAchievement();
    cobaltachiev7 = new Achievement(1007, "cobaltachiev7", 9, -3, cobaltstonecrystal, cobaltachiev6).registerAchievement();
    cobaltachiev8 = new Achievement(1008, "cobaltachiev8", 9, 0, njossstaff, cobaltachiev7).registerAchievement();
    cobaltachiev15 = new Achievement(1015, "cobaltachiev15", 9, -5, greenessence, cobaltachiev6).registerAchievement();
    
    //oben
    cobaltachiev9 = new Achievement(1009, "cobaltachiev9", 0, -2, cobaltbrick, cobaltachiev).registerAchievement();
    cobaltachiev10 = new Achievement(1010, "cobaltachiev10", 0, -5, recipebook, cobaltachiev9).registerAchievement();
    cobaltachiev14 = new Achievement(1014, "cobaltachiev14", -3, -4, cobaltportal, cobaltachiev9).registerAchievement();
    
    //links
    cobaltachiev11 = new Achievement(1011, "cobaltachiev11", -3, 0, redcabbage, cobaltachiev).registerAchievement();
    cobaltachiev12 = new Achievement(1012, "cobaltachiev12", -3, 3, blueberry, cobaltachiev11).registerAchievement();
    cobaltachiev13 = new Achievement(1013, "cobaltachiev13", -5, 0, cobaltnugget, cobaltachiev11).registerAchievement();
    
    //unten
    cobaltachiev16 = new Achievement(1016, "cobaltachiev16", 0, 3, cobaltpickaxe, cobaltachiev).registerAchievement();
    cobaltachiev17 = new Achievement(1017, "cobaltachiev17", 1, 5, cobaltsword, cobaltachiev16).registerAchievement();
    cobaltachiev18 = new Achievement(1018, "cobaltachiev18", -1, 5, cobalthelmet, cobaltachiev16).registerAchievement();
    
    cobaltachievpage1 = new AchievementPage("Cobalt Mod", cobaltachiev, cobaltachiev1, cobaltachiev2, cobaltachiev3, cobaltachiev4, cobaltachiev5, cobaltachiev6, cobaltachiev7, cobaltachiev8, cobaltachiev9, cobaltachiev10, cobaltachiev11, cobaltachiev12, cobaltachiev13, cobaltachiev14, cobaltachiev15, cobaltachiev16, cobaltachiev17, cobaltachiev18);
    AchievementPage.registerAchievementPage(cobaltachievpage1);
    this.addAchievementLocalizations();
    
    //Worldgenerator Registration
    GameRegistry.registerWorldGenerator(new WorldGenerator());
    
    
    //Event Registry
    MinecraftForge.EVENT_BUS.register(new BoneMealEvent());
    
    
    //GuiHandler
    NetworkRegistry.instance().registerGuiHandler(this, new GuiHandler());
 	}

 	//Achievement Language Registration
 	private static void addAchievementName(String ach, String name)
 	{
         LanguageRegistry.instance().addStringLocalization("achievement." + ach, "en_US", name); 
         LanguageRegistry.instance().addStringLocalization("achievement.cobaltachiev1", "de_DE", "Heiliges Erz!");
         
         LanguageRegistry.instance().addStringLocalization("achievement.cobaltachiev3", "de_DE", "Zeit das Cobalt zublocken.");
         
         LanguageRegistry.instance().addStringLocalization("achievement.cobaltachiev2", "de_DE", "Leckerer Apfel?");
         
         LanguageRegistry.instance().addStringLocalization("achievement.cobaltachiev9", "de_DE", "Ein Dungeon?");
         
         LanguageRegistry.instance().addStringLocalization("achievement.cobaltachiev10", "de_DE", "Das Buch.");
 	}


 	//Achievement Language Registration
 	private static void addAchievementDesc(String ach, String desc)
 	{
         LanguageRegistry.instance().addStringLocalization("achievement." + ach + ".desc", "en_US", desc);
         LanguageRegistry.instance().addStringLocalization("achievement.cobaltachiev1.desc", "de_DE", "Finde Cobalterz und baue es ab!");
         
         LanguageRegistry.instance().addStringLocalization("achievement.cobaltachiev3.desc", "de_DE", "Crafte einen Cobaltblock!");
         
         LanguageRegistry.instance().addStringLocalization("achievement.cobaltachiev2.desc", "de_DE", "Crafte einen Cobaltapfel!");
         
         LanguageRegistry.instance().addStringLocalization("achievement.cobaltachiev9.desc", "de_DE", "Finde einen Dungeon und raeum ihn aus.");
         
         LanguageRegistry.instance().addStringLocalization("achievement.cobaltachiev10.desc", "de_DE", "Finde das Cobalt Rezeptbuch und oeffne es.");
         
 	}
 	//Achievement Language Registration
    static void addAchievementLocalizations()
        {				
    				addAchievementName("cobaltachiev", "A new Biome");
    				addAchievementDesc("cobaltachiev", "Find the Cobalt Plains.");
    	
                        addAchievementName("cobaltachiev1", "Holy Ore!");
                        addAchievementDesc("cobaltachiev1", "Find some Cobalt Ore and mine it!");         
                        
                        addAchievementName("cobaltachiev2", "Tasty Apple?");
                        addAchievementDesc("cobaltachiev2", "Craft a Cobalt Apple!");
                        
                        addAchievementName("cobaltachiev3", "Time to Block the Cobalt");
                        addAchievementDesc("cobaltachiev3", "Craft a Cobalt Block!");
                        
                        addAchievementName("cobaltachiev4", "Helpful Fragment");
                        addAchievementDesc("cobaltachiev4", "Find a Cobalt Stone Fragment.");
                        
                        addAchievementName("cobaltachiev5", "Altar of Association");
                        addAchievementDesc("cobaltachiev5", "Craft a Altar of Association");
                        
                        addAchievementName("cobaltachiev6", "The Ritual");
                        addAchievementDesc("cobaltachiev6", "Craft a Ritual Stone");
                        
                        addAchievementName("cobaltachiev7", "Magic Things");
                        addAchievementDesc("cobaltachiev7", "Use the Altar and make a NjossCrystal");
                        
                        addAchievementName("cobaltachiev8", "Blue Magic");
                        addAchievementDesc("cobaltachiev8", "Craft a Njossstaff");
                        
                        addAchievementName("cobaltachiev9", "A Dungeon?");
                        addAchievementDesc("cobaltachiev9", "Find a Dungeon and loot it.");
                        
                        addAchievementName("cobaltachiev10", "The Book");
                        addAchievementDesc("cobaltachiev10", "Find the Cobalt Recipe Book and open it.");
                        
                        addAchievementName("cobaltachiev11", "It's not even red!");
                        addAchievementDesc("cobaltachiev11", "Find some Red Cabbage.");
                        
                        addAchievementName("cobaltachiev12", "Even more Food!");
                        addAchievementDesc("cobaltachiev12", "Find a Blue Berry.");
                        
                        addAchievementName("cobaltachiev13", "Terror of the night");
                        addAchievementDesc("cobaltachiev13", "Kill a Cobaltzombie.");
                        
                        addAchievementName("cobaltachiev14", "Another Dimension?");
                        addAchievementDesc("cobaltachiev14", "Build a Portal and go in the Cobalt Dimension.");
                        
                        addAchievementName("cobaltachiev15", "Essences");
                        addAchievementDesc("cobaltachiev15", "Get some Essences.");
                        
                        addAchievementName("cobaltachiev16", "Better Tools");
                        addAchievementDesc("cobaltachiev16", "Craft a Tool out of Cobaltingots.");
                        
                        addAchievementName("cobaltachiev17", "Better Weapons");
                        addAchievementDesc("cobaltachiev17", "Craft a Weapon out of Cobaltingots.");
                        
                        addAchievementName("cobaltachiev18", "Better Armor");
                        addAchievementDesc("cobaltachiev18", "Craft a Armor out of Cobaltingots.");
        }
    
    //Entity Egg
    public static int getUniqueEntityId() 
    {
     do 
     {
      startEntityId++;
     } 
     while (EntityList.getStringFromID(startEntityId) != null);

      return startEntityId;
    }
    
    public static void registerEntityEgg(Class<? extends Entity> entity, int primaryColor, int secondaryColor) 
    {
     int id = getUniqueEntityId();
     EntityList.IDtoClassMapping.put(id, entity);
     EntityList.entityEggs.put(id, new EntityEggInfo(id, primaryColor, secondaryColor));
    }
	@PostInit
        public void modsLoaded(FMLPostInitializationEvent evt) {}
}

 

 

I cant find the error in the code.

Link to comment
Share on other sites

You need to register your Achievements (and your block / items, too) in your @PreInit method.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

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.



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • rp.crazyheal.xyz mods  
    • I'm developing a dimension, but it's kinda resource intensive so some times during player teleporting it lags behind making the player phase down into the void, so im trying to implement some kind of pregeneration to force the game loading a small set of chunks in the are the player will teleport to. Some of the things i've tried like using ServerLevel and ServerChunkCache methods like getChunk() dont actually trigger chunk generation if the chunk isn't already on persistent storage (already generated) or placing tickets, but that doesn't work either. Ideally i should be able to check when the task has ended too. I've peeked around some pregen engines, but they're too complex for my current understanding of the system of which I have just a basic understanding (how ServerLevel ,ServerChunkCache  and ChunkMap work) of. Any tips or other classes I should be looking into to understand how to do this correctly?
    • https://mclo.gs/4UC49Ao
    • Way back in the Forge 1.17 days, work started for adding JPMS (Java Platform Module Support) to ModLauncher and ForgeModLoader. This has been used internally by Forge and some libraries for a while now, but mods (those with mods.toml specifically) have not been able to take advantage of it. As of Forge 1.21.1 and 1.21.3, this is now possible!   What is JPMS and what does it mean for modders? JPMS is the Java Platform Module System, introduced in Java 9. It allows you to define modules, which are collections of packages and resources that can be exported or hidden from other modules. This allows for much more fine-tuned control over visibility, cleaner syntax for service declarations and support for sealed types across packages. For example, you might have a mod with a module called `com.example.mod` that exports `com.example.mod.api` and `com.example.mod.impl` to other mods, but hides `com.example.mod.internal` from them. This would allow you to have a clean API for other mods to use, while keeping your internal implementation details hidden from IDE hints, helping prevent accidental usage of internals that might break without prior notice. This is particularly useful if you'd like to use public records with module-private constructors or partially module-private record components, as you can create a sealed interface that only your record implements, having the interface be exported and the record hidden. It's also nice for declaring and using services, as you'll get compile-time errors from the Java compiler for typos and the like, rather than deferring to runtime errors. In more advanced cases, you can also have public methods that are only accessible to specific other modules -- handy if you want internal interactions between multiple of your own mods.   How do I bypass it? We understand there may be drama in implementing a system that prevents mods from accessing each other's internals when necessary (like when a mod is abandoned or you need to fix a compat issue) -- after all, we are already modding a game that doesn't have explicit support for Java mods yet. We have already thought of this and are offering APIs from day one to selectively bypass module restrictions. Let me be clear: Forge mods are not required to use JPMS. If you don't want to use it, you don't have to. The default behaviour is to have fully open, fully exported automatic modules. In Java, you can use the `Add-Opens` and `Add-Exports` manifest attributes to selectively bypass module restrictions of other mods at launch time, and we've added explicit support for these when loading your Forge mods. At compile-time, you can use existing solutions such as the extra-java-module-info Gradle plugin to deal with non-modular dependencies and add extra opens and exports to other modules. Here's an example on how to make the internal package `com.example.examplemod.internal` open to your mod in your build.gradle: tasks.named('jar', Jar) { manifest { attributes([ 'Add-Opens' : 'com.example.examplemod/com.example.examplemod.internal' 'Specification-Title' : mod_id, 'Specification-Vendor' : mod_authors // (...) ]) } } With the above in your mod's jar manifest, you can now reflectively access the classes inside that internal package. Multiple entries are separated with a space, as per Java's official spec. You can also use Add-Exports to directly call without reflection, however you'd need to use the Gradle plugin mentioned earlier to be able to compile. The syntax for Add-Exports is the same as Add-Opens, and instructions for the compile-time step with the Gradle plugin are detailed later in this post. Remember to prefer the opens and exports keywords inside module-info.java for sources you control. The Add-Opens/Add-Exports attributes are only intended for forcing open other mods.   What else is new with module support? Previously, the runtime module name was always forced to the first mod ID in your `mods.toml` file and all packages were forced fully open and exported. Module names are now distinguished from mod IDs, meaning the module name in your module-info.java can be different from the mod ID in your `mods.toml`. This allows you to have a more descriptive module name that doesn't have to be the same as your mod ID, however we strongly recommend including your mod ID as part of your module name to aid troubleshooting. The `Automatic-Module-Name` manifest attribute is now also honoured, allowing you to specify a module name for your mod without needing to create a `module-info.java` file. This is particularly useful for mods that don't care about JPMS features but want to have a more descriptive module name and easier integration with other mods that do use JPMS.   How do I use it? The first step is to create a `module-info.java` file in your mod's source directory. This file should be in the same package as your main mod class, and should look something like this: open module com.example.examplemod { requires net.minecraftforge.eventbus; requires net.minecraftforge.fmlcore; requires net.minecraftforge.forge; requires net.minecraftforge.javafmlmod; requires net.minecraftforge.mergetool.api; requires org.slf4j; requires logging; } For now, we're leaving the whole module open to reflection, which is a good starting point. When we know we want to close something off, we can remove the open modifier from the module and open or export individual packages instead. Remember that you need to be open to Forge (module name net.minecraftforge.forge), otherwise it can't call your mod's constructor. Next is fixing modules in Gradle. While Forge and Java support modules properly, Gradle does not put automatic modules on the module path by default, meaning that the logging module (from com.mojang:logging) is not found. To fix this, add the Gradle plugin and add a compile-time module definition for that Mojang library: plugins { // (...) id 'org.gradlex.extra-java-module-info' version "1.9" } // (...) extraJavaModuleInfo { failOnMissingModuleInfo = false automaticModule("com.mojang:logging", "logging") } The automatic module override specified in your build.gradle should match the runtime one to avoid errors. You can do the same for any library or mod dependency that is missing either a module-info or explicit Automatic-Module-Name, however be aware that you may need to update your mod once said library adds one. That's all you need to get started with module support in your mods. You can learn more about modules and how to use them at dev.java.
    • Faire la mise à jour grâce à ce lien m'a aider personnellement, merci à @Paint_Ninja. https://www.amd.com/en/support 
  • Topics

×
×
  • Create New...

Important Information

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