Jump to content

Custom fluid crash!?!? Help! [1.7.10] [UNSOLVED]


TheEpicTekkit

Recommended Posts

Anyone know any good tutorials on creating a custom liquid for 1.7.10?

 

I want to add a creosote oil, petroleum, diesel, propane, butane, and tar to my mod.

 

I also need to know how to make the gui of a block be able to store and use liquids (I cant find any tutorials for this).

I ask complicated questions, and apparently like to write really long detailed posts. But I also help others when I can.

Link to comment
Share on other sites

For basic creation of custom fluids, look around https://github.com/Eternaldoom/Realms-of-Chaos/tree/master/com/eternaldoom/realmsofchaos/blocks. Check out BlockWaterPortal and FluidWaterPortal. Also, be sure to register your fluids before your blocks.

Check out my mod, Realms of Chaos, here.

 

If I helped you, be sure to press the "Thank You" button!

Link to comment
Share on other sites

Thanks, but I dont understand the way fluids work, Is there a place where you learnt how to do this? if so, please link. Also, does this fluid create an infinite source when flowing against itself? because I want my creosote oil not to have an infinite source.

I ask complicated questions, and apparently like to write really long detailed posts. But I also help others when I can.

Link to comment
Share on other sites

Okay, now I have a problem.

 

When I load the game, it crashes.....

 

 

 

This is the crash report:

 

 

[17:22:26] [Client thread/ERROR] [FML]: Fatal errors were detected during the transition from INITIALIZATION to POSTINITIALIZATION. Loading cannot continue
[17:22:26] [Client thread/ERROR] [FML]: 
mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized
FML{7.10.25.1207} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.0.1207.jar) Unloaded->Constructed->Pre-initialized->Initialized
Forge{10.13.0.1207} [Minecraft Forge] (forgeSrc-1.7.10-10.13.0.1207.jar) Unloaded->Constructed->Pre-initialized->Initialized
<CoFH ASM>{000} [CoFH ASM Data Initialization] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized
CoFHCore{1.7.10R3.0.0B3} [CoFH Core] (CoFHCore-[1.7.10]3.0.0B3-dev-26.jar) Unloaded->Constructed->Pre-initialized->Initialized
generator{Pre-Alpha 1.0} [Generator] (bin) Unloaded->Constructed->Pre-initialized->Errored
IC2{2.2.596-experimental} [industrialCraft 2] (industrialcraft-2-2.2.596-experimental-dev.jar) Unloaded->Constructed->Pre-initialized->Initialized
ThermalFoundation{1.7.10R1.0.0B1} [Thermal Foundation] (ThermalFoundation-[1.7.10]1.0.0B1-dev-6.jar) Unloaded->Constructed->Pre-initialized->Initialized
ThermalExpansion{1.7.10R4.0.0B3} [Thermal Expansion] (ThermalExpansion-[1.7.10]4.0.0B3-dev-11.jar) Unloaded->Constructed->Pre-initialized->Initialized
[17:22:26] [Client thread/ERROR] [FML]: The following problems were captured during this phase
[17:22:26] [Client thread/ERROR] [FML]: Caught exception from generator
java.lang.ExceptionInInitializerError
at net.theepictekkit.generator.Generator.init(Generator.java:59) ~[bin/:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_11]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_11]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_11]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_11]
at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:513) ~[forgeSrc-1.7.10-10.13.0.1207.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_11]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_11]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_11]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_11]
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?]
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?]
at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:208) ~[forgeSrc-1.7.10-10.13.0.1207.jar:?]
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187) ~[forgeSrc-1.7.10-10.13.0.1207.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_11]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_11]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_11]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_11]
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?]
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?]
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118) [LoadController.class:?]
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:691) [Loader.class:?]
at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:288) [FMLClientHandler.class:?]
at net.minecraft.client.Minecraft.startGame(Minecraft.java:596) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:941) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:164) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_11]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_11]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_11]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_11]
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:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_11]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_11]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_11]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_11]
at GradleStart.bounce(GradleStart.java:107) [start/:?]
at GradleStart.startClient(GradleStart.java:100) [start/:?]
at GradleStart.main(GradleStart.java:55) [start/:?]
Caused by: java.lang.NullPointerException
at net.minecraftforge.fluids.FluidRegistry.getFluidID(FluidRegistry.java:119) ~[FluidRegistry.class:?]
at net.minecraftforge.fluids.Fluid.getID(Fluid.java:177) ~[Fluid.class:?]
at net.minecraftforge.fluids.FluidStack.<init>(FluidStack.java:27) ~[FluidStack.class:?]
at net.minecraftforge.fluids.BlockFluidClassic.<init>(BlockFluidClassic.java:28) ~[blockFluidClassic.class:?]
at net.theepictekkit.generator.common.fluids.BlockCreosoteOil.<init>(BlockCreosoteOil.java:16) ~[blockCreosoteOil.class:?]
at net.theepictekkit.generator.common.fluids.FluidHandler.<clinit>(FluidHandler.java:20) ~[FluidHandler.class:?]
... 45 more
---- Minecraft Crash Report ----
// Ouch. That hurt 

