VoltzEngine-Project / Engine

Minecraft modding core lib
Other
13 stars 11 forks source link

Added conversion for fluids #10

Open DarkGuardsman opened 9 years ago

DarkGuardsman commented 9 years ago

Seems that each mod has its own way of registering fluids. To get around this VoltzEngine should contain a way to auto convert fluids to the same name.

An example is TinkersConstruct which ends all of it's molten fluids with ".molten". Which works but not all mods follow this naming convention.

Blue64 commented 8 years ago

Also not all mods are capable of handling special characters or blank space

<fluid:life essence>
<fluid:iron.molten>

I believe IC2 attached a prefix for their fluids, this would make your mod's fluids stand out from the group

<fluid:VEiron>
<fluid:VEgold>
<fluid:VEcopper>

But may cause obvious readability issues. The Suffix option is also viable

<fluid:ironVE>
<fluid:goldVE>
<fluid:copperVE>

And is also easier to read, but it won't cluster your fluids together when they're sorted alphabetically.

Also, some mods purposefully register identical fluids (PneumaticCraft copied BuildCraft's <fluid:oil>), so it should be a toggleable function, because someone might be looking to do exactly that, but default it to unique names so people don't Derp.

DarkGuardsman commented 8 years ago

Thank you for the information but the idea is to reduce unique names. As each mod seems to have the idea that fluids name should be unique. When the system was created to ensure that fluids match each other. Example is that fluid:water always returns as water rather than fluid:waterIC2. Which would result in vanilla water not being compatible.

Blue64 commented 8 years ago

Add their containers to the standardized list. BuildCraft Oil returns BuildCraft Oil Buckets, and if PneumaticCraft is installed, PneumaticCraft Oil will return BuildCraft Oil Buckets too, and it will deploy BuildCraft Oil from a PneumaticCraft Oil Bucket.

DarkGuardsman commented 8 years ago

Since forge already stores a list of cotainers I will just need a list of fluids names to fluids. This way I can automaticly convert 3 or more fluid types to one fluid type.

Code example

/** Map of fluids to common name */
HashMap<String, List<Fluid>> fluidNameMap;
/** Map of fluids to fluids to auto convert too */
HashMap<Fluid, Fluid> conversionMap