mirror of
https://github.com/EngineHub/WorldEdit.git
synced 2024-12-15 04:41:37 +08:00
Add worldedit runtime environment to increase yaml alias limit (#2395)
This can be set by -Dworldedit.yaml.aliasLimit=XXX in the startup parameter
This commit is contained in:
parent
5b4322e53a
commit
94565356fd
@ -97,6 +97,8 @@ public YAMLProcessor(File file, boolean writeDefaults, YAMLFormat format) {
|
||||
representer.setDefaultFlowStyle(format.getStyle());
|
||||
LoaderOptions loaderOptions = new LoaderOptions();
|
||||
try {
|
||||
int yamlAliasLimit = Integer.getInteger("worldedit.yaml.aliasLimit", 50);
|
||||
loaderOptions.setMaxAliasesForCollections(yamlAliasLimit);
|
||||
// 64 MB default
|
||||
int yamlCodePointLimit = Integer.getInteger("worldedit.yaml.codePointLimit", 64 * 1024 * 1024);
|
||||
loaderOptions.setCodePointLimit(yamlCodePointLimit);
|
||||
@ -104,7 +106,7 @@ public YAMLProcessor(File file, boolean writeDefaults, YAMLFormat format) {
|
||||
// pre-1.32 snakeyaml
|
||||
}
|
||||
|
||||
yaml = new Yaml(new SafeConstructor(new LoaderOptions()), representer, dumperOptions, loaderOptions);
|
||||
yaml = new Yaml(new SafeConstructor(loaderOptions), representer, dumperOptions, loaderOptions);
|
||||
|
||||
this.file = file;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user