Skip to content

Commit

Permalink
[Configuration] Disable SnakeYAML's max file size limit (layout skinc…
Browse files Browse the repository at this point in the history
…ache can exceed the default 3MB)
  • Loading branch information
NEZNAMY committed Feb 8, 2025
1 parent f332068 commit 2fd29b2
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package me.neznamy.tab.shared.config.file;

import lombok.NonNull;
import me.neznamy.tab.shared.TAB;
import me.neznamy.chat.TextColor;
import me.neznamy.chat.component.SimpleTextComponent;
import me.neznamy.chat.component.TextComponent;
import me.neznamy.tab.shared.TAB;
import me.neznamy.yamlassist.YamlAssist;
import org.jetbrains.annotations.Nullable;
import org.yaml.snakeyaml.DumperOptions;
import org.yaml.snakeyaml.LoaderOptions;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.error.YAMLException;

Expand Down Expand Up @@ -44,7 +45,10 @@ public YamlConfigurationFile(@Nullable InputStream source, @NonNull File destina
FileInputStream input = null;
try {
input = new FileInputStream(file);
values = new Yaml().load(input);
LoaderOptions loaderOptions = new LoaderOptions();
loaderOptions.setCodePointLimit(Integer.MAX_VALUE);
Yaml yaml = new Yaml(loaderOptions);
values = yaml.load(input);
if (values == null) values = new LinkedHashMap<>();
input.close();
} catch (YAMLException e) {
Expand Down

0 comments on commit 2fd29b2

Please sign in to comment.