Time: 26/08/14 17:22
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:692)
at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:288)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:596)
at net.minecraft.client.Minecraft.run(Minecraft.java:941)
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:134)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
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 GradleStart.bounce(GradleStart.java:107)
at GradleStart.startClient(GradleStart.java:100)
at GradleStart.main(GradleStart.java:55)
Caused by: java.lang.ExceptionInInitializerError
at net.theepictekkit.generator.Generator.init(Generator.java:59)
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.initializeMods(Loader.java:691)
... 17 more
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.theepictekkit.generator.common.fluids.BlockCreosoteOil.<init>(BlockCreosoteOil.java:16)
at net.theepictekkit.generator.common.fluids.FluidHandler.<clinit>(FluidHandler.java:20)
... 45 more


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

-- System Details --
Details:
Minecraft Version: 1.7.10
Operating System: Windows 8.1 (amd64) version 6.3
Java Version: 1.8.0_11, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 1957361352 bytes (1866 MB) / 2130051072 bytes (2031 MB) up to 2130051072 bytes (2031 MB)
JVM Flags: 5 total; -Xincgc -Xmx1024M -Xms1024M -Xmx2g -Xms2g
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.25.1207 Minecraft Forge 10.13.0.1207 9 mods loaded, 9 mods active
mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized
FML{7.10.25.1207} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.0.1207.jar) Unloaded->Constructed->Pre-initialized->Initialized
Forge{10.13.0.1207} [Minecraft Forge] (forgeSrc-1.7.10-10.13.0.1207.jar) Unloaded->Constructed->Pre-initialized->Initialized
<CoFH ASM>{000} [CoFH ASM Data Initialization] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized
CoFHCore{1.7.10R3.0.0B3} [CoFH Core] (CoFHCore-[1.7.10]3.0.0B3-dev-26.jar) Unloaded->Constructed->Pre-initialized->Initialized
generator{Pre-Alpha 1.0} [Generator] (bin) Unloaded->Constructed->Pre-initialized->Errored
IC2{2.2.596-experimental} [industrialCraft 2] (industrialcraft-2-2.2.596-experimental-dev.jar) Unloaded->Constructed->Pre-initialized->Initialized
ThermalFoundation{1.7.10R1.0.0B1} [Thermal Foundation] (ThermalFoundation-[1.7.10]1.0.0B1-dev-6.jar) Unloaded->Constructed->Pre-initialized->Initialized
ThermalExpansion{1.7.10R4.0.0B3} [Thermal Expansion] (ThermalExpansion-[1.7.10]4.0.0B3-dev-11.jar) Unloaded->Constructed->Pre-initialized->Initialized
#@!@# Game crashed! Crash report saved to: #@!@# C:\Users\Administrator\Desktop\MC Mod Dev\Generator Dev Workspace 1.7.10\eclipse\.\crash-reports\crash-2014-08-26_17.22.26-client.txt
AL lib: (EE) alc_cleanup: 1 device not closed
Picked up _JAVA_OPTIONS: -Xmx2g -Xms2g
Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release

 

 

 

