Skip to content

Commit

Permalink
fix: Possible fix for Addon System.
Browse files Browse the repository at this point in the history
  • Loading branch information
DxsSucuk committed Jan 22, 2025
1 parent d4ec05a commit 45be7e6
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package de.presti.ree6.addons;

import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.pf4j.*;
import org.pf4j.util.FileUtils;
import org.pf4j.util.StringUtils;
import org.simpleyaml.configuration.file.YamlConfiguration;

import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
Expand Down Expand Up @@ -61,7 +63,8 @@ protected YamlConfiguration readYaml(Path pluginPath) {
}

try (InputStream input = zip.getInputStream(pluginEntry)) {
yamlConfiguration = YamlConfiguration.loadConfiguration(() -> input);
// Don't use the input stream directly YAML will cry.
yamlConfiguration = YamlConfiguration.loadConfigurationFromString(String.join("\n", IOUtils.readLines(input, StandardCharsets.UTF_8)));
} catch (IOException e) {
throw new PluginRuntimeException(e);
}
Expand Down

0 comments on commit 45be7e6

Please sign in to comment.