Skip to content

3d viewer hotbar#62

Merged
mmeerrkkaa merged 1 commit into
masterfrom
3dviewer-hotbar
Dec 7, 2025
Merged

3d viewer hotbar#62
mmeerrkkaa merged 1 commit into
masterfrom
3dviewer-hotbar

Conversation

@mmeerrkkaa

@mmeerrkkaa mmeerrkkaa commented Dec 7, 2025

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Новые функции
    • Добавлена поддержка управления активным слотом быстрого доступа бота с валидацией параметров.
    • Реализована синхронизация обновлений блоков, которая отправляет информацию о положении, типе и названии изменённых блоков для обеспечения координации действий между процессами.

✏️ Tip: You can customize this high-level summary in your review settings.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, we are unable to review this pull request

The GitHub API does not allow us to fetch diffs exceeding 300 files, and this pull request has 586

@coderabbitai

coderabbitai Bot commented Dec 7, 2025

Copy link
Copy Markdown
📝 Walkthrough

Обзор

Добавлена поддержка нового типа команды hotbar_slot для управления быстрой панелью инструментов бота с валидацией слотов (0-8). Реализована передача событий обновления блоков между процессами через механизм IPC для синхронизации состояния.

Изменения

Когорта / Файлы Описание
Обработка команд управления ботом
backend/src/core/BotProcess.js
Добавлена обработка команды hotbar_slot с валидацией номера слота (0-8) и установкой быстрой панели инструментов бота через setQuickBarSlot().
Передача событий обновления блоков
backend/src/core/BotProcess.js
Добавлена подписка на события blockUpdate с пересылкой сообщения типа viewer:blockUpdate в родительский процесс, содержащего позицию и данные старого/нового блока.
Маршрутизация сообщений просмотра
backend/src/core/services/MinecraftViewerService.js
Добавлена обработка сообщений viewer:blockUpdate от дочерних процессов с пересылкой в соответствующий bot namespace.

Предполагаемые затраты на код-ревью

🎯 2 (Простой) | ⏱️ ~10 минут

  • Убедитесь, что валидация слотов горячей панели (диапазон 0-8) соответствует протоколу Minecraft
  • Проверьте структуру сообщения viewer:blockUpdate на согласованность между процессами
  • Убедитесь в правильности логирования для отладки состояния бота

Стихотворение

🐰 Команды новые спешат по горячим слотам,
Блоки летят в эфир меж нескольких работ,
Валидный номер ловко проверяет мудрый бот,
IPC-мостом связь работников поёт! 🌉✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Заголовок соответствует основным изменениям: добавлена поддержка hotbar_slot команды для 3D viewer и обработка blockUpdate событий.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 3dviewer-hotbar

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2fa9968 and 76649cd.

⛔ Files ignored due to path filters (298)
  • frontend/public/minecraft-assets/items/acacia_boat.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/acacia_chest_boat.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/acacia_door.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/acacia_hanging_sign.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/acacia_sign.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/amethyst_shard.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/angler_pottery_sherd.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/apple.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/archer_pottery_sherd.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/armor_stand.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/arms_up_pottery_sherd.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/arrow.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/axolotl_bucket.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/baked_potato.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/bamboo.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/bamboo_chest_raft.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/bamboo_door.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/bamboo_hanging_sign.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/bamboo_raft.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/bamboo_sign.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/barrier.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/beef.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/beetroot.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/beetroot_seeds.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/beetroot_soup.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/bell.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/birch_boat.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/birch_chest_boat.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/birch_door.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/birch_hanging_sign.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/birch_sign.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/black_candle.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/black_dye.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/blade_pottery_sherd.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/blaze_powder.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/blaze_rod.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/blue_candle.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/blue_dye.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/bone.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/bone_meal.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/book.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/bow.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/bow_pulling_0.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/bow_pulling_1.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/bow_pulling_2.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/bowl.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/bread.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/brewer_pottery_sherd.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/brewing_stand.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/brick.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/broken_elytra.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/brown_candle.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/brown_dye.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/brush.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/bucket.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/bundle.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/bundle_filled.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/burn_pottery_sherd.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/cake.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/campfire.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/candle.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/carrot.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/carrot_on_a_stick.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/cauldron.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/chain.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/chainmail_boots.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/chainmail_chestplate.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/chainmail_helmet.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/chainmail_leggings.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/charcoal.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/cherry_boat.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/cherry_chest_boat.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/cherry_door.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/cherry_hanging_sign.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/cherry_sign.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/chest_minecart.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/chicken.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/chorus_fruit.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clay_ball.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_00.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_01.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_02.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_03.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_04.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_05.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_06.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_07.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_08.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_09.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_10.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_11.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_12.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_13.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_14.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_15.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_16.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_17.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_18.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_19.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_20.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_21.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_22.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_23.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_24.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_25.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_26.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_27.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_28.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_29.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_30.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_31.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_32.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_33.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_34.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_35.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_36.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_37.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_38.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_39.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_40.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_41.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_42.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_43.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_44.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_45.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_46.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_47.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_48.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_49.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_50.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_51.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_52.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_53.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_54.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_55.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_56.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_57.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_58.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_59.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_60.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_61.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_62.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/clock_63.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/coal.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/coast_armor_trim_smithing_template.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/cocoa_beans.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/cod.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/cod_bucket.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/command_block_minecart.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/comparator.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/compass_00.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/compass_01.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/compass_02.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/compass_03.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/compass_04.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/compass_05.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/compass_06.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/compass_07.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/compass_08.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/compass_09.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/compass_10.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/compass_11.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/compass_12.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/compass_13.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/compass_14.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/compass_15.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/compass_16.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/compass_17.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/compass_18.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/compass_19.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/compass_20.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/compass_21.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/compass_22.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/compass_23.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/compass_24.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/compass_25.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/compass_26.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/compass_27.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/compass_28.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/compass_29.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/compass_30.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/compass_31.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/cooked_beef.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/cooked_chicken.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/cooked_cod.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/cooked_mutton.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/cooked_porkchop.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/cooked_rabbit.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/cooked_salmon.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/cookie.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/copper_ingot.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/creeper_banner_pattern.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/crimson_door.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/crimson_hanging_sign.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/crimson_sign.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/crossbow_arrow.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/crossbow_firework.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/crossbow_pulling_0.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/crossbow_pulling_1.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/crossbow_pulling_2.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/crossbow_standby.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/cyan_candle.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/cyan_dye.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/danger_pottery_sherd.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/dark_oak_boat.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/dark_oak_chest_boat.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/dark_oak_door.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/dark_oak_hanging_sign.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/dark_oak_sign.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/diamond.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/diamond_axe.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/diamond_boots.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/diamond_chestplate.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/diamond_helmet.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/diamond_hoe.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/diamond_horse_armor.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/diamond_leggings.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/diamond_pickaxe.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/diamond_shovel.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/diamond_sword.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/disc_fragment_5.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/dragon_breath.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/dried_kelp.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/dune_armor_trim_smithing_template.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/echo_shard.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/egg.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/elytra.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/emerald.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/empty_armor_slot_boots.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/empty_armor_slot_chestplate.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/empty_armor_slot_helmet.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/empty_armor_slot_leggings.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/empty_armor_slot_shield.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/empty_slot_amethyst_shard.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/empty_slot_axe.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/empty_slot_diamond.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/empty_slot_emerald.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/empty_slot_hoe.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/empty_slot_ingot.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/empty_slot_lapis_lazuli.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/empty_slot_pickaxe.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/empty_slot_quartz.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/empty_slot_redstone_dust.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/empty_slot_shovel.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/empty_slot_smithing_template_armor_trim.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/empty_slot_smithing_template_netherite_upgrade.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/empty_slot_sword.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/enchanted_book.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/end_crystal.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/ender_eye.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/ender_pearl.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/experience_bottle.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/explorer_pottery_sherd.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/eye_armor_trim_smithing_template.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/feather.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/fermented_spider_eye.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/filled_map.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/filled_map_markings.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/fire_charge.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/firework_rocket.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/firework_star.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/firework_star_overlay.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/fishing_rod.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/fishing_rod_cast.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/flint.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/flint_and_steel.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/flower_banner_pattern.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/flower_pot.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/friend_pottery_sherd.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/furnace_minecart.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/ghast_tear.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/glass_bottle.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/glistering_melon_slice.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/globe_banner_pattern.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/glow_berries.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/glow_ink_sac.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/glow_item_frame.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/glowstone_dust.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/goat_horn.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/gold_ingot.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/gold_nugget.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/golden_apple.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/golden_axe.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/golden_boots.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/golden_carrot.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/golden_chestplate.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/golden_helmet.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/golden_hoe.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/golden_horse_armor.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/golden_leggings.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/golden_pickaxe.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/golden_shovel.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/golden_sword.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/gray_candle.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/gray_dye.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/green_candle.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/green_dye.png is excluded by !**/*.png
  • frontend/public/minecraft-assets/items/gunpowder.png is excluded by !**/*.png
📒 Files selected for processing (2)
  • backend/src/core/BotProcess.js (2 hunks)
  • backend/src/core/services/MinecraftViewerService.js (1 hunks)
🔇 Additional comments (1)
backend/src/core/services/MinecraftViewerService.js (1)

113-114: Проксирование события viewer:blockUpdate выглядит корректным

Обработка нового типа IPC-сообщения и ретрансляция его в viewerNamespace сделаны в том же стиле, что и остальные viewer-события (spawn, move, health, chat), что упрощает поддержку и не меняет существующие контракты.

Comment on lines +321 to +326
case 'hotbar_slot':
if (command.slot !== undefined && command.slot >= 0 && command.slot <= 8) {
bot.setQuickBarSlot(command.slot);
sendLog(`[Viewer] Hotbar slot changed to ${command.slot}`);
}
break;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Усилить валидацию hotbar_slot и логировать неверные значения

Сейчас проверяется только диапазон и !== undefined; при этом дробные/строковые значения могут «тихо» игнорироваться, а причины будут неочевидны на стороне клиента. Имеет смысл нормализовать значение до числа, проверить, что это целое в диапазоне 0–8, и явно залогировать некорректные случаи.

-                case 'hotbar_slot':
-                    if (command.slot !== undefined && command.slot >= 0 && command.slot <= 8) {
-                        bot.setQuickBarSlot(command.slot);
-                        sendLog(`[Viewer] Hotbar slot changed to ${command.slot}`);
-                    }
-                    break;
+                case 'hotbar_slot': {
+                    const slot = Number(command.slot);
+                    if (Number.isInteger(slot) && slot >= 0 && slot <= 8) {
+                        bot.setQuickBarSlot(slot);
+                        sendLog(`[Viewer] Hotbar slot changed to ${slot}`);
+                    } else {
+                        sendLog(`[Viewer] Invalid hotbar slot value: ${command.slot}`);
+                    }
+                    break;
+                }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
case 'hotbar_slot':
if (command.slot !== undefined && command.slot >= 0 && command.slot <= 8) {
bot.setQuickBarSlot(command.slot);
sendLog(`[Viewer] Hotbar slot changed to ${command.slot}`);
}
break;
case 'hotbar_slot': {
const slot = Number(command.slot);
if (Number.isInteger(slot) && slot >= 0 && slot <= 8) {
bot.setQuickBarSlot(slot);
sendLog(`[Viewer] Hotbar slot changed to ${slot}`);
} else {
sendLog(`[Viewer] Invalid hotbar slot value: ${command.slot}`);
}
break;
}
🤖 Prompt for AI Agents
In backend/src/core/BotProcess.js around lines 321 to 326, the current
hotbar_slot handling only checks !== undefined and range, allowing non-integer
or string values to be silently ignored; normalize the incoming command.slot to
a Number, verify it's a finite integer (e.g., Number.isInteger) and within 0–8,
call bot.setQuickBarSlot only for valid integers, and add a
processLogger/sendLog entry for invalid values that includes the raw received
value and reason (e.g., "not a number", "not integer", or "out of range") so the
client/server can see why it was rejected.

Comment on lines +1120 to +1141
bot.on('blockUpdate', (oldBlock, newBlock) => {
if (process.send && oldBlock && newBlock) {
process.send({
type: 'viewer:blockUpdate',
payload: {
position: {
x: newBlock.position.x,
y: newBlock.position.y,
z: newBlock.position.z
},
oldBlock: {
type: oldBlock.type,
name: oldBlock.name
},
newBlock: {
type: newBlock.type,
name: newBlock.name
}
}
});
}
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Корректная отправка viewer:blockUpdate, возможны перфоманс‑риски при большом потоке событий

Сам формат отправляемых данных (позиция, старый и новый блок с type/name) выглядит аккуратным и хорошо подходит для инкрементального обновления 3D‑вьюера через MinecraftViewerService. Однако при массовых изменениях мира (например, большие регионы, WorldEdit и т.п.) частота blockUpdate может дать значительную нагрузку на IPC и фронтенд.

Если в будущем появятся проблемы с производительностью, можно рассмотреть опциональную фильтрацию (по радиусу от бота или по текущему viewerRenderDistance) или троттлинг/агрегацию таких событий, но это не блокер для текущего PR.

🤖 Prompt for AI Agents
In backend/src/core/BotProcess.js around lines 1120 to 1141, the
viewer:blockUpdate payload is correct but unbounded emission of blockUpdate
events can overload IPC/frontend during large world changes; add optional
protection by filtering events (e.g., ignore blocks outside a configurable
radius from the bot or beyond viewerRenderDistance) and/or implement simple
throttling/aggregation (batch updates for N ms or coalesce updates per position)
controlled by a config flag so the default behavior remains unchanged while
enabling performance mode for heavy-change scenarios.

@mmeerrkkaa mmeerrkkaa added area: frontend Фронтенд (React) enhancement New feature or request feature - frontend UI/UX component: minecraft-viewer 3D просмотр мира area: backend Бэкенд (Node.js/Express) component: real-time WebSocket/real-time функции labels Dec 7, 2025
@mmeerrkkaa
mmeerrkkaa merged commit 92f53fe into master Dec 7, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: backend Бэкенд (Node.js/Express) area: frontend Фронтенд (React) component: minecraft-viewer 3D просмотр мира component: real-time WebSocket/real-time функции enhancement New feature or request feature - frontend UI/UX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant