mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-18 19:39:22 +00:00
Minecraft is now Unobfuscated and requires Java 25 Lots of changes/code cleanup. See https://github.com/MinecraftForge/MinecraftForge-Experimental/tree/26.1-dev for non-squashed commits. Co-authored-by: Paint_Ninja <[email protected]>
49 lines
2.2 KiB
Diff
49 lines
2.2 KiB
Diff
--- a/net/minecraft/client/Camera.java
|
|
+++ b/net/minecraft/client/Camera.java
|
|
@@ -217,12 +_,14 @@
|
|
return 90.0F;
|
|
} else {
|
|
float f = this.minecraft.options.fov().get().intValue() * Mth.lerp(partialTicks, this.oldFovModifier, this.fovModifier);
|
|
- return this.modifyFovBasedOnDeathOrFluid(partialTicks, f);
|
|
+ var ret = this.modifyFovBasedOnDeathOrFluid(partialTicks, f);
|
|
+ return net.minecraftforge.client.event.ForgeEventFactoryClient.fireComputeFov(this.minecraft.gameRenderer, this, partialTicks, ret, true).getFOV();
|
|
}
|
|
}
|
|
|
|
private float calculateHudFov(final float partialTicks) {
|
|
- return this.modifyFovBasedOnDeathOrFluid(partialTicks, 70.0F);
|
|
+ var ret = this.modifyFovBasedOnDeathOrFluid(partialTicks, 70.0F);
|
|
+ return net.minecraftforge.client.event.ForgeEventFactoryClient.fireComputeFov(this.minecraft.gameRenderer, this, partialTicks, ret, false).getFOV();
|
|
}
|
|
|
|
private float modifyFovBasedOnDeathOrFluid(final float partialTicks, float fov) {
|
|
@@ -331,9 +_,13 @@
|
|
}
|
|
|
|
protected void setRotation(final float yRot, final float xRot) {
|
|
+ setRotation(yRot, xRot, 0.0f);
|
|
+ }
|
|
+
|
|
+ public void setRotation(float yRot, float xRot, float z) {
|
|
this.xRot = xRot;
|
|
this.yRot = yRot;
|
|
- this.rotation.rotationYXZ((float) Math.PI - yRot * (float) (Math.PI / 180.0), -xRot * (float) (Math.PI / 180.0), 0.0F);
|
|
+ this.rotation.rotationYXZ((float) Math.PI - yRot * (float) (Math.PI / 180.0), -xRot * (float) (Math.PI / 180.0), z * (float) (Math.PI / 180.0));
|
|
FORWARDS.rotate(this.rotation, this.forwards);
|
|
UP.rotate(this.rotation, this.up);
|
|
LEFT.rotate(this.rotation, this.left);
|
|
@@ -364,6 +_,13 @@
|
|
|
|
public float yRot() {
|
|
return this.yRot;
|
|
+ }
|
|
+
|
|
+ public net.minecraft.world.level.block.state.BlockState getBlockAtCamera() {
|
|
+ if (!this.initialized)
|
|
+ return net.minecraft.world.level.block.Blocks.AIR.defaultBlockState();
|
|
+ else
|
|
+ return this.level.getBlockState(this.blockPosition).getStateAtViewpoint(this.level, this.blockPosition, this.position);
|
|
}
|
|
|
|
@Override
|