Jump to content

Recommended Posts

Posted

Hello,

 

I am currently working on a mod for Minecraft 1.7.2 using Forge, and I have ran into a problem.

 

The problem is that Minecraft crashes on loading after adding a fluid. Any help is much appreciated.

I am also implementing Buildcraft, Forestry and IC2 APIs but haven't used any of them yet.

 

Crash Log:

 

 

---- Minecraft Crash Report ----

// This doesn't make any sense!

 

Time: 2014-04-15 23:01

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:420)

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:209)

at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:188)

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:119)

at cpw.mods.fml.common.Loader.loadMods(Loader.java:489)

at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:202)

at net.minecraft.client.Minecraft.startGame(Minecraft.java:520)

at net.minecraft.client.Minecraft.run(Minecraft.java:890)

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

at net.minecraftforge.fluids.FluidRegistry.getFluidID(FluidRegistry.java:119)

at net.minecraftforge.fluids.Fluid.getID(Fluid.java:177)

at net.minecraftforge.fluids.FluidStack.<init>(FluidStack.java:27)

at net.minecraftforge.fluids.BlockFluidClassic.<init>(BlockFluidClassic.java:28)

at net.theori.tmech.blocks.BlockLiquidPower.<init>(BlockLiquidPower.java:21)

at net.theori.tmech.TheoreticMechanics.<clinit>(TheoreticMechanics.java:33)

... 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:420)

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:209)

at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:188)

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:119)

at cpw.mods.fml.common.Loader.loadMods(Loader.java:489)

at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:202)

at net.minecraft.client.Minecraft.startGame(Minecraft.java:520)

 

-- Initialization --

Details:

Stacktrace:

at net.minecraft.client.Minecraft.run(Minecraft.java:890)

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)

 

-- System Details --

Details:

Minecraft Version: 1.7.2

Operating System: Windows 7 (amd64) version 6.1

Java Version: 1.7.0_51, Oracle Corporation

Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation

