mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-08 16:12:18 -07:00
SPIGOT-6234: enum classes don't serialize properly when implementing ConfigurationSerializable
By: md_5 <git@md-5.net>
This commit is contained in:
@@ -14,6 +14,9 @@ public class YamlRepresenter extends Representer {
|
||||
public YamlRepresenter() {
|
||||
this.multiRepresenters.put(ConfigurationSection.class, new RepresentConfigurationSection());
|
||||
this.multiRepresenters.put(ConfigurationSerializable.class, new RepresentConfigurationSerializable());
|
||||
// SPIGOT-6234: We could just switch YamlConstructor to extend Constructor rather than SafeConstructor, however there is a very small risk of issues with plugins treating config as untrusted input
|
||||
// So instead we will just allow future plugins to have their enums extend ConfigurationSerializable
|
||||
this.multiRepresenters.remove(Enum.class);
|
||||
}
|
||||
|
||||
private class RepresentConfigurationSection extends RepresentMap {
|
||||
|
Reference in New Issue
Block a user