Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hello Guys,

 

At first, sorry for my bad English, I'm German.

 

I've programmed a mod named MoreEMC

 

It uses the ProjectE API to add a EMC value to specific items from other mods like Draconic Evolution.

 

Any item works fine except the Hardened Energy Fluxduct from Thermal Dynamics

 

The Errorlog:

java.lang.NullPointerException: Initializing game
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:213)
at moze_intel.projecte.impl.EMCProxyImpl.registerCustomEMC(EMCProxyImpl.java:23)
at me.benfah.moreemc.MyMod.preInit(MyMod.java:68)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:532)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:212)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:190)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119)
at cpw.mods.fml.common.Loader.preinitializeMods(Loader.java:556)
at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:243)
at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:480)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:878)
at net.minecraft.client.main.Main.main(SourceFile:148)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

 

The Mainclass:

package me.benfah.moreemc;

import moze_intel.projecte.api.ProjectEAPI;
import moze_intel.projecte.api.proxy.IEMCProxy;
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 cofh.thermaldynamics.item.TDItems;
import cofh.thermalfoundation.item.TFItems;

import com.brandon3055.draconicevolution.common.ModItems;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
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;


@Mod(modid = MyMod.MODID, name = "More EMC", version = MyMod.VERSION, dependencies = "required-after:ProjectE;required-after:ThermalFoundation;required-after:ThermalDynamics;required-after:DraconicEvolution")
public class MyMod
{
    public static final String MODID = "moreemc";
    public static final String VERSION = "1.0";
    
    
    


    
    public static Item testItem;
    
   
    
    @Instance(MyMod.MODID)
public static MyMod modInstance;
    
    @EventHandler
    public void preInit(FMLPreInitializationEvent event)
    {

    	
    	IEMCProxy emcProxy = ProjectEAPI.getEMCProxy();
    	
    	emcProxy.registerCustomEMC(TFItems.dustNiter, 20);

    	emcProxy.registerCustomEMC(new ItemStack(ModItems.draconiumIngot), 16384);
    	emcProxy.registerCustomEMC(new ItemStack(ModItems.draconicIngot), 131072);
    	emcProxy.registerCustomEMC(new ItemStack(ModItems.dragonHeart), 262144);
    	emcProxy.registerCustomEMC(new ItemStack(ModItems.draconicHelm), 6062080);
    	emcProxy.registerCustomEMC(new ItemStack(ModItems.draconicChest), 9699328);
    	emcProxy.registerCustomEMC(new ItemStack(ModItems.draconicLeggs), 8486912);
    	emcProxy.registerCustomEMC(new ItemStack(ModItems.draconicBoots), 4849664);
    	
    	
    	

    

    }
    
    @EventHandler
    public void init(FMLInitializationEvent event)
    {
    	
    	

    	
    	
    }

    @EventHandler
    public void postInit(FMLPostInitializationEvent event)
    {
    	
    	IEMCProxy emcProxy = ProjectEAPI.getEMCProxy();

    	emcProxy.registerCustomEMC(TDItems.ductEnergyHardened, 20); //<---- The Error


    	
    


    }
}

 

Thanks in advance  :)

Looking at Thermal Dynamics in a decompiler, the fields in

TDItems

are never actually initialised. To get a duct

ItemStack

, get the appropriate

Duct

from the

TDDucts

class and then use the

Duct#itemStack

field.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.