And this is my fluid handler class:

 

 

package net.theepictekkit.generator.common.fluids;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;

public class FluidHandler extends Block {

protected FluidHandler(Material mat) {
	super(mat);
}

//Fluid
public static Fluid fluidCreosoteOil = new FluidCreosoteOil("fluidcreosoteoil").setUnlocalizedName("fluidCreosoteOil");

//Fluid Block
public static Block blockCreosoteOil = new BlockCreosoteOil().setBlockName("creosoteOil");

public static void registerFluids(GameRegistry gameRegistry) {
	FluidRegistry.registerFluid(fluidCreosoteOil);

	GameRegistry.registerBlock(blockCreosoteOil, "blockCreosoteOil"); LanguageRegistry.addName(blockCreosoteOil, "Creosote Oil");
}

}

 

 

 

This is my block creosote oil class:

 

 

package net.theepictekkit.generator.common.fluids;

import net.minecraft.block.material.Material;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fluids.BlockFluidClassic;
import net.minecraftforge.fluids.Fluid;
import net.theepictekkit.generator.GeneratorCreativeTabs;
import net.theepictekkit.generator.Reference;

public class BlockCreosoteOil extends BlockFluidClassic {

private final String modid = Reference.MODID;

protected BlockCreosoteOil() {
	super(FluidHandler.fluidCreosoteOil, Material.water);
	this.setBlockTextureName(modid + ":" + this.getUnlocalizedName());
	this.setCreativeTab(GeneratorCreativeTabs.Generator);
}

@Override
public boolean canDisplace(IBlockAccess iblockAccess, int x, int y, int z) {
	if (iblockAccess.getBlock(x, y, z).getMaterial().isLiquid()) {
		return false;
	}
	return super.canDisplace(iblockAccess, 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);
}
}

 

 

 

And finally, this is my fluid creosote oil class:

 

 

package net.theepictekkit.generator.common.fluids;

import net.minecraftforge.fluids.Fluid;

public class FluidCreosoteOil extends Fluid {

public FluidCreosoteOil(String string) {
	super(string);
	this.setDensity(2000);
	this.setTemperature(22);
	this.setViscosity(2600);
	this.setGaseous(false);
}
}

 

 

 

 

I ask complicated questions, and apparently like to write really long detailed posts. But I also help others when I can.

Link to comment
Share on other sites

I have registered my fluid before the block...

FluidRegistry.registerFluid(fluidCreosoteOil);

GameRegistry.registerBlock(blockCreosoteOil, "blockCreosoteOil"); LanguageRegistry.addName(blockCreosoteOil, "Creosote Oil");

I ask complicated questions, and apparently like to write really long detailed posts. But I also help others when I can.

Link to comment
Share on other sites

Okay, I figured it out, I rearranged the code a little, it is now:

 

//Fluid
public static Fluid fluidCreosoteOil;

//Fluid Block
public static Block blockCreosoteOil;

public static void registerFluids(GameRegistry gameRegistry) {
	fluidCreosoteOil = new  FluidCreosoteOil("fluidcreosoteoil").setUnlocalizedName("fluidCreosoteOil");
	FluidRegistry.registerFluid(fluidCreosoteOil);

	blockCreosoteOil = new BlockCreosoteOil().setBlockName("creosoteOil");
	GameRegistry.registerBlock(blockCreosoteOil, "blockCreosoteOil"); LanguageRegistry.addName(blockCreosoteOil, "Creosote Oil");
}

And it works.

 

I ask complicated questions, and apparently like to write really long detailed posts. But I also help others when I can.

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.



×
×
  • Create New...

Important Information

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