mirror of
https://github.com/GTNewHorizons/Angelica.git
synced 2026-11-21 04:42:17 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f7a79cf02f |
No files matched your search
@@ -26,7 +26,7 @@ public enum Mixins {
|
||||
ANGELICA(new Builder("Angelica").addTargetedMod(TargetedMod.VANILLA).setSide(Side.CLIENT)
|
||||
.setPhase(Phase.EARLY).addMixinClasses(
|
||||
"angelica.MixinEntityRenderer"
|
||||
|
||||
,"angelica.MixinActiveRenderInfo"
|
||||
)
|
||||
),
|
||||
|
||||
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.gtnewhorizons.angelica.mixins.early.angelica;
|
||||
|
||||
import com.gtnewhorizons.angelica.rendering.RenderingState;
|
||||
import net.minecraft.client.renderer.ActiveRenderInfo;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import java.nio.FloatBuffer;
|
||||
|
||||
@Mixin(ActiveRenderInfo.class)
|
||||
public class MixinActiveRenderInfo {
|
||||
@Shadow private static FloatBuffer modelview;
|
||||
@Shadow private static FloatBuffer projection;
|
||||
@Inject(method = "updateRenderInfo", at = @At(value = "TAIL"))
|
||||
private static void angelica$onUpdateRenderInfo(CallbackInfo ci) {
|
||||
RenderingState.INSTANCE.setProjectionMatrix(projection);
|
||||
RenderingState.INSTANCE.setModelViewMatrix(modelview);
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -21,8 +21,8 @@ public abstract class MixinEntityRenderer {
|
||||
viewEntity.lastTickPosY + (viewEntity.posY - viewEntity.lastTickPosY) * partialTicks,
|
||||
viewEntity.lastTickPosZ + (viewEntity.posZ - viewEntity.lastTickPosZ) * partialTicks
|
||||
);
|
||||
RenderingState.INSTANCE.captureProjectionMatrix();
|
||||
RenderingState.INSTANCE.captureModelViewMatrix();
|
||||
// RenderingState.INSTANCE.captureProjectionMatrix();
|
||||
// RenderingState.INSTANCE.captureModelViewMatrix();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -39,4 +39,13 @@ public class RenderingState {
|
||||
modelViewMatrix.set(modelViewBuffer);
|
||||
}
|
||||
|
||||
public void setProjectionMatrix(FloatBuffer projection) {
|
||||
projectionMatrix.set(projection);
|
||||
projectionMatrix.get(0, projectionBuffer);
|
||||
}
|
||||
|
||||
public void setModelViewMatrix(FloatBuffer modelview) {
|
||||
modelViewMatrix.set(modelview);
|
||||
modelViewMatrix.get(0, modelViewBuffer);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user