No more java 11 stuff :'(
This commit is contained in:
parent
503e40e76f
commit
13d27e81dd
2 changed files with 4 additions and 5 deletions
|
|
@ -7,8 +7,6 @@ String dependencyDir = group + '.dependencies'
|
||||||
version = rootProject.version
|
version = rootProject.version
|
||||||
archivesBaseName = rootProject.name + '-Velocity'
|
archivesBaseName = rootProject.name + '-Velocity'
|
||||||
|
|
||||||
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_11
|
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
maven { url 'https://nexus.velocitypowered.com/repository/maven-public/' }
|
maven { url 'https://nexus.velocitypowered.com/repository/maven-public/' }
|
||||||
maven { url 'https://libraries.minecraft.net' }
|
maven { url 'https://libraries.minecraft.net' }
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import com.google.common.collect.Multimaps;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.StandardOpenOption;
|
import java.nio.file.StandardOpenOption;
|
||||||
|
|
@ -28,7 +29,7 @@ public class VelocityPluginCommandManager {
|
||||||
* Loads and constructs a new {@link VelocityPluginCommandManager} from the given {@link Path}.
|
* Loads and constructs a new {@link VelocityPluginCommandManager} from the given {@link Path}.
|
||||||
*/
|
*/
|
||||||
public static VelocityPluginCommandManager load(Path path) throws IOException {
|
public static VelocityPluginCommandManager load(Path path) throws IOException {
|
||||||
var manager = new VelocityPluginCommandManager(path);
|
VelocityPluginCommandManager manager = new VelocityPluginCommandManager(path);
|
||||||
if (Files.exists(path)) {
|
if (Files.exists(path)) {
|
||||||
Map<String, Collection<String>> rawMap = gson.fromJson(
|
Map<String, Collection<String>> rawMap = gson.fromJson(
|
||||||
Files.newBufferedReader(path),
|
Files.newBufferedReader(path),
|
||||||
|
|
@ -48,9 +49,9 @@ public class VelocityPluginCommandManager {
|
||||||
* Saves the map to the {@link Path} it was loaded from.
|
* Saves the map to the {@link Path} it was loaded from.
|
||||||
*/
|
*/
|
||||||
public void save() throws IOException {
|
public void save() throws IOException {
|
||||||
Files.writeString(
|
Files.write(
|
||||||
path,
|
path,
|
||||||
gson.toJson(pluginCommands.asMap()),
|
gson.toJson(pluginCommands.asMap()).getBytes(StandardCharsets.UTF_8),
|
||||||
StandardOpenOption.CREATE,
|
StandardOpenOption.CREATE,
|
||||||
StandardOpenOption.TRUNCATE_EXISTING
|
StandardOpenOption.TRUNCATE_EXISTING
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue