Jump to content

Bucket for Custom Fluid Support [SOLVED]


calebty1

Recommended Posts

Hi all, I have recently started becoming a minecraft modder, and I have the basics down. Adding items and all that stuff. I recently moved into adding custom fluids which I was able to achieve. I am stuck on adding a bucket that can pick up and place my fluid. I have followed the tutorial provided by MinecraftForge, but it still doesn't work. I also went as far as referencing from the BuildCraft code. I'm pretty sure I am overlooking something small, but can't figure out what it is. I have already debugged enough NPEs to know where to start, but I am not sure what is causing this one. I have taken a look at the FluidRegistry and Fluid stuff with Minecraft Forge.

 

The source files can be found here:

https://github.com/calebty1/Caleb-Mod-G2G

 

The Crash Report:

---- Minecraft Crash Report ----
// Everything's going to plan. No, really, that was supposed to happen.

Time: 5/26/14 6:55 PM
Description: Initializing game

java.lang.RuntimeException: Invalid FluidContainerData - a parameter was null.
at net.minecraftforge.fluids.FluidContainerRegistry$FluidContainerData.<init>(FluidContainerRegistry.java:303)
at net.minecraftforge.fluids.FluidContainerRegistry$FluidContainerData.<init>(FluidContainerRegistry.java:292)
at net.minecraftforge.fluids.FluidContainerRegistry.registerFluidContainer(FluidContainerRegistry.java:103)
at calebty1.random.common.TutorialMod.load(TutorialMod.java:96)
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: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:500)
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)


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

-- Head --
Stacktrace:
at net.minecraftforge.fluids.FluidContainerRegistry$FluidContainerData.<init>(FluidContainerRegistry.java:303)
at net.minecraftforge.fluids.FluidContainerRegistry$FluidContainerData.<init>(FluidContainerRegistry.java:292)
at net.minecraftforge.fluids.FluidContainerRegistry.registerFluidContainer(FluidContainerRegistry.java:103)
at calebty1.random.common.TutorialMod.load(TutorialMod.java:96)
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: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:500)
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_55, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 867308408 bytes (827 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.1060 Minecraft Forge 10.12.1.1060 4 mods loaded, 4 mods active
mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized
FML{7.2.156.1060} [Forge Mod Loader] (forgeSrc-1.7.2-10.12.1.1060.jar) Unloaded->Constructed->Pre-initialized
Forge{10.12.1.1060} [Minecraft Forge] (forgeSrc-1.7.2-10.12.1.1060.jar) Unloaded->Constructed->Pre-initialized
TutorialMod{1.0.5 ALPHA} [TutorialMod] (bin) Unloaded->Constructed->Errored
Launched Version: 1.6
LWJGL: 2.9.0
OpenGL: GeForce GTX 550 Ti/PCIe/SSE2 GL version 4.4.0, NVIDIA Corporation
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)</script>

 

Like I said I know exactly where it's coming from, but I don't quite know why it's returning null. Something with this line perhaps?:

        if (!fluidIDs.containsKey(fluidName))
        {
            return null;
        }

Anyways, I will leave it up to you to try and figure out. Thanks :).

Link to comment
Share on other sites

It's a matter of case in FLuid names. They are internally converted to lower case. That cannot be found by GetFluidStack except in lower case. So, you get a null for the fuild.

 

There should be some documentation about that, as it is a very common crash.

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Recently started to attempt 1.20.1 modding, in registering idle, walk and attack animations in the mob entity class i've run into two issues:   a) idle and walk animations seem to play simultaneously  + the mob itself does not seem to walk private static final EntityDataAccessor<Boolean> ATTACKING = SynchedEntityData.defineId(MugaEntity.class, EntityDataSerializers.BOOLEAN); public MugaEntity(EntityType<? extends Monster > pEntityType, Level pLevel) { super(pEntityType, pLevel); } public final AnimationState idleAnimationState = new AnimationState(); private int idleAnimationTimeout = 1; public final AnimationState attackAnimationState = new AnimationState(); public int attackAnimationTimeout = 0; @Override public void tick() { super.tick(); if(this.level().isClientSide()) { setupAnimationStates(); } } private void setupAnimationStates () { if(this.idleAnimationTimeout <= 0) { this.idleAnimationTimeout = this.random.nextInt(30) + 60; this.idleAnimationState.start(this.tickCount); } else { --this.idleAnimationTimeout; } if (this.isAttacking() && attackAnimationTimeout <= 0 ) { attackAnimationTimeout = 20; attackAnimationState.start(this.tickCount); } else { --this.attackAnimationTimeout; } if(this.isAttacking()) { attackAnimationState.stop(); } } @Override protected void updateWalkAnimation(float pPartialTick) { float f; if(this.getPose() == Pose.STANDING) { f=Math.min(pPartialTick * 3.0F, 1.0F); } else { f= 0.0F; } this.walkAnimation.update(f, 0.2F); } @Override protected void defineSynchedData() { super.defineSynchedData(); this.entityData.define(ATTACKING, false); } public void setAttacking(boolean attacking) { this.entityData.set(ATTACKING, attacking); } public boolean isAttacking() { return this.entityData.get(ATTACKING); } b) the attack animation is never played on attack, despite being registered  @Override public void setupAnim(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) { this.root().getAllParts().forEach(ModelPart::resetPose); this.animateWalk(ModAnimationDefinitions.MUGA_WALKING, limbSwing, limbSwingAmount, 1f, 1f ); this.animate(((MugaEntity)entity).idleAnimationState, ModAnimationDefinitions.MUGA_IDLE, ageInTicks, 1f); this.animate(((MugaEntity)entity).attackAnimationState, ModAnimationDefinitions.MUGA_ATTACK, ageInTicks, 1f); }
    • Maybe there are some more broken files - check the new crash-report - the file name is mentioned in the first lines   If it is another crash, add it here
    • Thanks. Found and deleted it, but it doesn't change anything. When joining a new file is created, the screen freezes/ does not respond in typical manner and I have to close it then. I deleted it in curseforge>minecraft>instances>Modpack>saves>World>serverconfig Should I have deleted it anywhere else?
    • Do you still need help?
  • Topics

×
×
  • Create New...

Important Information

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