-
-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fluid should decide if FluidStacks (Components) can merge #1577
Comments
The FluidStacks are modeled after ItemStacks, which do not have such a feature. |
@Technici4n lazy argument since everything about storage is 100% different. On top of that fluid mixing makes a lot more sense than Item Mixing. (Edit: This answer assumes that your answer means: "This is why it shouldn't be done", if it is a answer for: "Why it hasn't been done" then I am sorry.) |
Anyways, I would suggest that this is at least seriously considered, because it would be sad if this feature gets unused (the components). |
They do. |
@HenryLoenwind what i am suggesting is that the Fluid itself, not the components, can validate if 2 FluidStacks (based on its Components) can merge. But if you wanted to as a fluid owner you could override it. The whole point is, Forge has a Component System for fluids like ItemStacks, but all Containers out there really only support 1 Fluid. And i don't remember neo/forge providing a multitank implementation last i remembered. Since there is an obvious difference between fluids/items, i am asking to consider giving the fluids a bit more creative freedom. |
I'm not personally convinced by the dye fluid usecase, that sounds to me like a case that should be handled by a mixer block that combines two fluids rather than just expected for every storage tank. This is partly because fluid tanks are typically not being filled by whole stacks at once, they are being filled based on the transfer rate, meaning such a system would have to guarantee I think its reasonable to be able to have a fluid ignore some data components when merging at a conceptual level, though I cannot think of any example usecases of that. I could see an argument for a system that allows fluids to merge with other fluid types entirely, such as for merging "equivalent" fluids from a tag, though I am not sure that is what you had in mind with this system. I find the idea of two fluids merging and leaving behind something that matches neither a bit problematic though; thats just forcing crafting recipes on storage blocks. |
This is for the Owner of said fluid to decide how that is handled. The idea is that the dev gets full control on how things are merged with their own fluid. So saying: "This edge case may appear and cause issues" would only result in the mod that uses the feature having to deal with it.
The main reason nobody really does it is, because its extremely incompatible with mods and causes a lot of "Why isn't this tank supporting it" issues on everyones side. It had a system where you would get like 3 different metadata values into the fluid and they would mix together/get consumed individually based on what you did with it. This functionality was sadly limited to its tanks and was 100% incompatible with any other mod. So that mods that went this creative actually are usable outside of their own ecosystem. |
The idea of fluids merging to create something different than they had originally being the default behavior of fluids in storage seems inherently unintuitive and a bit destructive to me. The idea is interesting, but its something that should be implemented as part of a recipe system like Tinkers alloy mixing, not as part of the default behavior of storage. In general I think that a player should reasonably be able to take something and store it without it being influenced by something. Thats consistent with the principal that things in chests are in a kind of stasis. They dont age or tick if they're inside a chest. Of course, you can change this with modded, but this is usually expressed to the user in some way, and the player chooses to do it or is aware this behavior has changed. This would inherently change the behavior of all storage to be mixing containers. They're no longer storage, but a mechanism for transforming liquids, in the same vein that a furnace is a mechanism for transforming items. Which shouldnt be the expected behavior for all storage. I could see a situation where perhaps there are components that are ignored when 2 things are merged, but yeah just having a straightup |
No, I have no desire to do that with my fluids. If I want to merge two fluids, I would use a recipe block to merge two fluids. If I have two fluids with different NBT, I assume they are different. I agree that a mod has wanted this feature before, but I don't see a usecase for this outside of that mod, and I also find that mods fluids merging questionable in my mods; it would be very incompatible with the concept of multi-tanks as a whole. Please, lets not merge two fluids into a fluid that is neither; I'd honestly rather not merge fluids at all as part of the transfer API. That is just going to make my life as a person who does multi-tanks way more difficult so a single mod can be more compatible with breaking tank assumptions. |
But if you use the default implementation it should support merging, because the default is a single type tank.
And? The default behavior would be what you want. It would be an Opt In system. The whole point is: If a mod would want to do that they have the ability to. Oh i just realized, with this suggestion max fluid sizes would also be possible... |
This would be an awful way to implement max fluid sizes. You have no context about how large the container its being held in is for the fluid to determine the max size, and the container itself isnt given enough information to know how to scale how much of that fluid can be stored in that slot.
This shouldn't be how mods implement this feature. This should be done via a data driven recipe system, not as part of the standard fluid api |
You said people "want to do this but can't". I was refuting that by saying, no, I don't want to do this. Its "extremely incompatible with mods and causes a lot of "Why isn't this tank supporting it" issues on everyones side", as you said, and even with this change its still an extra burden to support, all for a feature I see no usecase for. Just make an alloyer block like Tinkers has, served us well since 1.6.4. |
Fluids have components that allow additional data.
The main issue with that is usually that a Tank has 1 fluidtype limit. Yes there are alternatives but even these usually are with restrictions or self implementations.
The question is: Why do these components exist in the first place? (not a serious question)
One thing I realized is: If i want to implement fluids with custom components then Compat is going to suck with other mods because I have to expect that tanks support my implementation.
So the thought came:
What if Fluids have a function that is named:
public boolean canFluidsMerge(FluidStack self, FluidStack other)
andpublic FluidStack mergeFluids(FluidStack self, FluidStack other)
?This assumes the Fluid (type) itself are the same. If the fluids without components don't match then the thing gets thrown out of the window.
This would increase compat with fluids drastically and also allow mods to actually make use of such a functionality.
I only ever remember one 1 mod ever using this feature.
And I am pretty sure it was the mod with red obsidian that used it... Don't know the name, but it was on ForgeCraft server.
Anyways It is a thought that came to mind.
The text was updated successfully, but these errors were encountered: