Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void something() {
- String name = "";
- if(this.database.getBoolean("Enabled", true)) {
- for(String names : this.database.getSection("Names", new ArrayList<String>())) {
- if(name.equalsIgnoreCase(names)) {
- //Cancel action and say This name already exists
- return;
- }
- }
- ArrayList<String> names = this.database.getSection("Names", new ArrayList<String>());
- names.add(name);
- this.database.set("Names", names);
- }else{
- //This plugin is not enabled
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement