From 3edcfce0d343d60d3b123f1fa2d02cc71e77cd6c Mon Sep 17 00:00:00 2001 From: gravityfox Date: Sat, 16 Jul 2016 05:15:22 -0700 Subject: [PATCH] Changed file extensions to be unique --- .../foxguard/plugin/FGStorageManager.java | 64 +++++++++---------- .../plugin/controller/LogicController.java | 4 +- .../foxguard/plugin/handler/BasicHandler.java | 8 +-- .../foxguard/plugin/handler/GroupHandler.java | 8 +-- 4 files changed, 42 insertions(+), 42 deletions(-) diff --git a/src/main/java/net/foxdenstudio/sponge/foxguard/plugin/FGStorageManager.java b/src/main/java/net/foxdenstudio/sponge/foxguard/plugin/FGStorageManager.java index e82cff9..88392d1 100644 --- a/src/main/java/net/foxdenstudio/sponge/foxguard/plugin/FGStorageManager.java +++ b/src/main/java/net/foxdenstudio/sponge/foxguard/plugin/FGStorageManager.java @@ -88,7 +88,7 @@ public void saveRegions() { public synchronized void saveRegions(boolean force) { logger.info("Saving regions" + (force ? " (forced save)" : "")); - try (DB mainDB = DBMaker.fileDB(directory.resolve("regions.db").normalize().toString()).make()) { + try (DB mainDB = DBMaker.fileDB(directory.resolve("regions.foxdb").normalize().toString()).make()) { Map mainMap = mainDB.hashMap("main", Serializer.STRING, Serializer.STRING).createOrOpen(); Map typeMap = mainDB.hashMap("types", Serializer.STRING, Serializer.STRING).createOrOpen(); Map enabledMap = mainDB.hashMap("enabled", Serializer.STRING, Serializer.BOOLEAN).createOrOpen(); @@ -113,7 +113,7 @@ public synchronized void saveRegions(boolean force) { } logger.info("Saving metadata for region \"" + name + "\""); - try (DB metaDB = DBMaker.fileDB(singleDir.resolve("metadata.db").normalize().toString()).make()) { + try (DB metaDB = DBMaker.fileDB(singleDir.resolve("metadata.foxdb").normalize().toString()).make()) { Atomic.String metaName = metaDB.atomicString("name").createOrOpen(); Atomic.String metaCategory = metaDB.atomicString("category").createOrOpen(); Atomic.String metaType = metaDB.atomicString("type").createOrOpen(); @@ -142,7 +142,7 @@ public synchronized void saveRegions(boolean force) { }); } catch (DBException.DataCorruption e) { try { - Files.deleteIfExists(directory.resolve("regions.db")); + Files.deleteIfExists(directory.resolve("regions.foxdb")); saveRegions(force); } catch (IOException e1) { e1.printStackTrace(); @@ -156,7 +156,7 @@ public void saveWorldRegions(World world) { public synchronized void saveWorldRegions(World world, boolean force) { logger.info("Saving world regions in world \"" + world.getName() + "\"" + (force ? " (forced save)" : "")); - try (DB mainDB = DBMaker.fileDB(worldDirectories.get(world.getName()).resolve("wregions.db").normalize().toString()).make()) { + try (DB mainDB = DBMaker.fileDB(worldDirectories.get(world.getName()).resolve("wregions.foxdb").normalize().toString()).make()) { Map mainMap = mainDB.hashMap("main", Serializer.STRING, Serializer.STRING).createOrOpen(); Map typeMap = mainDB.hashMap("types", Serializer.STRING, Serializer.STRING).createOrOpen(); Map enabledMap = mainDB.hashMap("enabled", Serializer.STRING, Serializer.BOOLEAN).createOrOpen(); @@ -181,7 +181,7 @@ public synchronized void saveWorldRegions(World world, boolean force) { } logger.info("Saving metadata for world region \"" + name + "\""); - try (DB metaDB = DBMaker.fileDB(singleDir.resolve("metadata.db").normalize().toString()).make()) { + try (DB metaDB = DBMaker.fileDB(singleDir.resolve("metadata.foxdb").normalize().toString()).make()) { Atomic.String metaName = metaDB.atomicString("name").createOrOpen(); Atomic.String metaCategory = metaDB.atomicString("category").createOrOpen(); Atomic.String metaType = metaDB.atomicString("type").createOrOpen(); @@ -211,7 +211,7 @@ public synchronized void saveWorldRegions(World world, boolean force) { }); } catch (DBException.DataCorruption e) { try { - Files.deleteIfExists(directory.resolve("wregions.db")); + Files.deleteIfExists(directory.resolve("wregions.foxdb")); saveWorldRegions(world, force); } catch (IOException e1) { e1.printStackTrace(); @@ -225,7 +225,7 @@ public void saveHandlers() { public synchronized void saveHandlers(boolean force) { logger.info("Saving handlers" + (force ? " (forced save)" : "")); - try (DB mainDB = DBMaker.fileDB(directory.resolve("handlers.db").normalize().toString()).make()) { + try (DB mainDB = DBMaker.fileDB(directory.resolve("handlers.foxdb").normalize().toString()).make()) { Map mainMap = mainDB.hashMap("main", Serializer.STRING, Serializer.STRING).createOrOpen(); Map typeMap = mainDB.hashMap("types", Serializer.STRING, Serializer.STRING).createOrOpen(); Map enabledMap = mainDB.hashMap("enabled", Serializer.STRING, Serializer.BOOLEAN).createOrOpen(); @@ -249,7 +249,7 @@ public synchronized void saveHandlers(boolean force) { } logger.info("Saving metadata for handler \"" + name + "\""); - try (DB metaDB = DBMaker.fileDB(singleDir.resolve("metadata.db").normalize().toString()).make()) { + try (DB metaDB = DBMaker.fileDB(singleDir.resolve("metadata.foxdb").normalize().toString()).make()) { Atomic.String metaName = metaDB.atomicString("name").createOrOpen(); Atomic.String metaCategory = metaDB.atomicString("category").createOrOpen(); Atomic.String metaType = metaDB.atomicString("type").createOrOpen(); @@ -277,7 +277,7 @@ public synchronized void saveHandlers(boolean force) { }); } catch (DBException.DataCorruption e) { try { - Files.deleteIfExists(directory.resolve("handlers.db")); + Files.deleteIfExists(directory.resolve("handlers.foxdb")); saveHandlers(force); } catch (IOException e1) { e1.printStackTrace(); @@ -287,7 +287,7 @@ public synchronized void saveHandlers(boolean force) { public synchronized void saveRegion(IRegion fgObject) { if (fgObject instanceof IWorldRegion) saveWorldRegion((IWorldRegion) fgObject); - else try (DB mainDB = DBMaker.fileDB(directory.resolve("regions.db").normalize().toString()).make()) { + else try (DB mainDB = DBMaker.fileDB(directory.resolve("regions.foxdb").normalize().toString()).make()) { Map mainMap = mainDB.hashMap("main", Serializer.STRING, Serializer.STRING).createOrOpen(); Map typeMap = mainDB.hashMap("types", Serializer.STRING, Serializer.STRING).createOrOpen(); Map enabledMap = mainDB.hashMap("enabled", Serializer.STRING, Serializer.BOOLEAN).createOrOpen(); @@ -306,7 +306,7 @@ else try (DB mainDB = DBMaker.fileDB(directory.resolve("regions.db").normalize() } logger.info("Saving metadata for region \"" + name + "\""); - try (DB metaDB = DBMaker.fileDB(singleDir.resolve("metadata.db").normalize().toString()).make()) { + try (DB metaDB = DBMaker.fileDB(singleDir.resolve("metadata.foxdb").normalize().toString()).make()) { Atomic.String metaName = metaDB.atomicString("name").createOrOpen(); Atomic.String metaCategory = metaDB.atomicString("category").createOrOpen(); Atomic.String metaType = metaDB.atomicString("type").createOrOpen(); @@ -325,7 +325,7 @@ else try (DB mainDB = DBMaker.fileDB(directory.resolve("regions.db").normalize() defaultModifiedMap.put(fgObject, false); } catch (DBException.DataCorruption e) { try { - Files.deleteIfExists(directory.resolve("regions.db")); + Files.deleteIfExists(directory.resolve("regions.foxdb")); saveRegions(); } catch (IOException e1) { e1.printStackTrace(); @@ -334,7 +334,7 @@ else try (DB mainDB = DBMaker.fileDB(directory.resolve("regions.db").normalize() } public synchronized void saveWorldRegion(IWorldRegion fgObject) { - try (DB mainDB = DBMaker.fileDB(worldDirectories.get(fgObject.getWorld().getName()).resolve("wregions.db").normalize().toString()).make()) { + try (DB mainDB = DBMaker.fileDB(worldDirectories.get(fgObject.getWorld().getName()).resolve("wregions.foxdb").normalize().toString()).make()) { Map mainMap = mainDB.hashMap("main", Serializer.STRING, Serializer.STRING).createOrOpen(); Map typeMap = mainDB.hashMap("types", Serializer.STRING, Serializer.STRING).createOrOpen(); Map enabledMap = mainDB.hashMap("enabled", Serializer.STRING, Serializer.BOOLEAN).createOrOpen(); @@ -353,7 +353,7 @@ public synchronized void saveWorldRegion(IWorldRegion fgObject) { } logger.info("Saving metadata for world region \"" + name + "\""); - try (DB metaDB = DBMaker.fileDB(singleDir.resolve("metadata.db").normalize().toString()).make()) { + try (DB metaDB = DBMaker.fileDB(singleDir.resolve("metadata.foxdb").normalize().toString()).make()) { Atomic.String metaName = metaDB.atomicString("name").createOrOpen(); Atomic.String metaCategory = metaDB.atomicString("category").createOrOpen(); Atomic.String metaType = metaDB.atomicString("type").createOrOpen(); @@ -372,7 +372,7 @@ public synchronized void saveWorldRegion(IWorldRegion fgObject) { defaultModifiedMap.put(fgObject, false); } catch (DBException.DataCorruption e) { try { - Files.deleteIfExists(directory.resolve("regions.db")); + Files.deleteIfExists(directory.resolve("regions.foxdb")); saveWorldRegions(fgObject.getWorld()); } catch (IOException e1) { e1.printStackTrace(); @@ -381,7 +381,7 @@ public synchronized void saveWorldRegion(IWorldRegion fgObject) { } public synchronized void saveHandler(IHandler fgObject) { - try (DB mainDB = DBMaker.fileDB(directory.resolve("handlers.db").normalize().toString()).make()) { + try (DB mainDB = DBMaker.fileDB(directory.resolve("handlers.foxdb").normalize().toString()).make()) { Map mainMap = mainDB.hashMap("main", Serializer.STRING, Serializer.STRING).createOrOpen(); Map typeMap = mainDB.hashMap("types", Serializer.STRING, Serializer.STRING).createOrOpen(); Map enabledMap = mainDB.hashMap("enabled", Serializer.STRING, Serializer.BOOLEAN).createOrOpen(); @@ -400,7 +400,7 @@ public synchronized void saveHandler(IHandler fgObject) { } logger.info("Saving metadata for handler \"" + name + "\""); - try (DB metaDB = DBMaker.fileDB(singleDir.resolve("metadata.db").normalize().toString()).make()) { + try (DB metaDB = DBMaker.fileDB(singleDir.resolve("metadata.foxdb").normalize().toString()).make()) { Atomic.String metaName = metaDB.atomicString("name").createOrOpen(); Atomic.String metaCategory = metaDB.atomicString("category").createOrOpen(); Atomic.String metaType = metaDB.atomicString("type").createOrOpen(); @@ -421,7 +421,7 @@ public synchronized void saveHandler(IHandler fgObject) { defaultModifiedMap.put(fgObject, false); } catch (DBException.DataCorruption e) { try { - Files.deleteIfExists(directory.resolve("regions.db")); + Files.deleteIfExists(directory.resolve("regions.foxdb")); saveHandlers(); } catch (IOException e1) { e1.printStackTrace(); @@ -431,7 +431,7 @@ public synchronized void saveHandler(IHandler fgObject) { public synchronized void removeRegion(IRegion fgObject) { if (fgObject instanceof IWorldRegion) removeWorldRegion((IWorldRegion) fgObject); - else try (DB mainDB = DBMaker.fileDB(directory.resolve("regions.db").normalize().toString()).make()) { + else try (DB mainDB = DBMaker.fileDB(directory.resolve("regions.foxdb").normalize().toString()).make()) { Map mainMap = mainDB.hashMap("main", Serializer.STRING, Serializer.STRING).createOrOpen(); Map typeMap = mainDB.hashMap("types", Serializer.STRING, Serializer.STRING).createOrOpen(); Map enabledMap = mainDB.hashMap("enabled", Serializer.STRING, Serializer.BOOLEAN).createOrOpen(); @@ -443,7 +443,7 @@ else try (DB mainDB = DBMaker.fileDB(directory.resolve("regions.db").normalize() linksMap.remove(fgObject.getName()); } catch (DBException.DataCorruption e) { try { - Files.deleteIfExists(directory.resolve("regions.db")); + Files.deleteIfExists(directory.resolve("regions.foxdb")); saveRegions(); } catch (IOException e1) { e1.printStackTrace(); @@ -461,7 +461,7 @@ else try (DB mainDB = DBMaker.fileDB(directory.resolve("regions.db").normalize() } public synchronized void removeWorldRegion(IWorldRegion fgObject) { - try (DB mainDB = DBMaker.fileDB(worldDirectories.get(fgObject.getWorld().getName()).resolve("wregions.db").normalize().toString()).make()) { + try (DB mainDB = DBMaker.fileDB(worldDirectories.get(fgObject.getWorld().getName()).resolve("wregions.foxdb").normalize().toString()).make()) { Map mainMap = mainDB.hashMap("main", Serializer.STRING, Serializer.STRING).createOrOpen(); Map typeMap = mainDB.hashMap("types", Serializer.STRING, Serializer.STRING).createOrOpen(); Map enabledMap = mainDB.hashMap("enabled", Serializer.STRING, Serializer.BOOLEAN).createOrOpen(); @@ -473,7 +473,7 @@ public synchronized void removeWorldRegion(IWorldRegion fgObject) { linksMap.remove(fgObject.getName()); } catch (DBException.DataCorruption e) { try { - Files.deleteIfExists(directory.resolve("regions.db")); + Files.deleteIfExists(directory.resolve("regions.foxdb")); saveWorldRegions(fgObject.getWorld()); } catch (IOException e1) { e1.printStackTrace(); @@ -491,7 +491,7 @@ public synchronized void removeWorldRegion(IWorldRegion fgObject) { } public synchronized void removeHandler(IHandler fgObject) { - try (DB mainDB = DBMaker.fileDB(directory.resolve("handlers.db").normalize().toString()).make()) { + try (DB mainDB = DBMaker.fileDB(directory.resolve("handlers.foxdb").normalize().toString()).make()) { Map mainMap = mainDB.hashMap("main", Serializer.STRING, Serializer.STRING).createOrOpen(); Map typeMap = mainDB.hashMap("types", Serializer.STRING, Serializer.STRING).createOrOpen(); Map enabledMap = mainDB.hashMap("enabled", Serializer.STRING, Serializer.BOOLEAN).createOrOpen(); @@ -503,7 +503,7 @@ public synchronized void removeHandler(IHandler fgObject) { priorityMap.remove(fgObject.getName()); } catch (DBException.DataCorruption e) { try { - Files.deleteIfExists(directory.resolve("regions.db")); + Files.deleteIfExists(directory.resolve("regions.foxdb")); saveHandlers(); } catch (IOException e1) { e1.printStackTrace(); @@ -521,7 +521,7 @@ public synchronized void removeHandler(IHandler fgObject) { } public synchronized void loadRegions() { - try (DB mainDB = DBMaker.fileDB(directory.resolve("regions.db").normalize().toString()).make()) { + try (DB mainDB = DBMaker.fileDB(directory.resolve("regions.foxdb").normalize().toString()).make()) { Map mainMap = mainDB.hashMap("main", Serializer.STRING, Serializer.STRING).createOrOpen(); Map typeMap = mainDB.hashMap("types", Serializer.STRING, Serializer.STRING).createOrOpen(); Map enabledMap = mainDB.hashMap("enabled", Serializer.STRING, Serializer.BOOLEAN).createOrOpen(); @@ -530,7 +530,7 @@ public synchronized void loadRegions() { mainMap.entrySet().forEach((entry) -> { String name = entry.getKey(); Path singleDir = dir.resolve(name.toLowerCase()); - Path metaDataFile = singleDir.resolve("metadata.db"); + Path metaDataFile = singleDir.resolve("metadata.foxdb"); logger.info("Loading region \"" + name + "\" from " + singleDir); if (Files.exists(metaDataFile) && !Files.isDirectory(metaDataFile)) { String category; @@ -606,7 +606,7 @@ public synchronized void loadRegions() { } public synchronized void loadWorldRegions(World world) { - try (DB mainDB = DBMaker.fileDB(worldDirectories.get(world.getName()).resolve("wregions.db").normalize().toString()).make()) { + try (DB mainDB = DBMaker.fileDB(worldDirectories.get(world.getName()).resolve("wregions.foxdb").normalize().toString()).make()) { Map mainMap = mainDB.hashMap("main", Serializer.STRING, Serializer.STRING).createOrOpen(); Map typeMap = mainDB.hashMap("types", Serializer.STRING, Serializer.STRING).createOrOpen(); Map enabledMap = mainDB.hashMap("enabled", Serializer.STRING, Serializer.BOOLEAN).createOrOpen(); @@ -615,7 +615,7 @@ public synchronized void loadWorldRegions(World world) { mainMap.entrySet().forEach((entry) -> { String name = entry.getKey(); Path singleDir = dir.resolve(name.toLowerCase()); - Path metaDataFile = singleDir.resolve("metadata.db"); + Path metaDataFile = singleDir.resolve("metadata.foxdb"); logger.info("Loading world region \"" + name + "\" from " + singleDir); if (Files.exists(metaDataFile) && !Files.isDirectory(metaDataFile)) { String category; @@ -691,7 +691,7 @@ public synchronized void loadWorldRegions(World world) { } public synchronized void loadHandlers() { - try (DB mainDB = DBMaker.fileDB(directory.resolve("handlers.db").normalize().toString()).make()) { + try (DB mainDB = DBMaker.fileDB(directory.resolve("handlers.foxdb").normalize().toString()).make()) { Map mainMap = mainDB.hashMap("main", Serializer.STRING, Serializer.STRING).createOrOpen(); Map typeMap = mainDB.hashMap("types", Serializer.STRING, Serializer.STRING).createOrOpen(); Map enabledMap = mainDB.hashMap("enabled", Serializer.STRING, Serializer.BOOLEAN).createOrOpen(); @@ -701,7 +701,7 @@ public synchronized void loadHandlers() { mainMap.entrySet().forEach((entry) -> { String name = entry.getKey(); Path singleDir = dir.resolve(name.toLowerCase()); - Path metaDataFile = singleDir.resolve("metadata.db"); + Path metaDataFile = singleDir.resolve("metadata.foxdb"); logger.info("Loading handler \"" + name + "\" from " + singleDir); if (Files.exists(metaDataFile) && !Files.isDirectory(metaDataFile)) { String category; @@ -791,7 +791,7 @@ public void loadLinks() { public synchronized void loadRegionLinks() { logger.info("Loading region links"); - try (DB mainDB = DBMaker.fileDB(directory.resolve("regions.db").normalize().toString()).make()) { + try (DB mainDB = DBMaker.fileDB(directory.resolve("regions.foxdb").normalize().toString()).make()) { Map linksMap = mainDB.hashMap("links", Serializer.STRING, Serializer.STRING).createOrOpen(); linksMap.entrySet().forEach(entry -> { IRegion region = FGManager.getInstance().getRegion(entry.getKey()); @@ -815,7 +815,7 @@ public synchronized void loadRegionLinks() { public synchronized void loadWorldRegionLinks(World world) { logger.info("Loading world region links for world \"" + world.getName() + "\""); - try (DB mainDB = DBMaker.fileDB(worldDirectories.get(world.getName()).resolve("wregions.db").normalize().toString()).make()) { + try (DB mainDB = DBMaker.fileDB(worldDirectories.get(world.getName()).resolve("wregions.foxdb").normalize().toString()).make()) { Map linksMap = mainDB.hashMap("links", Serializer.STRING, Serializer.STRING).createOrOpen(); linksMap.entrySet().forEach(entry -> { IRegion region = FGManager.getInstance().getWorldRegion(world, entry.getKey()); diff --git a/src/main/java/net/foxdenstudio/sponge/foxguard/plugin/controller/LogicController.java b/src/main/java/net/foxdenstudio/sponge/foxguard/plugin/controller/LogicController.java index 0661631..dd25952 100644 --- a/src/main/java/net/foxdenstudio/sponge/foxguard/plugin/controller/LogicController.java +++ b/src/main/java/net/foxdenstudio/sponge/foxguard/plugin/controller/LogicController.java @@ -140,7 +140,7 @@ public List modifySuggestions(CommandSource source, String arguments) th @Override public void save(Path directory) { - try (DB linksDB = DBMaker.fileDB(directory.resolve("links.db").normalize().toString()).make()) { + try (DB linksDB = DBMaker.fileDB(directory.resolve("links.foxdb").normalize().toString()).make()) { List linksList = linksDB.indexTreeList("links", Serializer.STRING).createOrOpen(); linksList.clear(); handlers.stream().map(IFGObject::getName).forEach(linksList::add); @@ -170,7 +170,7 @@ public void save(Path directory) { @Override public void loadLinks(Path directory) { - try (DB linksDB = DBMaker.fileDB(directory.resolve("links.db").normalize().toString()).make()) { + try (DB linksDB = DBMaker.fileDB(directory.resolve("links.foxdb").normalize().toString()).make()) { List linksList = linksDB.indexTreeList("links", Serializer.STRING).createOrOpen(); handlers.clear(); linksList.stream() diff --git a/src/main/java/net/foxdenstudio/sponge/foxguard/plugin/handler/BasicHandler.java b/src/main/java/net/foxdenstudio/sponge/foxguard/plugin/handler/BasicHandler.java index 81489f0..6c3579f 100644 --- a/src/main/java/net/foxdenstudio/sponge/foxguard/plugin/handler/BasicHandler.java +++ b/src/main/java/net/foxdenstudio/sponge/foxguard/plugin/handler/BasicHandler.java @@ -1123,12 +1123,12 @@ public List detailsSuggestions(CommandSource source, String arguments) { public void save(Path directory) { FGStorageManager storageManager = FGStorageManager.getInstance(); UserStorageService userStorageService = FoxGuardMain.instance().getUserStorage(); - try (DB flagMapDB = DBMaker.fileDB(directory.resolve("groups.db").normalize().toString()).make()) { + try (DB flagMapDB = DBMaker.fileDB(directory.resolve("groups.foxdb").normalize().toString()).make()) { List groupNames = flagMapDB.indexTreeList("names", Serializer.STRING).createOrOpen(); groupNames.clear(); groupNames.addAll(this.groups.stream().map(group -> group.name).collect(Collectors.toList())); } - try (DB flagMapDB = DBMaker.fileDB(directory.resolve("flags.db").normalize().toString()).make()) { + try (DB flagMapDB = DBMaker.fileDB(directory.resolve("flags.foxdb").normalize().toString()).make()) { for (Group group : this.groups) { List stringEntries = flagMapDB.indexTreeList(group.name, Serializer.STRING).createOrOpen(); stringEntries.clear(); @@ -1577,7 +1577,7 @@ public IHandler create(String name, int priority, String arguments, CommandSourc public IHandler create(Path directory, String name, int priority, boolean isEnabled) { FGStorageManager storageManager = FGStorageManager.getInstance(); List groupNames = new ArrayList<>(); - try (DB flagMapDB = DBMaker.fileDB(directory.resolve("groups.db").normalize().toString()).make()) { + try (DB flagMapDB = DBMaker.fileDB(directory.resolve("groups.foxdb").normalize().toString()).make()) { groupNames.addAll(flagMapDB.indexTreeList("names", Serializer.STRING).createOrOpen()); } Path groupsDirectory = directory.resolve("groups"); @@ -1604,7 +1604,7 @@ public IHandler create(Path directory, String name, int priority, boolean isEnab } Map> groupPermissions = new HashMap<>(); List defaultPermissions; - try (DB flagMapDB = DBMaker.fileDB(directory.resolve("flags.db").normalize().toString()).make()) { + try (DB flagMapDB = DBMaker.fileDB(directory.resolve("flags.foxdb").normalize().toString()).make()) { for (Group group : groups) { List stringEntries = flagMapDB.indexTreeList(group.name, Serializer.STRING).createOrOpen(); groupPermissions.put(group, stringEntries.stream() diff --git a/src/main/java/net/foxdenstudio/sponge/foxguard/plugin/handler/GroupHandler.java b/src/main/java/net/foxdenstudio/sponge/foxguard/plugin/handler/GroupHandler.java index 32b2d4c..e97ff82 100644 --- a/src/main/java/net/foxdenstudio/sponge/foxguard/plugin/handler/GroupHandler.java +++ b/src/main/java/net/foxdenstudio/sponge/foxguard/plugin/handler/GroupHandler.java @@ -863,12 +863,12 @@ public List detailsSuggestions(CommandSource source, String arguments) { @Override public void save(Path directory) { - try (DB flagMapDB = DBMaker.fileDB(directory.resolve("groups.db").normalize().toString()).make()) { + try (DB flagMapDB = DBMaker.fileDB(directory.resolve("groups.foxdb").normalize().toString()).make()) { List groupNames = flagMapDB.indexTreeList("names", Serializer.STRING).createOrOpen(); groupNames.clear(); groupNames.addAll(this.groups.stream().map(group -> group.name).collect(Collectors.toList())); } - try (DB flagMapDB = DBMaker.fileDB(directory.resolve("flags.db").normalize().toString()).make()) { + try (DB flagMapDB = DBMaker.fileDB(directory.resolve("flags.foxdb").normalize().toString()).make()) { for (Group group : this.groups) { List stringEntries = flagMapDB.indexTreeList(group.name, Serializer.STRING).createOrOpen(); stringEntries.clear(); @@ -1224,7 +1224,7 @@ public IHandler create(String name, int priority, String arguments, CommandSourc @Override public IHandler create(Path directory, String name, int priority, boolean isEnabled) { List groupNames = new ArrayList<>(); - try (DB flagMapDB = DBMaker.fileDB(directory.resolve("groups.db").normalize().toString()).make()) { + try (DB flagMapDB = DBMaker.fileDB(directory.resolve("groups.foxdb").normalize().toString()).make()) { groupNames.addAll(flagMapDB.indexTreeList("names", Serializer.STRING).createOrOpen()); } List groups = new ArrayList<>(); @@ -1246,7 +1246,7 @@ public IHandler create(Path directory, String name, int priority, boolean isEnab Map> groupPermissions = new HashMap<>(); List defaultPermissions; - try (DB flagMapDB = DBMaker.fileDB(directory.resolve("flags.db").normalize().toString()).make()) { + try (DB flagMapDB = DBMaker.fileDB(directory.resolve("flags.foxdb").normalize().toString()).make()) { for (Group group : groups) { List stringEntries = flagMapDB.indexTreeList(group.name, Serializer.STRING).createOrOpen(); groupPermissions.put(group, stringEntries.stream()