Repository navigation
Conversation
|
pupnewfster
left a comment
There was a problem hiding this comment.
Few misc comments, I didn't pay too close attention to the removed rejects to make sure that they are equivalent/have corresponding hooks. But the initial pass seems decent (though there are various methods that we might end up wanting to rename/make closer to mojmap instead of their old naming scheme.
Additionally a solution is needed for applying non-default values of the "extended properties" to vanilla fluids (see commented-out FluidType registration in NeoForgeMod).
I think one potential way to do this would be in FluidPropertiesExtension add a method(s) similar to applyExtendedWaterProperties (or just something that takes an enum of water, lava, empty (assuming we don't default things to being empty at which point we could just have it be a boolean for water or lava), and then have that method handle adding all of the extra states. Then in Fluids we could just patch in two (or three lines if empty is also needed) to call that method at the tail end of property construction. The ones for water and lava wouldn't even need any removal hunks due to how the formatting is.
b03d0d6 to
25622ca
Compare
|
This is a list of all fluid extensions and fluid-related entity/livingentity extensions we currently have (names and parameters adjusted to take the removal of
|
I override this to copy across the |
|
For cases you ask if they can be replaced by a fluid tag, do you mean a tag in the neo namespace that has logic attached? If so I think in general they likely can, but we need to keep in mind cases where the checks are on the client as well, and a neo client connects to a vanilla server that doesn't then provide the tag to the client. Also I feel like a good number of the extensions for
|
I have an entity type sensitive drowning in one of my mods (don't want slimes to drown in liquid slime).
Temperature and lighter than air both fall into the case of "why does Neo add these properties with no description of what they mean?". They aren't used anywhere in its patches, I think they are legacy stuff from 1.12 if not earlier. Should be removed and people can bring them back via tag or datamap if they need them.
Should likely be a data component on the fluid/fluid stack like how items do it, though I suppose fluids lack a default components map, don't they?
Copying components from the fluid stack to the fluid item. For example, we use it to copy from our potion fluid type into a potion bucket.
Fluid components that change fluid state properties. Though more than likely you will want those components on a block entity instead; are fluid block entities a thing? |
Yes, they would be a "logic" tag in the Neo namespace. I didn't check yet whether the suggested places are server-only but we definitely need to be careful there.
I don't think this can easily be handled my
I really don't see the use case of level-sensitive getters for these properties (ignoring that the latter three are pretty much completely useless anyway outside of
This is currently defined as a non-positive density and, while the terrain fluid renderer doesn't support it, it's used by various mods to visually flip fluid rendering in containers and tanks or switch their rendering from a height-based to opacity-based (Mekanism does as well).
Should we restrict it to water or should the attribute apply to any swimmable fluid?
This also applies the swim speed attribute. How should we treat this, including with respect to the question above?
For temperature, viscosity and density I would agree (the first two are basically completely undefined, the last one is only defined by what positive vs. non-positive values mean) and I'm not opposed to remove them, for "lighter than air" I disagree as it's very well defined what this means and, as mentioned above, is widely used.
Fluids don't have a component initializer and adding one is non-trivial as it would require the
I'm not sure how useful this is considering practically nothing actually uses this method instead of |
Fair. Its perhaps more accurate with that to say its been a bit broken for awhile as the renderer and flow logic doesn't support it. Switching it to a tag is probably fine since I recall that actual reverse gravity fluids were considered out of scope for neo. |
|
It's not necessarily out of scope, the patch surface is just completely absurd. Last time I checked (which, to be fair, was about 3 years ago, sometime during the 1.20s), the renderer patch would have contained practically the entire class. I wouldn't be surprised if patching the propagation logic was nowhere near as bad |
I think we should let it apply to any swimmable fluid.
|
It allows a fluid to opt out of pushing the entity in its flow direction (i.e. an entity standing in a low-density gas probably shouldn't be affected by the fluid) |
|
I have taken the executive decision to make "is lighter than air" a The remaining rejects as well as me not wanting to re-introduce the absurdly broad "is water-like" flag bring up a few remaining questions about what to base these on instead of exact water checks:
|
|
I make use of the temperature properties of fluids in Mekanism. I don't necessarily need the per position variant to remain, but ideally this is something that will keep being exposed. |
|
In my experience, no one is providing a useful value for temperature as no one knows what it's meant to do. Tinkers uses temperature but almost exclusively it's set via JSON instead of grabbing it from the fluid instance so modpacks can set it to useful values. If you need temperature, I'd recommend a data map for it. Neo could provide that datamaps, but IMO it slmore logical to tie the datamaps to the application of temperature as it's weird that tinkers melting and casting is tied to the same thing as whatever mechanism uses temperature for, seems like those should be separate. |
|
I am not opposed to a datamap for temperature, but it is relatively defined if it is for real world substances as it is the temperature in kelvin which is what it says. Yes it might not be well defined for arbitrary made up substances, but it still is decent for getting a general sense of temperature |
| + if (this.mob.getFluidInteraction().isEyeInFluidMatching(this.mob, (_, type, _) -> type.getIsWaterLike())) { | ||
| this.mob.setDeltaMovement(this.mob.getDeltaMovement().add(0.0, 0.005, 0.0)); | ||
| + // Neo: allow movement in any floatable fluid | ||
| + if (this.mob.isEyeInFluid(FluidTags.ENTITY_FLOATABLE)) { |
There was a problem hiding this comment.
This patch feels logically wrong... Especially without a corresponding mojira issue.
There was a problem hiding this comment.
The thought process was that other swimming entities check this tag via the Swim goal (fish use the PathType instead). I can change it to a custom tag, though I also wouldn't be opposed to reverting it for now considering fish can only spawn in water-tagged fluids.
| FluidState fluidState = this.level().getFluidState(pos); | ||
| - if (fluidState.is(FluidTags.WATER)) { | ||
| + if (this.canBoatInFluid(fluidState)) { | ||
| + if (this.canBoatInFluid(fluidState.typeHolder())) { |
There was a problem hiding this comment.
Should we just provide the entire fluid state (or TypedInstance<Fluid> to canBoatInFluid rather than having to call typeHolder in all these places?
There was a problem hiding this comment.
The predicate in AbstractBoat#canAddPassenger() does not have access to the full FluidState
| boolean colliding = !this.level().noCollision(this.getBoundingBox()); | ||
| - if (this.isEyeInFluid(FluidTags.WATER)) { | ||
| + // Neo: allow movement in any floatable fluid | ||
| + if (this.isEyeInFluid(FluidTags.ENTITY_FLOATABLE)) { |
There was a problem hiding this comment.
This feels off similar to the change to fish, we can have our own tag potentially, that includes water by default, but this is a logical change to vanilla behavior for if lava gets added to the floatable tag
There was a problem hiding this comment.
Similar thought process to the fish patch, though this one can't use a custom tag because it runs on both sides.
|
I'd argue even things with an real world temperature don't consistently get that set. I'm just not convinced Neo can get modders to set a useful value without info on how it's used. But I suppose if it's a datamap then at least you can fix mods that don't set it well. |
137f580 to
9c35dfa
Compare
This PR removes
FluidTypeand moves its hooks toFluidas the former is no longer needed for its original purpose of combining the still and flowing variants of a given fluid.The first commit moves over (almost) all extensions and removes
FluidTypeitself. Further work is needed to reimplement the callsites of these hooks.Additionally a solution is needed for applying non-default values of the "extended properties" to vanilla fluids (see commented-out
FluidTyperegistration inNeoForgeMod).