Disable the hitbox in first person mode

This commit is contained in:
Sollace 2023-03-27 16:46:02 +01:00
parent ab22d05a1e
commit 70797a1883

View file

@ -12,6 +12,7 @@ import net.minecraft.util.math.Box;
import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3d;
import com.minelittlepony.api.model.RenderPass;
import com.minelittlepony.api.pony.IPony; import com.minelittlepony.api.pony.IPony;
import com.minelittlepony.client.PonyBounds; import com.minelittlepony.client.PonyBounds;
@ -19,6 +20,10 @@ public final class DebugBoundingBoxRenderer {
public static <T extends LivingEntity> void render(IPony pony, EntityRenderer<T> renderer, T entity, MatrixStack stack, VertexConsumerProvider renderContext, float tickDelta) { public static <T extends LivingEntity> void render(IPony pony, EntityRenderer<T> renderer, T entity, MatrixStack stack, VertexConsumerProvider renderContext, float tickDelta) {
if (RenderPass.getCurrent() != RenderPass.WORLD) {
return;
}
MinecraftClient client = MinecraftClient.getInstance(); MinecraftClient client = MinecraftClient.getInstance();
if (!client.getEntityRenderDispatcher().shouldRenderHitboxes() || entity.isInvisible() || client.hasReducedDebugInfo()) { if (!client.getEntityRenderDispatcher().shouldRenderHitboxes() || entity.isInvisible() || client.hasReducedDebugInfo()) {