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
|
// 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);
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren