-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
Create a Fluid Flow API #74
base: 1.20
Are you sure you want to change the base?
Conversation
library/fluid/fluid-flow/src/testmod/java/org/quiltmc/qsl/fluidflow/FluidFlowEventTests.java
Outdated
Show resolved
Hide resolved
library/fluid/fluid-flow/src/main/java/org/quiltmc/qsl/fluidflow/api/FluidFlowEvents.java
Outdated
Show resolved
Hide resolved
# Conflicts: # settings.gradle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if it's useful to get an event depending on the direction?
Especially if you iterate through every directions anyway.
library/fluid/fluid_flow/src/main/java/org/quiltmc/qsl/fluid/flow/api/FluidFlowEvents.java
Outdated
Show resolved
Hide resolved
library/fluid/fluid_flow/src/main/java/org/quiltmc/qsl/fluid/flow/api/FluidFlowEvents.java
Outdated
Show resolved
Hide resolved
library/fluid/fluid_flow/src/main/java/org/quiltmc/qsl/fluid/flow/api/FluidFlowEvents.java
Outdated
Show resolved
Hide resolved
library/fluid/fluid_flow/src/main/java/org/quiltmc/qsl/fluid/flow/api/FluidFlowEvents.java
Outdated
Show resolved
Hide resolved
Co-authored-by: LambdAurora <[email protected]>
Thats a good point, ill have the direction be a parameter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So far, the PR looks good; Just apply these tiny changes and all will be fine
library/fluid/fluid_flow/src/main/resources/quilt_fluid_flow.mixins.json
Outdated
Show resolved
Hide resolved
library/fluid/fluid_flow/src/main/java/org/quiltmc/qsl/fluid/flow/mixin/FluidBlockMixin.java
Outdated
Show resolved
Hide resolved
library/fluid/fluid_flow/src/main/java/org/quiltmc/qsl/fluid/flow/api/FluidFlowEvents.java
Outdated
Show resolved
Hide resolved
library/fluid/fluid_flow/src/main/java/org/quiltmc/qsl/fluid/flow/api/FluidFlowEvents.java
Outdated
Show resolved
Hide resolved
library/fluid/fluid_flow/src/main/resources/quilt_fluid_flow.mixins.json
Outdated
Show resolved
Hide resolved
Co-authored-by: Ennui Langeweile <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just realized that the onFlow event's parameter names might be a bit too verbose? but yeah, I can't think of any alternative shorter names that didn't sacrifice readability; Oh well
Here's the Ennui's Stamp of Approval
This needs to be updated to newest code + maybe can be made into an REA? |
This can't easily be made into a REA, but yeah I can update it. |
And by easily I mean it shouldn't. It's an event, not a property because there are too many variables |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still have no objections, however, here's a few nitpicks; Consider the general PR approved though
library/fluid/fluid_flow/src/main/java/org/quiltmc/qsl/fluid/flow/api/FluidFlowEvents.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Ennui Langeweile <[email protected]>
library/fluid/fluid_flow/src/main/java/org/quiltmc/qsl/fluid/flow/api/FluidFlowEvents.java
Outdated
Show resolved
Hide resolved
…low/api/FluidFlowEvents.java
* @param interactionBlock the block it interacts with | ||
* @return an event if the conditions are met, otherwise {@code null} | ||
*/ | ||
public static @Nullable Event<FluidFlowInteractionCallback> getEvent(Block flowingBlock, Block interactionBlock) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have a standardization on whether @Nullable
goes here or on the whole method declaration?
return null; | ||
} | ||
|
||
public interface FluidFlowInteractionCallback { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public interface FluidFlowInteractionCallback { | |
@FunctionalInterface | |
public interface FluidFlowInteractionCallback { |
library/fluid/fluid_flow/src/main/java/org/quiltmc/qsl/fluid/flow/api/FluidFlowEvents.java
Show resolved
Hide resolved
# Conflicts: # settings.gradle
This copies from https://github.com/FabricMC/fabric/pulls/1402, however, as I am the authors of said PRs, I allow my code to be added to QSL.
The testmod is a good example of how to add a new fluid flow event.
Questions to be asked:
Before this is merged, I would like to merge in a game test api to ensure vanilla behavior remains and to have a more effective test than currently having to go into a world to view the change.