aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSHsuperCM <shsupercm@gmail.com>2022-02-16 15:19:07 +0200
committerSHsuperCM <shsupercm@gmail.com>2022-02-16 15:19:07 +0200
commitdd0b7b4b6af463ee0b8e794300a05a10d46a75e4 (patch)
tree16156fee54d6f36b5408ffabf5a431267bfa9729 /src
parent9b04862bfb974a2b6728d1ddcf8a0c93b7bae1fc (diff)
downloadCITResewn-dd0b7b4b6af463ee0b8e794300a05a10d46a75e4.tar.gz
CITResewn-dd0b7b4b6af463ee0b8e794300a05a10d46a75e4.tar.bz2
CITResewn-dd0b7b4b6af463ee0b8e794300a05a10d46a75e4.zip
Added partial support for colon separator
Diffstat (limited to 'src')
-rw-r--r--src/main/java/shcm/shsupercm/fabric/citresewn/ex/CITParsingException.java2
-rw-r--r--src/main/java/shcm/shsupercm/fabric/citresewn/pack/format/PropertiesGroupAdapter.java6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/shcm/shsupercm/fabric/citresewn/ex/CITParsingException.java b/src/main/java/shcm/shsupercm/fabric/citresewn/ex/CITParsingException.java
index 384014b..b3e126f 100644
--- a/src/main/java/shcm/shsupercm/fabric/citresewn/ex/CITParsingException.java
+++ b/src/main/java/shcm/shsupercm/fabric/citresewn/ex/CITParsingException.java
@@ -8,6 +8,6 @@ public class CITParsingException extends Exception {
}
public static String descriptionOf(String message, PropertyGroup propertyGroup, int position) {
- return message + (position != -1 ? " line " + position : "") + " in " + propertyGroup.identifier.toString() + " from " + propertyGroup.packName;
+ return message + (position != -1 ? " @L" + position : "") + " in " + propertyGroup.identifier.toString() + " from " + propertyGroup.packName;
}
}
diff --git a/src/main/java/shcm/shsupercm/fabric/citresewn/pack/format/PropertiesGroupAdapter.java b/src/main/java/shcm/shsupercm/fabric/citresewn/pack/format/PropertiesGroupAdapter.java
index 8ad2ccf..c0b3da6 100644
--- a/src/main/java/shcm/shsupercm/fabric/citresewn/pack/format/PropertiesGroupAdapter.java
+++ b/src/main/java/shcm/shsupercm/fabric/citresewn/pack/format/PropertiesGroupAdapter.java
@@ -47,6 +47,7 @@ public class PropertiesGroupAdapter extends PropertyGroup {
StringBuilder builder = new StringBuilder();
String key = null, keyMetadata = null;
+ final boolean checkColonSeparator = !line.contains("=");
for (int i = 0; i < line.length(); i++) {
char c = line.charAt(i);
@@ -75,7 +76,7 @@ public class PropertiesGroupAdapter extends PropertyGroup {
default -> c;
};
- } else if (key == null && c == '=') {
+ } else if (key == null && (c == '=' || (checkColonSeparator && c == ':'))) {
key = builder.toString().stripTrailing();
int metadataIndex = key.indexOf('.');
if (metadataIndex >= 0) {
@@ -89,11 +90,10 @@ public class PropertiesGroupAdapter extends PropertyGroup {
continue;
}
-
builder.append(c);
}
- if (key == null) //todo handle : separator
+ if (key == null)
throw new IOException("Missing separator in line " + linePos);
int pos = linePos - multilineSkip;