-
Notifications
You must be signed in to change notification settings - Fork 284
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
idea: let draw_shape can use players sight local coordinate, so that it can be used to create HUD easilier. #1854
Draft
ch-yx
wants to merge
21
commits into
gnembon:master
Choose a base branch
from
ch-yx:patch-9
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 18 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
ba63e2e
Update ShapesRenderer.java
ch-yx d5b2792
Update ShapesRenderer.java
ch-yx 653b8c6
Merge branch 'patch-9' of https://github.com/ch-yx/fabric-carpet into…
ch-yx fe97dd2
emmmmm
ch-yx 9acf092
Update ShapesRenderer.java
ch-yx db5aa8b
Update ShapesRenderer.java
ch-yx 2b0694f
remove unnecessary part
ch-yx 20dee00
Merge branch 'master' into patch-9
ch-yx 5594597
Update ShapesRenderer.java
ch-yx 2b8b14c
fix---half
ch-yx ee6f7fd
looks fine now?
ch-yx 892946c
Update ShapesRenderer.java
ch-yx b939c34
Merge remote-tracking branch 'upstream/master' into patch-9
ch-yx 0676d77
update
ch-yx f6d701e
Update ShapesRenderer.java
ch-yx 792bd63
rewrite a mixin
ch-yx 6aa97ce
Merge remote-tracking branch 'upstream/master' into patch-9
ch-yx 0d043c8
?
ch-yx 6e686af
Merge remote-tracking branch 'upstream/master' into patch-9
ch-yx 73f4857
Merge remote-tracking branch 'upstream/master' into patch-9
ch-yx d769ebe
update
ch-yx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package carpet.mixins; | ||
|
||
import carpet.script.utils.ShapesRenderer; | ||
import net.minecraft.client.renderer.block.LiquidBlockRenderer; | ||
import org.joml.Vector4f; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.ModifyArgs; | ||
import org.spongepowered.asm.mixin.injection.invoke.arg.Args; | ||
|
||
@Mixin(LiquidBlockRenderer.class) | ||
public abstract class FluidRenderingMixin { | ||
@ModifyArgs(method = "vertex", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/vertex/VertexConsumer;addVertex(FFF)Lcom/mojang/blaze3d/vertex/VertexConsumer;")) | ||
private void injected(Args args) { | ||
var pair = ShapesRenderer.DrawingShape.get(); | ||
if (pair == null) return; | ||
float f = args.get(0); | ||
float g = args.get(1); | ||
float h = args.get(2); | ||
int x = pair.getSecond().getX() & 0xf; | ||
int y = pair.getSecond().getY() & 0xf; | ||
int z = pair.getSecond().getZ() & 0xf; | ||
var vec = new Vector4f(f - x, g - y, h - z, 1); | ||
pair.getFirst().pose().transform(vec); | ||
args.set(0, vec.x); | ||
args.set(1, vec.y); | ||
args.set(2, vec.z); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
not sure if this line of code is written correctly