Jump to content

Minecraft crashing in eclipse after making config file


RosarioMokaChan

Recommended Posts

Hi, I recently made a configuration file for my mod so users can change the item ids of blocks and items (as expected), but when I test it in eclipse it crashes. I read through the error report and I think it's saying that there's a conflict between two blocks (plutoniumblock and plutoniumore). Although by searching all throughout my code, I can't seem to find any conflicts. Any opinions on a fix would be greatly appreciated.

 

Crash report:

 

---- Minecraft Crash Report ----
// I bet Cylons wouldn't have this problem.

Time: 07/09/13 13:18
Description: Initializing game

java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:457)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:194)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:174)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:105)
at cpw.mods.fml.common.Loader.loadMods(Loader.java:510)
at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:182)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:470)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:796)
at net.minecraft.client.main.Main.main(Main.java:93)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:57)
at net.minecraft.launchwrapper.Launch.main(Launch.java:18)
Caused by: java.lang.IllegalArgumentException: Slot 0 is already occupied by RosarioMokaChan.RandomCraft.blocks.PlutoniumBlock@1631c79f when adding RosarioMokaChan.RandomCraft.blocks.PlutoniumOre@1e28a31b
at net.minecraft.block.Block.<init>(Block.java:348)
at RosarioMokaChan.RandomCraft.blocks.PlutoniumOre.<init>(PlutoniumOre.java:11)
at RosarioMokaChan.RandomCraft.RandomCraft.<clinit>(RandomCraft.java:59)
... 35 more


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

-- Head --
Stacktrace:
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:457)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:194)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:174)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:105)
at cpw.mods.fml.common.Loader.loadMods(Loader.java:510)
at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:182)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:470)

-- Initialization --
Details:
Stacktrace:
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:796)
at net.minecraft.client.main.Main.main(Main.java:93)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:57)
at net.minecraft.launchwrapper.Launch.main(Launch.java:18)

