Jump to content

Recommended Posts

Posted

Alright, I am tired and sick of getting errors, so I'll type just the needed.

I am updating my code from 1.6 to 1.7. No errors shown in eclipse, but when I run it, I get an ExceptionInInitializerError at a setCreativeTab() line in my code. This is happening only to my metadata items and blocks. Here's the code of one of them and the crash log:

 

Block

package coalpower.block;

import java.util.List;
import java.util.Random;

import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import coalpower.core.CPTab;
import coalpower.lib.metadata.OreEnum;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class BlockBaseOre extends BlockBase {

public static final float DEFAULT_RESISTANCE = 5F;
public static final float DEFAULT_HARDNESS = 3F;

public IIcon[] oreOnly;

@SideOnly(Side.CLIENT)
public long soundDelay;

public BlockBaseOre(int i) {
	super(i, Material.rock, ItemBlockBaseOre.class, OreEnum.class);
	setHardness(DEFAULT_HARDNESS);
	setResistance(DEFAULT_RESISTANCE);
	//setCreativeTab(CPTab.resource);
}

public boolean isBlockSolidOnSide(World world, int x, int y, int z, ForgeDirection side) {
	return true;
}

public boolean renderAsNormalBlock() {
	return false;
}

@Override
public float getBlockHardness(World world, int x, int y, int z) {
	return this.DEFAULT_HARDNESS;
}

@Override
@SideOnly(Side.CLIENT)
@SuppressWarnings({"unchecked", "rawtypes"})
public void getSubBlocks(Item unknown, CreativeTabs tab, List subItems) {
	for (OreEnum ore : OreEnum.values()) {

			subItems.add(ore.toItemStack());

	}
}



@SuppressWarnings("unused")
@Override
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
	int meta = world.getBlockMetadata(x, y, z);
	IIcon[] blockIcons = null;

		if (blockIcons != null) {
			if (blockIcons.length == 6) {
				return blockIcons[side];
			}
		}


	return getIcon(side, meta);
}

@Override
public IIcon getIcon(int side, int metadata) {
	return textures[metadata];
}

@Override
public Item getItemDropped(int par1, Random par2Random, int par3){
	return OreEnum.get(par3).toItemStack().getItem();

}

@Override
public void registerBlockIcons(IIconRegister registry) {
	super.registerBlockIcons(registry);

	oreOnly = new IIcon[OreEnum.values().length];

	for (int i = 1; i < OreEnum.values().length; i++) {
		oreOnly[i] = registry.registerIcon(OreEnum.get(i).getTextureFile());
	}

}

}

 

And the log:

 

