Railcraft

Railcraft

34M Downloads

RC [10.0.1] Puring out creosote bottle crashes game when playing with Immersive Engineering [MC 1.10.2]

Cakx opened this issue ยท 10 comments

commented

Bug:

Spilling / Right clicking the ground with a creosote bottle in survival mode crashes the game to desktop when playing with Immersive Engineering.

Crashlog-MultiMC5.txt


Minecraft 1.10.2
Mods:

  • Forge 12.18.3.2254
  • Railcraft_1.10.2-10.0.1
  • ImmersiveEngineering-0.10-57
  • jei_1.10.2-3.14.7.416

Some minor details:
Without any other mods the Creosote Bottle and the Creosote Bucket are not spillable. Once you install Immersive Engeneering they become spillable. (Works fine in creative mode)
If you recollect the spilled Railcraft creosote using a empty bucket it becomes a "Forge Bucket" filled with forge registered creosote. So far so good but there shouldn't exist any Railcraft Creosote bucket in the first place.

Suggestion:
Make correct use of the forge fluid registry to unify creosote and make it interchangeable between mods.

As of now there are the forge buckets (e.g. Water, Lava, Creosote....) and then there is your creosote bucket using a different icon and not beeing correctly integrated into the fluid registry system.

There should only exist one creosote fluid / one bucket regardless of how many mods you've installed.

Keep up the great work.

commented

I didn't even think that this was enabled on my items.

commented

As i mentioned, they become spillable once i install immersive engeneering.
Your Bottle and Bucket are not spillable by default.

commented

main issue is creosote is not registered to forge fluid registry.

commented

I'm fairly certain this crash isn't because of the Creosote fluid added in Immersive Engineering and instead it's actually the container it's kept in.

The ItemBottle/ItemFluidContainer that Railcraft implements has methods to place fluids contained within the item in world which works just fine in Creative. The problem happens when the mod tries to find the Container item for Railcraft's Creosote Bottle. Near as I can tell Railcraft just returns null and calls it a day. If you override that method and instead return a glass bottle, the crash vanishes.

Short GIF of not crashing

commented

@mallrat208 The creosote bottle is supposed to be consumed in crafting... I support your idea though.

commented

@mallrat208 Item.getContainerItem()? I don't override that, why would I? It's just using the vanilla default. It doesn't and isn't supposed to have one.

commented

@CovertJaguar You don't override it, no, but you do invoke it.
https://github.com/CovertJaguar/Railcraft/blob/mc-1.10.2/src/main/java/mods/railcraft/common/fluids/ItemFluidContainer.java#L66-L67

Since the bottles only crash when you are in not* Creative, this is the most likely spot for there to be a problem. As a test I had setup a local version of Railcraft that had your ItemBottle return a Glass Bottle instead. Doing so eliminated the crash.

If the intentions of the bottle's are for transit/crafting item only you should probably override the default onItemRightClick it inherits from your ItemFluidContainer

*Apparently I a word early, sorry for the confusion.

commented

Ah...I see the issue now! Null is not a valid return value for that function.

commented

Whoops, I definitely thought I had typed not, I'm sorry about the confusion there.