mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-28 05:35:26 +01:00
Cleanup some misc stuff
This commit is contained in:
parent
14cb34ac95
commit
486b19aa90
@ -22,16 +22,16 @@
|
||||
|
||||
package me.lucko.luckperms.common.locale;
|
||||
|
||||
import lombok.Cleanup;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import me.lucko.luckperms.common.constants.Message;
|
||||
|
||||
import org.yaml.snakeyaml.Yaml;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.util.Map;
|
||||
|
||||
public class SimpleLocaleManager implements LocaleManager {
|
||||
@ -40,8 +40,9 @@ public class SimpleLocaleManager implements LocaleManager {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void loadFromFile(File file) throws Exception {
|
||||
@Cleanup FileReader fileReader = new FileReader(file);
|
||||
translations = ImmutableMap.copyOf((Map<String, String>) new Yaml().load(fileReader));
|
||||
try (BufferedReader reader = Files.newBufferedReader(file.toPath(), StandardCharsets.UTF_8)) {
|
||||
translations = ImmutableMap.copyOf((Map<String, String>) new Yaml().load(reader));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -33,7 +33,7 @@ import me.lucko.luckperms.api.context.ImmutableContextSet;
|
||||
@Getter
|
||||
@EqualsAndHashCode
|
||||
@ToString
|
||||
public class ExtractedContexts {
|
||||
public final class ExtractedContexts {
|
||||
public static ExtractedContexts generate(Contexts contexts) {
|
||||
return new ExtractedContexts(contexts);
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ public class PasteUtils {
|
||||
connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
|
||||
connection.setDoOutput(true);
|
||||
try (OutputStream os = connection.getOutputStream()) {
|
||||
os.write(("url=" + pasteUrl).getBytes());
|
||||
os.write(("url=" + pasteUrl).getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
pasteUrl = connection.getHeaderField("Location");
|
||||
connection.disconnect();
|
||||
|
Loading…
Reference in New Issue
Block a user