aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/net/sowgro/npehero/levelapi/Difficulties.java
diff options
context:
space:
mode:
authorsowgro <tpoke.ferrari@gmail.com>2024-08-29 21:51:14 -0400
committersowgro <tpoke.ferrari@gmail.com>2024-08-29 21:51:14 -0400
commitfb70a24c04a5beec6cc7ff9248ef8f5fd46fcc87 (patch)
tree8f9610d0da1301d6b5e82903418aaf0459cf8666 /src/main/java/net/sowgro/npehero/levelapi/Difficulties.java
parent7a3aa914a7a64952dd0e134cd998d0cf0e445b4f (diff)
downloadNPEhero-fb70a24c04a5beec6cc7ff9248ef8f5fd46fcc87.tar.gz
NPEhero-fb70a24c04a5beec6cc7ff9248ef8f5fd46fcc87.tar.bz2
NPEhero-fb70a24c04a5beec6cc7ff9248ef8f5fd46fcc87.zip
Implement new create dialog
Diffstat (limited to 'src/main/java/net/sowgro/npehero/levelapi/Difficulties.java')
-rw-r--r--src/main/java/net/sowgro/npehero/levelapi/Difficulties.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/net/sowgro/npehero/levelapi/Difficulties.java b/src/main/java/net/sowgro/npehero/levelapi/Difficulties.java
index ea17e21..cfb3673 100644
--- a/src/main/java/net/sowgro/npehero/levelapi/Difficulties.java
+++ b/src/main/java/net/sowgro/npehero/levelapi/Difficulties.java
@@ -82,7 +82,7 @@ public class Difficulties {
* @param text The name of the directory
* @throws IOException If there is a problem adding the level
*/
- public void add(String text) throws IOException {
+ public Difficulty add(String text) throws IOException {
File diffDir = new File(level.dir, text.toLowerCase().replaceAll("\\W+", "-"));
if (diffDir.exists()) {
throw new FileAlreadyExistsException(diffDir.getName());
@@ -92,6 +92,7 @@ public class Difficulties {
temp.title = text;
list.add(temp);
list.sort(Comparator.naturalOrder());
+ return temp;
}
else {
throw new IOException();