Specifically write Spigot's chat components as null
Dieser Commit ist enthalten in:
Ursprung
7861a57d37
Commit
c7dab69cba
@ -427,15 +427,15 @@ public class StructureModifier<TField> {
|
||||
|
||||
// Write a default instance to every field
|
||||
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 {
|
||||
FieldUtils.writeField(field, target,
|
||||
generator.getDefault(field.getType()), true);
|
||||
if (field.getType().getCanonicalName().equals("net.md_5.bungee.api.chat.BaseComponent[]")) {
|
||||
// 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) {
|
||||
throw new FieldAccessException("Cannot write to field due to a security limitation.", e);
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren