Skip to content

Commit

Permalink
Sellall: when sellall message delay is enabled for autosell, changed …
Browse files Browse the repository at this point in the history
…it to when the player does `/sellall sell` it reports the sale for that transaction instead of waiting until 15 to 20 seconds later.
  • Loading branch information
rbluer committed Jul 3, 2024
1 parent 3fba245 commit c10a9a1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
4 changes: 4 additions & 0 deletions docs/changelog_v3.3.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ These change logs represent the work that has been going on within prison.
# 3.3.0-alpha.18b 2024-07-03


* **Sellall: when sellall message delay is enabled for autosell, changed it to when the player does `/sellall sell` it reports the sale for that transaction instead of waiting until 15 to 20 seconds later.**



* **Refactor JsonFileIO to push more of the non-json content to FileIO where it really should be located.**


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,10 @@ else if (p == null){
}

boolean notifications = (notification != null && "silent".equalsIgnoreCase( notification ));

sellAllUtil.sellAllSell(p, false, notifications, true, true, false, true);
boolean delayNotifications = false;
boolean delayNotificationsEarnings = false;

sellAllUtil.sellAllSell(p, false, notifications, true, delayNotifications, delayNotificationsEarnings, true);

SpigotPlayer sPlayer = new SpigotPlayer( p );
PlayerAutoRankupTask.autoSubmitPlayerRankupTask( sPlayer, null );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2773,7 +2773,10 @@ public double sellAllSell(Player p, SpigotItemStack itemStack,
if (!isPlayerWaitingAutoSellNotification(p)){
// Initialize && Force delayed notifications, even if delayed is disabled:
autoSellEarningsNotificationWaiting.put(p, 0.00);
Bukkit.getScheduler().scheduleSyncDelayedTask(SpigotPrison.getInstance(), () -> removeFromAutoSellDelayAndNotify(p), 20L * defaultAutoSellEarningNotificationDelay);

Bukkit.getScheduler().scheduleSyncDelayedTask(
SpigotPrison.getInstance(), () ->
removeFromAutoSellDelayAndNotify(p), 20L * defaultAutoSellEarningNotificationDelay);

}

Expand Down

0 comments on commit c10a9a1

Please sign in to comment.