-
-
Notifications
You must be signed in to change notification settings - Fork 90
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
Corpse Finder #960
base: master
Are you sure you want to change the base?
Corpse Finder #960
Conversation
pretty sure I clicked wrong thing but eh ima go see if it compiles and works |
tested, it works |
src/main/java/de/hysky/skyblocker/skyblock/dwarven/CorpseFinder.java
Outdated
Show resolved
Hide resolved
src/main/java/de/hysky/skyblocker/skyblock/chocolatefactory/EggFinder.java
Outdated
Show resolved
Hide resolved
src/main/java/de/hysky/skyblocker/skyblock/dwarven/CorpseFinder.java
Outdated
Show resolved
Hide resolved
063995c
to
b961414
Compare
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.
feature seems to work well. with a few nitpicks in the code:
src/main/java/de/hysky/skyblocker/skyblock/dwarven/CorpseFinder.java
Outdated
Show resolved
Hide resolved
src/main/java/de/hysky/skyblocker/skyblock/dwarven/CorpseFinder.java
Outdated
Show resolved
Hide resolved
src/main/java/de/hysky/skyblocker/skyblock/dwarven/CorpseFinder.java
Outdated
Show resolved
Hide resolved
int z = Integer.parseInt(matcher.group("z")); | ||
LOGGER.info(PREFIX + "Parsed message! X:{}, Y:{}, Z:{}", x, y, z); | ||
boolean foundCorpse = false; | ||
BlockPos parsedPos = new BlockPos(x-1, y-1, z-1); // skyhanni cords format difference is -1, -1, -1 |
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.
is skyhanni the only other mod to send cwords? surely this would mess up detecting cwords from this mods messages. Would it be better just to see if they are within 2 blocks distance to a location instead of relying on this conversion?
lockPos parsedPos = new BlockPos(x, y, z);
...
...
if(corpse.waypoint.pos.getSquaredDistance(parsedPos) < 4) {
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.
If you're talking in terms of the temporary waypoint that gets added when someone sends a location, the way I wrote it wouldn't cause an issue. it would just add the corpse location to a list so it doesn't get shared since someone already shared it's location, parsing the waypoint was using skyhanni patcher coords waypoint feature
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.
tho reading it again, you'd probably want to use a range of blocks rather than checking corpse location, when I wrote it on SH I didn't see any other mod that had it like this so I just sent the corpse location, but other mods might share the player location.
and also some people just don't realise features like this exist so they just /patcher sendcoords
If you'd like help since I originally wrote it I don't mind, tho I'm writing it in kotlin, tho it looks like you're done |
I'm kinda sick rn so can't do much, brain isn't braining |
Pretty much the only thing is, check in a radius around the corpse like olim88 said, it's a small and niche thing but it'd be better that way |
This needs to be rebased as its not going to work on 1.21.2+ |
This should allow skyhanni users to be able to parse the messages sent by skyblocker users since their regex starts matching from the start of the message content (so after any prefixes, player names) The regex change was also because of this. We use .find so the regex doesn't have to match the whole message body.
Did 100+ runs with this with someone else on 1.8, and it worked just fine with no duplicate messages and everything got marked nicely. Could be considered complete. There's only one tiny issue with it: corpses buried within ice are not considered "seen" until you break the ice blocks despite ice being translucent. I couldn't figure out a solution to this that didn't break the normal |
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.
Did a bit of refactoring, basically migrated everything to CorpseType
enum, which is much safer.
I mean yea that is why I used a range of -1 to 3? or 4 I forgot, it was a good range since -1 covered the ones that are hanging and the other value was for the ones buried in ice |
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.
why is there a lot of whitespace added to the constructor parameters?
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.
Just to align the parameters after type with other constructors. It makes it much easier to read and verify.
basically this thing
support sharing cords in chat. Support parsing cords from chat (skyhanni format). Shows corpse moment even a pixel of it gets on your screen
todo: make it parse skyblocker format