Skip to content
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

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open

Conversation

WannaBeIan
Copy link

  • 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.

New Settings

Stacks + Grouped Visitors

Fixed XP/hr Counter + Fancy Dots

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!

@LifeIsAParadox LifeIsAParadox added the reviews needed This PR needs reviews label Dec 31, 2024
@AzureAaron AzureAaron added the new feature This issue or PR is a new feature label Dec 31, 2024
@LifeIsAParadox LifeIsAParadox added changes requested This PR need changes and removed reviews needed This PR needs reviews labels Jan 2, 2025
@kevinthegreat1
Copy link
Collaborator

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.

@LifeIsAParadox LifeIsAParadox added reviews needed This PR needs reviews and removed changes requested This PR need changes labels Jan 3, 2025
@LifeIsAParadox LifeIsAParadox added changes requested This PR need changes and removed reviews needed This PR needs reviews labels Jan 6, 2025
@LifeIsAParadox LifeIsAParadox added reviews needed This PR needs reviews and removed changes requested This PR need changes labels Jan 6, 2025
@WannaBeIan
Copy link
Author

Sorry for the messy commits. this should be everything requested change wise.

  • VisitorHelper is now it's own group and work's/looks really good.
  • Added a "Vacuum Solver" which just makes a guess based on the angry_witch partcles and places a waypoint at the location
  • Added "Pest Highlighter" which applies a glow effect on pests.
  • Made a little change in MayorUtils causing an error when no minister is found.
  • Made the changes requested in the Farming hud, and when you're at max farming rather than it showing xp/0 I have farmingXpPercentProgress clamped between 0/100
  • Noticed while going through the config that the description of suppliesAndFuelWaypointType was using an old translation so I updated that as well

@WannaBeIan
Copy link
Author

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.

@AzureAaron AzureAaron added merge conflicts This PR has merge conflicts that need solving. and removed reviews needed This PR needs reviews labels Feb 4, 2025
@LifeIsAParadox LifeIsAParadox added reviews needed This PR needs reviews and removed merge conflicts This PR has merge conflicts that need solving. labels Feb 12, 2025
kevinthegreat1
kevinthegreat1 previously approved these changes Feb 12, 2025
Copy link
Collaborator

@kevinthegreat1 kevinthegreat1 left a 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.

Comment on lines 36 to 49
@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);
}
Copy link
Collaborator

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(
Copy link
Collaborator

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"))
Copy link
Collaborator

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.

@LifeIsAParadox LifeIsAParadox added merge me please Pull requests that are ready to merge and removed reviews needed This PR needs reviews labels Feb 12, 2025
WorldRenderEvents.AFTER_TRANSLUCENT.register(VacuumSolver::renderTrail);
}

private static void reset() {
Copy link
Collaborator

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?

Copy link
Collaborator

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.

Copy link
Author

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.

}

private static void renderTrail(WorldRenderContext context) {
if (fixedDestination == null) {
Copy link
Collaborator

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?

@AzureAaron AzureAaron added changes requested This PR need changes and removed merge me please Pull requests that are ready to merge labels Feb 13, 2025
@LifeIsAParadox LifeIsAParadox added merge me please Pull requests that are ready to merge and removed changes requested This PR need changes labels Feb 13, 2025
@LifeIsAParadox LifeIsAParadox added reviews needed This PR needs reviews and removed merge me please Pull requests that are ready to merge labels Feb 13, 2025
@kevinthegreat1
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature This issue or PR is a new feature reviews needed This PR needs reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants