-
-
Notifications
You must be signed in to change notification settings - Fork 100
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
Garden Tweaks & Features #1118
base: master
Are you sure you want to change the base?
Garden Tweaks & Features #1118
Conversation
src/main/java/de/hysky/skyblocker/config/configs/FarmingConfig.java
Outdated
Show resolved
Hide resolved
src/main/java/de/hysky/skyblocker/skyblock/garden/FarmingHud.java
Outdated
Show resolved
Hide resolved
src/main/java/de/hysky/skyblocker/skyblock/garden/FarmingHud.java
Outdated
Show resolved
Hide resolved
src/main/java/de/hysky/skyblocker/skyblock/garden/VisitorHelper.java
Outdated
Show resolved
Hide resolved
src/main/java/de/hysky/skyblocker/skyblock/garden/VisitorHelper.java
Outdated
Show resolved
Hide resolved
src/main/java/de/hysky/skyblocker/skyblock/garden/VisitorHelper.java
Outdated
Show resolved
Hide resolved
After a discussion, we think the visitor helper options would be better in a group. If you can also do that it’d be great. |
Sorry for the messy commits. this should be everything requested change wise.
|
The VacuumSolver could be improved by checking the scoreboard location line for the pest icon before rendering the waypoint, instead of rendering it regardless of pests. This can be addressed in a future PR. |
… method during some tests
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. I've made some clean up and fixes if you want to take a look.
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
Visitor visitor = (Visitor) o; | ||
return Objects.equals(name, visitor.name) && | ||
ItemStack.areEqual(head, visitor.head) && | ||
Objects.equals(requiredItems, visitor.requiredItems); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(name, head, requiredItems); | ||
} |
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.
Are these methods used? Two visitors may be equal when ItemStack::areEqual
but have different hash codes.
} | ||
|
||
if (linkedMarkers.isEmpty() && fixedDestination != null) { | ||
RenderHelper.renderFilled(context, new BlockPos( |
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.
Line 111 and 124 are the same? I've pushed a fix.
ItemUtils.getLore(acceptButton).stream() | ||
.map(Text::getString) | ||
.map(String::trim) | ||
.filter(lore -> !lore.isEmpty() && !lore.contains("Rewards")) |
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.
filter
doesn't work this way. This still matches lines after the rewards line. I've gone ahead and used takeWhile
.
src/main/java/de/hysky/skyblocker/config/configs/FarmingConfig.java
Outdated
Show resolved
Hide resolved
WorldRenderEvents.AFTER_TRANSLUCENT.register(VacuumSolver::renderTrail); | ||
} | ||
|
||
private static void reset() { |
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.
Shouldn't this reset the destination too?
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.
I tried to use this solver but couldn't figure it out so @WannaBeIan.
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.
Like I mentioned the code for the Vacuum Solver is really bad I mean it "kinda" worked it would get the particles and find where they end but it wouldn't estimate where the pest was I looked at some code from skyhanni as reference and that's where I got with it.
src/main/java/de/hysky/skyblocker/skyblock/garden/visitor/Visitor.java
Outdated
Show resolved
Hide resolved
src/main/java/de/hysky/skyblocker/skyblock/garden/visitor/VisitorHelper.java
Outdated
Show resolved
Hide resolved
src/main/java/de/hysky/skyblocker/skyblock/garden/visitor/VisitorHelper.java
Outdated
Show resolved
Hide resolved
} | ||
|
||
private static void renderTrail(WorldRenderContext context) { | ||
if (fixedDestination == null) { |
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.
Maybe also check if the person is in the garden and stuff?
The vacuum solver needs a bit of testing and the potential bugs Aaron pointed out. I wasn't able to figure out how to use it. |
Added an option to view required crops in the visitor helper as stacks + remainder.
Visitor Helper now works outside of the Garden by default but includes a new setting to lock it to the Garden.
Fixed the regex for Farming XP so it works correctly and now displays your XP/h, even at max farming level.
Added decimals for more precise XP/h and Blocks/s calculations.
Visitors requesting the same crops are grouped together, displaying a sum of the required crops.
I am aware the code is pretty messy its been some time since I've sat down and type something up
Let me know if anything needs to be fixed, and I'll take care of it!