[00:03:10] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLTweaker
[00:03:10] [main/INFO] [LaunchWrapper]: Using primary tweak class name cpw.mods.fml.common.launcher.FMLTweaker
[00:03:10] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLTweaker
[00:03:10] [main/INFO] [FML]: Forge Mod Loader version 7.2.195.1080 for Minecraft 1.7.2 loading
[00:03:10] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.7.0_45, running on Windows 7:amd64:6.1, installed at C:\Program Files\Java\jre7
[00:03:10] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
[00:03:10] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
[00:03:10] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLDeobfTweaker
[00:03:10] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
[00:03:10] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
[00:03:10] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper
[00:03:11] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!
[00:03:11] [main/ERROR] [FML]: The minecraft jar file:/C:/Users/pakard/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.2-10.12.1.1080/forgeSrc-1.7.2-10.12.1.1080.jar!/net/minecraft/client/ClientBrandRetriever.class appears to be corrupt! There has been CRITICAL TAMPERING WITH MINECRAFT, it is highly unlikely minecraft will work! STOP NOW, get a clean copy and try again!
[00:03:11] [main/ERROR] [FML]: FML has been ordered to ignore the invalid or missing minecraft certificate. This is very likely to cause a problem!
[00:03:11] [main/ERROR] [FML]: Technical information: ClientBrandRetriever was at jar:file:/C:/Users/pakard/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.2-10.12.1.1080/forgeSrc-1.7.2-10.12.1.1080.jar!/net/minecraft/client/ClientBrandRetriever.class, there were 0 certificates for it
[00:03:11] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing
[00:03:11] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper
[00:03:11] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLDeobfTweaker
[00:03:12] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}
[00:03:13] [main/INFO]: Setting user: Player949
[00:03:16] [Client thread/INFO]: LWJGL Version: 2.9.0
[00:03:17] [Client thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization
[00:03:17] [Client thread/INFO] [FML]: MinecraftForge v10.12.1.1080 Initialized
[00:03:17] [Client thread/INFO] [FML]: Replaced 141 ore recipies
[00:03:17] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization
[00:03:17] [Client thread/INFO] [FML]: Searching C:\Modding\MechaniCraft\1.7\eclipse\mods for mods
[00:03:19] [Client thread/ERROR] [FML]: FML has detected a mod that is using a package name based on 'net.minecraft.src' : net.minecraft.src.FMLRenderAccessLibrary. This is generally a severe programming error.  There should be no mod code in the minecraft namespace. MOVE YOUR MOD! If you're in eclipse, select your source code and 'refactor' it into a new package. Go on. DO IT NOW!
[00:03:22] [Client thread/INFO] [FML]: Forge Mod Loader has identified 4 mods to load
[00:03:23] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:CoalPower-old
[00:03:23] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0

Starting up SoundSystem...
Initializing LWJGL OpenAL
    (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
OpenAL initialized.

[00:03:24] [sound Library Loader/INFO]: Sound engine started
[00:03:25] [Client thread/INFO]: Created: 512x256 textures/blocks-atlas
[00:03:26] [Client thread/INFO]: Created: 256x256 textures/items-atlas
[00:03:26] [Client thread/ERROR] [FML]: Fatal errors were detected during the transition from INITIALIZATION to POSTINITIALIZATION. Loading cannot continue
[00:03:26] [Client thread/ERROR] [FML]: 
mcp{9.03} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized
FML{7.2.195.1080} [Forge Mod Loader] (forgeSrc-1.7.2-10.12.1.1080.jar) Unloaded->Constructed->Pre-initialized->Initialized
Forge{10.12.1.1080} [Minecraft Forge] (forgeSrc-1.7.2-10.12.1.1080.jar) Unloaded->Constructed->Pre-initialized->Initialized
CoalPower-old{0.0.1} [CoalPower-old] (bin) Unloaded->Constructed->Pre-initialized->Errored
[00:03:26] [Client thread/ERROR] [FML]: The following problems were captured during this phase
[00:03:26] [Client thread/ERROR] [FML]: Caught exception from CoalPower-old
java.lang.ExceptionInInitializerError
at coalpower.block.BlockBaseOre.<init>(BlockBaseOre.java:33) ~[blockBaseOre.class:?]
at coalpower.CPLoader.load(CPLoader.java:50) ~[CPLoader.class:?]
at coalpower.CoalPower.load(CoalPower.java:68) ~[CoalPower.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_45]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_45]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_45]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_45]
at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:513) ~[FMLModContainer.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_45]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_45]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_45]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_45]
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) ~[guava-15.0.jar:?]
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47) ~[guava-15.0.jar:?]
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) ~[guava-15.0.jar:?]
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) ~[guava-15.0.jar:?]
at com.google.common.eventbus.EventBus.post(EventBus.java:267) ~[guava-15.0.jar:?]
at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:208) ~[LoadController.class:?]
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187) ~[LoadController.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_45]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_45]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_45]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_45]
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) ~[guava-15.0.jar:?]
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47) ~[guava-15.0.jar:?]
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) ~[guava-15.0.jar:?]
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) ~[guava-15.0.jar:?]
at com.google.common.eventbus.EventBus.post(EventBus.java:267) ~[guava-15.0.jar:?]
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118) [LoadController.class:?]
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:687) [Loader.class:?]
at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:288) [FMLClientHandler.class:?]
at net.minecraft.client.Minecraft.startGame(Minecraft.java:585) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:892) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:112) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_45]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_45]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_45]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_45]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]
Caused by: java.lang.NullPointerException
at coalpower.core.CPTab.<init>(CPTab.java:33) ~[CPTab.class:?]
at coalpower.core.CPTab.<clinit>(CPTab.java:27) ~[CPTab.class:?]
... 40 more
---- Minecraft Crash Report ----
// You should try our sister game, Minceraft!

Time: 31/05/14 0.03
Description: There was a severe problem during mod loading that has caused the game to fail

cpw.mods.fml.common.LoaderException: java.lang.ExceptionInInitializerError
at cpw.mods.fml.common.LoadController.transition(LoadController.java:162)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:688)
at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:288)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:585)
at net.minecraft.client.Minecraft.run(Minecraft.java:892)
at net.minecraft.client.main.Main.main(Main.java:112)
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:134)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
Caused by: java.lang.ExceptionInInitializerError
at coalpower.block.BlockBaseOre.<init>(BlockBaseOre.java:33)
at coalpower.CPLoader.load(CPLoader.java:50)
at coalpower.CoalPower.load(CoalPower.java:68)
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:513)
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:47)
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.sendEventToModContainer(LoadController.java:208)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187)
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:47)
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:118)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:687)
... 10 more
Caused by: java.lang.NullPointerException
at coalpower.core.CPTab.<init>(CPTab.java:33)
at coalpower.core.CPTab.<clinit>(CPTab.java:27)
... 40 more


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

