diff --git a/pom.xml b/pom.xml
index 1331baf..e658198 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
com.asintoto
Basic
- 1.0.16
+ 1.0.17
jar
Basic
diff --git a/src/main/java/com/asintoto/basic/Basic.java b/src/main/java/com/asintoto/basic/Basic.java
index 84db64a..34f3bef 100644
--- a/src/main/java/com/asintoto/basic/Basic.java
+++ b/src/main/java/com/asintoto/basic/Basic.java
@@ -85,6 +85,8 @@ public static void terminate() {
hologramManager.save();
}
+ regionManager.terminate();
+ hologramManager.terminate();
}
/**
diff --git a/src/main/java/com/asintoto/basic/holograms/HologramManager.java b/src/main/java/com/asintoto/basic/holograms/HologramManager.java
index a6bd5ff..336518d 100644
--- a/src/main/java/com/asintoto/basic/holograms/HologramManager.java
+++ b/src/main/java/com/asintoto/basic/holograms/HologramManager.java
@@ -29,6 +29,13 @@ public HologramManager(String fileName) {
usedIds = new HashSet<>();
}
+ @Override
+ public void terminate() {
+ hologramList.clear();
+ currentId = 0;
+ usedIds.clear();
+ }
+
public Map getHologramList() {
return hologramList;
}
diff --git a/src/main/java/com/asintoto/basic/regions/RegionManager.java b/src/main/java/com/asintoto/basic/regions/RegionManager.java
index 67daa2d..305488e 100644
--- a/src/main/java/com/asintoto/basic/regions/RegionManager.java
+++ b/src/main/java/com/asintoto/basic/regions/RegionManager.java
@@ -26,6 +26,11 @@ public RegionManager(String fileName) {
regionList = new ArrayList<>();
}
+ @Override
+ public void terminate() {
+ regionList.clear();
+ }
+
public void addRegion(Region r) {
regionList.add(r);
}
diff --git a/src/main/java/com/asintoto/basic/utils/DataManager.java b/src/main/java/com/asintoto/basic/utils/DataManager.java
index 3e27162..be8de56 100644
--- a/src/main/java/com/asintoto/basic/utils/DataManager.java
+++ b/src/main/java/com/asintoto/basic/utils/DataManager.java
@@ -6,7 +6,7 @@
import java.io.File;
import java.io.IOException;
-public class DataManager {
+public abstract class DataManager {
private String fileName;
private YamlConfiguration config;
private File file;
@@ -30,22 +30,10 @@ public void setConfig(YamlConfiguration config) {
this.config = config;
}
- /*public File getFile() {
- return new File(Basic.getPlugin().getDataFolder() + "/" + Basic.getOptions().getDataFolderName() + "/" + fileName);
- }*/
-
public File getFile() {
return file;
}
- /*public void setFileName(String fileName) {
- this.fileName = fileName;
- }
-
- public void setFile(File file) {
- this.file = file;
- }*/
-
public boolean fileExists() {
return getFile().exists();
}
@@ -61,4 +49,6 @@ public void regenerateFile() {
e.printStackTrace();
}
}
+
+ public abstract void terminate();
}
diff --git a/src/main/java/com/asintoto/basic/utils/Options.java b/src/main/java/com/asintoto/basic/utils/Options.java
index bb47bca..da50048 100644
--- a/src/main/java/com/asintoto/basic/utils/Options.java
+++ b/src/main/java/com/asintoto/basic/utils/Options.java
@@ -27,6 +27,10 @@ public boolean isDebugMode() {
return debugMode;
}
+ public void debug() {
+ this.debugMode = true;
+ }
+
public void setSaveRegions(boolean saveRegions) {
this.saveRegions = saveRegions;
}