Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ArrayList<String> enchants = new ArrayList<String>();
- enchantments = enchantments.replaceAll(" ", "");
- if (enchantments.equalsIgnoreCase("-none,0")) {
- enchants = null;
- } else {
- try {
- int i = 0;
- String foo = "";
- Bukkit.getLogger().info("Start");
- for (i = 1; i < enchantments.length(); i++) {
- if (enchantments.charAt(i) == ',') {
- enchants.add(foo);
- foo = "";
- } else if (enchantments.charAt(i) == '-') {
- enchants.add(foo);
- foo = "";
- } else {
- foo = foo + enchantments.charAt(i);
- }
- Bukkit.getLogger().info(i + "");
- }
- Bukkit.getLogger().info("End");
- } catch (Exception e) {
- enchants = null;
- }
- }
Add Comment
Please, Sign In to add comment