Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Asintotoo authored Jun 20, 2024
1 parent 2aca3c1 commit ff91adc
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 14 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.asintoto</groupId>
<artifactId>Basic</artifactId>
<version>1.0.16</version>
<version>1.0.17</version>
<packaging>jar</packaging>

<name>Basic</name>
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/asintoto/basic/Basic.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ public static void terminate() {
hologramManager.save();
}

regionManager.terminate();
hologramManager.terminate();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ public HologramManager(String fileName) {
usedIds = new HashSet<>();
}

@Override
public void terminate() {
hologramList.clear();
currentId = 0;
usedIds.clear();
}

public Map<Hologram, Integer> getHologramList() {
return hologramList;
}
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/asintoto/basic/regions/RegionManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
16 changes: 3 additions & 13 deletions src/main/java/com/asintoto/basic/utils/DataManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
}
Expand All @@ -61,4 +49,6 @@ public void regenerateFile() {
e.printStackTrace();
}
}

public abstract void terminate();
}
4 changes: 4 additions & 0 deletions src/main/java/com/asintoto/basic/utils/Options.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ public boolean isDebugMode() {
return debugMode;
}

public void debug() {
this.debugMode = true;
}

public void setSaveRegions(boolean saveRegions) {
this.saveRegions = saveRegions;
}
Expand Down

0 comments on commit ff91adc

Please sign in to comment.