-- System Details --
Details:
Minecraft Version: 1.6.2
Operating System: Windows 7 (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: 765608176 bytes (730 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 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 v8.04 FML v6.2.35.804 Minecraft Forge 9.10.0.804 4 mods loaded, 4 mods active
mcp{8.04} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed
FML{6.2.35.804} [Forge Mod Loader] (coremods) Unloaded->Constructed
Forge{9.10.0.804} [Minecraft Forge] (coremods) Unloaded->Constructed
RandomCraft{0.0.1} [RandomCraft] (bin) Unloaded
Launched Version: 1.6
LWJGL: 2.9.0
OpenGL: GeForce GTX 645/PCIe/SSE2 GL version 4.3.0, NVIDIA Corporation
Is Modded: Definitely; Client brand changed to 'fml,forge'
Type: Client (map_client.txt)
Resource Pack: Default
Current Language: English (US)
Profiler Position: N/A (disabled)
Vec3 Pool Size: ~~ERROR~~ NullPointerException: null

Link to comment
Share on other sites

If you mean the bit from the config handler, then here ya go:

 

package RosarioMokaChan.RandomCraft;

import java.io.File;
import java.util.logging.Level;

import cpw.mods.fml.common.FMLLog;

import RosarioMokaChan.RandomCraft.lib.BlockIds;
import RosarioMokaChan.RandomCraft.lib.ItemIds;
import RosarioMokaChan.RandomCraft.lib.ModInfo;
import RosarioMokaChan.RandomCraft.lib.Strings;

import net.minecraftforge.common.Configuration;

public class ConfigurationHandler {

static Configuration config = new Configuration();

public static void init(File file){

	config = new Configuration(file);

	try{

		config.load();

		BlockIds.PLUTONIUMBLOCK_ID = config.get(config.CATEGORY_BLOCK, Strings.PLUTONIUMBLOCK_NAME, BlockIds.PLUTONIUMBLOCK_ID_DEFAULT).getInt(BlockIds.PLUTONIUMBLOCK_ID_DEFAULT);
		BlockIds.PLUTONIUMORE_ID = config.get(config.CATEGORY_BLOCK, Strings.PLUTONIUMORE_NAME, BlockIds.PLUTONIUMORE_ID_DEFAULT).getInt(BlockIds.PLUTONIUMORE_ID_DEFAULT);
		BlockIds.RADIUMBLOCK_ID = config.get(config.CATEGORY_BLOCK, Strings.RADIUMBLOCK_NAME, BlockIds.RADIUMBLOCK_ID_DEFAULT).getInt(BlockIds.RADIUMBLOCK_ID_DEFAULT);
		BlockIds.RADIUMORE_ID = config.get(config.CATEGORY_BLOCK, Strings.RADIUMORE_NAME, BlockIds.RADIUMORE_ID_DEFAULT).getInt(BlockIds.RADIUMORE_ID_DEFAULT);
		BlockIds.MOONSTONE_ID = config.get(config.CATEGORY_BLOCK, Strings.MOONSTONE_NAME, BlockIds.MOONSTONE_ID_DEFAULT).getInt(BlockIds.MOONSTONE_ID_DEFAULT);


		ItemIds.ENDERHATCHER_ID = config.get(config.CATEGORY_ITEM, Strings.ENDERHATCHER_NAME, ItemIds.ENDERHATCHER_ID_DEFAULT).getInt(ItemIds.ENDERHATCHER_ID_DEFAULT);
		ItemIds.PLUTONIUMINGOT_ID = config.get(config.CATEGORY_ITEM, Strings.ENDERHATCHER_NAME, ItemIds.ENDERHATCHER_ID_DEFAULT).getInt(ItemIds.ENDERHATCHER_ID_DEFAULT);
		ItemIds.RADIUMINGOT_ID = config.get(config.CATEGORY_ITEM, Strings.ENDERHATCHER_NAME, ItemIds.ENDERHATCHER_ID_DEFAULT).getInt(ItemIds.ENDERHATCHER_ID_DEFAULT);
		ItemIds.MOONSTONEDUST_ID = config.get(config.CATEGORY_ITEM, Strings.ENDERHATCHER_NAME, ItemIds.ENDERHATCHER_ID_DEFAULT).getInt(ItemIds.ENDERHATCHER_ID_DEFAULT);
		ItemIds.DRAGONWINGS_ID = config.get(config.CATEGORY_ITEM, Strings.ENDERHATCHER_NAME, ItemIds.ENDERHATCHER_ID_DEFAULT).getInt(ItemIds.ENDERHATCHER_ID_DEFAULT);
		ItemIds.DIAMONDHORSECHEST_ID = config.get(config.CATEGORY_ITEM, Strings.DIAMONDHORSECHEST_NAME, ItemIds.DIAMONDHORSECHEST_ID_DEFAULT).getInt(ItemIds.DIAMONDHORSECHEST_ID_DEFAULT);
		ItemIds.DIAMONDHORSEHELM_ID = config.get(config.CATEGORY_ITEM, Strings.DIAMONDHORSEHELM_NAME, ItemIds.DIAMONDHORSEHELM_ID_DEFAULT).getInt(ItemIds.DIAMONDHORSEHELM_ID_DEFAULT);
		ItemIds.GOLDHORSECHEST_ID = config.get(config.CATEGORY_ITEM, Strings.GOLDHORSECHEST_NAME, ItemIds.GOLDHORSECHEST_ID_DEFAULT).getInt(ItemIds.GOLDHORSECHEST_ID_DEFAULT);
		ItemIds.GOLDHORSEHELM_ID = config.get(config.CATEGORY_ITEM, Strings.GOLDHORSEHELM_NAME, ItemIds.GOLDHORSEHELM_ID_DEFAULT).getInt(ItemIds.GOLDHORSEHELM_ID_DEFAULT);
		ItemIds.IRONHORSECHEST_ID = config.get(config.CATEGORY_ITEM, Strings.IRONHORSECHEST_NAME, ItemIds.IRONHORSECHEST_ID_DEFAULT).getInt(ItemIds.IRONHORSECHEST_ID_DEFAULT);
		ItemIds.IRONHORSEHELM_ID = config.get(config.CATEGORY_ITEM, Strings.IRONHORSEHELM_NAME, ItemIds.IRONHORSEHELM_ID_DEFAULT).getInt(ItemIds.IRONHORSEHELM_ID_DEFAULT);


	}

	catch(Exception e){

		FMLLog.log(Level.SEVERE, e, ModInfo.ID + " has trouble loading the config");
	}

	finally{

		config.save();
	}
}
}

Link to comment
Share on other sites

I believe this part of the error log might be your problem

 

Caused by: java.lang.IllegalArgumentException: Slot 0 is already occupied by RosarioMokaChan.RandomCraft.blocks.PlutoniumBlock@1631c79f when adding RosarioMokaChan.RandomCraft.blocks.PlutoniumOre@1e28a31b

at net.minecraft.block.Block.<init>(Block.java:348)

at RosarioMokaChan.RandomCraft.blocks.PlutoniumOre.<init>(PlutoniumOre.java:11)

at RosarioMokaChan.RandomCraft.RandomCraft.<clinit>(RandomCraft.java:59)

... 35 more

if (You.likescoding == false){
      You.goaway;
}

Link to comment
Share on other sites

There is nothing wrong with the config class, its the id class where you messed up.  Plutonium block, and plutonium ore are sharing an ID of 0 that is the problem you are having.  You can tell by the fact that the error log states

 

IllegalArgumentException.....

if (You.likescoding == false){
      You.goaway;
}

Link to comment
Share on other sites

In my BlockIds class I have the two blocks as having ids 3000 and 3001 as shown here:

 

public class BlockIds {

public static final int PLUTONIUMBLOCK_ID_DEFAULT = 3000;
public static int PLUTONIUMBLOCK_ID;
public static final int PLUTONIUMORE_ID_DEFAULT = 3001;
public static int PLUTONIUMORE_ID;
public static final int RADIUMBLOCK_ID_DEFAULT = 3002;
public static int RADIUMBLOCK_ID;
public static final int RADIUMORE_ID_DEFAULT = 3003;
public static int RADIUMORE_ID;
public static final int MOONSTONE_ID_DEFAULT = 3004;
public static int MOONSTONE_ID;



}

 

Then applied to the block in the main class here:

 

	public final static Block plutoniumBlock = new PlutoniumBlock(BlockIds.PLUTONIUMBLOCK_ID, Material.iron);
public final static Block plutoniumOre = new PlutoniumOre(BlockIds.PLUTONIUMORE_ID, Material.rock);

 

So i'm not sure how i'm getting the ids messed up.

Link to comment
Share on other sites

Ive never seen config files set up that way this is the way I usually have it set up

 

hope this helps you

 

IdHandler

 

 

package kakarotvg.common.tutorial.handlers;

 

import net.minecraftforge.common.Configuration;

 

public class IDHandler {

 

    // config categories

    public static String blockids = "Block IDs";

    public static String itemids = "Item IDs";

    public static String toolids = "Tool IDs";

    public static String armorids = "Armor IDs";

    public static String liquidids = "Liquid IDs";

    public static String cropids = "Crop IDs";

 

    // block ids

    public static int tutorialblockID;

    public static int tutorialblock2ID;

    public static int animatedblockID;

 

    // item ids

    public static int tutorialitemID;

    public static int tutorialingotID;

 

    // toold ids

    public static int tutorialaxeID;

    public static int tutorialhoeID;

    public static int tutorialshovelID;

    public static int tutorialswordID;

    public static int tutorialpickaxeID;

 

    // armor ids

    public static int tutorialhelmID;

    public static int tutorialplateID;

    public static int tutoriallegsID;

    public static int tutorialbootsID;

 

    // liquid ids

    public static int blocktutorialfluidID;

    public static int tutorialbucketID;

 

    // crop ids

    public static int tutorialcropID;

    public static int tutorialseedsID;

    public static int tutorialfoodID;

 

    // the ids that will appear in the config file and are used by everything

    // that uses ids

    public static void createConfigfile(Configuration config) {

        // block ids

        tutorialblockID = config.get(blockids, "Tutorial Block", 3300).getInt();

        tutorialblock2ID = config.get(blockids, "Tutorial Block 2", 3301).getInt();

        animatedblockID = config.get(blockids, "Animated Block", 3302).getInt();

        // item ids

        tutorialitemID = config.get(itemids, "Tutorial Item", 24000).getInt();

        tutorialingotID = config.get(itemids, "Tutorial Ingot", 24001).getInt();

        // tool ids

        tutorialaxeID = config.get(toolids, "Tutorial Axe", 24100).getInt();

        tutorialhoeID = config.get(toolids, "Tutorial Hoe", 24101).getInt();

        tutorialshovelID = config.get(toolids, "Tutorial Shovel", 24102).getInt();

        tutorialswordID = config.get(toolids, "Tutorial Sword", 24103).getInt();

        tutorialpickaxeID = config.get(toolids, "Tutorial Pickaxe", 24104).getInt();

        // armor ids

        tutorialhelmID = config.get(armorids, "Tutorial Helmet", 24200).getInt();

        tutorialplateID = config.get(armorids, "Tutorial Chestplate", 24201).getInt();

        tutoriallegsID = config.get(armorids, "Tutorial Leggings", 24202).getInt();

        tutorialbootsID = config.get(armorids, "Tutorial Boots", 24203).getInt();

        // liquid ids

        blocktutorialfluidID = config.get(liquidids, "Tutorial Fluid", 3350).getInt();

        tutorialbucketID = config.get(liquidids, "Tutorial BUcket", 24250).getInt();

        // crop ids

        tutorialcropID = config.get(cropids, "Tutorial Crop", 3360).getInt();

        tutorialseedsID = config.get(cropids, "Tutorial Seeds", 24300).getInt();

        tutorialfoodID = config.get(cropids, "Tutorial Food", 24301).getInt();

 

    }

 

}

 

 

 

blockhandler (to show you how I call the IDs

 

 

package kakarotvg.common.tutorial.handlers;

 

import kakarotvg.common.tutorial.blocks.TutorialBlock;

import net.minecraft.block.Block;

import net.minecraft.block.material.Material;

import net.minecraft.creativetab.CreativeTabs;

import net.minecraftforge.common.Configuration;

import net.minecraftforge.common.MinecraftForge;

import cpw.mods.fml.common.registry.GameRegistry;

import cpw.mods.fml.common.registry.LanguageRegistry;

 

public class BlockHandler {

 

    // blocks

    public static Block tutorialblock;

    public static Block tutorialblock2;

    public static Block animatedblock;

 

    // registers the block ids, texturs, resistance, and their hardness

    public static void configureBlocks(Configuration config) {

        tutorialblock = new TutorialBlock(IDHandler.tutorialblockID, Material.iron).setUnlocalizedName("tutorialblock").setCreativeTab(CreativeTabHandler.ttab).setStepSound(Block.soundMetalFootstep).setHardness(50.0F).setResistance(2000.0F);

        tutorialblock2 = new TutorialBlock(IDHandler.tutorialblock2ID, Material.rock).setUnlocalizedName("tutorialblock2").setCreativeTab(CreativeTabHandler.ttab).setStepSound(Block.soundStoneFootstep).setHardness(3.0F).setResistance(5.0F);

        animatedblock = new TutorialBlock(IDHandler.animatedblockID, Material.wood).setUnlocalizedName("animatedblock").setCreativeTab(CreativeTabHandler.ttab).setStepSound(Block.soundClothFootstep).setHardness(1.0F).setResistance(4.0F);

    }

 

    // registers the blocks as blocks

    public static void registerBlocks(GameRegistry registry) {

        registry.registerBlock(tutorialblock, "tutorialblock");

        registry.registerBlock(tutorialblock2, "tutorialblock2");

        registry.registerBlock(animatedblock, "animatedblock");

    }

 

    // registers the names of teh blocks

    public static void addNames(LanguageRegistry registry) {

        registry.addName(tutorialblock, "Tutorial Block");

        registry.addName(tutorialblock2, "Tutorial Block 2");

        registry.addName(animatedblock, "Animated Block");

    }

 

    // registers the harvestlevel of each block

    public static void setBlockHarvestLevel(MinecraftForge registry) {

        registry.setBlockHarvestLevel(tutorialblock, "pickaxe", 3);

        registry.setBlockHarvestLevel(tutorialblock2, "pickaxe", 2);

        registry.setBlockHarvestLevel(animatedblock, "pickaxe", 1);

    }

 

}

 

 

if (You.likescoding == false){
      You.goaway;
}

Link to comment
Share on other sites

I've tried doing it in a similar way to what you described, but it still doesn't feel like working.

 

I commented out some lines in the BlockIds class and in the ConfigurationHandler so I could try it this way as shown below:

 

package RosarioMokaChan.RandomCraft.lib;

import net.minecraftforge.common.Configuration;



public class BlockIds {
public static String blockids = "Block IDs";


//public static final int PLUTONIUMBLOCK_ID_DEFAULT = 3000;
public static int PLUTONIUMBLOCK_ID;
//public static final int PLUTONIUMORE_ID_DEFAULT = 3001;
public static int PLUTONIUMORE_ID;
//public static final int RADIUMBLOCK_ID_DEFAULT = 3002;
public static int RADIUMBLOCK_ID;
//public static final int RADIUMORE_ID_DEFAULT = 3003;
public static int RADIUMORE_ID;
//public static final int MOONSTONE_ID_DEFAULT = 3004;
public static int MOONSTONE_ID;

public static void createConfigfile(Configuration config) {
        // block ids
        PLUTONIUMBLOCK_ID = config.get(blockids, "plutoniumBlock", 3000).getInt();
        PLUTONIUMORE_ID = config.get(blockids, "plutoniumOre", 3001).getInt();
        RADIUMBLOCK_ID = config.get(blockids, "radiumBlock", 3002).getInt();
        RADIUMORE_ID = config.get(blockids, "radiumOre", 3003).getInt();
        MOONSTONE_ID = config.get(blockids, "moonstone", 3004).getInt();


}
}

Link to comment
Share on other sites

did you make sure to have the config loader in the main mod class

 

main mod class

 

 

package kakarotvg.common.tutorial;

 

import kakarotvg.common.tutorial.handlers.ArmorHandler;

import kakarotvg.common.tutorial.handlers.BlockHandler;

import kakarotvg.common.tutorial.handlers.CreativeTabHandler;

import kakarotvg.common.tutorial.handlers.CropHandler;

import kakarotvg.common.tutorial.handlers.IDHandler;

import kakarotvg.common.tutorial.handlers.ItemHandler;

import kakarotvg.common.tutorial.handlers.LiquidHandler;

import kakarotvg.common.tutorial.handlers.RecipeHandler;

import kakarotvg.common.tutorial.handlers.ToolHandler;

import kakarotvg.common.tutorial.handlers.TutorialEventHandler;

import kakarotvg.common.tutorial.proxys.CommonProxy;

import net.minecraftforge.common.Configuration;

import net.minecraftforge.common.MinecraftForge;

import net.minecraftforge.fluids.FluidContainerRegistry;

import cpw.mods.fml.common.Mod;

import cpw.mods.fml.common.Mod.EventHandler;

import cpw.mods.fml.common.Mod.Instance;

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.registry.GameRegistry;

import cpw.mods.fml.common.registry.LanguageRegistry;

 

@Mod(modid = TutorialModInfo.ID, name = TutorialModInfo.MOD_N, version = TutorialModInfo.MOD_V)

@NetworkMod(serverSideRequired = false, clientSideRequired = true)

public class VgTutorial {

 

    @Instance(TutorialModInfo.ID)

    public static VgTutorial instance;

 

    @SidedProxy(clientSide = "kakarotvg.common.tutorial.proxys.ClientProxy", serverSide = "kakarotvg.common.tutorial.proxys.CommonProxy")

    public static CommonProxy proxy;

 

    @EventHandler

    public void preInit(FMLPreInitializationEvent event) {

        /*

        * Runs the Configuration file and saves the IDs to the file (file will

        * be named Tutorial_Mod.cfg)

        */

 

        // the 4 lines under this comment are what you need to pay attention to for the config file

        Configuration config = new Configuration(event.getSuggestedConfigurationFile());

        config.load();

        IDHandler.createConfigfile(config);

        config.save();

 

        // Calls the blockhandler class, making our block show up in game

        BlockHandler.configureBlocks(config);

        BlockHandler.registerBlocks(new GameRegistry());

        BlockHandler.addNames(new LanguageRegistry());

        BlockHandler.setBlockHarvestLevel(new MinecraftForge());

 

        // calls the ItemHandler class making our Item show up in game

        ItemHandler.configureItems(config);

        ItemHandler.registerItems(new GameRegistry());

        ItemHandler.addNames(new LanguageRegistry());

 

        // calls the toolhandler class allowing our tools to show up in game

        ToolHandler.configureTools(config);

        ToolHandler.registerTools(new GameRegistry());

        ToolHandler.addNames(new LanguageRegistry());

        ToolHandler.setToolClass(new MinecraftForge());

 

        // calls the armorhandler class allowing our armors to show up in game

        ArmorHandler.configureArmors(config);

        ArmorHandler.registerArmor(new GameRegistry());

        ArmorHandler.addNames(new LanguageRegistry());

 

        // calls the liquidhandler class allowing our fluids to show up in game

        LiquidHandler.configurefluids(config);

        LiquidHandler.registerfluids(new GameRegistry());

        LiquidHandler.addNAmes(new LanguageRegistry());

        LiquidHandler.fluidContainerRegistry();

 

        // calls the crophandler class allowing our crops to show up in game

        CropHandler.configureCrops(config);

        CropHandler.registerCrops(new GameRegistry());

        CropHandler.addNames(new LanguageRegistry());

        CropHandler.addGrassSeedDrop(new MinecraftForge());

 

        // calls the eventhandler, allowing an empty bucket to pick up our fluid

        TutorialEventHandler.registerEvents();

 

        /*

        * calls the creative tab handler allowing our creative tab to have its

        * own custom name

        */

        CreativeTabHandler.setNames(new LanguageRegistry());

 

        /*

        * calls the classregistry class allowing what ever classes we need to

        * register, to show up in the game...

        */

        ClassRegistry.classRegistry(new GameRegistry());

 

        /*

        * Recipes need to be on bottom. Otherwise you may get a

        * nullpointerexception! calls the recipehandler allowing for our

        * crafting recipes

        */

        RecipeHandler.registerCrafting(new GameRegistry());

        RecipeHandler.registerSmelting(new GameRegistry());

 

        proxy.init();

    }

 

    @EventHandler

    public void Init(FMLInitializationEvent event) {

 

    }

 

    @EventHandler

    public void postInit(FMLPostInitializationEvent event) {

 

    }

}

 

 

if (You.likescoding == false){
      You.goaway;
}

Link to comment
Share on other sites

After putting in:

 

        	
        Configuration config = new Configuration(event.getSuggestedConfigurationFile());
            config.load();
            BlockIds.createConfigfile(config);
            config.save();

 

instead of

 

ConfigurationHandler.init(new File(event.getModConfigurationDirectory().getAbsolutePath()+ File.separator + ModInfo.ID + File.separator + ModInfo.ID + ".cfg"));

 

After commenting out all of the ConfigurationHandler class it still refuses to startup, producing the same error report.

Link to comment
Share on other sites

Sure:

 

---- Minecraft Crash Report ----
// This is a token for 1 free hug. Redeem at your nearest Mojangsta: [~~HUG~~]

Time: 07/09/13 17:23
Description: Initializing game

java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:457)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:194)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:174)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:105)
at cpw.mods.fml.common.Loader.loadMods(Loader.java:510)
at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:182)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:470)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:796)
at net.minecraft.client.main.Main.main(Main.java:93)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:57)
at net.minecraft.launchwrapper.Launch.main(Launch.java:18)
Caused by: java.lang.IllegalArgumentException: Slot 0 is already occupied by RosarioMokaChan.RandomCraft.blocks.PlutoniumBlock@24ea5bd0 when adding RosarioMokaChan.RandomCraft.blocks.PlutoniumOre@1631c79f
at net.minecraft.block.Block.<init>(Block.java:348)
at RosarioMokaChan.RandomCraft.blocks.PlutoniumOre.<init>(PlutoniumOre.java:11)
at RosarioMokaChan.RandomCraft.RandomCraft.<clinit>(RandomCraft.java:60)
... 35 more


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

