if (!Float.isNaN(relMove.getX()) && !Float.isNaN(relMove.getY()) && !Float.isNaN(relMove.getZ())) { entity.send(new CharacterMoveInputEvent(inputSequenceNumber++, lookPitch, lookYaw, relMove, run, crouch, jump, time.getGameDeltaInMs()));
@Command(shortDescription = "Sets the height of the player", runOnServer = true, requiredPermission = PermissionManager.CHEAT_PERMISSION) public String playerHeight(@Sender EntityRef client, @CommandParam("height") float amount) { try { ClientComponent clientComp = client.getComponent(ClientComponent.class); CharacterMovementComponent move = clientComp.character.getComponent(CharacterMovementComponent.class); if (move != null) { float prevHeight = move.height; move.height = amount; clientComp.character.saveComponent(move); LocationComponent loc = client.getComponent(LocationComponent.class); Vector3f currentPosition = loc.getWorldPosition(); clientComp.character .send(new CharacterTeleportEvent(new Vector3f(currentPosition.getX(), currentPosition.getY() + (amount - prevHeight) / 2, currentPosition.getZ()))); physics.removeCharacterCollider(clientComp.character); physics.getCharacterCollider(clientComp.character); return "Height of player set to " + amount + " (was " + prevHeight + ")"; } return ""; } catch (NullPointerException e) { e.printStackTrace(); return ""; } }