Skip to content

Commit

Permalink
Emergency SellGUI fix where a double being passed into a NumberFormat…
Browse files Browse the repository at this point in the history
… contained a '$' causing the event.setCancelled to not fire.
  • Loading branch information
Oheers committed Apr 16, 2021
1 parent f1d430b commit ef814c6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion main/java/com/oheers/fish/competition/Competition.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void runLeaderboardScan(Player fisher, Fish fish) {
if (holder == fisher) {
if (fish.getLength() > leaderboard.get(holder).getLength()) {
leaderboard.remove(holder);
leaderboard.put(holder, fish);
leaderboard.put(fisher, fish);
leaderboard = sortByValue(leaderboard);
return;
}
Expand Down
4 changes: 1 addition & 3 deletions main/java/com/oheers/fish/selling/SellGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;

import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;

public class SellGUI {

Expand Down Expand Up @@ -135,7 +133,7 @@ public String getTotalWorth() {
this.value = val;
this.fishCount = count;

return NumberFormat.getInstance(Locale.US).format(val);
return Double.toString(val);
}

// will drop only non-fish items if the method is called from selling, and everything if it's just a gui close
Expand Down

0 comments on commit ef814c6

Please sign in to comment.