Disable head angle changes when moving through a portal

This commit is contained in:
Sollace 2022-06-09 22:23:12 +02:00
parent 47022fc1e8
commit 12dc7c1d28

View file

@ -1,7 +1,10 @@
package com.minelittlepony.client; package com.minelittlepony.client;
import net.minecraft.block.Blocks;
import net.minecraft.block.Material;
import net.minecraft.client.MinecraftClient; import net.minecraft.client.MinecraftClient;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.hit.HitResult; import net.minecraft.util.hit.HitResult;
import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3d;
@ -85,6 +88,10 @@ public class HorseCam {
return originalPitch; return originalPitch;
} }
if (hit instanceof BlockHitResult && player.world.getBlockState(((BlockHitResult)hit).getBlockPos()).getMaterial() == Material.PORTAL) {
return originalPitch;
}
Vec3d hitPos = hit.getPos(); Vec3d hitPos = hit.getPos();
Vec3d pos = player.getPos(); Vec3d pos = player.getPos();