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