Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Minecraft Forge
  • Suggestions
  • Proper Fluid Handling
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 0
ChampionAsh5357

Proper Fluid Handling

By ChampionAsh5357, December 29, 2020 in Suggestions

  • Reply to this topic
  • Start new topic

Recommended Posts

ChampionAsh5357    160

ChampionAsh5357

ChampionAsh5357    160

  • World Shaper
  • ChampionAsh5357
  • Members
  • 160
  • 1017 posts
Posted December 29, 2020

We currently have the ability to add fluids to all entities, but no real system to handle the fluid itself. Specifically, I will be talking about the associated physics as the client side effects are simply just fluid checks with events. The relevant common code effects can also be matched using the many provided events added by Forge. There are a few places where relevant tagged data would need to be check for custom fluid handling, but its less important for the purposes of this post.

 

To make a minimum viable fluid with unique physics, one must apply two methods provided within the entity: Entity#handleFluidAcceleration which does exactly what it says and Entity#func_233571_b_ which grabs where the entities eyes are within the fluid level. Both of these are used in different places. The first is used within the entity tick via Entity#func_233566_aG_.  The second is used to determine if the user might be jumping off the ground within a fluid, moving through fluid, swimming in fluid, etc.

 

Exposing this would result in some class object or registry that would store the associated fluid tag, a function given the entity and returning the acceleration, a consumer containing the entity if the fluid acceleration returns true to update a specific state. The fluid code would also need to be patched within LivingEntity#livingTick to check the tags for the correct fluid the entity is in when jumping and whether or not entities can swim within it.

 

I want to discuss what would be the optimal way of storing and handling these instances. Creating an event is out of the question as its unnecessary ticks for a portion of the code that can be handled with a registry. It would also be good to consider fluids in some sort of dynamic context where existing hardcoded traits could be genericized in some fashion. However, most of this code dances in the realm of tags, so there would need to be some discussion on how to handle and comply with Forge's stance on tags.

  • Quote

Share this post


Link to post
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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 0
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Klarks
      [1.16.4] How i can open a container by clicking on my mob

      By Klarks · Posted 8 minutes ago

      I don't understand. Where i should have container factory
    • Johnkakminecraft
      Mod Code Not Detecting Correct Version

      By Johnkakminecraft · Posted 1 hour ago

      Thank you so much. Don't know how I missed this.
    • DaemonUmbra
      Mod Code Not Detecting Correct Version

      By DaemonUmbra · Posted 2 hours ago

      https://paste.gg/p/anonymous/47eb336f970d400bb9f707d7aed7c776#pastefile1-l30 That's not a valid mod ID
    • DaemonUmbra
      tinkers crashing server

      By DaemonUmbra · Posted 2 hours ago

      1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
    • DaemonUmbra
      Forge Server Error

      By DaemonUmbra · Posted 2 hours ago

      Please provide the installer log. It will be named the same as the installer but with .log on the end: Installer: forge-<mc_version>-<forge_version>-installer.jar Log: forge-<mc_version>-<forge_version>-installer.jar.log   Note: Windows hides file extensions by default, so unless you have set it to show file extensions it may show as below: Installer: forge-<mc_version>-<forge_version>-installer Log: forge-<mc_version>-<forge_version>-installer.jar
  • Topics

    • Klarks
      30
      [1.16.4] How i can open a container by clicking on my mob

      By Klarks
      Started Saturday at 09:56 PM

    • Johnkakminecraft
      6
      Mod Code Not Detecting Correct Version

      By Johnkakminecraft
      Started 4 hours ago

    • cammoschetti
      1
      tinkers crashing server

      By cammoschetti
      Started 2 hours ago

    • Darkbarracuda541
      1
      Forge Server Error

      By Darkbarracuda541
      Started 3 hours ago

    • Xenfo
      3
      Mod Blocker

      By Xenfo
      Started 9 hours ago

  • Who's Online (See full list)

    • zen6773
    • ChampionAsh5357
    • FreshMod
    • BGames
    • Insanity_Alice
    • Klarks
    • Will11690
    • Cheezy Amuzus
    • TeuFox
    • Moon2288
  • All Activity
  • Home
  • Minecraft Forge
  • Suggestions
  • Proper Fluid Handling
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community