fix: fall back to chat if above or below world Y limit

This commit is contained in:
Chayapak Supasakul 2025-04-19 18:46:56 +07:00
parent a6d6ed198c
commit 051a2b2f27
Signed by: ChomeNS
SSH key fingerprint: SHA256:0YoxhdyXsgbc0nfeB2N6FYE60mxMU7DS4uCUMaw2mvA

View file

@ -358,6 +358,16 @@ public class CommandCore {
if (player == null || world == null || !player.isInCreativeMode()) return;
final DimensionType dimensionType = world.getDimension();
if (
player.getPos().getY() < dimensionType.minY()
|| player.getPos().getY() > dimensionType.height() + dimensionType.minY()
) {
networkHandler.sendChatCommand(command);
return;
}
final ClientPlayerInteractionManager interactionManager = client.interactionManager;
if (interactionManager == null) return;