}
private static MCCraftPacket unknownPacket = new MCCraftPacketUnknown();
private static MCPacket wrapPacket(Packet packet, MCCraftPacket[] packetWrappers, int packetId) {
MCCraftPacket packetWrapper = packetWrappers[packetId];
if (packetWrapper == null) {
packetWrapper = MCCraftPacket.newInstance(packetId, packet);
packetWrappers[packetId] = packetWrapper;
} else {
packetWrapper.setPacket(packet, packetId);
}
if (packetWrapper == null) {
packetWrapper = unknownPacket;
packetWrapper.setPacket(packet, packetId);
}
return packetWrapper;
}