Jump to content

[FIXED]Creating a fluid BUT keeps crashing [1.7.10][HELP]


PeaceKeeper

Recommended Posts

Hey this is the first time I'm creating a fluid so any help with this crash is appreciated. Thank you in advance.

 

github link : https://github.com/XchaoshunterX/testmod

 

crash report:

 

---- Minecraft Crash Report ----

// Quite honestly, I wouldn't worry myself about that.

 

Time: 6/4/16 4:38 PM

Description: Initializing game

 

java.lang.NullPointerException: Initializing game

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 com.chaoshunter.blocks.acidBlock.<init>(acidBlock.java:22)

at com.chaoshunter.blocks.MODED_Blocks.initializeBlock(MODED_Blocks.java:73)

at com.chaoshunter.blocks.MODED_Blocks.mainRegistry(MODED_Blocks.java:28)

at com.chaoshunter.testmod.MainRegistry.Preload(MainRegistry.java:45)

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

at cpw.mods.fml.common.Loader.preinitializeMods(Loader.java:513)

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

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

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

at net.minecraft.client.main.Main.main(Main.java:164)

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

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)

at GradleStart.main(Unknown Source)

 

 

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

---------------------------------------------------------------------------------------

 

-- Head --

Stacktrace:

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 com.chaoshunter.blocks.acidBlock.<init>(acidBlock.java:22)

at com.chaoshunter.blocks.MODED_Blocks.initializeBlock(MODED_Blocks.java:73)

at com.chaoshunter.blocks.MODED_Blocks.mainRegistry(MODED_Blocks.java:28)

at com.chaoshunter.testmod.MainRegistry.Preload(MainRegistry.java:45)

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

at cpw.mods.fml.common.Loader.preinitializeMods(Loader.java:513)

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

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

 

-- Initialization --

Details:

Stacktrace:

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

at net.minecraft.client.main.Main.main(Main.java:164)

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

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)

at GradleStart.main(Unknown Source)

 

-- System Details --

Details:

Minecraft Version: 1.7.10

Operating System: Windows 8.1 (amd64) version 6.3

Java Version: 1.8.0_51, Oracle Corporation

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

Memory: 882816256 bytes (841 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 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.05 FML v7.10.84.1221 Minecraft Forge 10.13.1.1221 4 mods loaded, 4 mods active

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

FML{7.10.84.1221} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.1.1221.jar) Unloaded->Constructed->Pre-initialized

Forge{10.13.1.1221} [Minecraft Forge] (forgeSrc-1.7.10-10.13.1.1221.jar) Unloaded->Constructed->Pre-initialized

testmod{10.1.2.3} [Dimensional Warpack Mod] (bin) Unloaded->Constructed->Errored

Launched Version: 1.7.10

LWJGL: 2.9.1

OpenGL: Intel® HD Graphics GL version 3.1.0 - Build 9.17.10.4229, Intel

GL Caps: Using GL 1.3 multitexturing.

Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.

Anisotropic filtering is supported and maximum anisotropy is 16.

Shaders are available because OpenGL 2.1 is supported.

 

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: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

Anisotropic Filtering: Off (1)

 

life is easy if you stay claim and code

Link to comment
Share on other sites

To elaborate on what diesieben07 said: You have an

acidFluid

class that registers itself, but you create an instance of

Fluid

instead of this class.

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.

Link to comment
Share on other sites

You need to register your Fluid before you can use it.

 

like this?

acidFluid.setUnlocalizedName(acidBlock.getUnlocalizedName());

GameRegistry.registerBlock(acidBlock, RefStrings.MODID + "_" + acidBlock.getUnlocalizedName().substring(5));

 

but it still crashes.

life is easy if you stay claim and code

Link to comment
Share on other sites

To elaborate on what diesieben07 said: You have an

acidFluid

class that registers itself, but you create an instance of

Fluid

instead of this class.

sorry what do you mean?

 

You assign a new instance of

Fluid

to

MODED_Blocks.acidFluid

and never use your

acidFluid

class. This

Fluid

instance is never registered, causing the crash.

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.

Link to comment
Share on other sites

Thanks got it fixed

===========

public static acidFluid acidFluid = new acidFluid("acidFluid");

public static Block acidBlock;

 

 

public static void initializeBlock(){

//dirt

ComDirt = new ComDirt(Material.ground).setBlockName("ComDirt").setCreativeTab(MODED_Tabs.tabBlock).setBlockTextureName(RefStrings.MODID + ":ComDirt");

//element p

Element_P = new Element_p(Material.ground).setBlockName("Element_P").setCreativeTab(MODED_Tabs.tabBlock).setBlockTextureName(RefStrings.MODID + ":Element_P").setLightLevel(20.0f).setHardness(50F);

PBlock = new PBlock(Material.ground).setBlockName("PBlock").setCreativeTab(MODED_Tabs.tabBlock).setBlockTextureName(RefStrings.MODID + ":PBlock");

PGrassDirt = new PGrassDirt(Material.ground).setBlockName("PGrassDirt").setCreativeTab(MODED_Tabs.tabBlock);

PDirt = new PDirt(Material.ground).setBlockName("PDirt").setCreativeTab(MODED_Tabs.tabBlock).setBlockTextureName(RefStrings.MODID + ":PDirt");

PStone = new PStone(Material.ground).setBlockName("PStone").setCreativeTab(MODED_Tabs.tabBlock).setBlockTextureName(RefStrings.MODID + ":PStone");

 

 

//purpium

Purpium = new Purpium(Material.ground).setBlockName("Purpium").setCreativeTab(MODED_Tabs.tabBlock).setBlockTextureName(RefStrings.MODID + ":Purpium").setHardness(30F);

//Purpium_Tnt = new Purpium_Tnt(Material.tnt).setBlockName("Purpium_Tnt").setCreativeTab(MODED_Tabs.tabBlock).setBlockTextureName(RefStrings.MODID + ":Purpium_Tnt");

Purpium_Block = new Purpium_Block(Material.ground).setBlockName("Purpium_Block").setCreativeTab(MODED_Tabs.tabBlock).setBlockTextureName(RefStrings.MODID + ":Purpium Block").setHardness(20F);

 

//PWater = new PWater(null, Material.water).setBlockName("PWater").setCreativeTab(MODED_Tabs.tabBlock).setBlockTextureName(RefStrings.MODID + ":PWater");

//acidBlock = new acidBlock(acidFluid, Material.water).setBlockName("acidblock");

//acidFluid = new acidFluid("acidFluid");

FluidRegistry.registerFluid(acidFluid);

acidBlock = new acidBlock(acidFluid, Material.water).setCreativeTab(MODED_Tabs.tabBlock);

=============

Do you know how to fix the textures xD thanks again in advance

2mMx1Li

 

image link

http://imgur.com/R2ncCTB

life is easy if you stay claim and code

Link to comment
Share on other sites

textures for liquids in 1.7.10 are the easy ones to do. Just get the vanilla one and re-color it ot the way you want. Include an mcmeta with the same name as your fluids and your good to go. If you want to update to 1.8.x that is a whole other story and quite honestly I find them to be a b**** to try and get working so good luck with those.

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.

Announcements



×
×
  • Create New...

Important Information

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