5.0.0 #32

Merged
quentinlegot merged 4 commits from dev into master 2024-02-12 20:49:50 +01:00
17 changed files with 41 additions and 24 deletions

View File

@ -24,10 +24,10 @@ public class ConfigI {
return configPath.resolve(name); return configPath.resolve(name);
} }
public static ConfigI load(Path configPath, String name, Class<? extends ConfigI> clazz) throws IOException, JsonSyntaxException, JsonIOException { public static <T extends ConfigI> T load(Path configPath, String name, Class<T> clazz) throws IOException, JsonSyntaxException, JsonIOException {
Path path = getConfigPath(configPath, name); Path path = getConfigPath(configPath, name);
ConfigI file; T file;
if(Files.exists(path)) { if(Files.exists(path)) {
FileReader reader = new FileReader(path.toFile()); FileReader reader = new FileReader(path.toFile());
@ -58,6 +58,7 @@ public class ConfigI {
Files.writeString(this.configPath, GSON.toJson(this)); Files.writeString(this.configPath, GSON.toJson(this));
// Files.copy(tempPath, this.configPath, StandardCopyOption.REPLACE_EXISTING); // Files.copy(tempPath, this.configPath, StandardCopyOption.REPLACE_EXISTING);
// Files.delete(tempPath); // Files.delete(tempPath);
// commented because throws an error on windows each time if the file already exist
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 323 KiB

View File

@ -8,7 +8,7 @@
"Altarik" "Altarik"
], ],
"contributors": [ "contributors": [
"Legot Quentin<legotquentin@gmail.com>"
], ],
"contact": { "contact": {
"homepage": "https://altarik.fr" "homepage": "https://altarik.fr"
@ -25,5 +25,13 @@
"fabric-api": "*", "fabric-api": "*",
"minecraft": "${minecraftVersion}", "minecraft": "${minecraftVersion}",
"java": ">=17" "java": ">=17"
},
"custom": {
"modmenu": {
"badges": [ "library" ],
"parent": {
"parent": "toolbox"
}
}
} }
} }

View File

@ -32,7 +32,7 @@ public class BuilderImpl implements IBuilder<BuilderResult> {
@Override @Override
public BuilderResult build() throws Exception { public BuilderResult build() {
return new BuilderResult(collection.get(), numberOfSentences.get()); return new BuilderResult(collection.get(), numberOfSentences.get());
} }
} }

View File

@ -14,7 +14,7 @@ public class ConfigITest {
public double para3 = 3.14; public double para3 = 3.14;
public static ConfigClazz load() throws IOException { public static ConfigClazz load() throws IOException {
return (ConfigClazz) load(Path.of("."), "test.json", ConfigClazz.class); return load(Path.of("."), "test.json", ConfigClazz.class);
} }
} }

View File

@ -25,13 +25,6 @@ public abstract class AbstractSqlConnection implements SqlConnection {
return connection; return connection;
} }
@Override
public void closeConnection() {
try {
close();
} catch (Exception ignored) {}
}
@Override @Override
public void close() throws Exception { public void close() throws Exception {
if(!connection.isClosed()) { if(!connection.isClosed()) {

View File

@ -23,10 +23,4 @@ public interface SqlConnection extends AutoCloseable {
*/ */
void checkConnection() throws SQLException; void checkConnection() throws SQLException;
/**
* @deprecated replaced with {@link AutoCloseable#close()}
*/
@Deprecated(forRemoval = true)
void closeConnection();
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 323 KiB

View File

@ -8,7 +8,7 @@
"Altarik" "Altarik"
], ],
"contributors": [ "contributors": [
"Legot Quentin<legotquentin@gmail.com>"
], ],
"contact": { "contact": {
"homepage": "https://altarik.fr" "homepage": "https://altarik.fr"
@ -26,5 +26,13 @@
"minecraft": "${minecraftVersion}", "minecraft": "${minecraftVersion}",
"java": ">=17", "java": ">=17",
"toolbox-core": "${version}" "toolbox-core": "${version}"
},
"custom": {
"modmenu": {
"badges": [ "library" ],
"parent": {
"parent": "toolbox"
}
}
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 323 KiB

View File

@ -8,7 +8,7 @@
"Altarik" "Altarik"
], ],
"contributors": [ "contributors": [
"Legot Quentin<legotquentin@gmail.com>"
], ],
"contact": { "contact": {
"homepage": "https://altarik.fr" "homepage": "https://altarik.fr"
@ -29,5 +29,13 @@
"fabric-api": "*", "fabric-api": "*",
"minecraft": "${minecraftVersion}", "minecraft": "${minecraftVersion}",
"java": ">=17" "java": ">=17"
},
"custom": {
"modmenu": {
"badges": [ "library" ],
"parent": {
"parent": "toolbox"
}
}
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 323 KiB

View File

@ -8,7 +8,7 @@
"Altarik" "Altarik"
], ],
"contributors": [ "contributors": [
"Legot Quentin<legotquentin@gmail.com>"
], ],
"contact": { "contact": {
"homepage": "https://altarik.fr" "homepage": "https://altarik.fr"

View File

@ -1 +1 @@
okhttp_version=4.10.0 okhttp_version=4.12.0

View File

@ -8,7 +8,7 @@ loader_version=0.15.6
fabric_version=0.95.4+1.20.4 fabric_version=0.95.4+1.20.4
maven_group=fr.altarik.toolbox maven_group=fr.altarik.toolbox
maven_version=4.5.1 maven_version=5.0.0
git_owner=quentinlegot git_owner=quentinlegot
git_repo=Toolbox git_repo=Toolbox

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 323 KiB

View File

@ -8,7 +8,7 @@
"Altarik" "Altarik"
], ],
"contributors": [ "contributors": [
"Legot Quentin<legotquentin@gmail.com>"
], ],
"contact": { "contact": {
"homepage": "https://altarik.fr" "homepage": "https://altarik.fr"
@ -25,6 +25,11 @@
"toolbox-database": "${version}", "toolbox-database": "${version}",
"toolbox-pagination": "${version}", "toolbox-pagination": "${version}",
"toolbox-task": "${version}" "toolbox-task": "${version}"
},
"custom": {
"modmenu": {
"badges": [ "library" ]
} }
} }
}