[1.16] Optionally add milk as a fluid to the vanilla bucket#7294
Conversation
1aa0e21 to
979a719
Compare
|
Updated to resolve conflicts with be58851 |
979a719 to
183c44e
Compare
|
Updated to resolve conflicts with c75eb9e |
6cf1e25 to
93ba03a
Compare
|
I give my permission for Forge and all associated to use the milk fluid textures I created as linked. |
93ba03a to
fc6e967
Compare
|
Updated for current Forge mappings on the main repo, and resolved conflicts with |
Fixes the previous broken code that was supposed to make mod registered milk returned by the vanilla bucket by allowing mods to enable a milk fluid.
fc6e967 to
757b80c
Compare
|
This seems fine to me - were we waiting on anything else? |
|
No, It's fluids so you and cpw are the only one that touch it. If it doesn't break things I don't care. |
|
Why is this PR a requirement? |
|
Minecraft's milk bucket doesn't handle the fluid properly without a registry replacement and multiple modders might need milk as a fluid so this way we fix unnecesary fluid conflicts and registry replacements. |
|
I approve and would have merged but the language changes need a local staging I cannot provide right now. |
Fixes the previous broken code that was supposed to make mod registered milk returned by the vanilla bucket by allowing mods to enable a milk fluid.
This pull request supersedes #6840, in order to fix #6769. After discussion on Discord, it was determined the best solution for mods to add milk as a fluid was for Forge to register the fluid, while mods just set a Forge flag to enable it, similar to the universal bucket back in 1.12
To enable Forge adding milk, you simply need to call
ForgeMod.enableMilkFluid()during mod construction. We can move this function to a different location if there is a better one, but this location kept the logic behind the flag clean.A few details on implementation:
minecraft:milkand alike rather than theforgenamespace for the fluids.forge:milkwas added containing the still and flowing milk like the vanilla water and lava tags. I am not sure if we want to add the tag to theminecraftnamespace instead for consistency with the fluid's namespace, but I know some mods are usingforge:milkfor compat right now so it probably is better to stick with that.I had to add a listener to the texture stitch event to ensure fluid textures are registered (KingLemming can give more details on why that is required). I am not sure if there is a better place than a client event listener subclass ofForgeMod, but I can say it does not cause issues when launching a server there.Included in this PR is
ForgeMilkTestthat will enable the Forge milk fluid and cause a milk bucket to display the name of the contained fluid on right click. You can enable the test mod using the booleanENABLEflag.Finally, credits to Rorax for the textures for the milk fluid. Used for this PR with permission.