Fixes some capitalization
All checks were successful
EpicKnarvik97/Books-Without-Borders/pipeline/head This commit looks good
All checks were successful
EpicKnarvik97/Books-Without-Borders/pipeline/head This commit looks good
This commit is contained in:
@@ -27,8 +27,8 @@ import java.util.logging.Level;
|
|||||||
public class BookshelfHandler {
|
public class BookshelfHandler {
|
||||||
|
|
||||||
private static final File bookshelfFile = new File(BooksWithoutBorders.getInstance().getDataFolder(),
|
private static final File bookshelfFile = new File(BooksWithoutBorders.getInstance().getDataFolder(),
|
||||||
"bookShelves.yml");
|
"bookshelves.yml");
|
||||||
private Set<Bookshelf> bookShelves;
|
private Set<Bookshelf> bookshelves;
|
||||||
private Map<Location, Bookshelf> locationLookup;
|
private Map<Location, Bookshelf> locationLookup;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -48,7 +48,7 @@ public class BookshelfHandler {
|
|||||||
* @param bookshelf <p>The bookshelf to register</p>
|
* @param bookshelf <p>The bookshelf to register</p>
|
||||||
*/
|
*/
|
||||||
public void registerBookshelf(@NotNull Bookshelf bookshelf) {
|
public void registerBookshelf(@NotNull Bookshelf bookshelf) {
|
||||||
this.bookShelves.add(bookshelf);
|
this.bookshelves.add(bookshelf);
|
||||||
this.locationLookup.put(bookshelf.getLocation(), bookshelf);
|
this.locationLookup.put(bookshelf.getLocation(), bookshelf);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,14 +59,14 @@ public class BookshelfHandler {
|
|||||||
*/
|
*/
|
||||||
public void unregisterBookshelf(@NotNull Bookshelf bookshelf) {
|
public void unregisterBookshelf(@NotNull Bookshelf bookshelf) {
|
||||||
this.locationLookup.remove(bookshelf.getLocation());
|
this.locationLookup.remove(bookshelf.getLocation());
|
||||||
this.bookShelves.remove(bookshelf);
|
this.bookshelves.remove(bookshelf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads all stored bookshelves
|
* Loads all stored bookshelves
|
||||||
*/
|
*/
|
||||||
public void load() {
|
public void load() {
|
||||||
this.bookShelves = new HashSet<>();
|
this.bookshelves = new HashSet<>();
|
||||||
this.locationLookup = new HashMap<>();
|
this.locationLookup = new HashMap<>();
|
||||||
|
|
||||||
YamlConfiguration configuration = YamlConfiguration.loadConfiguration(bookshelfFile);
|
YamlConfiguration configuration = YamlConfiguration.loadConfiguration(bookshelfFile);
|
||||||
@@ -113,7 +113,7 @@ public class BookshelfHandler {
|
|||||||
try {
|
try {
|
||||||
YamlConfiguration configuration = new YamlConfiguration();
|
YamlConfiguration configuration = new YamlConfiguration();
|
||||||
ConfigurationSection bookshelfSection = configuration.createSection("bookshelves");
|
ConfigurationSection bookshelfSection = configuration.createSection("bookshelves");
|
||||||
for (Bookshelf bookshelf : bookShelves) {
|
for (Bookshelf bookshelf : bookshelves) {
|
||||||
saveBookshelf(bookshelfSection, bookshelf);
|
saveBookshelf(bookshelfSection, bookshelf);
|
||||||
}
|
}
|
||||||
configuration.save(bookshelfFile);
|
configuration.save(bookshelfFile);
|
||||||
|
Reference in New Issue
Block a user