Archiviert
13
0

Specifically write Spigot's chat components as null

Dieser Commit ist enthalten in:
Dan Mulloy 2015-07-06 21:08:14 -04:00
Ursprung 7861a57d37
Commit c7dab69cba

Datei anzeigen

@ -427,15 +427,15 @@ public class StructureModifier<TField> {
// Write a default instance to every field // Write a default instance to every field
for (Field field : defaultFields.keySet()) { for (Field field : defaultFields.keySet()) {
if (field.getType().getCanonicalName().equals("net.md_5.bungee.api.chat.BaseComponent[]")) {
// Special case for Spigot's custom chat components
// Generating this will cause messages to be blank
continue;
}
try { try {
FieldUtils.writeField(field, target, if (field.getType().getCanonicalName().equals("net.md_5.bungee.api.chat.BaseComponent[]")) {
generator.getDefault(field.getType()), true); // Special case for Spigot's custom chat components
// They must be null or messages will be blank
FieldUtils.writeField(field, target, null, true);
continue;
}
FieldUtils.writeField(field, target, generator.getDefault(field.getType()), true);
} catch (IllegalAccessException e) { } catch (IllegalAccessException e) {
throw new FieldAccessException("Cannot write to field due to a security limitation.", e); throw new FieldAccessException("Cannot write to field due to a security limitation.", e);
} }