-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from LQ1234/1.19
Update to 1.19
- Loading branch information
Showing
10 changed files
with
251 additions
and
234 deletions.
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
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
Binary file not shown.
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.2-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
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
34 changes: 34 additions & 0 deletions
34
src/main/java/net/Segovo/TrajectoryFabric/RenderUtils.java
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,34 @@ | ||
package net.Segovo.TrajectoryFabric; | ||
|
||
//shamelessly ripped from https://github.com/ate47/Xray/blob/fabric-1.19/src/main/java/fr/atesab/xray/utils/RenderUtils.java | ||
import net.minecraft.client.render.VertexConsumer; | ||
import net.minecraft.client.util.math.MatrixStack; | ||
import net.minecraft.util.math.Matrix3f; | ||
import net.minecraft.util.math.Matrix4f; | ||
import net.minecraft.util.math.Vec3f; | ||
|
||
public class RenderUtils { | ||
|
||
public static void renderSingleLine(MatrixStack stack, VertexConsumer buffer, float x1, float y1, float z1, | ||
float x2, float y2, | ||
float z2, float r, float g, float b, float a) { | ||
Vec3f normal = new Vec3f(x2 - x1, y2 - y1, z2 - z1); | ||
normal.normalize(); | ||
renderSingleLine(stack, buffer, x1, y1, z1, x2, y2, z2, r, g, b, a, normal.getX(), normal.getY(), | ||
normal.getZ()); | ||
} | ||
|
||
public static void renderSingleLine(MatrixStack stack, VertexConsumer buffer, float x1, float y1, float z1, | ||
float x2, float y2, | ||
float z2, float r, float g, float b, float a, float normalX, float normalY, float normalZ) { | ||
Matrix4f matrix4f = stack.peek().getPositionMatrix(); | ||
Matrix3f matrix3f = stack.peek().getNormalMatrix(); | ||
buffer.vertex(matrix4f, x1, y1, z1).color(r, g, b, a) | ||
.normal(matrix3f, normalX, normalY, normalZ).next(); | ||
buffer.vertex(matrix4f, x2, y2, z2).color(r, g, b, a) | ||
.normal(matrix3f, normalX, normalY, normalZ).next(); | ||
} | ||
|
||
private RenderUtils() { | ||
} | ||
} |
Oops, something went wrong.