Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-27 08:30:09 +01:00
Handle not found metadata properly, and register the player as a type.
Fixes #270
Dieser Commit ist enthalten in:
Ursprung
0376602894
Commit
9257298e17
@ -184,6 +184,7 @@ public class EntityPackets {
|
|||||||
MetadataRewriter.transform(tracker.getClientEntityTypes().get(entityID), metadataList);
|
MetadataRewriter.transform(tracker.getClientEntityTypes().get(entityID), metadataList);
|
||||||
} else if (!ViaVersion.getConfig().isUnknownEntitiesSuppressed()) {
|
} else if (!ViaVersion.getConfig().isUnknownEntitiesSuppressed()) {
|
||||||
System.out.println("Unable to find entity for metadata, entity ID: " + entityID);
|
System.out.println("Unable to find entity for metadata, entity ID: " + entityID);
|
||||||
|
metadataList.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -180,6 +180,7 @@ public class SpawnPackets {
|
|||||||
MetadataRewriter.transform(tracker.getClientEntityTypes().get(entityID), metadataList);
|
MetadataRewriter.transform(tracker.getClientEntityTypes().get(entityID), metadataList);
|
||||||
} else {
|
} else {
|
||||||
System.out.println("Unable to find entity for metadata, entity ID: " + entityID);
|
System.out.println("Unable to find entity for metadata, entity ID: " + entityID);
|
||||||
|
metadataList.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -235,6 +236,16 @@ public class SpawnPackets {
|
|||||||
map(Type.VAR_INT); // 0 - Entity ID
|
map(Type.VAR_INT); // 0 - Entity ID
|
||||||
map(Type.UUID); // 1 - Player UUID
|
map(Type.UUID); // 1 - Player UUID
|
||||||
|
|
||||||
|
// Parse this info
|
||||||
|
handler(new PacketHandler() {
|
||||||
|
@Override
|
||||||
|
public void handle(PacketWrapper wrapper) throws Exception {
|
||||||
|
int entityID = wrapper.get(Type.VAR_INT, 0);
|
||||||
|
EntityTracker tracker = wrapper.user().get(EntityTracker.class);
|
||||||
|
tracker.getClientEntityTypes().put(entityID, EntityType.PLAYER);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
map(Type.INT, toNewDouble); // 2 - X - Needs to be divide by 32
|
map(Type.INT, toNewDouble); // 2 - X - Needs to be divide by 32
|
||||||
map(Type.INT, toNewDouble); // 3 - Y - Needs to be divide by 32
|
map(Type.INT, toNewDouble); // 3 - Y - Needs to be divide by 32
|
||||||
map(Type.INT, toNewDouble); // 4 - Z - Needs to be divide by 32
|
map(Type.INT, toNewDouble); // 4 - Z - Needs to be divide by 32
|
||||||
@ -256,6 +267,7 @@ public class SpawnPackets {
|
|||||||
MetadataRewriter.transform(tracker.getClientEntityTypes().get(entityID), metadataList);
|
MetadataRewriter.transform(tracker.getClientEntityTypes().get(entityID), metadataList);
|
||||||
} else {
|
} else {
|
||||||
System.out.println("Unable to find entity for metadata, entity ID: " + entityID);
|
System.out.println("Unable to find entity for metadata, entity ID: " + entityID);
|
||||||
|
metadataList.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren