Guest User

Untitled

a guest
Jan 22nd, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. ArrayList<String> enchants = new ArrayList<String>();
  2. enchantments = enchantments.replaceAll(" ", "");
  3. if (enchantments.equalsIgnoreCase("-none,0")) {
  4. enchants = null;
  5. } else {
  6. try {
  7. int i = 0;
  8. String foo = "";
  9. Bukkit.getLogger().info("Start");
  10. for (i = 1; i < enchantments.length(); i++) {
  11. if (enchantments.charAt(i) == ',') {
  12. enchants.add(foo);
  13. foo = "";
  14. } else if (enchantments.charAt(i) == '-') {
  15. enchants.add(foo);
  16. foo = "";
  17. } else {
  18. foo = foo + enchantments.charAt(i);
  19. }
  20. Bukkit.getLogger().info(i + "");
  21. }
  22. Bukkit.getLogger().info("End");
  23. } catch (Exception e) {
  24. enchants = null;
  25. }
  26. }
Add Comment
Please, Sign In to add comment