Skip to content

Commit

Permalink
Fixes to Garden UI (#682)
Browse files Browse the repository at this point in the history
* Fix Garden UI

* Update src/main/java/de/hysky/skyblocker/skyblock/garden/FarmingHud.java

Co-authored-by: Kevin <92656833+kevinthegreat1@users.noreply.github.com>

* Update src/main/java/de/hysky/skyblocker/skyblock/garden/FarmingHud.java

Co-authored-by: Kevin <92656833+kevinthegreat1@users.noreply.github.com>

---------

Co-authored-by: Kevin <92656833+kevinthegreat1@users.noreply.github.com>
  • Loading branch information
BigloBot and kevinthegreat1 authored May 4, 2024
1 parent 37ad3ca commit ed04895
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class FarmingHud {
private static final Logger LOGGER = LoggerFactory.getLogger(FarmingHud.class);
public static final NumberFormat NUMBER_FORMAT = NumberFormat.getInstance(Locale.US);
private static final Pattern COUNTER = Pattern.compile("Counter: (?<count>[\\d,]+) .+");
private static final Pattern FARMING_XP = Pattern.compile("§3\\+(?<xp>\\d+.?\\d*) Farming \\((?<percent>\\d+.?\\d*)%\\)");
private static final Pattern FARMING_XP = Pattern.compile("§3\\+(?<xp>\\d+.?\\d*) Farming \\((?<percent>[\\d,]+.?\\d*)%\\)");
private static final Deque<IntLongPair> counter = new ArrayDeque<>();
private static final LongPriorityQueue blockBreaks = new LongArrayFIFOQueue();
private static final Queue<FloatLongPair> farmingXp = new ArrayDeque<>();
Expand Down Expand Up @@ -118,6 +118,6 @@ public static float farmingXpPercentProgress() {
}

public static double farmingXpPerHour() {
return farmingXp.stream().mapToDouble(FloatLongPair::leftFloat).sum() * 3600;
return farmingXp.stream().mapToDouble(FloatLongPair::leftFloat).sum() * blockBreaks() * 1800; // Hypixel only sends xp updates around every half a second
}
}

0 comments on commit ed04895

Please sign in to comment.