-- System Details --
Details:
Minecraft Version: 1.7.2
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.7.0_45, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 689243368 bytes (657 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
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP v9.03 FML v7.2.195.1080 Minecraft Forge 10.12.1.1080 4 mods loaded, 4 mods active
mcp{9.03} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized
FML{7.2.195.1080} [Forge Mod Loader] (forgeSrc-1.7.2-10.12.1.1080.jar) Unloaded->Constructed->Pre-initialized->Initialized
Forge{10.12.1.1080} [Minecraft Forge] (forgeSrc-1.7.2-10.12.1.1080.jar) Unloaded->Constructed->Pre-initialized->Initialized
CoalPower-old{0.0.1} [CoalPower-old] (bin) Unloaded->Constructed->Pre-initialized->Errored
#@!@# Game crashed! Crash report saved to: #@!@# C:\Modding\MechaniCraft\1.7\eclipse\.\crash-reports\crash-2014-05-31_00.03.26-client.txt
AL lib: (EE) alc_cleanup: 1 device not closed

 

I AM DESPERATE.

I try my best, so apologies if I said something obviously stupid!

Posted

Alrighty. Sorry If i haven't read it carefully enough, It's just stress. Note to self and everyone else: don't code if stressed. Don't do it.

 

Anyways, i'm still tired to code right now, so I'll do the lazy hated guy and throw y'all the code:

 

package coalpower.core;

import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import coalpower.CPLoader;
import coalpower.lib.block.BlockLoader;
import coalpower.lib.lang.LanguageHandler;
import coalpower.lib.metadata.DustEnum;
import coalpower.lib.metadata.OreEnum;
import cpw.mods.fml.common.registry.LanguageRegistry;


public class CPTab extends CreativeTabs {

public static CreativeTabs resource;
public static CreativeTabs tool;
public static CreativeTabs world;
public static CreativeTabs machine;

public Item itemID = Items.apple;
public int itemMeta = 0;

static {
	resource = new CPTab(LanguageHandler.getInstance().translate("cptab.resource")).setIcon(Item.getItemFromBlock(CPLoader.ore), OreEnum.COPPER.ordinal());
	//world = new CPTab(LanguageHandler.getInstance().translate("cptab.world")).setIcon(Config.blockProjectTableID, 0);
	machine = new CPTab(LanguageHandler.getInstance().translate("cptab.machine")).setIcon(Item.getItemFromBlock(BlockLoader.MACHINE_SAWMILL), 0);
}

public CPTab(String label) {
	super(label.toLowerCase().replace(" ", "_"));
	LanguageRegistry.instance().addStringLocalization("itemGroup." + label.toLowerCase().replace(" ", "_"), label);
}

public CPTab setIcon(Item id, int meta) {
	this.itemID = id;
	this.itemMeta = meta;
	return this;
}

public CPTab setIcon(ItemStack stack) {
	this.itemID = stack.getItem();
	this.itemMeta = stack.getItemDamage();
	return this;
}

@Override
public ItemStack getIconItemStack() {
	return new ItemStack(itemID, 1, itemMeta);
}

@Override
public Item getTabIconItem() {
	return null;
}

}

 

I think I'll go to sleep, 2am over here. Tomorrow I'll doublecheck my code :/

The strange thing here is that it suddenly started crashing, whereas it didn't do this 3 weeks ago (Same exact code)

I try my best, so apologies if I said something obviously stupid!

Posted

Man, I just discovered everything as soon as you replied. Also, i forgot to put the resource folder containing my lang files, which I already use in 2 different languages. (I have everything set up already)

Let me try moving the lang file to the folder, and I'll see if it works.

I try my best, so apologies if I said something obviously stupid!

Posted

Alright, i solved every error, but now language files load only for certain items.

For example, I have a block which is shown up as tile.block.ash.name in my tab. In my lang file i have tile.block.ash.name = Ash

(I also tried with tile.block.ash, block.ash.name, block.ash) but still nothing.

I try my best, so apologies if I said something obviously stupid!

Posted

Alright, but some other blocks still work, having those spaces too.

I try my best, so apologies if I said something obviously stupid!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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