Fix main hand in first person spectator view (fixes #731)

This commit is contained in:
Jonas Herzig
2022-07-17 16:25:23 +02:00
parent 42aef017c1
commit 633ac10d89
2 changed files with 13 additions and 0 deletions

View File

@@ -73,6 +73,7 @@ import net.minecraft.client.recipebook.ClientRecipeBook;
//$$ import net.minecraft.stats.RecipeBook;
//#endif
//#endif
import net.minecraft.util.Arm;
import net.minecraft.util.Hand;
//#endif
@@ -498,6 +499,17 @@ public class CameraEntity
}
//#endif
//#if MC>=10904
@Override
public Arm getMainArm() {
Entity view = this.client.getCameraEntity();
if (view != this && view instanceof PlayerEntity) {
return ((PlayerEntity) view).getMainArm();
}
return super.getMainArm();
}
//#endif
@Override
public float getHandSwingProgress(float renderPartialTicks) {
Entity view = this.client.getCameraEntity();