Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-09-08 20:43:04 +02:00
Actually did what Konicai wanted
Dieser Commit ist enthalten in:
Ursprung
8bb8e48a55
Commit
f8c173aae8
@ -42,28 +42,10 @@ public class GeyserExtensionDescription implements org.geysermc.geyser.api.exten
|
|||||||
private final List<String> authors = new ArrayList<>();
|
private final List<String> authors = new ArrayList<>();
|
||||||
|
|
||||||
public GeyserExtensionDescription(InputStream inputStream) throws InvalidDescriptionException {
|
public GeyserExtensionDescription(InputStream inputStream) throws InvalidDescriptionException {
|
||||||
try {
|
DumperOptions dumperOptions = new DumperOptions();
|
||||||
InputStreamReader reader = new InputStreamReader(inputStream);
|
dumperOptions.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
|
||||||
StringBuilder builder = new StringBuilder();
|
Yaml yaml = new Yaml(dumperOptions);
|
||||||
String temp;
|
this.loadMap(yaml.loadAs(inputStream, LinkedHashMap.class));
|
||||||
BufferedReader bufferedReader = new BufferedReader(reader);
|
|
||||||
temp = bufferedReader.readLine();
|
|
||||||
while (temp != null) {
|
|
||||||
if (builder.length() != 0) {
|
|
||||||
builder.append("\n");
|
|
||||||
}
|
|
||||||
builder.append(temp);
|
|
||||||
temp = bufferedReader.readLine();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.loadString(builder.toString());
|
|
||||||
} catch (IOException e) {
|
|
||||||
throw new InvalidDescriptionException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public GeyserExtensionDescription(String yamlString) throws InvalidDescriptionException {
|
|
||||||
this.loadString(yamlString);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadString(String yamlString) throws InvalidDescriptionException {
|
private void loadString(String yamlString) throws InvalidDescriptionException {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren