Files
MinecraftForge/patches/minecraft/net/minecraft/client/Camera.java.patch
T
2024-10-25 18:04:34 -07:00

32 lines
1.3 KiB
Diff

--- a/net/minecraft/client/Camera.java
+++ b/net/minecraft/client/Camera.java
@@ -120,9 +_,13 @@
}
protected void setRotation(float p_90573_, float p_90574_) {
+ setRotation(p_90573_, p_90574_, 0.0f);
+ }
+
+ public void setRotation(float p_90573_, float p_90574_, float z) {
this.xRot = p_90574_;
this.yRot = p_90573_;
- this.rotation.rotationYXZ((float) Math.PI - p_90573_ * (float) (Math.PI / 180.0), -p_90574_ * (float) (Math.PI / 180.0), 0.0F);
+ this.rotation.rotationYXZ((float) Math.PI - p_90573_ * (float) (Math.PI / 180.0), -p_90574_ * (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);
@@ -238,6 +_,13 @@
public float getPartialTickTime() {
return this.partialTickTime;
+ }
+
+ 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);
}
@OnlyIn(Dist.CLIENT)