diff --git a/pom.xml b/pom.xml index baf7aba..745de5c 100644 --- a/pom.xml +++ b/pom.xml @@ -1,4 +1,21 @@ + + diff --git a/src/main/java/lol/hyper/toolstats/events/BlocksMined.java b/src/main/java/lol/hyper/toolstats/events/BlocksMined.java index 84eb20b..da2bb8d 100644 --- a/src/main/java/lol/hyper/toolstats/events/BlocksMined.java +++ b/src/main/java/lol/hyper/toolstats/events/BlocksMined.java @@ -1,3 +1,20 @@ +/* + * This file is part of ToolStats. + * + * ToolStats is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * ToolStats is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with ToolStats. If not, see . + */ + package lol.hyper.toolstats.events; import lol.hyper.toolstats.ToolStats; @@ -13,9 +30,11 @@ import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.persistence.PersistentDataContainer; import org.bukkit.persistence.PersistentDataType; +import java.text.NumberFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.Locale; public class BlocksMined implements Listener { @@ -71,18 +90,18 @@ public class BlocksMined implements Listener { for (int x = 0; x < lore.size(); x++) { if (lore.get(x).contains("Blocks mined")) { hasLore = true; - lore.set(x, blocksMinedLore.replace("X", Integer.toString(blocksMined))); + lore.set(x, blocksMinedLore.replace("X", NumberFormat.getNumberInstance(Locale.US).format(Integer.toString(blocksMined)))); break; } } // if the item has lore but doesn't have the tag, add it if (!hasLore) { - lore.add(blocksMinedLore.replace("X", Integer.toString(blocksMined))); + lore.add(blocksMinedLore.replace("X", NumberFormat.getNumberInstance(Locale.US).format(Integer.toString(blocksMined)))); } } else { // if the item has no lore, create a new list and add the string lore = new ArrayList<>(); - lore.add(blocksMinedLore.replace("X", Integer.toString(blocksMined))); + lore.add(blocksMinedLore.replace("X", NumberFormat.getNumberInstance(Locale.US).format(Integer.toString(blocksMined)))); } meta.setLore(lore); itemStack.setItemMeta(meta); diff --git a/src/main/java/lol/hyper/toolstats/events/CraftItem.java b/src/main/java/lol/hyper/toolstats/events/CraftItem.java index c4db96a..e1eb8f2 100644 --- a/src/main/java/lol/hyper/toolstats/events/CraftItem.java +++ b/src/main/java/lol/hyper/toolstats/events/CraftItem.java @@ -1,3 +1,20 @@ +/* + * This file is part of ToolStats. + * + * ToolStats is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * ToolStats is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with ToolStats. If not, see . + */ + package lol.hyper.toolstats.events; import lol.hyper.toolstats.ToolStats; diff --git a/src/main/java/lol/hyper/toolstats/events/EntityDamage.java b/src/main/java/lol/hyper/toolstats/events/EntityDamage.java index 74374c4..b78cc6b 100644 --- a/src/main/java/lol/hyper/toolstats/events/EntityDamage.java +++ b/src/main/java/lol/hyper/toolstats/events/EntityDamage.java @@ -1,3 +1,20 @@ +/* + * This file is part of ToolStats. + * + * ToolStats is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * ToolStats is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with ToolStats. If not, see . + */ + package lol.hyper.toolstats.events; import lol.hyper.toolstats.ToolStats; @@ -18,6 +35,7 @@ import org.bukkit.persistence.PersistentDataType; import java.math.RoundingMode; import java.text.DecimalFormat; +import java.text.NumberFormat; import java.util.*; public class EntityDamage implements Listener { @@ -116,18 +134,18 @@ public class EntityDamage implements Listener { for (int x = 0; x < lore.size(); x++) { if (lore.get(x).contains("Player kills")) { hasLore = true; - lore.set(x, playerKillsLore.replace("X", Integer.toString(playerKills))); + lore.set(x, playerKillsLore.replace("X", NumberFormat.getNumberInstance(Locale.US).format(Integer.toString(playerKills)))); break; } } // if the item has lore but doesn't have the tag, add it if (!hasLore) { - lore.add(playerKillsLore.replace("X", Integer.toString(playerKills))); + lore.add(playerKillsLore.replace("X", NumberFormat.getNumberInstance(Locale.US).format(Integer.toString(playerKills)))); } } else { // if the item has no lore, create a new list and add the string lore = new ArrayList<>(); - lore.add(playerKillsLore.replace("X", Integer.toString(playerKills))); + lore.add(playerKillsLore.replace("X", NumberFormat.getNumberInstance(Locale.US).format(Integer.toString(playerKills)))); } meta.setLore(lore); finalItem.setItemMeta(meta); @@ -162,18 +180,18 @@ public class EntityDamage implements Listener { for (int x = 0; x < lore.size(); x++) { if (lore.get(x).contains("Mob kills")) { hasLore = true; - lore.set(x, mobKillsLore.replace("X", Integer.toString(mobKills))); + lore.set(x, mobKillsLore.replace("X", NumberFormat.getNumberInstance(Locale.US).format(Integer.toString(mobKills)))); break; } } // if the item has lore but doesn't have the tag, add it if (!hasLore) { - lore.add(mobKillsLore.replace("X", Integer.toString(mobKills))); + lore.add(mobKillsLore.replace("X", NumberFormat.getNumberInstance(Locale.US).format(Integer.toString(mobKills)))); } } else { // if the item has no lore, create a new list and add the string lore = new ArrayList<>(); - lore.add(mobKillsLore.replace("X", Integer.toString(mobKills))); + lore.add(mobKillsLore.replace("X", NumberFormat.getNumberInstance(Locale.US).format(Integer.toString(mobKills)))); } meta.setLore(lore); finalItem.setItemMeta(meta); diff --git a/src/main/java/lol/hyper/toolstats/events/PlayerFish.java b/src/main/java/lol/hyper/toolstats/events/PlayerFish.java index dc51ff8..f6f238b 100644 --- a/src/main/java/lol/hyper/toolstats/events/PlayerFish.java +++ b/src/main/java/lol/hyper/toolstats/events/PlayerFish.java @@ -1,3 +1,20 @@ +/* + * This file is part of ToolStats. + * + * ToolStats is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * ToolStats is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with ToolStats. If not, see . + */ + package lol.hyper.toolstats.events; import lol.hyper.toolstats.ToolStats; @@ -12,8 +29,10 @@ import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.persistence.PersistentDataContainer; import org.bukkit.persistence.PersistentDataType; +import java.text.NumberFormat; import java.util.ArrayList; import java.util.List; +import java.util.Locale; public class PlayerFish implements Listener { @@ -65,18 +84,18 @@ public class PlayerFish implements Listener { for (int x = 0; x < lore.size(); x++) { if (lore.get(x).contains("Fish caught")) { hasLore = true; - lore.set(x, fishCaughtLore.replace("X", Integer.toString(fishCaught))); + lore.set(x, fishCaughtLore.replace("X", NumberFormat.getNumberInstance(Locale.US).format(Integer.toString(fishCaught)))); break; } } // if the item has lore but doesn't have the tag, add it if (!hasLore) { - lore.add(fishCaughtLore.replace("X", Integer.toString(fishCaught))); + lore.add(fishCaughtLore.replace("X", NumberFormat.getNumberInstance(Locale.US).format(Integer.toString(fishCaught)))); } } else { // if the item has no lore, create a new list and add the string lore = new ArrayList<>(); - lore.add(fishCaughtLore.replace("X", Integer.toString(fishCaught))); + lore.add(fishCaughtLore.replace("X", NumberFormat.getNumberInstance(Locale.US).format(Integer.toString(fishCaught)))); } meta.setLore(lore); itemStack.setItemMeta(meta); diff --git a/src/main/java/lol/hyper/toolstats/events/SheepShear.java b/src/main/java/lol/hyper/toolstats/events/SheepShear.java index aca62c6..2febab6 100644 --- a/src/main/java/lol/hyper/toolstats/events/SheepShear.java +++ b/src/main/java/lol/hyper/toolstats/events/SheepShear.java @@ -1,3 +1,20 @@ +/* + * This file is part of ToolStats. + * + * ToolStats is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * ToolStats is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with ToolStats. If not, see . + */ + package lol.hyper.toolstats.events; import lol.hyper.toolstats.ToolStats; @@ -14,8 +31,10 @@ import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.persistence.PersistentDataContainer; import org.bukkit.persistence.PersistentDataType; +import java.text.NumberFormat; import java.util.ArrayList; import java.util.List; +import java.util.Locale; public class SheepShear implements Listener { @@ -70,18 +89,18 @@ public class SheepShear implements Listener { for (int x = 0; x < lore.size(); x++) { if (lore.get(x).contains("Sheep sheared")) { hasLore = true; - lore.set(x, sheepShearLore.replace("X", Integer.toString(sheepSheared))); + lore.set(x, sheepShearLore.replace("X", NumberFormat.getNumberInstance(Locale.US).format(Integer.toString(sheepSheared)))); break; } } // if the item has lore but doesn't have the tag, add it if (!hasLore) { - lore.add(sheepShearLore.replace("X", Integer.toString(sheepSheared))); + lore.add(sheepShearLore.replace("X", NumberFormat.getNumberInstance(Locale.US).format(Integer.toString(sheepSheared)))); } } else { // if the item has no lore, create a new list and add the string lore = new ArrayList<>(); - lore.add(sheepShearLore.replace("X", Integer.toString(sheepSheared))); + lore.add(sheepShearLore.replace("X", NumberFormat.getNumberInstance(Locale.US).format(Integer.toString(sheepSheared)))); } meta.setLore(lore); itemStack.setItemMeta(meta);