summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.classpath2
-rw-r--r--.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--[-rwxr-xr-x]genafx-base.sh0
-rw-r--r--[-rwxr-xr-x]genafx-nogen.sh0
-rw-r--r--[-rwxr-xr-x]genafx-test.sh0
-rw-r--r--pom.xml6
-rw-r--r--src/main/java/module-info.java8
-rw-r--r--src/main/java/tlIItools/AffixGroup.java8
-rw-r--r--src/main/java/tlIItools/EffectGroup.java5
-rw-r--r--src/main/java/tlIItools/LevelRange.java44
-rw-r--r--src/main/java/tlIItools/NameFileReader.java2
11 files changed, 69 insertions, 13 deletions
diff --git a/.classpath b/.classpath
index 2efb9eea..9dab56c4 100644
--- a/.classpath
+++ b/.classpath
@@ -18,7 +18,7 @@
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs
index 2f5cc74c..aeacc3c6 100644
--- a/.settings/org.eclipse.jdt.core.prefs
+++ b/.settings/org.eclipse.jdt.core.prefs
@@ -1,8 +1,7 @@
eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
-org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
+org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.release=disabled
-org.eclipse.jdt.core.compiler.source=1.8
+org.eclipse.jdt.core.compiler.source=17
diff --git a/genafx-base.sh b/genafx-base.sh
index bf68a28b..bf68a28b 100755..100644
--- a/genafx-base.sh
+++ b/genafx-base.sh
diff --git a/genafx-nogen.sh b/genafx-nogen.sh
index 27e2b040..27e2b040 100755..100644
--- a/genafx-nogen.sh
+++ b/genafx-nogen.sh
diff --git a/genafx-test.sh b/genafx-test.sh
index b84e0fd7..b84e0fd7 100755..100644
--- a/genafx-test.sh
+++ b/genafx-test.sh
diff --git a/pom.xml b/pom.xml
index ff43c2ab..1ab26789 100644
--- a/pom.xml
+++ b/pom.xml
@@ -7,8 +7,8 @@
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
- <source>1.8</source>
- <target>1.8</target>
+ <source>1.17</source>
+ <target>1.17</target>
</configuration>
</plugin>
@@ -36,7 +36,7 @@
<groupId>bjc</groupId>
<artifactId>tlIITools</artifactId>
- <version>1.0.0</version>
+ <version>2.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>tlIITools</name>
diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java
new file mode 100644
index 00000000..c0b567e1
--- /dev/null
+++ b/src/main/java/module-info.java
@@ -0,0 +1,8 @@
+/**
+ * Utilities for Torchlight II modding
+ * @author bjcul
+ *
+ */
+module tlIITools {
+ exports tlIItools;
+} \ No newline at end of file
diff --git a/src/main/java/tlIItools/AffixGroup.java b/src/main/java/tlIItools/AffixGroup.java
index 5835614d..9f6bf788 100644
--- a/src/main/java/tlIItools/AffixGroup.java
+++ b/src/main/java/tlIItools/AffixGroup.java
@@ -12,6 +12,9 @@ import tlIItools.Affix.*;
*
* @author Ben Culkin */
public class AffixGroup implements Comparable<AffixGroup> {
+ /**
+ * Contains all of the effects in this affix group
+ */
public List<EffectGroup> effects;
/** The types of enchanters who can add this. */
public List<String> enchantSources;
@@ -50,6 +53,11 @@ public class AffixGroup implements Comparable<AffixGroup> {
return afx.toAffixGroup().equals(this);
}
+ /**
+ * Get a summary of the effects of this group.
+ *
+ * @return A string summarizing the effects in this group
+ */
public String groupSummary() {
StringBuilder sb = new StringBuilder();
diff --git a/src/main/java/tlIItools/EffectGroup.java b/src/main/java/tlIItools/EffectGroup.java
index 9f4ad49b..4cbbc0a1 100644
--- a/src/main/java/tlIItools/EffectGroup.java
+++ b/src/main/java/tlIItools/EffectGroup.java
@@ -32,6 +32,11 @@ public class EffectGroup {
/** Whether or not this effect is a 'transfer' effect (Applied to the enemy on a hit). */
public boolean isTransfer;
+ /**
+ * Retrieve a summary of this effect group.
+ *
+ * @return A summary of the effect group
+ */
public String summary() {
StringBuilder sb = new StringBuilder();
diff --git a/src/main/java/tlIItools/LevelRange.java b/src/main/java/tlIItools/LevelRange.java
index b0d620bf..0cc803dd 100644
--- a/src/main/java/tlIItools/LevelRange.java
+++ b/src/main/java/tlIItools/LevelRange.java
@@ -2,6 +2,12 @@ package tlIItools;
import java.util.*;
+/**
+ * Represents a range of levels.
+ *
+ * @author bjcul
+ *
+ */
public class LevelRange implements Comparable<LevelRange> {
/*
* if (minLevel <= 1 && maxLevel == 999) {
@@ -19,14 +25,29 @@ public class LevelRange implements Comparable<LevelRange> {
* sb.append(minLevel);
* } */
+ /**
+ * The maximum level for this range.
+ */
public int minLevel;
+ /**
+ * The minimum level for this range.
+ */
public int maxLevel;
+ /**
+ * Create a new blank level range
+ */
public LevelRange() {
minLevel = 1;
maxLevel = 999;
}
+ /**
+ * Create a new set level range.
+ *
+ * @param minLevel The minimum level
+ * @param maxLevel The maximum level
+ */
public LevelRange(int minLevel, int maxLevel) {
this.minLevel = minLevel;
this.maxLevel = maxLevel;
@@ -37,14 +58,29 @@ public class LevelRange implements Comparable<LevelRange> {
maxLevel = Math.min(999, maxLevel);
}
+ /**
+ * Check if this level range is 'unrestricted'
+ *
+ * @return Whether the level range is unrestricted
+ */
public boolean isUnrestricted() {
return minLevel <= 1 && maxLevel >= 999;
}
+ /**
+ * Check if this range has no lower bound
+ *
+ * @return Whether the range has no lower bound
+ */
public boolean noLowerBound() {
return minLevel <= 1;
}
+ /**
+ * Check if this range has no upper bound
+ *
+ * @return Whether the range has no upper bound
+ */
public boolean noUpperBound() {
return maxLevel >= 999;
}
@@ -118,18 +154,16 @@ public class LevelRange implements Comparable<LevelRange> {
if (noLowerBound()) {
if (other.noLowerBound()) {
return maxLevel - other.maxLevel;
- } else {
- return -1;
}
+ return -1;
} else if (noUpperBound()) {
if (other.noUpperBound()) {
return minLevel - other.minLevel;
- } else {
- return 1;
}
+ return 1;
} else {
if (minLevel == other.minLevel) return maxLevel - other.maxLevel;
- else return minLevel - other.minLevel;
+ return minLevel - other.minLevel;
}
}
}
diff --git a/src/main/java/tlIItools/NameFileReader.java b/src/main/java/tlIItools/NameFileReader.java
index a9646942..a0593c28 100644
--- a/src/main/java/tlIItools/NameFileReader.java
+++ b/src/main/java/tlIItools/NameFileReader.java
@@ -80,6 +80,8 @@ public class NameFileReader {
*
* @param r The input source to read from. */
public void readFrom(Reader r) {
+ // the caller will take care of it
+ @SuppressWarnings("resource")
Scanner scn = new Scanner(r);
while (scn.hasNextLine()) {