Skip to content

Commit

Permalink
removing the warnings in the lore in the mob loot recipe gui from neu…
Browse files Browse the repository at this point in the history
… mod when the chance from the repo does not meet simple percentage formatting (Moulberry#239)
  • Loading branch information
hannibal002 authored Aug 20, 2022
1 parent 46e99cb commit 70812dc
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@ public ItemStack getItemStack() {

private String formatDropChance() {
if (!chance.endsWith("%")) {
return chance + " §cInvalid repo data!";
return chance;
}

String chanceText = chance.substring(0, chance.length() - 1);
int chanceIn;
try {
chanceIn = (int) (100.0 / Double.parseDouble(chanceText));
} catch (NumberFormatException e) {
return chance + " §cInvalid repo data!";
return chance;
}

String format = GuiProfileViewer.numberFormat.format(chanceIn);
Expand Down

0 comments on commit 70812dc

Please sign in to comment.