Memory: 666118416 bytes (635 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 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.01-pre FML v7.2.156.1056 Minecraft Forge 10.12.0.1056 12 mods loaded, 12 mods active

mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed

FML{7.2.156.1056} [Forge Mod Loader] (forgeSrc-1.7.2-10.12.0.1056.jar) Unloaded->Constructed

Forge{10.12.0.1056} [Minecraft Forge] (forgeSrc-1.7.2-10.12.0.1056.jar) Unloaded->Constructed

BuildCraft|Core{5.0.4} [buildCraft] (buildcraft-5.0.4-dev.jar) Unloaded->Constructed

IC2{2.1.459-experimental} [industrialCraft 2] (industrialcraft-2-2.1.459-experimental-dev.jar) Unloaded->Constructed

Forestry{2.4.0.0-711} [Forestry for Minecraft] (forestry-2.4.0.0-711-dev.jar) Unloaded->Constructed

tmech{0.1.0-dev1} [Theoretic Mechanics] (bin) Unloaded

BuildCraft|Builders{5.0.4} [bC Builders] (buildcraft-5.0.4-dev.jar) Unloaded

BuildCraft|Energy{5.0.4} [bC Energy] (buildcraft-5.0.4-dev.jar) Unloaded

BuildCraft|Factory{5.0.4} [bC Factory] (buildcraft-5.0.4-dev.jar) Unloaded

BuildCraft|Transport{5.0.4} [bC Transport] (buildcraft-5.0.4-dev.jar) Unloaded

BuildCraft|Silicon{5.0.4} [bC Silicon] (buildcraft-5.0.4-dev.jar) Unloaded

Launched Version: 1.6

LWJGL: 2.9.0

OpenGL: Intel® HD Graphics 4000 GL version 4.0.0 - Build 9.17.10.2828, Intel

Is Modded: Definitely; Client brand changed to 'fml,forge'

Type: Client (map_client.txt)

Resource Packs: []

Current Language: English (US)

Profiler Position: N/A (disabled)

Vec3 Pool Size: ~~ERROR~~ NullPointerException: null

Anisotropic Filtering: Off (1)

 

 

 

Base Mod class:

 

 

package net.theori.tmech;

 

import net.minecraft.block.Block;

import net.minecraft.block.material.Material;

import net.minecraft.item.Item;

import net.minecraftforge.fluids.Fluid;

import net.minecraftforge.fluids.FluidRegistry;

import net.theori.tmech.blocks.BlockLiquidPower;

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;

 

@Mod(modid=TheoreticMechanics.MODID, name=TheoreticMechanics.NAME, version=TheoreticMechanics.VERSION)

public class TheoreticMechanics {

public static final String MODID = "tmech";

public static final String NAME = "Theoretic Mechanics";

public static final String VERSION = "0.1.0-dev1";

 

@Instance(value = TheoreticMechanics.MODID)

public static TheoreticMechanics instance;

 

@SidedProxy(clientSide="net.theori.tmech.client.ClientProxy", serverSide="net.theori.tmech.CommonProxy")

public static CommonProxy proxy;

 

// Fluids

public static Fluid liquidPower = new Fluid("liquidpower").setLuminosity(15).setDensity(10000).setTemperature(1273).setViscosity(9000);

 

// Blocks

public static Block blockLiquidPower = new BlockLiquidPower(TheoreticMechanics.liquidPower, Material.lava);

 

@EventHandler

public void preInit(FMLPreInitializationEvent event) {

 

}

 

@EventHandler

public void load(FMLInitializationEvent event) {

proxy.registerRenderers();

 

// Fluids

FluidRegistry.registerFluid(liquidPower);

}

 

@EventHandler

public void postInit(FMLPostInitializationEvent event) {

 

}

}

 

 

 

Fluid block class:

 

 

package net.theori.tmech.blocks;

 

import net.minecraft.block.material.Material;

import net.minecraft.client.renderer.texture.IIconRegister;

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.util.IIcon;

import net.minecraft.world.IBlockAccess;

import net.minecraft.world.World;

import net.minecraftforge.fluids.BlockFluidClassic;

import net.minecraftforge.fluids.Fluid;

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

 

public class BlockLiquidPower extends BlockFluidClassic {

@SideOnly(Side.CLIENT)

protected IIcon stillIcon;

@SideOnly(Side.CLIENT)

protected IIcon flowingIcon;

 

public BlockLiquidPower(Fluid fluid, Material material) {

super(fluid, material);

setBlockName("liquidPower");

setCreativeTab(CreativeTabs.tabMisc);

}

 

@Override

public IIcon getIcon(int side, int meta) {

return (side == 0 || side == 1)? stillIcon : flowingIcon;

 

}

 

@SideOnly(Side.CLIENT)

@Override

public void registerBlockIcons(IIconRegister register) {

stillIcon = register.registerIcon("modid:powerStill");

flowingIcon = register.registerIcon("modid:powerFlowing");

}

 

@Override

public boolean canDisplace(IBlockAccess world, int x, int y, int z) {

if (world.getBlock(x, y, z).getMaterial().isLiquid()) return false;

return super.canDisplace(world, x, y, z);

}

 

@Override

public boolean displaceIfPossible(World world, int x, int y, int z) {

if (world.getBlock(x, y, z).getMaterial().isLiquid()) return false;

return super.displaceIfPossible(world, x, y, z);

}

}

 

 

Posted

Hello,

 

I am currently working on a mod for Minecraft 1.7.2 using Forge, and I have ran into a problem.

 

The problem is that Minecraft crashes on loading after adding a fluid. Any help is much appreciated.

I am also implementing Buildcraft, Forestry and IC2 APIs but haven't used any of them yet.

 

Base Mod class:

 

 

package net.theori.tmech;

 

import net.minecraft.block.Block;

import net.minecraft.block.material.Material;

import net.minecraft.item.Item;

import net.minecraftforge.fluids.Fluid;

import net.minecraftforge.fluids.FluidRegistry;

import net.theori.tmech.blocks.BlockLiquidPower;

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;

 

@Mod(modid=TheoreticMechanics.MODID, name=TheoreticMechanics.NAME, version=TheoreticMechanics.VERSION)

public class TheoreticMechanics {

public static final String MODID = "tmech";

public static final String NAME = "Theoretic Mechanics";

public static final String VERSION = "0.1.0-dev1";

 

@Instance(value = TheoreticMechanics.MODID)

public static TheoreticMechanics instance;

 

@SidedProxy(clientSide="net.theori.tmech.client.ClientProxy", serverSide="net.theori.tmech.CommonProxy")

public static CommonProxy proxy;

 

// Fluids

public static Fluid liquidPower = new Fluid("liquidpower").setLuminosity(15).setDensity(10000).setTemperature(1273).setViscosity(9000);

 

// Blocks

public static Block blockLiquidPower = new BlockLiquidPower(TheoreticMechanics.liquidPower, Material.lava);

 

@EventHandler

public void preInit(FMLPreInitializationEvent event) {

 

}

@EventHandler

public void load(FMLInitializationEvent event) {

proxy.registerRenderers();

 

// Fluids

FluidRegistry.registerFluid(liquidPower);

}

 

@EventHandler

public void postInit(FMLPostInitializationEvent event) {

 

}

}

 

 

 

 

ahmmm... shouldn't you register your blovks in preinit?

like:

 

 

        public static Block blockXYZ;


@EventHandler
public void preInit(FMLPreInitializationEvent event) {
	blockXYZ = new......;
}


 

 

 

Thats the way i do it...(Don't forget the thank you button!)

 

Here could be your advertisement!

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Thank you so much Choonster! That's what i was missing! For now i added a folder assets/<mod_id>/items and put the model definition JSON file with the item name in it: { "model":{ "type": "minecraft:model", "model": "teleportpugmod:item/teleportpug" } }   Some log errors/warnings pointing me into the right direction would've been nice 😅 Haven't had much time to look into the DataGenerator and ModelProviders, because i'm still at work. But i guess these would would make more sense if have many custom items and want to generate these model definition files?
    • Minecraft 1.21.4 requires a new model definition file for each item, which you don't have. These can be created through Data Generation, specifically the ModelProvider, BlockModelGenerators and ItemModelGenerators classes.
    • Hi,  I'm using Forge 47.3.0 for Minecraft 1.20.1 I apologise if this is obvious I am very new to modding for Minecraft. I sucessfully made a mod that launched without errors or crashes (without it doing anything) but in order to add the features I need, I need to add "Custom Portal API [Forge]" as a dependency. However no matter the way I've tried to acheive this, it crashes. I am pretty sure it's not the way I'm putting it in the repositories, the dependencies or the way I'm refrencing it, as I've a hundred diffrent combinations and multiple Maven methods. And on all those diffrent variations I still get this crash: pastebin.com/UhumzZCZ Any tips would be invaluable as I've been loosing my mind over this!
    • Hi, i'm really having problems trying to set the texture to my custom item. I thought i'm doing everything correctly, but all i see is the missing texture block for my item. I am trying this for over a week now and getting really frustrated. The only time i could make the texture work, was when i used an older Forge version (52.0.1) for Minecraft (1.21.4). Was there a fundamental change for textures and models somewhere between versions that i'm missing? I started with Forge 54.1.0 and had this problem, so in my frustration i tried many things: Upgrading to Forge 54.1.1, created multiple new projects, workspaces, redownloaded everything and setting things up multiple times, as it was suggested in an older thread. Therea are no errors in the console logs, but maybe i'm blind, so i pasted the console logs to pastebin anyway: https://pastebin.com/zAM8RiUN The only time i see an error is when i change the models JSON file to an incorrect JSON which makes sense and that suggests to me it is actually reading the JSON file.   I set the github repository to public, i would be so thankful if anyone could take a look and tell me what i did wrong: https://github.com/xLorkin/teleport_pug_forge   As a note: i'm pretty new to modding, this is my first mod ever. But i'm used to programming. I had some up and downs, but through reading the documentation, using google and experimenting, i could solve all other problems. I only started modding for Minecraft because my son is such a big fan and wanted this mod.
    • Please read the FAQ (link in orange bar at top of page), and post logs as described there.
  • 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.