Mirror von
https://github.com/ViaVersion/ViaBackwards.git
synchronisiert 2024-11-20 06:50:10 +01:00
Fix handling of untracked entities
Some simple meta handlers do not go through entity rewriters, suddenly having to deal with invalid metadata because of plugins' bad concurrency handling Closes #412
Dieser Commit ist enthalten in:
Ursprung
87aed8f3f2
Commit
a5a789c440
@ -52,7 +52,6 @@ public abstract class EntityRewriterBase<T extends BackwardsProtocol> extends En
|
||||
private final MetaType displayVisibilityMetaType;
|
||||
private final int displayNameIndex;
|
||||
private final int displayVisibilityIndex;
|
||||
protected boolean allowNullEntityType;
|
||||
|
||||
EntityRewriterBase(T protocol, MetaType displayNameMetaType, int displayNameIndex,
|
||||
MetaType displayVisibilityMetaType, int displayVisibilityIndex) {
|
||||
@ -65,13 +64,9 @@ public abstract class EntityRewriterBase<T extends BackwardsProtocol> extends En
|
||||
|
||||
@Override
|
||||
public void handleMetadata(int entityId, List<Metadata> metadataList, UserConnection connection) {
|
||||
EntityType type = tracker(connection).entityType(entityId);
|
||||
if (type == null && !allowNullEntityType) {
|
||||
return;
|
||||
}
|
||||
|
||||
super.handleMetadata(entityId, metadataList, connection);
|
||||
|
||||
EntityType type = tracker(connection).entityType(entityId);
|
||||
if (type == null) {
|
||||
return; // Don't handle untracked entities - basically always the fault of a plugin sending virtual entities through concurrency-unsafe handling
|
||||
}
|
||||
|
@ -38,7 +38,6 @@ public final class EntityPackets1_18 extends EntityRewriter<Protocol1_17_1To1_18
|
||||
|
||||
public EntityPackets1_18(final Protocol1_17_1To1_18 protocol) {
|
||||
super(protocol);
|
||||
allowNullEntityType = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren