mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-17 19:15:32 +00:00
New Decompiler Runtime Official mappings ItemStacks arnt Capability providers anymore, use Vanilla's system. Co-authored-by: RealMangoRage <[email protected]> Co-authored-by: Paint_Ninja <[email protected]>
32 lines
1.1 KiB
Diff
32 lines
1.1 KiB
Diff
--- a/com/mojang/math/Transformation.java
|
|
+++ b/com/mojang/math/Transformation.java
|
|
@@ -13,7 +_,7 @@
|
|
import org.joml.Quaternionf;
|
|
import org.joml.Vector3f;
|
|
|
|
-public final class Transformation {
|
|
+public final class Transformation implements net.minecraftforge.common.extensions.IForgeTransformation {
|
|
private final Matrix4f matrix;
|
|
public static final Codec<Transformation> CODEC = RecordCodecBuilder.create(
|
|
p_269604_ -> p_269604_.group(
|
|
@@ -169,5 +_,19 @@
|
|
vector3f1.lerp(p_175938_.getScale(), p_175939_);
|
|
quaternionf1.slerp(p_175938_.getRightRotation(), p_175939_);
|
|
return new Transformation(vector3f, quaternionf, vector3f1, quaternionf1);
|
|
+ }
|
|
+
|
|
+ private Matrix3f normalTransform = null;
|
|
+ public Matrix3f getNormalMatrix() {
|
|
+ checkNormalTransform();
|
|
+ return normalTransform;
|
|
+ }
|
|
+
|
|
+ private void checkNormalTransform() {
|
|
+ if (normalTransform == null) {
|
|
+ normalTransform = new Matrix3f(matrix);
|
|
+ normalTransform.invert();
|
|
+ normalTransform.transpose();
|
|
+ }
|
|
}
|
|
}
|