Port to MC 1.19.3

Building against 1.19.3-rc3 for now because 1.19.3 has yet to release.
ReplayStudio/ViaVersion is already targeting the release version though.
This commit is contained in:
Jonas Herzig
2022-12-06 17:58:52 +01:00
parent e8ea70aabc
commit d571e8fed5
19 changed files with 440 additions and 58 deletions

View File

@@ -10,12 +10,22 @@ import org.spongepowered.asm.mixin.injection.ModifyArg;
@Mixin(GameRenderer.class)
public abstract class Mixin_Omnidirectional_Camera implements EntityRendererHandler.IEntityRenderer {
private static final String METHOD = "getBasicProjectionMatrix";
//#if MC>=11903
//$$ private static final String TARGET = "Lorg/joml/Matrix4f;setPerspective(FFFF)Lorg/joml/Matrix4f;";
//$$ private static final boolean TARGET_REMAP = false;
//$$ private static final float OMNIDIRECTIONAL_FOV = (float) Math.PI / 2;
//#else
private static final String TARGET = "Lnet/minecraft/util/math/Matrix4f;viewboxMatrix(DFFF)Lnet/minecraft/util/math/Matrix4f;";
private static final boolean TARGET_REMAP = true;
private static final float OMNIDIRECTIONAL_FOV = 90;
//#endif
@ModifyArg(method = METHOD, at = @At(value = "INVOKE", target = TARGET, remap = TARGET_REMAP), index = 0)
//#if MC>=11903
//$$ private float replayModRender_perspective_fov(float fovY) {
//#else
private double replayModRender_perspective_fov(double fovY) {
//#endif
return isOmnidirectional() ? OMNIDIRECTIONAL_FOV : fovY;
}