-
-
Notifications
You must be signed in to change notification settings - Fork 158
More precise crystal waypoints when clicking or killing NPCs (Odawa, … #1605
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
Open
TheMychenik
wants to merge
7
commits into
SkyblockerMod:master
Choose a base branch
from
TheMychenik:crystalwaypoints
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
fefd724
More precise crystal waypoints when clicking or killing NPCs (Odawa, …
TheMychenik ae45dd7
Cleanup
TheMychenik f83d562
stylecheck
TheMychenik 97d83fc
Fix for Khazad-dûm, Goblin Queen's Den and Mines of Divan (search in …
TheMychenik b706fc4
cleanup
TheMychenik 818df5d
cleanup x2
TheMychenik 74671f5
Refactor crystal locations
kevinthegreat1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,8 @@ | |
|
|
||
| import java.awt.*; | ||
|
|
||
| import javax.annotation.Nullable; | ||
|
|
||
| public class MiningLocationLabel extends DistancedNamedWaypoint { | ||
| private final Category category; | ||
|
|
||
|
|
@@ -163,29 +165,34 @@ public int getColor() { | |
| * enum for the different waypoints used int the crystals hud each with a {@link CrystalHollowsLocationsCategory#name} and associated {@link CrystalHollowsLocationsCategory#color} | ||
| */ | ||
| public enum CrystalHollowsLocationsCategory implements Category, StringIdentifiable { | ||
| UNKNOWN("Unknown", Color.WHITE, null), //used when a location is known but what's at the location is not known | ||
| JUNGLE_TEMPLE("Jungle Temple", new Color(DyeColor.PURPLE.getSignColor()), "[NPC] Kalhuiki Door Guardian:"), | ||
| MINES_OF_DIVAN("Mines of Divan", Color.GREEN, " Jade Crystal"), | ||
| GOBLIN_QUEENS_DEN("Goblin Queen's Den", new Color(DyeColor.ORANGE.getSignColor()), " Amber Crystal"), | ||
| LOST_PRECURSOR_CITY("Lost Precursor City", Color.CYAN, " Sapphire Crystal"), | ||
| KHAZAD_DUM("Khazad-dûm", Color.YELLOW, " Topaz Crystal"), | ||
| FAIRY_GROTTO("Fairy Grotto", Color.PINK, null), | ||
| DRAGONS_LAIR("Dragon's Lair", Color.BLACK, null), | ||
| CORLEONE("Corleone", Color.WHITE, null), | ||
| KING_YOLKAR("King Yolkar", Color.RED, "[NPC] King Yolkar:"), | ||
| ODAWA("Odawa", Color.MAGENTA, "[NPC] Odawa:"), | ||
| KEY_GUARDIAN("Key Guardian", Color.LIGHT_GRAY, null); | ||
| UNKNOWN("Unknown", Color.WHITE, null, 0), //used when a location is known but what's at the location is not known | ||
| // These waypoints are verified by interacting with the corresponding NPC (e.g., by clicking on Odawa) | ||
| JUNGLE_TEMPLE("Jungle Temple", new Color(DyeColor.PURPLE.getSignColor()), "Kalhuiki Door Guardian", 10), | ||
| LOST_PRECURSOR_CITY("Lost Precursor City", Color.CYAN, "Professor Robot", 8), | ||
| KING_YOLKAR("King Yolkar", Color.RED, "King Yolkar", 8), | ||
| ODAWA("Odawa", Color.MAGENTA, "Odawa", 8), | ||
| CORLEONE("Corleone", Color.WHITE, "Boss Corleone", 20), | ||
| KEY_GUARDIAN("Key Guardian", Color.LIGHT_GRAY, "Key Guardian", 10), | ||
| // Look for chat message containing npcName (crystal name) | ||
| KHAZAD_DUM("Khazad-dûm", Color.YELLOW, " Topaz Crystal", 20), | ||
| GOBLIN_QUEENS_DEN("Goblin Queen's Den", new Color(DyeColor.ORANGE.getSignColor()), " Amber Crystal", 20), | ||
| MINES_OF_DIVAN("Mines of Divan", Color.GREEN, " Jade Crystal", 20), | ||
| // These cannot be found automatically yet. | ||
| FAIRY_GROTTO("Fairy Grotto", Color.PINK, null, 0), | ||
| DRAGONS_LAIR("Dragon's Lair", Color.BLACK, null, 0); | ||
|
|
||
| public static final Codec<CrystalHollowsLocationsCategory> CODEC = StringIdentifiable.createBasicCodec(CrystalHollowsLocationsCategory::values); | ||
|
|
||
| public final Color color; | ||
| private final String name; | ||
| private final String linkedMessage; | ||
| private final @Nullable String name; | ||
| private final String npcName; | ||
|
||
| private final int searchRadius; | ||
|
|
||
| CrystalHollowsLocationsCategory(String name, Color color, String linkedMessage) { | ||
| CrystalHollowsLocationsCategory(String name, Color color, String npcName, int searchRadius) { | ||
| this.name = name; | ||
| this.color = color; | ||
| this.linkedMessage = linkedMessage; | ||
| this.npcName = npcName; | ||
| this.searchRadius = searchRadius; | ||
| } | ||
|
|
||
| @Override | ||
|
|
@@ -198,14 +205,30 @@ public int getColor() { | |
| return this.color.getRGB(); | ||
| } | ||
|
|
||
| public String getLinkedMessage() { | ||
| return this.linkedMessage; | ||
| public @Nullable String getNpcName() { | ||
| return this.npcName; | ||
| } | ||
|
|
||
| public int getSearchRadius() { | ||
| return this.searchRadius; | ||
| } | ||
|
|
||
| @Override | ||
| public String asString() { | ||
| return name(); | ||
| } | ||
|
|
||
| // npcName search | ||
| public static CrystalHollowsLocationsCategory findNpcNameBySubstring(String query) { | ||
| if (query == null || query.isBlank()) return null; | ||
|
|
||
| for (CrystalHollowsLocationsCategory c : values()) { | ||
| if (c.npcName != null && !c.npcName.isBlank() && query.contains(c.npcName)) { | ||
| return c; | ||
| } | ||
| } | ||
| return null; | ||
| } | ||
| } | ||
|
|
||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
would using the npc's position be better?