-
-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add unbreakable carpet highlighter #1034
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like good code to me.
src/main/java/de/hysky/skyblocker/skyblock/dwarven/MithrilCarpetHighlighter.java
Outdated
Show resolved
Hide resolved
ebb8bfa
to
d2c5240
Compare
Because apparently it's not limited to mithril
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that this pr just continually adds to the list of carpets without checking if it was already in the list? The list should be changed to a set, (AVLTreeSet should be better in this case as this is look-up intensive.) Also set contains should be checked before calling checkForCarpet
.
INSTANCE.configCallback(SkyblockerConfigManager.get().mining.dwarvenMines.carpetHighlightColor); | ||
WorldRenderEvents.AFTER_TRANSLUCENT.register(INSTANCE::render); | ||
SkyblockEvents.LOCATION_CHANGE.register(INSTANCE::onLocationChange); | ||
ClientTickEvents.END_CLIENT_TICK.register(INSTANCE::tick); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could just be Scheduler#scheduleCyclic
, and you would also not need the tick counter stuff.
|
Oh, sorry. I read it as |
Oops too late xd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
On the bright side, we can handle millions of carpets now... |
I'm not sure how well an AVLTreeSet will handle iteration over millions of carpets per frame, though. And I just noticed that light gray carpet is used for sneaky lighting in various places outside of tungsten ore veins. Idk what we should do for these false positives. It probably doesn't matter since they are indeed unbreakable carpets, but still. |
} | ||
|
||
public void tick() { | ||
if (!isLocationValid || MinecraftClient.getInstance().world == null || MinecraftClient.getInstance().player == null) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should also check for whether the feature is enabled or not so that we are not locating carpets unnecessarily.
Renders a colored box around nearby carpets within mithril ore veins in dwarven mines.
It can be toggled on and off, and the color is configurable.
Uses up about 0.30% of tick time for scanning & rendering while in dwarven mines. Didn't test outside but it should be much less, probably not even worth mentioning as it's just a boolean if check on each tick.