-- Head --
Stacktrace:
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:457)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:194)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:174)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:105)
at cpw.mods.fml.common.Loader.loadMods(Loader.java:510)
at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:182)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:470)

-- Initialization --
Details:
Stacktrace:
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:796)
at net.minecraft.client.main.Main.main(Main.java:93)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:57)
at net.minecraft.launchwrapper.Launch.main(Launch.java:18)

-- System Details --
Details:
Minecraft Version: 1.6.2
Operating System: Windows 7 (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: 765621096 bytes (730 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 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 v8.04 FML v6.2.35.804 Minecraft Forge 9.10.0.804 4 mods loaded, 4 mods active
mcp{8.04} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed
FML{6.2.35.804} [Forge Mod Loader] (coremods) Unloaded->Constructed
Forge{9.10.0.804} [Minecraft Forge] (coremods) Unloaded->Constructed
RandomCraft{0.0.1} [RandomCraft] (bin) Unloaded
Launched Version: 1.6
LWJGL: 2.9.0
OpenGL: GeForce GTX 645/PCIe/SSE2 GL version 4.3.0, NVIDIA Corporation
Is Modded: Definitely; Client brand changed to 'fml,forge'
Type: Client (map_client.txt)
Resource Pack: Default
Current Language: English (US)
Profiler Position: N/A (disabled)
Vec3 Pool Size: ~~ERROR~~ NullPointerException: null

Link to comment
Share on other sites

Ok, the BlockIds class is already here so i'll post a few others;

 

package RosarioMokaChan.RandomCraft.lib;

public class Strings {

public static final String PLUTONIUMBLOCK_NAME = "plutoniumBlock";
public static final String PLUTONIUMORE_NAME = "plutoniumOre";
public static final String RADIUMBLOCK_NAME = "radiumBlock";
public static final String RADIUMORE_NAME = "radiumOre";
public static final String MOONSTONE_NAME = "moonstone";

public static final String ENDERHATCHER_NAME = "enderHatcher";
public static final String PLUTONIUMINGOT_NAME = "plutoniumIngot";
public static final String RADIUMINGOT_NAME = "radiumIngot";
public static final String MOONSTONEDUST_NAME = "moonstoneDust";
public static final String DRAGONWINGS_NAME = "dragonWings";
public static final String DIAMONDHORSECHEST_NAME = "diamondHorseChest";
public static final String DIAMONDHORSEHELM_NAME = "diamondHorseHelm";
public static final String GOLDHORSECHEST_NAME = "goldHorseChest";
public static final String GOLDHORSEHELM_NAME = "goldHorseHelm";
public static final String IRONHORSECHEST_NAME = "ironHorseChest";
public static final String IRONHORSEHELM_NAME = "ironHorseHelm";


}

 

In main class under load:

 

//Blocks
                //Block of Plutonium
                GameRegistry.registerBlock(plutoniumBlock, Strings.PLUTONIUMBLOCK_NAME);
                LanguageRegistry.addName(plutoniumBlock, "Block of Plutonium");
                MinecraftForge.setBlockHarvestLevel(plutoniumBlock, "pickaxe", 2);
                //Plutonium Ore
                GameRegistry.registerBlock(plutoniumOre, Strings.PLUTONIUMORE_NAME);
                LanguageRegistry.addName(plutoniumOre, "Plutonium Ore");
                MinecraftForge.setBlockHarvestLevel(plutoniumOre, "pickaxe", 2);
                //Block of Radium
                GameRegistry.registerBlock(radiumBlock, Strings.RADIUMBLOCK_NAME);
                LanguageRegistry.addName(radiumBlock, "Block of Radium");
                MinecraftForge.setBlockHarvestLevel(radiumBlock, "pickaxe", 2);
                //Radium Ore
                GameRegistry.registerBlock(radiumOre, Strings.RADIUMORE_NAME);
                LanguageRegistry.addName(radiumOre, "Radium Ore");
                MinecraftForge.setBlockHarvestLevel(radiumOre, "pickaxe", 2);
                //Moonstone
                GameRegistry.registerBlock(moonstone, Strings.MOONSTONE_NAME);
                LanguageRegistry.addName(moonstone, "Moonstone");
                MinecraftForge.setBlockHarvestLevel(moonstone, "pickaxe", 0);

 

The PlutoniumOre class:

 

package RosarioMokaChan.RandomCraft.blocks;

import RosarioMokaChan.RandomCraft.RandomCraft;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;

public class PlutoniumOre extends Block {

public PlutoniumOre(int id, Material material) {
	super(id, material);

	setHardness(3.8f);
	setStepSound(Block.soundStoneFootstep);
	setUnlocalizedName("plutoniumOre");
	setCreativeTab(RandomCraft.RandomCraftTab);
}
}

 

Anything else you'd like me to add?

Link to comment
Share on other sites

Ok, the entire RandomCraft.java:

 

package RosarioMokaChan.RandomCraft;

import java.io.File;

import RosarioMokaChan.RandomCraft.blocks.Moonstone;
import RosarioMokaChan.RandomCraft.blocks.PlutoniumBlock;
import RosarioMokaChan.RandomCraft.blocks.PlutoniumOre;
import RosarioMokaChan.RandomCraft.blocks.RadiumBlock;
import RosarioMokaChan.RandomCraft.blocks.RadiumOre;
import RosarioMokaChan.RandomCraft.items.DiamondHorseChest;
import RosarioMokaChan.RandomCraft.items.DiamondHorseHelm;
import RosarioMokaChan.RandomCraft.items.DragonWings;
import RosarioMokaChan.RandomCraft.items.EnderHatcher;
import RosarioMokaChan.RandomCraft.items.GoldHorseChest;
import RosarioMokaChan.RandomCraft.items.GoldHorseHelm;
import RosarioMokaChan.RandomCraft.items.IronHorseChest;
import RosarioMokaChan.RandomCraft.items.IronHorseHelm;
import RosarioMokaChan.RandomCraft.items.MoonstoneDust;
import RosarioMokaChan.RandomCraft.items.PlutoniumIngot;
import RosarioMokaChan.RandomCraft.items.RadiumIngot;
import RosarioMokaChan.RandomCraft.lib.BlockIds;
import RosarioMokaChan.RandomCraft.lib.ItemIds;
import RosarioMokaChan.RandomCraft.lib.ModInfo;
import RosarioMokaChan.RandomCraft.lib.Strings;
import RosarioMokaChan.RandomCraft.proxies.CommonProxy;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.MinecraftForge;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
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.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
// used in 1.6.2

@Mod(modid=ModInfo.ID, name=ModInfo.NAME, version=ModInfo.VERS)
@NetworkMod( channels = ModInfo.CHANNEL, clientSideRequired = true, serverSideRequired = true, packetHandler = PacketHandler.class )
public class RandomCraft {

public static CreativeTabs RandomCraftTab = new CreativeTabs("RandomCraftTab"){
	public ItemStack getIconItemStack(){
		return new ItemStack(plutoniumIngot);
	}
};

//World Generation
EventManager oreManager = new EventManager();	

//Blocks
public final static Block plutoniumBlock = new PlutoniumBlock(BlockIds.PLUTONIUMBLOCK_ID, Material.iron);
public final static Block plutoniumOre = new PlutoniumOre(BlockIds.PLUTONIUMORE_ID, Material.rock);
public final static Block radiumBlock = new RadiumBlock(BlockIds.RADIUMBLOCK_ID, Material.iron);
public final static Block radiumOre = new RadiumOre(BlockIds.RADIUMORE_ID, Material.rock);
public final static Block moonstone = new Moonstone(BlockIds.MOONSTONE_ID, Material.glass);

//Items
public final static Item enderHatcher = new EnderHatcher(BlockIds.ENDERHATCHER_ID);
public final static Item plutoniumIngot = new PlutoniumIngot(BlockIds.PLUTONIUMINGOT_ID);
public final static Item radiumIngot = new RadiumIngot(BlockIds.RADIUMINGOT_ID);
public final static Item moonstoneDust = new MoonstoneDust(BlockIds.MOONSTONEDUST_ID);
public final static Item dragonWings = new DragonWings(BlockIds.DRAGONWINGS_ID);

public static Item diamondHorseChest = new DiamondHorseChest(BlockIds.DIAMONDHORSECHEST_ID);
public static Item diamondHorseHelm = new DiamondHorseHelm(BlockIds.DIAMONDHORSEHELM_ID);
public static Item goldHorseChest = new GoldHorseChest(BlockIds.GOLDHORSECHEST_ID);
public static Item goldHorseHelm = new GoldHorseHelm(BlockIds.GOLDHORSEHELM_ID);
public static Item ironHorseChest = new IronHorseChest(BlockIds.IRONHORSECHEST_ID);
public static Item ironHorseHelm = new IronHorseHelm(BlockIds.IRONHORSEHELM_ID);

        // The instance of your mod that Forge uses.
        @Instance(value = ModInfo.ID)
        public static RandomCraft instance;
        
        // Says where the client and server 'proxy' code is loaded.
        @SidedProxy(clientSide= ModInfo.PROXY_LOCATION + ".ClientProxy", serverSide= ModInfo.PROXY_LOCATION + ".CommonProxy")
        public static CommonProxy proxy;
        
        @EventHandler // used in 1.6.2
        public void preInit(FMLPreInitializationEvent event) {
                // Stub Method
        	//ConfigurationHandler.init(new File(event.getModConfigurationDirectory().getAbsolutePath()+ File.separator + ModInfo.ID + File.separator + ModInfo.ID + ".cfg"));
        	Configuration config = new Configuration(event.getSuggestedConfigurationFile());
            config.load();
            BlockIds.createConfigfile(config);
            config.save();
        	proxy.initRenderers();
        	proxy.initSounds();
        	
        }
        
        @EventHandler // used in 1.6.2
        public void load(FMLInitializationEvent event) {
                
                MinecraftForge.EVENT_BUS.register(new DragonDrops());
                
                //Defining stacks for recipies
                ItemStack plutoniumBlockStack = new ItemStack(RandomCraft.plutoniumBlock);
                ItemStack plutoniumIngotStack = new ItemStack(RandomCraft.plutoniumIngot, 4);
                ItemStack radiumBlockStack = new ItemStack(RandomCraft.radiumBlock);
                ItemStack radiumIngotStack = new ItemStack(RandomCraft.radiumIngot, 4);
                ItemStack moonstoneStack = new ItemStack(RandomCraft.moonstone);
                ItemStack moonstoneDustStack = new ItemStack(RandomCraft.moonstoneDust, 4);
                
                //Shapeless recipes
                //Gets 4 plutonium ingots from 1 block
                GameRegistry.addShapelessRecipe(plutoniumIngotStack, plutoniumBlock);
                //Makes 1 plutonium block from 4 ingots
                GameRegistry.addRecipe(plutoniumBlockStack, "XX", "XX", 
                		'X', plutoniumIngot);
                //Gets 4 radium ingots from 1 block
                GameRegistry.addShapelessRecipe(radiumIngotStack, radiumBlock);
                //Makes 1 radium block from 4 ingots
                GameRegistry.addRecipe(radiumBlockStack, "XX", "XX", 
                		'X', radiumIngot);
                //Gets 4 moonstone dust from 1 moonstone
                GameRegistry.addShapelessRecipe(moonstoneDustStack, moonstone);
                //Makes 1 moonstone from 4 moonstone dust
                GameRegistry.addRecipe(moonstoneStack, "XX", "XX", 
                		'X', moonstoneDust);
                
                
                //Ore Generation
                GameRegistry.registerWorldGenerator(oreManager);
                
                //Blocks
                //Block of Plutonium
                GameRegistry.registerBlock(plutoniumBlock, Strings.PLUTONIUMBLOCK_NAME);
                LanguageRegistry.addName(plutoniumBlock, "Block of Plutonium");
                MinecraftForge.setBlockHarvestLevel(plutoniumBlock, "pickaxe", 2);
                //Plutonium Ore
                GameRegistry.registerBlock(plutoniumOre, Strings.PLUTONIUMORE_NAME);
                LanguageRegistry.addName(plutoniumOre, "Plutonium Ore");
                MinecraftForge.setBlockHarvestLevel(plutoniumOre, "pickaxe", 2);
                //Block of Radium
                GameRegistry.registerBlock(radiumBlock, Strings.RADIUMBLOCK_NAME);
                LanguageRegistry.addName(radiumBlock, "Block of Radium");
                MinecraftForge.setBlockHarvestLevel(radiumBlock, "pickaxe", 2);
                //Radium Ore
                GameRegistry.registerBlock(radiumOre, Strings.RADIUMORE_NAME);
                LanguageRegistry.addName(radiumOre, "Radium Ore");
                MinecraftForge.setBlockHarvestLevel(radiumOre, "pickaxe", 2);
                //Moonstone
                GameRegistry.registerBlock(moonstone, Strings.MOONSTONE_NAME);
                LanguageRegistry.addName(moonstone, "Moonstone");
                MinecraftForge.setBlockHarvestLevel(moonstone, "pickaxe", 0);
                
                //Items
                //Plutonium Ingot
                GameRegistry.registerItem(plutoniumIngot, Strings.PLUTONIUMINGOT_NAME);
                LanguageRegistry.addName(plutoniumIngot, "Plutonium Ingot");
                //Plutonium Ingot
                GameRegistry.registerItem(radiumIngot, Strings.RADIUMINGOT_NAME);
                LanguageRegistry.addName(radiumIngot, "Radium Ingot");
                //Ender Hatcher
                GameRegistry.registerItem(enderHatcher, Strings.ENDERHATCHER_NAME);
                LanguageRegistry.addName(enderHatcher, "Ender Hatcher");
                //Moonstone Dust
                GameRegistry.registerItem(moonstoneDust, Strings.MOONSTONEDUST_NAME);
                LanguageRegistry.addName(moonstoneDust, "Moonstone Dust");
                //Dragon Wings
                GameRegistry.registerItem(dragonWings, Strings.DRAGONWINGS_NAME);
                LanguageRegistry.addName(dragonWings, "Dragon Wings");
                
                //Horse Armour
                GameRegistry.registerItem(diamondHorseChest, Strings.DIAMONDHORSECHEST_NAME);
                GameRegistry.registerItem(diamondHorseHelm, Strings.DIAMONDHORSEHELM_NAME);
                GameRegistry.registerItem(goldHorseChest, Strings.GOLDHORSECHEST_NAME);
                GameRegistry.registerItem(goldHorseHelm, Strings.GOLDHORSEHELM_NAME);
                GameRegistry.registerItem(ironHorseChest, Strings.IRONHORSECHEST_NAME);
                GameRegistry.registerItem(ironHorseHelm, Strings.IRONHORSEHELM_NAME);
                
                LanguageRegistry.addName(diamondHorseChest, "Diamond Horse Chestplate");
                LanguageRegistry.addName(diamondHorseHelm, "Diamond Horse Helmet");
                LanguageRegistry.addName(ironHorseChest, "Iron Horse Chestplate");
                LanguageRegistry.addName(ironHorseHelm, "Iron Horse Helmet");
                LanguageRegistry.addName(goldHorseChest, "Gold Horse Chestplate");
                LanguageRegistry.addName(goldHorseHelm, "Gold Horse Helmet");
                
                GameRegistry.addRecipe(new ItemStack(diamondHorseHelm,1), new Object[]{
                	"XXX","XYX","Z Z",'X',Item.diamond,'Y',Item.silk,'Z',Item.leather,
                	});
                GameRegistry.addRecipe(new ItemStack(diamondHorseChest,1), new Object[]{
                	"XZX","XYX","XXX",'X',Item.diamond,'Y',Item.silk,'Z',Item.leather,
                	});
                GameRegistry.addRecipe(new ItemStack(goldHorseHelm,1), new Object[]{
                	"XXX","XYX","Z Z",'X',Item.ingotGold,'Y',Item.silk,'Z',Item.leather,
                	});
                GameRegistry.addRecipe(new ItemStack(goldHorseChest,1), new Object[]{
                	"XZX","XYX","XXX",'X',Item.ingotGold,'Y',Item.silk,'Z',Item.leather,
                	});
                GameRegistry.addRecipe(new ItemStack(ironHorseHelm,1), new Object[]{
                	"XXX","XYX","Z Z",'X',Item.ingotIron,'Y',Item.silk,'Z',Item.leather,
                	});
                GameRegistry.addRecipe(new ItemStack(ironHorseChest,1), new Object[]{
                	"XZX","XYX","XXX",'X',Item.ingotIron,'Y',Item.silk,'Z',Item.leather,
                	});
                GameRegistry.addShapelessRecipe(new ItemStack(Item.field_111215_ce,1), new Object[]{ ironHorseChest, ironHorseHelm });
                GameRegistry.addShapelessRecipe(new ItemStack(Item.field_111216_cf,1), new Object[]{ goldHorseChest, goldHorseHelm });
                GameRegistry.addShapelessRecipe(new ItemStack(Item.field_111213_cg,1), new Object[]{ diamondHorseHelm, diamondHorseChest });
                
                //Creative Tab
                LanguageRegistry.instance().addStringLocalization("itemGroup.RandomCraftTab", "en_US", "RandomCraft");
        }
        
        @EventHandler // used in 1.6.2
        public void postInit(FMLPostInitializationEvent event) {
                // Stub Method
        }
}

Link to comment
Share on other sites

public final static Block plutoniumBlock = new PlutoniumBlock(BlockIds.PLUTONIUMBLOCK_ID, Material.iron);
public final static Block plutoniumOre = new PlutoniumOre(BlockIds.PLUTONIUMORE_ID, Material.rock);

You will never use the correct id with this.

Set the blocks after loading the config file.

Link to comment
Share on other sites

public final static Block plutoniumBlock = new PlutoniumBlock(BlockIds.PLUTONIUMBLOCK_ID, Material.iron);
public final static Block plutoniumOre = new PlutoniumOre(BlockIds.PLUTONIUMORE_ID, Material.rock);

You will never use the correct id with this.

Set the blocks after loading the config file.

 

That should work, great job for thinking of that!

 

 

if (You.likescoding == false){
      You.goaway;
}

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

  • Who's Online (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

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