Skip to content

Conversation

@The-Deerman
Copy link

Fix: Detection for minibosses by removing the color codes which aren't present in entity.displayName?.string
Fix: Slayer detection by using contains instead of startsWith so that even if hypixel changes their mobtypes again it won't instantly break

Doesn't fix any of the rendering issues

Changes from nameStart to nameContains so even if Hypixel changes mobtypes again it won't break
Just adds an optional §r at the start of the regex (works for revs might want to check the others)
entity.displayName?.string doesn't have color codes
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @The-Deerman, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on enhancing the reliability of slayer and miniboss detection within the application. It resolves inconsistencies arising from Minecraft's text formatting by stripping color codes from entity names used in detection logic and updates the matching mechanism to be more adaptable to potential future game updates, ensuring smoother gameplay integration.

Highlights

  • Miniboss Detection Fix: Addressed issues with miniboss detection by removing Minecraft color codes (e.g., '§c') from hardcoded miniboss names and health bar checks. The entity.displayName?.string property does not include these formatting codes, causing previous detection failures.
  • Slayer Detection Robustness: Improved the resilience of slayer detection by refactoring the Slayer class to use contains instead of startsWith when matching entity names. This change makes the detection logic more flexible and less prone to breaking if Hypixel makes minor alterations to mob names.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces several fixes to improve the detection of slayer bosses and minibosses, making the logic more robust against future game updates. Key changes include removing color codes for miniboss detection on unformatted names, switching to contains from startsWith for more flexible slayer boss detection, and updating various string-based checks to be more resilient. The changes are consistent and well-implemented, and I found no issues of medium or higher severity.

Copy link
Member

@Sychic Sychic left a comment

Choose a reason for hiding this comment

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

Overall looks fine, just one question

if (!entity.hasCustomName()) return
val name = entity.displayName?.string ?: return
if (Skytils.config.slayerBossHitbox && name.endsWith("§c") && !name.endsWith("§e0§c") && !mc.entityRenderDispatcher.shouldRenderHitboxes()) {
if (Skytils.config.slayerBossHitbox && name.endsWith("") && !name.endsWith(" 0") && !mc.entityRenderDispatcher.shouldRenderHitboxes()) {
Copy link
Member

Choose a reason for hiding this comment

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

Are you sure this works? Assuming that name is still formatted, this will fail due to having no formatting codes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants